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
c3472b5bb09f2971b4ecc1e1d87b28feeb70f64c
1,800
py
Python
pypy/module/_bisect/interp_bisect.py
benoitc/pypy
a3e1b12d1d01dc29056b7badc051ffc034297658
[ "MIT" ]
1
2020-01-21T11:10:51.000Z
2020-01-21T11:10:51.000Z
pypy/module/_bisect/interp_bisect.py
benoitc/pypy
a3e1b12d1d01dc29056b7badc051ffc034297658
[ "MIT" ]
null
null
null
pypy/module/_bisect/interp_bisect.py
benoitc/pypy
a3e1b12d1d01dc29056b7badc051ffc034297658
[ "MIT" ]
null
null
null
from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import unwrap_spec @unwrap_spec(lo=int, hi=int) def bisect_left(space, w_a, w_x, lo=0, hi=-1): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, i points just before the leftmost x already there. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched.""" if lo < 0: raise OperationError(space.w_ValueError, space.wrap("lo must be non-negative")) if hi == -1: hi = space.len_w(w_a) while lo < hi: mid = (lo + hi) >> 1 w_litem = space.getitem(w_a, space.wrap(mid)) if space.is_true(space.lt(w_litem, w_x)): lo = mid + 1 else: hi = mid return space.wrap(lo) @unwrap_spec(lo=int, hi=int) def bisect_right(space, w_a, w_x, lo=0, hi=-1): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, i points just beyond the rightmost x already there Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched.""" if lo < 0: raise OperationError(space.w_ValueError, space.wrap("lo must be non-negative")) if hi == -1: hi = space.len_w(w_a) while lo < hi: mid = (lo + hi) >> 1 w_litem = space.getitem(w_a, space.wrap(mid)) if space.is_true(space.lt(w_x, w_litem)): hi = mid else: lo = mid + 1 return space.wrap(lo)
33.962264
79
0.607222
317
1,800
3.369085
0.236593
0.011236
0.022472
0.026217
0.805243
0.805243
0.805243
0.805243
0.750936
0.750936
0
0.010886
0.285556
1,800
52
80
34.615385
0.819596
0.382778
0
0.8125
0
0
0.041818
0
0
0
0
0
0
1
0.0625
false
0
0.0625
0
0.1875
0
0
0
0
null
0
0
0
1
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
7
5eda004b6d98c35400b83fdfe12b724063abd54f
3,827
py
Python
tests/test_all.py
TGIfr/CSEplaylist
050fe3a7da27e757d128a34cb4f7a9da411ab266
[ "MIT" ]
1
2018-03-10T19:27:14.000Z
2018-03-10T19:27:14.000Z
tests/test_all.py
TGIfr/CSEplaylist
050fe3a7da27e757d128a34cb4f7a9da411ab266
[ "MIT" ]
null
null
null
tests/test_all.py
TGIfr/CSEplaylist
050fe3a7da27e757d128a34cb4f7a9da411ab266
[ "MIT" ]
null
null
null
import unittest import id3 import htmltags import nesting import xmlHelper class TestMethods(unittest.TestCase): def setUp(self): pass def tearDown(self): pass #id3 def test_get_genre(self): self.assertTrue(id3.get_genre("http://ol7.mp3party.net/online/8500/8500219.mp3") == "Unknown") self.assertTrue(id3.get_genre("http://ol7.mp3party.net") == "Unknown") self.assertTrue(id3.get_genre("http://ol5.mp3party.net/online/7813/7813030.mp3") == ['Alternative']) #htmltags def test_hrefs(self): self.assertTrue(htmltags.hrefs("http://mp3party.net/music/8500219", nested=0) == set()) set1 = {'https://litworld.herokuapp.com/contacts', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/search'} set2 = {'https://litworld.herokuapp.com/contacts', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/search', 'https://litworld.herokuapp.com/'} set3 = {'https://litworld.herokuapp.com/contacts'} self.assertTrue(sorted(htmltags.hrefs("https://litworld.herokuapp.com/", nested=1)) == sorted(set1)) self.assertTrue(sorted(htmltags.hrefs("https://litworld.herokuapp.com/", nested=3)) == sorted(set2)) self.assertFalse(htmltags.hrefs("http://mp3party.net/music/8500219", nested=0) == sorted(set3)) def test_mp3refs(self): self.assertTrue(htmltags.mp3refs("http://mp3party.net/music/8500219") == ['http://ol7.mp3party.net/online/8500/8500219.mp3']) #nesting.py def test_get_nested_links(self): links1 = ['https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/search', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/contacts'] links2 = ['https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/search', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/contacts', 'https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/register/signup', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/register/signup', 'https://litworld.herokuapp.com/search', 'https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/register/signup', 'https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/register/signup', 'https://litworld.herokuapp.com/contacts'] self.assertTrue(nesting.get_nested_links("https://litworld.herokuapp.com/", 1) == links1) links3 = ['https://litworld.herokuapp.com/', 'https://litworld.herokuapp.com/world', 'https://litworld.herokuapp.com/search', 'https://litworld.herokuapp.com/register/login', 'https://litworld.herokuapp.com/contacts', 'https://litworld.herokuapp.com/register/signup', 'https://litworld.herokuapp.com/login'] self.assertTrue(nesting.get_nested_links("https://litworld.herokuapp.com/", 3) == links3) self.assertTrue(nesting.get_nested_links("https://litworld.herokuapp.com/", 0) == []) self.assertTrue(nesting.get_nested_links_from_list(links1) == links2) #xmlHelper def test_parse(self): print(xmlHelper.save('tests/test1.xml', 's')) self.assertTrue(xmlHelper.parse('tests/test.xml') == []) test = '<songs><song>s</song></songs>' self.assertTrue(xmlHelper.save('tests/test1.xml', 's') == test) if __name__ == '__main__': unittest.main()
69.581818
885
0.702639
461
3,827
5.770065
0.158351
0.234586
0.396992
0.451128
0.785338
0.772932
0.739474
0.707895
0.68609
0.603759
0
0.028288
0.103998
3,827
54
886
70.87037
0.747448
0.007839
0
0.051282
0
0
0.576588
0.007646
0
0
0
0
0.358974
1
0.179487
false
0.051282
0.128205
0
0.333333
0.025641
0
0
0
null
1
1
1
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
6f0729336d7ff7421fb769b85ffd0f256eb43b24
11,752
py
Python
tests/commands/test_test.py
williamirick/hatch
704cdcd1a0cd3a621235ac9f5b2b90e7524e3cd3
[ "Apache-2.0", "MIT" ]
2,549
2017-09-05T06:44:17.000Z
2022-03-31T23:21:02.000Z
tests/commands/test_test.py
williamirick/hatch
704cdcd1a0cd3a621235ac9f5b2b90e7524e3cd3
[ "Apache-2.0", "MIT" ]
97
2017-06-07T23:14:12.000Z
2022-03-30T14:22:34.000Z
tests/commands/test_test.py
williamirick/hatch
704cdcd1a0cd3a621235ac9f5b2b90e7524e3cd3
[ "Apache-2.0", "MIT" ]
140
2017-06-10T14:16:47.000Z
2022-03-23T09:25:01.000Z
import os from click.testing import CliRunner from hatch.cli import hatch from hatch.env import ( get_editable_packages, get_installed_packages, install_packages ) from hatch.utils import env_vars, temp_chdir from hatch.venv import create_venv, is_venv, venv from ..utils import requires_internet, wait_until def create_test_passing(d): with open(os.path.join(d, 'tests', 'test_add.py'), 'w') as f: f.write( 'def test_add():\n' ' assert 1 + 2 == 3\n' ) def create_test_failing(d): with open(os.path.join(d, 'tests', 'test_add.py'), 'w') as f: f.write( 'def test_add():\n' ' assert 1 + 2 != 3\n' ) def create_test_complete_coverage(d, pkg): with open(os.path.join(d, pkg, 'core.py'), 'w') as f: f.write( 'def square_5():\n' ' return 5 ** 2\n' ) with open(os.path.join(d, 'tests', 'test_core.py'), 'w') as f: f.write( 'from {pkg}.core import square_5\n' 'def test_square_5():\n' ' assert square_5() == 25\n'.format(pkg=pkg) ) def create_test_incomplete_coverage(d, pkg): with open(os.path.join(d, pkg, 'core.py'), 'w') as f: f.write( 'def square_5():\n' ' return 5 ** 2\n' ) with open(os.path.join(d, 'tests', 'test_add.py'), 'w') as f: f.write( 'import {}\n' 'def test_add():\n' ' assert 1 + 2 == 3\n'.format(pkg) ) def test_passing_cwd(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_passing(d) result = runner.invoke(hatch, ['test', '-nd']) assert result.exit_code == 0 assert '1 passed' in result.output def test_failing_cwd(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_failing(d) result = runner.invoke(hatch, ['test', '-nd']) assert result.exit_code == 1 assert '1 failed' in result.output @requires_internet def test_project_existing_venv(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic']) venv_dir = os.path.join(d, 'venv') wait_until(is_venv, venv_dir) with venv(venv_dir): install_packages(['pytest', 'coverage']) installed_packages = get_installed_packages(editable=False) assert 'pytest' in installed_packages assert 'coverage' in installed_packages create_test_passing(d) with env_vars({'_IGNORE_VENV_': '1'}): result = runner.invoke(hatch, ['test']) assert result.exit_code == 0 assert '1 passed' in result.output @requires_internet def test_project_no_venv(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_passing(d) with env_vars({'_IGNORE_VENV_': '1'}): result = runner.invoke(hatch, ['test']) with venv(os.path.join(d, 'venv')): assert 'ok' in get_editable_packages() installed_packages = get_installed_packages(editable=False) assert 'pytest' in installed_packages assert 'coverage' in installed_packages assert result.exit_code == 0 assert 'A project has been detected!' in result.output assert 'Creating a dedicated virtual env... complete!' in result.output assert 'Installing this project in the virtual env...' in result.output assert 'Ensuring pytest and coverage are available...' in result.output assert '1 passed' in result.output @requires_internet def test_project_no_venv_install_dev_requirements(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) with open(os.path.join(d, 'dev-requirements.txt'), 'w') as f: f.write('six\n') create_test_passing(d) with env_vars({'_IGNORE_VENV_': '1'}): result = runner.invoke(hatch, ['test']) with venv(os.path.join(d, 'venv')): assert 'ok' in get_editable_packages() installed_packages = get_installed_packages(editable=False) assert 'pytest' in installed_packages assert 'coverage' in installed_packages assert 'six' in installed_packages assert result.exit_code == 0 assert 'A project has been detected!' in result.output assert 'Creating a dedicated virtual env... complete!' in result.output assert 'Installing this project in the virtual env...' in result.output assert 'Ensuring pytest and coverage are available...' in result.output assert 'Installing test dependencies in the virtual env...' in result.output assert '1 passed' in result.output @requires_internet def test_project_no_venv_coverage(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_complete_coverage(d, 'ok') with env_vars({'_IGNORE_VENV_': '1'}): result = runner.invoke(hatch, ['test', '-c']) assert result.exit_code == 0 assert '1 passed' in result.output assert result.output.strip().endswith(' 100%') @requires_internet def test_project_no_venv_coverage_merge(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_complete_coverage(d, 'ok') with env_vars({'_IGNORE_VENV_': '1'}): runner.invoke(hatch, ['test', '-c']) result = runner.invoke(hatch, ['test', '-c', '-m']) assert result.exit_code == 0 assert '1 passed' in result.output assert result.output.strip().endswith(' 100%') @requires_internet def test_package(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) package_dir = os.path.join(d, 'ok') create_test_passing(package_dir) venv_dir = os.path.join(d, 'venv') create_venv(venv_dir) with venv(venv_dir): os.chdir(package_dir) install_packages(['-e', '.']) os.chdir(d) result = runner.invoke(hatch, ['test', '-nd', 'ok', '-g']) assert result.exit_code == 0 assert '1 passed' in result.output def test_package_not_exist(): with temp_chdir() as d: runner = CliRunner() venv_dir = os.path.join(d, 'venv') create_venv(venv_dir) with venv(venv_dir): result = runner.invoke(hatch, ['test', '-nd', 'ok']) assert result.exit_code == 1 assert '`{}` is not an editable package.'.format('ok') in result.output @requires_internet def test_local(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) package_dir = os.path.join(d, 'ok') create_test_passing(package_dir) venv_dir = os.path.join(d, 'venv') create_venv(venv_dir) with venv(venv_dir): install_packages(['-e', package_dir]) result = runner.invoke(hatch, ['test', '-nd', '-l', '-g']) assert result.exit_code == 0 assert 'Package `ok` has been selected.' in result.output assert '1 passed' in result.output def test_local_not_exist(): with temp_chdir() as d: runner = CliRunner() venv_dir = os.path.join(d, 'venv') create_venv(venv_dir) with venv(venv_dir): result = runner.invoke(hatch, ['test', '-nd', '-l', '-g']) assert result.exit_code == 1 assert 'There are no local packages available.' in result.output @requires_internet def test_local_multiple(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) runner.invoke(hatch, ['new', 'ko', '--basic', '-ne']) venv_dir = os.path.join(d, 'venv') create_venv(venv_dir) with venv(venv_dir): install_packages(['-e', os.path.join(d, 'ok')]) install_packages(['-e', os.path.join(d, 'ko')]) result = runner.invoke(hatch, ['test', '-nd', '-l', '-g']) assert result.exit_code == 1 assert ( 'There are multiple local packages available. ' 'Select one with the optional argument.' ) in result.output def test_path_relative(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) create_test_passing(os.path.join(d, 'ok')) result = runner.invoke(hatch, ['test', '-nd', '-p', 'ok']) assert result.exit_code == 0 assert '1 passed' in result.output def test_path_full(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) runner.invoke(hatch, ['new', 'ko', '--basic', '-ne']) package_dir = os.path.join(d, 'ok') create_test_passing(package_dir) os.chdir(os.path.join(d, 'ko')) result = runner.invoke(hatch, ['test', '-nd', '-p', os.path.join(d, 'ok')]) assert result.exit_code == 0 assert '1 passed' in result.output def test_path_full_not_exist(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['new', 'ok', '--basic', '-ne']) full_path = os.path.join(d, 'ko') result = runner.invoke(hatch, ['test', '-nd', '-p', full_path]) assert result.exit_code == 1 assert 'Directory `{}` does not exist.'.format(full_path) in result.output def test_coverage_complete(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_complete_coverage(d, 'ok') result = runner.invoke(hatch, ['test', '-nd', '-c']) assert result.exit_code == 0 assert '1 passed' in result.output assert result.output.strip().endswith(' 100%') def test_coverage_complete_merge(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_complete_coverage(d, 'ok') runner.invoke(hatch, ['test', '-nd', '-c']) result = runner.invoke(hatch, ['test', '-nd', '-c', '-m']) assert result.exit_code == 0 assert '1 passed' in result.output assert result.output.strip().endswith(' 100%') def test_coverage_incomplete(): with temp_chdir() as d: runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) create_test_incomplete_coverage(d, 'ok') result = runner.invoke(hatch, ['test', '-nd', '-c']) assert result.exit_code == 0 assert '1 passed' in result.output assert not result.output.strip().endswith(' 100%') def test_test_args(): with temp_chdir(): runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) result = runner.invoke(hatch, ['test', '-nd', '-ta', '--help']) assert '-k EXPRESSION' in result.output def test_coverage_args(): with temp_chdir(): runner = CliRunner() runner.invoke(hatch, ['init', 'ok', '--basic', '-ne']) result = runner.invoke(hatch, ['test', '-nd', '-c', '-ca', '--help']) assert '--parallel-mode' in result.output
31.42246
84
0.581178
1,498
11,752
4.393858
0.089453
0.076572
0.108478
0.040109
0.873899
0.852628
0.817381
0.791097
0.75904
0.742176
0
0.008338
0.265231
11,752
373
85
31.506702
0.753909
0
0
0.677536
0
0
0.158781
0
0
0
0
0
0.23913
1
0.086957
false
0.083333
0.032609
0
0.119565
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
1
0
0
0
0
0
7
6f22563cdbcdd326af9d700ba8da682139675e6b
4,535
py
Python
tests/test_all.py
liskin/foursquare-swarm-ical
2497f496f6430059c2cc5fc13be0ce4aeaa643e6
[ "MIT" ]
6
2021-03-20T07:32:05.000Z
2022-03-13T00:22:54.000Z
tests/test_all.py
liskin/foursquare-swarm-ical
2497f496f6430059c2cc5fc13be0ce4aeaa643e6
[ "MIT" ]
null
null
null
tests/test_all.py
liskin/foursquare-swarm-ical
2497f496f6430059c2cc5fc13be0ce4aeaa643e6
[ "MIT" ]
1
2022-03-13T00:21:39.000Z
2022-03-13T00:21:39.000Z
import textwrap import pytest # type: ignore [import] from foursquare_swarm_ical import db from foursquare_swarm_ical.emoji import Emojis from foursquare_swarm_ical import ical @pytest.mark.vcr def test_all(): with db.database(":memory:") as db_conn: # initial sync db.sync(db=db_conn, access_token="TEST", verbose=-1) # check that we have all the checkins we expect checkins = [list(row) for row in db_conn.execute( "SELECT id, createdAt FROM checkins ORDER BY createdAt")] assert checkins == [ ['5e4438da6f33df00072b2e60', 1581529306], ['5e452f61ba340a000874006b', 1581592417], ['5e45c278162b2c0008794e67', 1581630072], ] # delete newest checkin db_conn.execute("DELETE FROM checkins ORDER BY createdAt DESC LIMIT 0") # sync again db.sync(db=db_conn, access_token="TEST", verbose=-1) # recheck that we have all the checkins we expect checkins = [list(row) for row in db_conn.execute( "SELECT id, createdAt FROM checkins ORDER BY createdAt")] assert checkins == [ ['5e4438da6f33df00072b2e60', 1581529306], ['5e452f61ba340a000874006b', 1581592417], ['5e45c278162b2c0008794e67', 1581630072], ] # check ical generation emojis = Emojis() assert ical.ical(db=db_conn, emojis=emojis) == textwrap.dedent("""\ BEGIN:VCALENDAR VERSION:2.0 PRODID:foursquare-swarm-ical BEGIN:VEVENT SUMMARY:🍺 Pivnice Pegas DTSTART;VALUE=DATE-TIME:20200212T174146Z DTEND;VALUE=DATE-TIME:20200212T174146Z UID:5e4438da6f33df00072b2e60@foursquare.com GEO:49.203087013053825;16.595776878926344 LOCATION:Jiráskova 44\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e4438da6f33df00072b2e60 END:VEVENT BEGIN:VEVENT SUMMARY:🍴 Zahrada Ambrosia DTSTART;VALUE=DATE-TIME:20200213T111337Z DTEND;VALUE=DATE-TIME:20200213T111337Z UID:5e452f61ba340a000874006b@foursquare.com GEO:49.1980983508588;16.597204121337384 LOCATION:Údolní 599/37\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e452f61ba340a000874006b END:VEVENT BEGIN:VEVENT SUMMARY:🍺 U Vašinů DTSTART;VALUE=DATE-TIME:20200213T214112Z DTEND;VALUE=DATE-TIME:20200213T214112Z UID:5e45c278162b2c0008794e67@foursquare.com GEO:49.207467399173076;16.60221666114012 LOCATION:Kotlářská 907/41\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e45c278162b2c0008794e67 END:VEVENT END:VCALENDAR """).replace('\n', '\r\n').encode('utf-8') assert ical.ical(db=db_conn, emojis=None) == textwrap.dedent("""\ BEGIN:VCALENDAR VERSION:2.0 PRODID:foursquare-swarm-ical BEGIN:VEVENT SUMMARY:@ Pivnice Pegas DTSTART;VALUE=DATE-TIME:20200212T174146Z DTEND;VALUE=DATE-TIME:20200212T174146Z UID:5e4438da6f33df00072b2e60@foursquare.com GEO:49.203087013053825;16.595776878926344 LOCATION:Jiráskova 44\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e4438da6f33df00072b2e60 END:VEVENT BEGIN:VEVENT SUMMARY:@ Zahrada Ambrosia DTSTART;VALUE=DATE-TIME:20200213T111337Z DTEND;VALUE=DATE-TIME:20200213T111337Z UID:5e452f61ba340a000874006b@foursquare.com GEO:49.1980983508588;16.597204121337384 LOCATION:Údolní 599/37\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e452f61ba340a000874006b END:VEVENT BEGIN:VEVENT SUMMARY:@ U Vašinů DTSTART;VALUE=DATE-TIME:20200213T214112Z DTEND;VALUE=DATE-TIME:20200213T214112Z UID:5e45c278162b2c0008794e67@foursquare.com GEO:49.207467399173076;16.60221666114012 LOCATION:Kotlářská 907/41\\, 602 00 Brno\\, Česká republika URL:https://www.swarmapp.com/self/checkin/5e45c278162b2c0008794e67 END:VEVENT END:VCALENDAR """).replace('\n', '\r\n').encode('utf-8')
41.227273
79
0.627343
466
4,535
6.075107
0.263949
0.038149
0.055104
0.042388
0.9071
0.876722
0.876722
0.856941
0.856941
0.856941
0
0.247243
0.280265
4,535
109
80
41.605505
0.619179
0.040353
0
0.782609
0
0
0.752302
0.268416
0
0
0
0
0.043478
1
0.01087
false
0
0.054348
0
0.065217
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
6f2fae6902fb5a91ecd99969186df881893be71a
9,030
py
Python
tests/test_handler.py
pitrho/rancher-gen
5f228632e04d423cfc166ffa0fc3a43705ec1000
[ "MIT" ]
32
2016-09-09T19:51:15.000Z
2018-09-01T08:30:15.000Z
tests/test_handler.py
pitrho/rancher-gen
5f228632e04d423cfc166ffa0fc3a43705ec1000
[ "MIT" ]
5
2016-10-07T14:12:07.000Z
2017-11-28T14:52:58.000Z
tests/test_handler.py
pitrho/rancher-gen
5f228632e04d423cfc166ffa0fc3a43705ec1000
[ "MIT" ]
6
2016-09-28T18:29:17.000Z
2017-11-09T13:06:57.000Z
import base64 import json import os import time from mock import patch from threading import Thread from rancher_gen.handler import RancherConnector, MessageHandler from rancher_gen.compat import b64encode class TestRancherConnector: @classmethod def setup_class(cls): template = os.path.join(os.path.dirname(__file__), 'fixtures', 'template.j2') cls.out_file = '/tmp/out.txt' cls.config = { 'host': os.getenv('RANCHER_HOST'), 'port': int(os.getenv('RANCHER_PORT', 80)), 'project_id': None, 'access_key': os.getenv('RANCHER_ACCESS_KEY'), 'secret_key': os.getenv('RANCHER_SECRET_KEY'), 'templates': ['{0}:{1}'.format(template, cls.out_file)], 'ssl': False, 'stack': 'teststack', 'services': ['hello1', 'hello2'], 'notify': None } @classmethod def teardown_class(cls): if os.path.exists(cls.out_file): os.remove(cls.out_file) def test_prerenders_template(self, stack_service): stack, service = stack_service self.config['project_id'] = stack['accountId'] # Test with filtering by stack and service handler = RancherConnector(**self.config) handler._prerender() with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output assert '10.42.232.34' in output # Test with filtering by stack only config = self.config.copy() config['project_id'] = stack['accountId'] config['services'] = None handler = RancherConnector(**config) handler._prerender() with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output assert '10.42.232.34' in output # Test without filtering config = self.config.copy() config['project_id'] = stack['accountId'] config['stack'] = None config['services'] = None handler = RancherConnector(**config) handler._prerender() with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output def test_on_message_ignores_bad_messages(self): handler = RancherConnector(**self.config) mock_msg = { 'name': 'bad', 'data': [] } # Test with bad name with patch.object(MessageHandler, 'run') as mock: handler._on_message(None, json.dumps(mock_msg)) assert not mock.called # Test with missing data mock_msg['name'] = 'resource.change' with patch.object(MessageHandler, 'run') as mock: handler._on_message(None, json.dumps(mock_msg)) assert not mock.called def test_on_message_calls_handler(self): handler = RancherConnector(**self.config) mock_msg = { 'name': 'resource.change', 'data': [1, 2, 3] } with patch.object(MessageHandler, 'run') as mock: handler._on_message(None, json.dumps(mock_msg)) assert mock.called class TestMessageHandler: def setup_method(self, method): self.out_file = '/tmp/out.txt' def teardown_method(self, method): if os.path.exists(self.out_file): os.remove(self.out_file) def test_renders_template(self, stack_service, mock_message): stack, services = stack_service access_key = os.getenv('RANCHER_ACCESS_KEY') secret_key = os.getenv('RANCHER_SECRET_KEY') api_token = b64encode("{0}:{1}".format(access_key, secret_key)) template = os.path.join(os.path.dirname(__file__), 'fixtures', 'template.j2') config = { 'message': mock_message, 'host': os.getenv('RANCHER_HOST'), 'port': int(os.getenv('RANCHER_PORT', 80)), 'project_id': stack['accountId'], 'api_token': api_token, 'templates': ['{0}:{1}'.format(template, self.out_file)], 'ssl': False, 'stack': 'teststack', 'services': ['hello1', 'hello2'], 'notify': None } # Test with stack and service filter handler = MessageHandler(**config) handler.run() while not os.path.exists(self.out_file): time.sleep(1) with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output assert '10.42.232.34' in output # Test with stack only filter config['project_id'] = stack['accountId'] config['services'] = None handler = MessageHandler(**config) handler.run() while not os.path.exists(self.out_file): time.sleep(1) with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output assert '10.42.232.34' in output # Test without filter config['stack'] = None handler = MessageHandler(**config) handler.run() while not os.path.exists(self.out_file): time.sleep(1) with open(self.out_file) as fh: output = fh.read().replace('\n', '').strip() assert '10.42.232.33' in output def test_does_not_render_with_missing_labels_in_message( self, stack_service, mock_message): stack, service = stack_service mock_message['data']['resource']['labels'] = None access_key = os.getenv('RANCHER_ACCESS_KEY') secret_key = os.getenv('RANCHER_SECRET_KEY') api_token = b64encode("{0}:{1}".format(access_key, secret_key)) template = os.path.join(os.path.dirname(__file__), 'fixtures', 'template.j2') config = { 'message': mock_message, 'host': os.getenv('RANCHER_HOST'), 'port': int(os.getenv('RANCHER_PORT', 80)), 'project_id': stack['accountId'], 'api_token': api_token, 'templates': ['{0}:{1}'.format(template, self.out_file)], 'ssl': False, 'stack': 'teststack', 'services': ['badservice'], 'notify': None } handler = MessageHandler(**config) handler.run() time.sleep(1) assert not os.path.exists(self.out_file) def test_does_not_render_with_missing_stack_name_in_message( self, stack_service, mock_message): stack, service = stack_service del mock_message['data']['resource']['labels']['io.rancher.stack.name'] access_key = os.getenv('RANCHER_ACCESS_KEY') secret_key = os.getenv('RANCHER_SECRET_KEY') api_token = b64encode("{0}:{1}".format(access_key, secret_key)) template = os.path.join(os.path.dirname(__file__), 'fixtures', 'template.j2') config = { 'message': mock_message, 'host': os.getenv('RANCHER_HOST'), 'port': int(os.getenv('RANCHER_PORT', 80)), 'project_id': stack['accountId'], 'api_token': api_token, 'templates': ['{0}:{1}'.format(template, self.out_file)], 'ssl': False, 'stack': 'teststack', 'services': ['badservice'], 'notify': None } handler = MessageHandler(**config) handler.run() time.sleep(1) assert not os.path.exists(self.out_file) def test_does_not_render_with_invalid_filter( self, stack_service, mock_message): stack, service = stack_service access_key = os.getenv('RANCHER_ACCESS_KEY') secret_key = os.getenv('RANCHER_SECRET_KEY') api_token = b64encode("{0}:{1}".format(access_key, secret_key)) template = os.path.join(os.path.dirname(__file__), 'fixtures', 'template.j2') config = { 'message': mock_message, 'host': os.getenv('RANCHER_HOST'), 'port': int(os.getenv('RANCHER_PORT', 80)), 'project_id': stack['accountId'], 'api_token': api_token, 'templates': ['{0}:{1}'.format(template, self.out_file)], 'ssl': False, 'ssl': False, 'stack': 'teststack', 'services': ['badservice'], 'notify': None } # Test with bad service name handler1 = MessageHandler(**config) handler1.start() time.sleep(1) assert not os.path.exists(self.out_file) # test with back stack name config['stack'] = 'bad' config['services'] = None handler2 = MessageHandler(**config) handler2.start() time.sleep(1) assert not os.path.exists(self.out_file)
33.69403
79
0.564452
1,019
9,030
4.815505
0.124632
0.034237
0.061137
0.036682
0.811698
0.762584
0.751376
0.745058
0.715305
0.698594
0
0.024209
0.300111
9,030
267
80
33.820225
0.752215
0.030454
0
0.744076
0
0
0.151647
0.002402
0
0
0
0
0.080569
1
0.052133
false
0
0.037915
0
0.099526
0
0
0
0
null
0
0
0
1
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
7
489d5d11e89a26e665e79bcd9d76d2af1c9eeef4
6,862
py
Python
contrib/NumSciPy/Filters.py
celiafish/VisTrails
d8cb575b8b121941de190fe608003ad1427ef9f6
[ "BSD-3-Clause" ]
83
2015-01-05T14:50:50.000Z
2021-09-17T19:45:26.000Z
contrib/NumSciPy/Filters.py
celiafish/VisTrails
d8cb575b8b121941de190fe608003ad1427ef9f6
[ "BSD-3-Clause" ]
254
2015-01-02T20:39:19.000Z
2018-11-28T17:16:44.000Z
contrib/NumSciPy/Filters.py
celiafish/VisTrails
d8cb575b8b121941de190fe608003ad1427ef9f6
[ "BSD-3-Clause" ]
40
2015-04-17T16:46:36.000Z
2021-09-28T22:43:24.000Z
import core.modules import core.modules.module_registry from core.modules.vistrails_module import Module, ModuleError from Array import * import scipy import scipy.signal from scipy import sparse, fftpack import numpy class WindowModule(object): my_namespace = 'scipy|signals|windows' class HanningWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.hanning(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class TriangularWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.triang(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BlackmanWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.blackman(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BlackmanHarrisWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.blackmanharris(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class ParzenWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.parzen(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class HammingWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.hamming(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class KaiserWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") beta = self.get_input("Beta") out = NDArray() out.set_array(scipy.signal.kaiser(size, beta)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_input_port(cls, "Beta", (basic.Float, 'Beta')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BartlettHannWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.barthann(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class GaussianWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") sigma = self.get_input("Sigma") out = NDArray() out.set_array(scipy.signal.gaussian(size, sigma)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_input_port(cls, "Sigma", (basic.Float, 'Sigma')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BoxcarWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.boxcar(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BohmanWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.bohman(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class BartlettWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.bartlett(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function')) class NuttallBlackmanHarrisWindow(WindowModule, Module): def compute(self): size = self.get_input("Window Size") out = NDArray() out.set_array(scipy.signal.nuttall(size)) self.set_output("Window", out) @classmethod def register(cls, reg, basic): reg.add_module(cls, namespace=cls.my_namespace) reg.add_input_port(cls, "Window Size", (basic.Integer, 'Window Size')) reg.add_output_port(cls, "Window", (NDArray, 'Window Function'))
36.892473
78
0.659429
862
6,862
5.103248
0.081207
0.055922
0.076836
0.051148
0.856331
0.856331
0.856331
0.841782
0.841782
0.841782
0
0
0.207228
6,862
185
79
37.091892
0.80864
0
0
0.745223
0
0
0.120682
0.003061
0
0
0
0
0
1
0.165605
false
0
0.050955
0
0.312102
0
0
0
0
null
0
0
0
1
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
7
d2e718cf4929e8377e05f761f6290eccf1505159
6,574
py
Python
tests/tensortrade/unit/oms/orders/test_order_spec.py
zeeshanalipanhwar/tensortrade
7c294293cb65d0e31cae47402145dffe2e7bc75f
[ "Apache-2.0" ]
3,081
2020-01-12T13:42:13.000Z
2022-03-27T18:09:31.000Z
tests/tensortrade/unit/oms/orders/test_order_spec.py
zeeshanalipanhwar/tensortrade
7c294293cb65d0e31cae47402145dffe2e7bc75f
[ "Apache-2.0" ]
257
2020-01-15T03:14:29.000Z
2022-03-31T04:19:14.000Z
tests/tensortrade/unit/oms/orders/test_order_spec.py
zeeshanalipanhwar/tensortrade
7c294293cb65d0e31cae47402145dffe2e7bc75f
[ "Apache-2.0" ]
804
2020-01-12T12:22:22.000Z
2022-03-28T13:41:59.000Z
import re import unittest.mock as mock from decimal import Decimal from tensortrade.oms.orders import OrderSpec, TradeSide, TradeType from tensortrade.oms.exchanges import ExchangeOptions from tensortrade.oms.instruments import USD, BTC, ExchangePair from tensortrade.oms.wallets import Portfolio, Wallet @mock.patch("tensortrade.exchanges.Exchange") def test_init(mock_exchange_class): exchange = mock_exchange_class.return_value exchange.options = ExchangeOptions() exchange.id = "fake_exchange_id" exchange.name = "bitfinex" exchange.clock = mock.Mock() exchange.clock.step = 0 side = TradeSide.BUY trade_type = TradeType.MARKET # Create order specification without criteria order_spec = OrderSpec( side=side, trade_type=trade_type, exchange_pair=ExchangePair(exchange, USD / BTC) ) assert order_spec.id assert order_spec.side == side assert order_spec.type == trade_type assert order_spec.exchange_pair == ExchangePair(exchange, USD / BTC) assert not order_spec.criteria # Create order specification with criteria order_spec = OrderSpec( side=side, trade_type=trade_type, exchange_pair=ExchangePair(exchange, USD / BTC), criteria=lambda order, exchange: True ) assert order_spec.id assert order_spec.side == side assert order_spec.type == trade_type assert order_spec.exchange_pair == ExchangePair(exchange, USD / BTC) assert order_spec.criteria @mock.patch("tensortrade.exchanges.Exchange") @mock.patch("tensortrade.orders.Order") def test_create_from_buy_order(mock_order_class, mock_exchange_class): exchange = mock_exchange_class.return_value exchange.options = ExchangeOptions() exchange.id = "fake_exchange_id" exchange.name = "bitfinex" exchange.clock = mock.Mock() exchange.clock.step = 0 exchange.quote_price = mock.Mock(return_value=Decimal(7000.00)) wallets = [Wallet(exchange, 10000 * USD), Wallet(exchange, 2 * BTC)] portfolio = Portfolio(USD, wallets) order = mock_order_class.return_value order.portfolio = portfolio order.exchange_pair = ExchangePair(exchange, USD / BTC) order.path_id = "fake_path_id" order.price = Decimal(7000.00) wallet_btc = portfolio.get_wallet(exchange.id, BTC) wallet_btc.lock( quantity=0.4 * BTC, order=order, reason="test" ) assert float(wallet_btc.balance.size) == 1.6 assert float(wallet_btc.locked[order.path_id].size) == 0.4 order_spec = OrderSpec( side=TradeSide.SELL, trade_type=TradeType.MARKET, exchange_pair=ExchangePair(exchange, USD / BTC) ) next_order = order_spec.create_order(order) assert next_order assert next_order.side == TradeSide.SELL assert next_order.type == TradeType.MARKET assert next_order.exchange_pair == ExchangePair(exchange, USD / BTC) assert next_order.path_id == order.path_id assert next_order.quantity.path_id == order.path_id assert next_order.quantity.instrument == BTC @mock.patch("tensortrade.exchanges.Exchange") @mock.patch("tensortrade.orders.Order") def test_create_from_sell_order(mock_order_class, mock_exchange_class): exchange = mock_exchange_class.return_value exchange.options = ExchangeOptions() exchange.id = "fake_exchange_id" exchange.name = "bitfinex" exchange.clock = mock.Mock() exchange.clock.step = 0 exchange.quote_price = mock.Mock(return_value=Decimal(7000.00)) wallets = [Wallet(exchange, 10000 * USD), Wallet(exchange, 2 * BTC)] portfolio = Portfolio(USD, wallets) order = mock_order_class.return_value order.portfolio = portfolio order.exchange_pair = ExchangePair(exchange, USD / BTC) order.path_id = "fake_path_id" order.price = 7000.00 wallet_usd = portfolio.get_wallet(exchange.id, USD) wallet_usd.lock( quantity=1000 * USD, order=order, reason="test" ) assert float(wallet_usd.balance.size) == 9000 assert float(wallet_usd.locked[order.path_id].size) == 1000 order_spec = OrderSpec( side=TradeSide.BUY, trade_type=TradeType.MARKET, exchange_pair=ExchangePair(exchange, USD / BTC) ) next_order = order_spec.create_order(order) assert next_order assert next_order.side == TradeSide.BUY assert next_order.type == TradeType.MARKET assert next_order.exchange_pair == ExchangePair(exchange, USD / BTC) assert next_order.path_id == order.path_id assert next_order.quantity.path_id == order.path_id assert next_order.quantity.instrument == USD @mock.patch("tensortrade.exchanges.Exchange") def test_to_dict(mock_exchange_class): exchange = mock_exchange_class.return_value exchange.options = ExchangeOptions() exchange.id = "fake_exchange_id" exchange.name = "bitfinex" exchange.clock = mock.Mock() exchange.clock.step = 0 exchange.quote_price = mock.Mock(return_value=Decimal(7000.00)) order_spec = OrderSpec( side=TradeSide.BUY, trade_type=TradeType.MARKET, exchange_pair=ExchangePair(exchange, USD / BTC) ) d = order_spec.to_dict() assert d == { "id": order_spec.id, "type": order_spec.type, "exchange_pair": order_spec.exchange_pair, "criteria": order_spec.criteria } order_spec = OrderSpec( side=TradeSide.BUY, trade_type=TradeType.MARKET, exchange_pair=ExchangePair(exchange, USD / BTC), criteria=lambda order, exchange: True ) d = order_spec.to_dict() assert d == { "id": order_spec.id, "type": order_spec.type, "exchange_pair": order_spec.exchange_pair, "criteria": order_spec.criteria } @mock.patch("tensortrade.exchanges.Exchange") def test_str(mock_exchange_class): exchange = mock_exchange_class.return_value exchange.options = ExchangeOptions() exchange.id = "fake_exchange_id" exchange.name = "bitfinex" exchange.clock = mock.Mock() exchange.clock.step = 0 exchange.quote_price = mock.Mock(return_value=Decimal(7000.00)) order_spec = OrderSpec( side=TradeSide.BUY, trade_type=TradeType.MARKET, exchange_pair=ExchangePair(exchange, USD / BTC) ) pattern = re.compile("<[A-Z][a-zA-Z]*:\\s(\\w+=.*,\\s)*(\\w+=.*)>") string = str(order_spec) assert string assert string == pattern.fullmatch(string).string
30.719626
72
0.692881
811
6,574
5.406905
0.112207
0.061574
0.047891
0.094869
0.851995
0.822577
0.822577
0.774914
0.764652
0.7626
0
0.013583
0.204898
6,574
213
73
30.86385
0.82533
0.012778
0
0.714286
0
0
0.068918
0.037157
0
0
0
0
0.190476
1
0.029762
false
0
0.041667
0
0.071429
0
0
0
0
null
0
0
0
1
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
7
960293a17e71c88120a06da9fda32e58435f463f
9,502
py
Python
fontes/plot_P.py
fluidgeo/fluidgeo-simulator
adf261abf19852a39b1cbb453c1b1a11ff4251b2
[ "Apache-2.0" ]
7
2015-09-15T14:35:25.000Z
2020-05-19T13:31:22.000Z
fontes/plot_P.py
fluidgeo/fluidgeo-simulator
adf261abf19852a39b1cbb453c1b1a11ff4251b2
[ "Apache-2.0" ]
5
2015-09-11T21:37:34.000Z
2015-11-29T04:29:37.000Z
fontes/plot_P.py
fluidgeo/fluidgeo-simulator
adf261abf19852a39b1cbb453c1b1a11ff4251b2
[ "Apache-2.0" ]
4
2018-07-13T14:12:03.000Z
2021-01-25T02:37:07.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d from matplotlib import cm #plt.rcParams['legend.loc'] = 'best' #plt.rc('text', usetex=True) #plt.rc('font', family='serif') ano = 30.*12.*86400. mes = 30.*86400. # Perfil de pressão inDataLegendP = np.loadtxt('./testeDS/passosPressaoBlocoMacro.dat',unpack=True) dataLegendP = inDataLegendP[1:] pnum = len(dataLegendP) Px0 = np.zeros(pnum) #pData = np.loadtxt('./expTeste/fort.1111',unpack=True) #Pr = pData[0] #Pw = pData[1] #PI = pData[2] fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) for i in range(1,pnum+1): #i_mask = 10*i inDataNameP = './testeDS/solP.%d' % i xx, yy, P = np.loadtxt(inDataNameP,unpack=True,usecols=[2,3,4]) print xx print yy print P #fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') if dataLegendP[i-1] == 1.: leg = (u"%d mês" % dataLegendP[i-1]) else: leg = ("%d meses" % dataLegendP[i-1]) Px0[i-1] = P[0] #ax.plot(xx,yy,P,'o',label=leg) ax.plot(xx,P,'-o',label=leg) #surf = ax.plot_surface(xx, yy, P, rstride=1, cstride=1, cmap=cm.coolwarm, #linewidth=0, antialiased=True) #surf = ax.plot_surface(xx, yy, P) #plt.show() #plt.pcolor(xx,yy,P) #ax.contour(xx, yy, P) #plt.savefig('./teste/tmpPressao%d.pdf' % i_mask) box = ax.get_position() ax.set_position([box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.set_xlabel(r'$x^{*}$',fontsize=18) #ax.set_ylabel('$y^{*}$',fontsize=18) ax.set_ylabel(r'$p^{*}$',fontsize=18) #plt.xlabel('$x^{*}$',fontsize=18) #plt.ylabel('$p^{*}$',fontsize=18,rotation='horizontal') #plt.grid(b=True, which='major', color='k', linestyle='--') #ax.legend() plt.savefig('./testeDS/tmpPressao.pdf') plt.show() fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) for i in range(1,pnum+1): #i_mask = 11*i inDataNameGradP = './testeDS/gradPx.%d' % i xx, yy, gradP = np.loadtxt(inDataNameGradP,unpack=True,usecols=[2,3,4]) print xx print yy print gradP #fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') if dataLegendP[i-1] == 1.: leg = (u"%d mês" % dataLegendP[i-1]) else: leg = ("%d meses" % dataLegendP[i-1]) Px0[i-1] = P[0] #ax.plot(xx,yy,gradP,'o',label=leg) ax.plot(xx,gradP,'-o',label=leg) #surf = ax.plot_surface(xx, yy, P, rstride=1, cstride=1, cmap=cm.coolwarm, #linewidth=0, antialiased=True) #surf = ax.plot_surface(xx, yy, P) #plt.show() #plt.pcolor(xx,yy,P) #ax.contour(xx, yy, P) #plt.savefig('./teste/tmpPressao%d.pdf' % i_mask) box = ax.get_position() ax.set_position([box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.set_xlabel(r'$x^{*}$',fontsize=18) #ax.set_ylabel('$y^{*}$',fontsize=18) ax.set_ylabel(r"$\nabla^* p^{*}$",fontsize=18) #plt.xlabel('$x^{*}$',fontsize=18) #plt.ylabel('$p^{*}$',fontsize=18,rotation='horizontal') #plt.grid(b=True, which='major', color='k', linestyle='--') #ax.legend() plt.savefig('./testeDS/tmpgradPressao.pdf') plt.show() fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) for i in range(1,pnum+1): #i_mask = 14*i inDataNameV = './testeDS/solVelocity_x.%d' % i xx, yy, V = np.loadtxt(inDataNameV,unpack=True,usecols=[2,3,4]) print xx print yy print V #fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') if dataLegendP[i-1] == 1.: leg = (u"%d mês" % dataLegendP[i-1]) else: leg = ("%d meses" % dataLegendP[i-1]) Px0[i-1] = P[0] #ax.plot(xx,yy,V,'o',label=leg) ax.plot(xx,V,'-o',label=leg) #surf = ax.plot_surface(xx, yy, P, rstride=1, cstride=1, cmap=cm.coolwarm, #linewidth=0, antialiased=True) #surf = ax.plot_surface(xx, yy, P) #plt.show() #plt.pcolor(xx,yy,P) #ax.contour(xx, yy, P) #plt.savefig('./teste/tmpPressao%d.pdf' % i_mask) box = ax.get_position() ax.set_position([0.3*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.set_xlabel(r'$x^{*}$',fontsize=18) #ax.set_ylabel('$y^{*}$',fontsize=18) ax.set_ylabel(r"$u_D\,(m/s)$",fontsize=18) #plt.xlabel('$x^{*}$',fontsize=18) #plt.ylabel('$p^{*}$',fontsize=18,rotation='horizontal') #plt.grid(b=True, which='major', color='k', linestyle='--') #ax.legend() plt.savefig('./testeDS/tmpV.pdf') plt.show() fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) for i in range(1,pnum+1): #i_mask = 19*i inDataNameJ = './testeDS/nodeFlux_x.%d' % i xx, yy, J = np.loadtxt(inDataNameJ,unpack=True,usecols=[2,3,4]) print xx print yy print J #fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') if dataLegendP[i-1] == 1.: leg = (u"%d mês" % dataLegendP[i-1]) else: leg = ("%d meses" % dataLegendP[i-1]) Px0[i-1] = P[0] #ax.plot(xx,yy,J,'.',label=leg) #ax.plot(xx,yy,J,'o',label=leg) ax.plot(xx,J,'-o',label=leg) #surf = ax.plot_surface(xx, yy, P, rstride=1, cstride=1, cmap=cm.coolwarm, #linewidth=0, antialiased=True) #surf = ax.plot_surface(xx, yy, P) #plt.show() #plt.pcolor(xx,yy,P) #ax.contour(xx, yy, P) #plt.savefig('./teste/tmpPressao%d.pdf' % i_mask) box = ax.get_position() ax.set_position([0.2*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.set_xlabel('$x^{*}$',fontsize=18) #ax.set_ylabel(r'$y^{*}$',fontsize=18) ax.set_ylabel(r'$J \,\left(\frac{kg}{m^2 s}\right)$',fontsize=18) #plt.xlabel('$x^{*}$',fontsize=18) #plt.ylabel('$p^{*}$',fontsize=18,rotation='horizontal') #plt.grid(b=True, which='major', color='k', linestyle='--') #ax.legend() plt.savefig('./testeDS/tmpJ.pdf') plt.show() fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) for i in range(1,pnum+1): #i_mask = 23*i inDataNameResid = './testeDS/residueFlux_x.%d' % i xx, yy, Resid = np.loadtxt(inDataNameResid,unpack=True,usecols=[2,3,4]) print xx print yy print Resid #fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') if dataLegendP[i-1] == 1.: leg = (u"%d mês" % dataLegendP[i-1]) else: leg = ("%d meses" % dataLegendP[i-1]) Px0[i-1] = P[0] #ax.plot(xx,yy,J,'.',label=leg) #ax.plot(xx,yy,J,'o',label=leg) ax.plot(xx,Resid,'-o',label=leg) #surf = ax.plot_surface(xx, yy, P, rstride=1, cstride=1, cmap=cm.coolwarm, #linewidth=0, antialiased=True) #surf = ax.plot_surface(xx, yy, P) #plt.show() #plt.pcolor(xx,yy,P) #ax.contour(xx, yy, P) #plt.savefig('./teste/tmpPressao%d.pdf' % i_mask) box = ax.get_position() ax.set_position([0.2*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.set_xlabel('$x^{*}$',fontsize=18) #ax.set_ylabel(r'$y^{*}$',fontsize=18) ax.set_ylabel(u'Resíduo',fontsize=18) #plt.xlabel('$x^{*}$',fontsize=18) #plt.ylabel('$p^{*}$',fontsize=18,rotation='horizontal') #plt.grid(b=True, which='major', color='k', linestyle='--') #ax.legend() plt.savefig('./testeDS/tmpResid.pdf') plt.show() # Produção do bloco fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) inDataNameJprod = './testeDS/echoProducao.dat' dt, Jprod = np.loadtxt(inDataNameJprod,unpack=True,usecols=[1,5]) dt = dt/mes ax.set_xlabel(r'$t\,(meses)$',fontsize=18) ax.set_ylabel(r'$Produ \c c \~ a o\, \left(kg\right)$',fontsize=16) ax.plot(dt,Jprod,'-o',label=u'Produção') box = ax.get_position() ax.set_position([0.1*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.savefig('./testeDS/Prod.pdf') plt.show() # RF barra fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) inDataNameRF_ = './testeDS/echoProducao.dat' dt, RF_ = np.loadtxt(inDataNameRF_,unpack=True,usecols=[1,6]) dt = dt/mes ax.set_xlabel(r'$t\,(meses)$',fontsize=18) ax.set_ylabel(r'$RF_{recuper\'avel}$',fontsize=16) ax.plot(dt,RF_,'-o',label=u'RF') box = ax.get_position() ax.set_position([0.1*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.savefig('./testeDS/RF_.pdf') plt.show() # RF fig = plt.figure() #ax = fig.gca(projection='3d') #ax = fig.add_subplot(111, projection='3d') ax = plt.subplot(111) inDataNameRF = './testeDS/echoProducao.dat' dt, RF = np.loadtxt(inDataNameRF,unpack=True,usecols=[1,7]) dt = dt/mes ax.set_xlabel(r'$t\,(meses)$',fontsize=18) ax.set_ylabel(r'$RF_{total}$',fontsize=16) ax.plot(dt,RF,'-o',label=u'RF') box = ax.get_position() ax.set_position([0.1*box.x0+box.x0, box.y0, box.width * 0.8, box.height]) ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.savefig('./testeDS/RF.pdf') plt.show()
30.06962
79
0.62871
1,585
9,502
3.707256
0.11735
0.021784
0.01872
0.030973
0.830667
0.82403
0.815351
0.81518
0.81518
0.81518
0
0.042409
0.143864
9,502
316
80
30.06962
0.679902
0.389392
0
0.636364
0
0.012987
0.137682
0.050114
0
0
0
0
0
0
null
null
0.006494
0.025974
null
null
0.097403
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
1
0
0
0
0
0
0
0
0
7
8249c1549ae1e1c8b5732cf2d1cf1afad7c5d776
33,081
py
Python
venv/lib/python3.8/site-packages/azureml/_restclient/operations/machine_learning_compute_operations.py
amcclead7336/Enterprise_Data_Science_Final
ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28
[ "Unlicense", "MIT" ]
null
null
null
venv/lib/python3.8/site-packages/azureml/_restclient/operations/machine_learning_compute_operations.py
amcclead7336/Enterprise_Data_Science_Final
ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28
[ "Unlicense", "MIT" ]
null
null
null
venv/lib/python3.8/site-packages/azureml/_restclient/operations/machine_learning_compute_operations.py
amcclead7336/Enterprise_Data_Science_Final
ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28
[ "Unlicense", "MIT" ]
2
2021-05-23T16:46:31.000Z
2021-05-26T23:51:09.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator 2.3.33.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse from .. import models class MachineLearningComputeOperations(object): """MachineLearningComputeOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2020-06-01". """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.config = config self.api_version = "2020-06-01" def list_by_workspace( self, subscription_id, resource_group_name, workspace_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): """Gets computes in specified workspace. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param skiptoken: Continuation token for pagination. :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: PaginatedComputeResourcesList or ClientRawResponse if raw=true :rtype: ~_restclient.models.PaginatedComputeResourcesList or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.list_by_workspace.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if skiptoken is not None: query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('PaginatedComputeResourcesList', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} def get( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: ComputeResource or ClientRawResponse if raw=true :rtype: ~_restclient.models.ComputeResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('ComputeResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} def create_or_update( self, subscription_id, resource_group_name, workspace_name, compute_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param parameters: Payload with Machine Learning compute definition. :type parameters: ~_restclient.models.ComputeResource :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: ComputeResource or ClientRawResponse if raw=true :rtype: ~_restclient.models.ComputeResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct body body_content = self._serialize.body(parameters, 'ComputeResource') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None header_dict = {} if response.status_code == 200: deserialized = self._deserialize('ComputeResource', response) header_dict = { 'Azure-AsyncOperation': 'str', } if response.status_code == 201: deserialized = self._deserialize('ComputeResource', response) header_dict = { 'Azure-AsyncOperation': 'str', } if raw: client_raw_response = ClientRawResponse(deserialized, response) client_raw_response.add_headers(header_dict) return client_raw_response return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} def update( self, subscription_id, resource_group_name, workspace_name, compute_name, parameters, custom_headers=None, raw=False, **operation_config): """Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param parameters: Additional parameters for cluster update. :type parameters: ~_restclient.models.ClusterUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: ComputeResource or ClientRawResponse if raw=true :rtype: ~_restclient.models.ComputeResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct body body_content = self._serialize.body(parameters, 'ClusterUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('ComputeResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} def delete( self, subscription_id, resource_group_name, workspace_name, compute_name, underlying_resource_action, custom_headers=None, raw=False, **operation_config): """Deletes specified Machine Learning compute. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'. Possible values include: 'Delete', 'Detach' :type underlying_resource_action: str or ~_restclient.models.UnderlyingResourceAction :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') query_parameters['underlyingResourceAction'] = self._serialize.query("underlying_resource_action", underlying_resource_action, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 202]: raise models.MachineLearningServiceErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'Azure-AsyncOperation': 'str', 'Location': 'str', }) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} def list_nodes( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: AmlComputeNodesInformation or ClientRawResponse if raw=true :rtype: ~_restclient.models.AmlComputeNodesInformation or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.list_nodes.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('AmlComputeNodesInformation', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} def list_keys( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: ComputeSecrets or ClientRawResponse if raw=true :rtype: ~_restclient.models.ComputeSecrets or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.list_keys.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('ComputeSecrets', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} def start( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Posts a start action to a compute instance. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.start.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} def stop( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Posts a stop action to a compute instance. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.stop.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} def restart( self, subscription_id, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): """Posts a restart action to a compute instance. :param subscription_id: The Azure Subscription ID. :type subscription_id: str :param resource_group_name: The Name of the resource group in which the workspace is located. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str :param compute_name: :type compute_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`MachineLearningServiceErrorException<_restclient.models.MachineLearningServiceErrorException>` """ # Construct URL url = self.restart.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), 'computeName': self._serialize.url("compute_name", compute_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.MachineLearningServiceErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'}
48.936391
208
0.670657
3,319
33,081
6.478457
0.070202
0.039066
0.039531
0.012092
0.890289
0.885546
0.881127
0.875546
0.857781
0.857781
0
0.00354
0.239926
33,081
675
209
49.008889
0.851615
0.338956
0
0.748299
0
0.030612
0.206234
0.090557
0
0
0
0
0
1
0.037415
false
0
0.006803
0
0.105442
0
0
0
0
null
0
0
0
1
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
7
82d064a6c3d9fa061a018171f8ecbde3d86beba1
161
py
Python
by-session/class-921/week5/string_find_replace.py
amiraliakbari/sharif-mabani-python
5d14a08d165267fe71c28389ddbafe29af7078c5
[ "MIT" ]
2
2015-04-29T20:59:35.000Z
2018-09-26T13:33:43.000Z
by-session/class-921/week5/string_find_replace.py
amiraliakbari/sharif-mabani-python
5d14a08d165267fe71c28389ddbafe29af7078c5
[ "MIT" ]
null
null
null
by-session/class-921/week5/string_find_replace.py
amiraliakbari/sharif-mabani-python
5d14a08d165267fe71c28389ddbafe29af7078c5
[ "MIT" ]
null
null
null
a = "Hello World!" print a.find("Wor") print a[a.find("Wor"):] print a[a.find("Word"):] print a.replace("W", "salam") print a a = a.replace("W", 'salam') print a
20.125
29
0.614907
31
161
3.193548
0.322581
0.363636
0.212121
0.262626
0.737374
0.737374
0.333333
0
0
0
0
0
0.124224
161
8
30
20.125
0.702128
0
0
0.25
0
0
0.209877
0
0
0
0
0
0
0
null
null
0
0
null
null
0.75
0
0
0
null
1
1
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
7
7d642d7bce416ab0cf28ed58baedd15dd462f018
3,228
py
Python
asq/test/test_relational.py
sixty-north/asq
389f647a7b7a2c4f64af22820713d2c3658d5068
[ "MIT" ]
175
2016-01-09T20:07:00.000Z
2022-01-03T17:10:01.000Z
asq/test/test_relational.py
sixty-north/asq
389f647a7b7a2c4f64af22820713d2c3658d5068
[ "MIT" ]
13
2016-01-02T14:56:48.000Z
2020-11-25T17:12:45.000Z
asq/test/test_relational.py
sixty-north/asq
389f647a7b7a2c4f64af22820713d2c3658d5068
[ "MIT" ]
17
2016-01-02T14:57:00.000Z
2020-11-03T14:18:09.000Z
import unittest from asq.queryables import Queryable from asq.test.test_queryable import infinite __author__ = "Sixty North" class TestEqualOperator(unittest.TestCase): def test_eq_positive(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) == b self.assertTrue(c) def test_eq_negative(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 5, 16, 32) c = Queryable(a) == b self.assertFalse(c) def test_eq_shorter_longer(self): a = [1, 2, 3] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) == b self.assertFalse(c) def test_eq_longer_shorter(self): a = [1, 2, 3, 4, 5, 6] b = (1, 2, 3) c = Queryable(a) == b self.assertFalse(c) def test_eq_empty(self): a = [] b = () c = Queryable(a) == b self.assertTrue(c) def test_eq_non_iterable(self): a = [1, 2, 3] b = None self.assertRaises(TypeError, lambda: Queryable(a) == b) def test_eq_order(self): a = [1, 2] b = (2, 1) c = Queryable(a) == b self.assertFalse(c) def test_eq_finite_infinite(self): a = infinite() b = (1, 2, 3, 5, 16, 32) c = Queryable(a) == b self.assertFalse(c) def test_eq_infinite_finite(self): a = (1, 2, 3, 5, 16, 32) b = infinite() c = Queryable(a) == b self.assertFalse(c) def test_eq_closed(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) c.close() self.assertRaises(ValueError, lambda: c == b) class TestNotEqualOperator(unittest.TestCase): def test_ne_negative(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) != b self.assertFalse(c) def test_ne_positive(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 5, 16, 32) c = Queryable(a) != b self.assertTrue(c) def test_ne_shorter_longer(self): a = [1, 2, 3] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) != b self.assertTrue(c) def test_ne_longer_shorter(self): a = [1, 2, 3, 4, 5, 6] b = (1, 2, 3) c = Queryable(a) != b self.assertTrue(c) def test_ne_empty(self): a = [] b = () c = Queryable(a) != b self.assertFalse(c) def test_ne_non_iterable(self): a = [1, 2, 3] b = None self.assertRaises(TypeError, lambda: Queryable(a) != b) def test_ne_order(self): a = [1, 2] b = (2, 1) c = Queryable(a) != b self.assertTrue(c) def test_ne_finite_infinite(self): a = infinite() b = (1, 2, 3, 5, 16, 32) c = Queryable(a) != b self.assertTrue(c) def test_ne_infinite_finite(self): a = (1, 2, 3, 5, 16, 32) b = infinite() c = Queryable(a) != b self.assertTrue(c) def test_ne_closed(self): a = [1, 2, 3, 4, 16, 32] b = (1, 2, 3, 4, 16, 32) c = Queryable(a) c.close() self.assertRaises(ValueError, lambda: c != b)
24.641221
63
0.488228
475
3,228
3.202105
0.101053
0.036818
0.051282
0.073636
0.86785
0.86785
0.86785
0.86785
0.86785
0.853386
0
0.088608
0.363693
3,228
131
64
24.641221
0.651899
0
0
0.716981
0
0
0.003407
0
0
0
0
0
0.188679
1
0.188679
false
0
0.028302
0
0.235849
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
7d6d94e3977aa465b1368301f5727e8203d577cc
27
py
Python
text_generator/__init__.py
LokotamaTheMastermind/random-text-generator
64a71a98afa9b3eebd0e741f06e83020dfe41dd8
[ "MIT" ]
null
null
null
text_generator/__init__.py
LokotamaTheMastermind/random-text-generator
64a71a98afa9b3eebd0e741f06e83020dfe41dd8
[ "MIT" ]
1
2020-09-27T12:56:55.000Z
2020-09-27T12:56:55.000Z
text_generator/__init__.py
LokotamaTheMastermind/random-text-generator
64a71a98afa9b3eebd0e741f06e83020dfe41dd8
[ "MIT" ]
null
null
null
from .main import generate
13.5
26
0.814815
4
27
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.956522
0
0
0
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
816e46d68ab17559e18fb70a635b12938b5883d5
29,791
py
Python
tests/functional/test_drivers.py
dmfigol/scrapli
d1f8641a1e3f490dab6bae704f092255efe6655c
[ "MIT" ]
null
null
null
tests/functional/test_drivers.py
dmfigol/scrapli
d1f8641a1e3f490dab6bae704f092255efe6655c
[ "MIT" ]
null
null
null
tests/functional/test_drivers.py
dmfigol/scrapli
d1f8641a1e3f490dab6bae704f092255efe6655c
[ "MIT" ]
null
null
null
import time import pytest from scrapli.exceptions import ScrapliAuthenticationFailed from .test_data.devices import DEVICES, INVALID_PRIVATE_KEY, PRIVATE_KEY from .test_data.test_cases import TEST_CASES class TestDevice: def test_get_prompt(self, nix_conn, transport): prompt = nix_conn.channel.get_prompt() assert prompt == TEST_CASES["linux"]["get_prompt"] @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_short(self, nix_conn, transport, strip_prompt): command = TEST_CASES["linux"]["send_command_short"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES["linux"]["send_command_short"][expected_type] _, response = nix_conn.channel.send_input(channel_input=command, strip_prompt=strip_prompt) assert response.decode() == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_long(self, nix_conn, transport, strip_prompt): command = TEST_CASES["linux"]["send_command_long"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES["linux"]["send_command_long"][expected_type] _, response = nix_conn.channel.send_input(channel_input=command, strip_prompt=strip_prompt) assert response.decode() == expected_response def test_isalive_and_close(self, nix_conn, transport): assert nix_conn.isalive() is True nix_conn.close() # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.1) assert nix_conn.isalive() is False class TestGenericDevice: def test_get_prompt(self, nix_conn_generic, transport): prompt = nix_conn_generic.channel.get_prompt() assert prompt == TEST_CASES["linux"]["get_prompt"] @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_short(self, nix_conn_generic, transport, strip_prompt): command = TEST_CASES["linux"]["send_command_short"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES["linux"]["send_command_short"][expected_type] response = nix_conn_generic.send_command(command=command, strip_prompt=strip_prompt) assert response.result == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_long(self, nix_conn_generic, transport, strip_prompt): command = TEST_CASES["linux"]["send_command_long"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES["linux"]["send_command_long"][expected_type] response = nix_conn_generic.send_command(command=command, strip_prompt=strip_prompt) assert response.result == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_commands(self, nix_conn_generic, transport, strip_prompt): commands = [] expected_responses = [] commands.append(TEST_CASES["linux"]["send_command_short"]["command"]) commands.append(TEST_CASES["linux"]["send_command_long"]["command"]) expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses.append(TEST_CASES["linux"]["send_command_short"][expected_type]) expected_responses.append(TEST_CASES["linux"]["send_command_long"][expected_type]) responses = nix_conn_generic.send_commands(commands=commands, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert response.result == expected_response def test_isalive_and_close(self, nix_conn_generic, transport): assert nix_conn_generic.isalive() is True nix_conn_generic.close() # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.1) assert nix_conn_generic.isalive() is False class TestNetworkDevice: @pytest.mark.parametrize( "priv_level", ["exec", "privilege_exec", "configuration"], ids=["exec", "privilege_exec", "configuration"], ) def test_get_prompt_and_acquire_priv(self, conn, priv_level, device_type, transport): if TEST_CASES[device_type]["get_prompt"][priv_level] is None: pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") conn.acquire_priv(priv_level) prompt = conn.get_prompt() assert prompt == TEST_CASES[device_type]["get_prompt"][priv_level] @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_short(self, conn, device_type, transport, strip_prompt): command = TEST_CASES[device_type]["send_command_short"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_command_short"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = conn.send_command(command=command, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_command_long(self, conn, device_type, transport, strip_prompt): command = TEST_CASES[device_type]["send_command_long"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_command_long"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = conn.send_command(command=command, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_commands(self, conn, device_type, transport, strip_prompt): commands = [] expected_responses = [] commands.append(TEST_CASES[device_type]["send_command_short"]["command"]) commands.append(TEST_CASES[device_type]["send_command_long"]["command"]) expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses.append(TEST_CASES[device_type]["send_command_short"][expected_type]) expected_responses.append(TEST_CASES[device_type]["send_command_long"][expected_type]) sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = conn.send_commands(commands=commands, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_commands_from_file(self, conn, device_type, transport, strip_prompt): file = TEST_CASES[device_type]["send_commands_from_file"]["file"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_commands_from_file"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert sanitize_response(response.result) == expected_response def test_send_commands_stop_on_failed(self, conn, device_type, transport): commands = TEST_CASES[device_type]["send_commands_error"]["commands"] responses = conn.send_commands(commands=commands, stop_on_failed=True) assert len(responses) == 2 assert responses[0].failed is False assert responses[1].failed is True def test_send_interactive_normal_response(self, conn, device_type, transport): if TEST_CASES[device_type]["send_interactive_normal_response"] is None: pytest.skip( f"send_interactive_normal_response for device type {device_type} not tested" ) interact = TEST_CASES[device_type]["send_interactive_normal_response"]["command"] expected_response = TEST_CASES[device_type]["send_interactive_normal_response"]["expected"] response = conn.send_interactive(interact_events=interact) assert response.result == expected_response def test_send_interactive_hidden_response(self, conn, device_type, transport): if TEST_CASES[device_type]["send_interactive_hidden_response"] is None: pytest.skip( f"send_interactive_hidden_response for device type {device_type} not tested" ) interact = TEST_CASES[device_type]["send_interactive_hidden_response"]["command"] expected_response = TEST_CASES[device_type]["send_interactive_hidden_response"]["expected"] response = conn.send_interactive(interact_events=interact) assert response.result == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_config(self, conn, device_type, transport, strip_prompt): config = TEST_CASES[device_type]["send_config"]["configs"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_config"][expected_type] verification = TEST_CASES[device_type]["send_config"]["verification"] expected_verification = TEST_CASES[device_type]["send_config"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_config"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = conn.send_config(config=config, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): conn.send_configs(configs=teardown_configs) else: conn.send_config(config=teardown_configs) @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_configs(self, conn, device_type, transport, strip_prompt): configs = TEST_CASES[device_type]["send_configs"]["configs"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_configs"][expected_type] verification = TEST_CASES[device_type]["send_configs"]["verification"] expected_verification = TEST_CASES[device_type]["send_configs"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_configs"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = conn.send_configs(configs=configs, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert response.result == expected_response verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): conn.send_configs(configs=teardown_configs) else: conn.send_config(config=teardown_configs) @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) def test_send_configs_from_file(self, conn, device_type, transport, strip_prompt): file = TEST_CASES[device_type]["send_configs_from_file"]["file"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_configs"][expected_type] verification = TEST_CASES[device_type]["send_configs"]["verification"] expected_verification = TEST_CASES[device_type]["send_configs"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_configs"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = conn.send_configs_from_file(file=file, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert response.result == expected_response verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): conn.send_configs(configs=teardown_configs) else: conn.send_config(config=teardown_configs) def test_send_configs_stop_on_failed(self, conn, device_type, transport): if TEST_CASES[device_type]["send_configs_error"] is None: pytest.skip( f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." ) configs = TEST_CASES[device_type]["send_configs_error"]["configs"] teardown_configs = TEST_CASES[device_type]["send_configs_error"]["teardown_configs"] responses = conn.send_configs(configs=configs, stop_on_failed=True) assert len(responses) == 2 assert responses[0].failed is False assert responses[1].failed is True if isinstance(teardown_configs, list): conn.send_configs(configs=teardown_configs) else: conn.send_config(config=teardown_configs) def test_isalive_and_close(self, conn, device_type, transport): assert conn.isalive() is True conn.close() # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.5) assert conn.isalive() is False @pytest.mark.asyncio class TestAsyncNetworkDevice: @pytest.mark.parametrize( "priv_level", ["exec", "privilege_exec", "configuration"], ids=["exec", "privilege_exec", "configuration"], ) async def test_get_prompt_and_acquire_priv(self, async_conn, priv_level, device_type): if TEST_CASES[device_type]["get_prompt"][priv_level] is None: pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") await async_conn.acquire_priv(priv_level) prompt = await async_conn.get_prompt() assert prompt == TEST_CASES[device_type]["get_prompt"][priv_level] @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_command_short(self, async_conn, device_type, strip_prompt): command = TEST_CASES[device_type]["send_command_short"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_command_short"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_command_long(self, async_conn, device_type, strip_prompt): command = TEST_CASES[device_type]["send_command_long"]["command"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_command_long"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_commands(self, async_conn, device_type, strip_prompt): commands = [] expected_responses = [] commands.append(TEST_CASES[device_type]["send_command_short"]["command"]) commands.append(TEST_CASES[device_type]["send_command_long"]["command"]) expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses.append(TEST_CASES[device_type]["send_command_short"][expected_type]) expected_responses.append(TEST_CASES[device_type]["send_command_long"][expected_type]) sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = await async_conn.send_commands(commands=commands, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert sanitize_response(response.result) == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_commands_from_file(self, async_conn, device_type, strip_prompt): file = TEST_CASES[device_type]["send_commands_from_file"]["file"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_commands_from_file"][expected_type] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = await async_conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert sanitize_response(response.result) == expected_response async def test_send_commands_stop_on_failed(self, async_conn, device_type): commands = TEST_CASES[device_type]["send_commands_error"]["commands"] responses = await async_conn.send_commands(commands=commands, stop_on_failed=True) assert len(responses) == 2 assert responses[0].failed is False assert responses[1].failed is True async def test_send_interactive_normal_response(self, async_conn, device_type): if TEST_CASES[device_type]["send_interactive_normal_response"] is None: pytest.skip( f"send_interactive_normal_response for device type {device_type} not tested" ) interact = TEST_CASES[device_type]["send_interactive_normal_response"]["command"] expected_response = TEST_CASES[device_type]["send_interactive_normal_response"]["expected"] response = await async_conn.send_interactive(interact_events=interact) assert response.result == expected_response async def test_send_interactive_hidden_response(self, async_conn, device_type): if TEST_CASES[device_type]["send_interactive_hidden_response"] is None: pytest.skip( f"send_interactive_hidden_response for device type {device_type} not tested" ) interact = TEST_CASES[device_type]["send_interactive_hidden_response"]["command"] expected_response = TEST_CASES[device_type]["send_interactive_hidden_response"]["expected"] response = await async_conn.send_interactive(interact_events=interact) assert response.result == expected_response @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_config(self, async_conn, device_type, strip_prompt): config = TEST_CASES[device_type]["send_config"]["configs"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_response = TEST_CASES[device_type]["send_config"][expected_type] verification = TEST_CASES[device_type]["send_config"]["verification"] expected_verification = TEST_CASES[device_type]["send_config"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_config"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] response = await async_conn.send_config(config=config, strip_prompt=strip_prompt) assert sanitize_response(response.result) == expected_response verification_response = await async_conn.send_command( command=verification, strip_prompt=strip_prompt ) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): await async_conn.send_configs(configs=teardown_configs) else: await async_conn.send_config(config=teardown_configs) @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_configs(self, async_conn, device_type, strip_prompt): configs = TEST_CASES[device_type]["send_configs"]["configs"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_configs"][expected_type] verification = TEST_CASES[device_type]["send_configs"]["verification"] expected_verification = TEST_CASES[device_type]["send_configs"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_configs"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = await async_conn.send_configs(configs=configs, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert response.result == expected_response verification_response = await async_conn.send_command( command=verification, strip_prompt=strip_prompt ) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): await async_conn.send_configs(configs=teardown_configs) else: await async_conn.send_config(config=teardown_configs) @pytest.mark.parametrize( "strip_prompt", [True, False], ids=["strip_prompt", "no_strip_prompt"], ) async def test_send_configs_from_file(self, async_conn, device_type, strip_prompt): file = TEST_CASES[device_type]["send_configs_from_file"]["file"] expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" expected_responses = TEST_CASES[device_type]["send_configs"][expected_type] verification = TEST_CASES[device_type]["send_configs"]["verification"] expected_verification = TEST_CASES[device_type]["send_configs"][ f"verification_{expected_type}" ] teardown_configs = TEST_CASES[device_type]["send_configs"]["teardown_configs"] sanitize_response = TEST_CASES[device_type]["sanitize_response"] responses = await async_conn.send_configs_from_file(file=file, strip_prompt=strip_prompt) for expected_response, response in zip(expected_responses, responses): assert response.result == expected_response verification_response = await async_conn.send_command( command=verification, strip_prompt=strip_prompt ) assert sanitize_response(verification_response.result) == expected_verification if isinstance(teardown_configs, list): await async_conn.send_configs(configs=teardown_configs) else: await async_conn.send_config(config=teardown_configs) async def test_send_configs_stop_on_failed(self, async_conn, device_type): if TEST_CASES[device_type]["send_configs_error"] is None: pytest.skip( f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." ) configs = TEST_CASES[device_type]["send_configs_error"]["configs"] teardown_configs = TEST_CASES[device_type]["send_configs_error"]["teardown_configs"] responses = await async_conn.send_configs(configs=configs, stop_on_failed=True) assert len(responses) == 2 assert responses[0].failed is False assert responses[1].failed is True if isinstance(teardown_configs, list): await async_conn.send_configs(configs=teardown_configs) else: await async_conn.send_config(config=teardown_configs) async def test_isalive_and_close(self, async_conn, device_type): assert async_conn.isalive() is True await async_conn.close() # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.5) assert async_conn.isalive() is False def test_context_manager(device_type, transport): device = DEVICES[device_type].copy() driver = device.pop("driver") device.pop("base_config") device.pop("async_driver") port = device.pop("port", 22) if transport == "telnet": port = port + 1 device["port"] = port device["transport"] = transport # nxos running on macos is crazy slow.... device["timeout_socket"] = 30 device["timeout_transport"] = 30 device["timeout_ops"] = 30 with driver(**device) as conn: assert conn.isalive() is True # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.5) assert conn.isalive() is False def test_public_key_auth(device_type, transport): if device_type != "cisco_iosxe" or transport == "telnet": pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") device = DEVICES[device_type].copy() driver = device.pop("driver") device.pop("base_config") device.pop("async_driver") device["transport"] = transport device["timeout_socket"] = 5 device["timeout_transport"] = 5 device["timeout_ops"] = 5 device["auth_private_key"] = PRIVATE_KEY with driver(**device) as conn: assert conn.isalive() is True # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt # close in time for the next assert time.sleep(0.2) assert conn.isalive() is False def test_public_key_auth_failure(device_type, transport): if device_type != "cisco_iosxe" or transport == "telnet": pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") if device_type != "cisco_iosxe" or transport == "system": pytest.skip( "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" ) device = DEVICES[device_type].copy() driver = device.pop("driver") device.pop("base_config") device.pop("async_driver") device["transport"] = transport device["timeout_socket"] = 5 device["timeout_transport"] = 5 device["timeout_ops"] = 5 device["auth_private_key"] = INVALID_PRIVATE_KEY device.pop("auth_password") conn = driver(**device) with pytest.raises(ScrapliAuthenticationFailed) as exc: conn.open() assert str(exc.value) == ( f"Failed to authenticate to host {device['host']} with private key `{INVALID_PRIVATE_KEY}`." " Unable to continue authentication, missing username, password, or both." ) def test_public_key_auth_failure_systemssh(device_type, transport): if device_type != "cisco_iosxe" or transport != "system": pytest.skip( "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" ) device = DEVICES[device_type].copy() driver = device.pop("driver") device.pop("base_config") device.pop("async_driver") device["transport"] = transport device["timeout_socket"] = 5 device["timeout_transport"] = 5 device["timeout_ops"] = 5 device["auth_private_key"] = INVALID_PRIVATE_KEY device.pop("auth_password") conn = driver(**device) with pytest.raises(ScrapliAuthenticationFailed) as exc: conn.open() assert "auth failed" in str(exc.value)
49.241322
134
0.706354
3,600
29,791
5.507778
0.048056
0.080442
0.066573
0.084325
0.961116
0.948759
0.938118
0.921929
0.903772
0.903772
0
0.001752
0.195361
29,791
604
135
49.322848
0.825414
0.025075
0
0.738636
0
0
0.192973
0.03114
0
0
0
0
0.111742
1
0.049242
false
0.005682
0.00947
0
0.066288
0
0
0
0
null
0
0
0
1
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
7
819bbc8ef9d47ece9b6bcb01596d4ee70b7edd04
254
py
Python
CPAC/pypeer/__init__.py
Lawreros/C-PAC
ce26ba9a38cbd401cd405150eeed23b805007724
[ "BSD-3-Clause" ]
125
2015-03-04T09:14:46.000Z
2022-03-29T07:46:12.000Z
CPAC/pypeer/__init__.py
Lawreros/C-PAC
ce26ba9a38cbd401cd405150eeed23b805007724
[ "BSD-3-Clause" ]
1,018
2015-01-04T16:01:29.000Z
2022-03-31T19:23:09.000Z
CPAC/pypeer/__init__.py
Lawreros/C-PAC
ce26ba9a38cbd401cd405150eeed23b805007724
[ "BSD-3-Clause" ]
117
2015-01-10T08:05:52.000Z
2022-01-18T05:16:51.000Z
from .peer import ( pypeer_eye_masking, pypeer_zscore, pypeer_ravel_data, motion_scrub, prep_for_pypeer ) __all__ = [ 'pypeer_eye_masking', 'pypeer_zscore', 'pypeer_ravel_data', 'motion_scrub', 'prep_for_pypeer' ]
16.933333
25
0.673228
30
254
5.033333
0.466667
0.119205
0.211921
0.291391
0.887417
0.887417
0.887417
0.887417
0.887417
0.887417
0
0
0.232283
254
15
26
16.933333
0.774359
0
0
0
0
0
0.294118
0
0
0
0
0
0
1
0
false
0
0.071429
0
0.071429
0
0
0
0
null
0
1
1
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
8
81aa846d9c1755d2c6c5ca14246e438aa585c1f7
312,637
py
Python
sympy/integrals/rubi/rules/hyperbolic.py
STALKER2010/sympy-bleeding-edge
81233029a9a30866747f6da2c0e9604d1681d474
[ "BSD-3-Clause" ]
2
2018-12-05T02:30:43.000Z
2020-11-14T01:43:15.000Z
sympy/integrals/rubi/rules/hyperbolic.py
STALKER2010/sympy-bleeding-edge
81233029a9a30866747f6da2c0e9604d1681d474
[ "BSD-3-Clause" ]
1
2017-10-23T06:56:43.000Z
2017-10-23T06:56:43.000Z
sympy/integrals/rubi/rules/hyperbolic.py
STALKER2010/sympy-bleeding-edge
81233029a9a30866747f6da2c0e9604d1681d474
[ "BSD-3-Clause" ]
1
2020-10-02T15:05:03.000Z
2020-10-02T15:05:03.000Z
from sympy.external import import_module matchpy = import_module("matchpy") from sympy.utilities.decorator import doctest_depends_on if matchpy: from matchpy import Pattern, ReplacementRule, CustomConstraint from sympy.integrals.rubi.utility_function import (Int, Set, With, Module, Scan, MapAnd, FalseQ, ZeroQ, NegativeQ, NonzeroQ, FreeQ, NFreeQ, List, Log, PositiveQ, PositiveIntegerQ, NegativeIntegerQ, IntegerQ, IntegersQ, ComplexNumberQ, PureComplexNumberQ, RealNumericQ, PositiveOrZeroQ, NegativeOrZeroQ, FractionOrNegativeQ, NegQ, Equal, Unequal, IntPart, FracPart, RationalQ, ProductQ, SumQ, NonsumQ, Subst, First, Rest, SqrtNumberQ, SqrtNumberSumQ, LinearQ, Sqrt, ArcCosh, Coefficient, Denominator, Hypergeometric2F1, Not, Simplify, FractionalPart, IntegerPart, AppellF1, EllipticPi, EllipticE, EllipticF, ArcTan, ArcCot, ArcCoth, ArcTanh, ArcSin, ArcSinh, ArcCos, ArcCsc, ArcSec, ArcCsch, ArcSech, Sinh, Tanh, Cosh, Sech, Csch, Coth, LessEqual, Less, Greater, GreaterEqual, FractionQ, IntLinearcQ, Expand, IndependentQ, PowerQ, IntegerPowerQ, PositiveIntegerPowerQ, FractionalPowerQ, AtomQ, ExpQ, LogQ, Head, MemberQ, TrigQ, SinQ, CosQ, TanQ, CotQ, SecQ, CscQ, Sin, Cos, Tan, Cot, Sec, Csc, HyperbolicQ, SinhQ, CoshQ, TanhQ, CothQ, SechQ, CschQ, InverseTrigQ, SinCosQ, SinhCoshQ, LeafCount, Numerator, NumberQ, NumericQ, Length, ListQ, Im, Re, InverseHyperbolicQ, InverseFunctionQ, TrigHyperbolicFreeQ, InverseFunctionFreeQ, RealQ, EqQ, FractionalPowerFreeQ, ComplexFreeQ, PolynomialQ, FactorSquareFree, PowerOfLinearQ, Exponent, QuadraticQ, LinearPairQ, BinomialParts, TrinomialParts, PolyQ, EvenQ, OddQ, PerfectSquareQ, NiceSqrtAuxQ, NiceSqrtQ, Together, PosAux, PosQ, CoefficientList, ReplaceAll, ExpandLinearProduct, GCD, ContentFactor, NumericFactor, NonnumericFactors, MakeAssocList, GensymSubst, KernelSubst, ExpandExpression, Apart, SmartApart, MatchQ, PolynomialQuotientRemainder, FreeFactors, NonfreeFactors, RemoveContentAux, RemoveContent, FreeTerms, NonfreeTerms, ExpandAlgebraicFunction, CollectReciprocals, ExpandCleanup, AlgebraicFunctionQ, Coeff, LeadTerm, RemainingTerms, LeadFactor, RemainingFactors, LeadBase, LeadDegree, Numer, Denom, hypergeom, Expon, MergeMonomials, PolynomialDivide, BinomialQ, TrinomialQ, GeneralizedBinomialQ, GeneralizedTrinomialQ, FactorSquareFreeList, PerfectPowerTest, SquareFreeFactorTest, RationalFunctionQ, RationalFunctionFactors, NonrationalFunctionFactors, Reverse, RationalFunctionExponents, RationalFunctionExpand, ExpandIntegrand, SimplerQ, SimplerSqrtQ, SumSimplerQ, BinomialDegree, TrinomialDegree, CancelCommonFactors, SimplerIntegrandQ, GeneralizedBinomialDegree, GeneralizedBinomialParts, GeneralizedTrinomialDegree, GeneralizedTrinomialParts, MonomialQ, MonomialSumQ, MinimumMonomialExponent, MonomialExponent, LinearMatchQ, PowerOfLinearMatchQ, QuadraticMatchQ, CubicMatchQ, BinomialMatchQ, TrinomialMatchQ, GeneralizedBinomialMatchQ, GeneralizedTrinomialMatchQ, QuotientOfLinearsMatchQ, PolynomialTermQ, PolynomialTerms, NonpolynomialTerms, PseudoBinomialParts, NormalizePseudoBinomial, PseudoBinomialPairQ, PseudoBinomialQ, PolynomialGCD, PolyGCD, AlgebraicFunctionFactors, NonalgebraicFunctionFactors, QuotientOfLinearsP, QuotientOfLinearsParts, QuotientOfLinearsQ, Flatten, Sort, AbsurdNumberQ, AbsurdNumberFactors, NonabsurdNumberFactors, SumSimplerAuxQ, Prepend, Drop, CombineExponents, FactorInteger, FactorAbsurdNumber, SubstForInverseFunction, SubstForFractionalPower, SubstForFractionalPowerOfQuotientOfLinears, FractionalPowerOfQuotientOfLinears, SubstForFractionalPowerQ, SubstForFractionalPowerAuxQ, FractionalPowerOfSquareQ, FractionalPowerSubexpressionQ, Apply, FactorNumericGcd, MergeableFactorQ, MergeFactor, MergeFactors, TrigSimplifyQ, TrigSimplify, TrigSimplifyRecur, Order, FactorOrder, Smallest, OrderedQ, MinimumDegree, PositiveFactors, Sign, NonpositiveFactors, PolynomialInAuxQ, PolynomialInQ, ExponentInAux, ExponentIn, PolynomialInSubstAux, PolynomialInSubst, Distrib, DistributeDegree, FunctionOfPower, DivideDegreesOfFactors, MonomialFactor, FullSimplify, FunctionOfLinearSubst, FunctionOfLinear, NormalizeIntegrand, NormalizeIntegrandAux, NormalizeIntegrandFactor, NormalizeIntegrandFactorBase, NormalizeTogether, NormalizeLeadTermSigns, AbsorbMinusSign, NormalizeSumFactors, SignOfFactor, NormalizePowerOfLinear, SimplifyIntegrand, SimplifyTerm, TogetherSimplify, SmartSimplify, SubstForExpn, ExpandToSum, UnifySum, UnifyTerms, UnifyTerm, CalculusQ, FunctionOfInverseLinear, PureFunctionOfSinhQ, PureFunctionOfTanhQ, PureFunctionOfCoshQ, IntegerQuotientQ, OddQuotientQ, EvenQuotientQ, FindTrigFactor, FunctionOfSinhQ, FunctionOfCoshQ, OddHyperbolicPowerQ, FunctionOfTanhQ, FunctionOfTanhWeight, FunctionOfHyperbolicQ, SmartNumerator, SmartDenominator, SubstForAux, ActivateTrig, ExpandTrig, TrigExpand, SubstForTrig, SubstForHyperbolic, InertTrigFreeQ, LCM, SubstForFractionalPowerOfLinear, FractionalPowerOfLinear, InverseFunctionOfLinear, InertTrigQ, InertReciprocalQ, DeactivateTrig, FixInertTrigFunction, DeactivateTrigAux, PowerOfInertTrigSumQ, PiecewiseLinearQ, KnownTrigIntegrandQ, KnownSineIntegrandQ, KnownTangentIntegrandQ, KnownCotangentIntegrandQ, KnownSecantIntegrandQ, TryPureTanSubst, TryTanhSubst, TryPureTanhSubst, AbsurdNumberGCD, AbsurdNumberGCDList, ExpandTrigExpand, ExpandTrigReduce, ExpandTrigReduceAux, NormalizeTrig, TrigToExp, ExpandTrigToExp, TrigReduce, FunctionOfTrig, AlgebraicTrigFunctionQ, FunctionOfHyperbolic, FunctionOfQ, FunctionOfExpnQ, PureFunctionOfSinQ, PureFunctionOfCosQ, PureFunctionOfTanQ, PureFunctionOfCotQ, FunctionOfCosQ, FunctionOfSinQ, OddTrigPowerQ, FunctionOfTanQ, FunctionOfTanWeight, FunctionOfTrigQ, FunctionOfDensePolynomialsQ, FunctionOfLog, PowerVariableExpn, PowerVariableDegree, PowerVariableSubst, EulerIntegrandQ, FunctionOfSquareRootOfQuadratic, SquareRootOfQuadraticSubst, Divides, EasyDQ, ProductOfLinearPowersQ, Rt, NthRoot, AtomBaseQ, SumBaseQ, NegSumBaseQ, AllNegTermQ, SomeNegTermQ, TrigSquareQ, RtAux, TrigSquare, IntSum, IntTerm, Map2, ConstantFactor, SameQ, ReplacePart, CommonFactors, MostMainFactorPosition, FunctionOfExponentialQ, FunctionOfExponential, FunctionOfExponentialFunction, FunctionOfExponentialFunctionAux, FunctionOfExponentialTest, FunctionOfExponentialTestAux, stdev, rubi_test, If, IntQuadraticQ, IntBinomialQ, RectifyTangent, RectifyCotangent, Inequality, Condition, Simp, SimpHelp, SplitProduct, SplitSum, SubstFor, SubstForAux, FresnelS, FresnelC, Erfc, Erfi, Gamma, FunctionOfTrigOfLinearQ, ElementaryFunctionQ, Complex, UnsameQ, _SimpFixFactor, SimpFixFactor, _FixSimplify, FixSimplify, _SimplifyAntiderivativeSum, SimplifyAntiderivativeSum, _SimplifyAntiderivative, SimplifyAntiderivative, _TrigSimplifyAux, TrigSimplifyAux, Cancel, Part, PolyLog, D, Dist) from sympy import Integral, S, sqrt from sympy.integrals.rubi.symbol import WC from sympy.core.symbol import symbols, Symbol from sympy.functions import (log, sin, cos, tan, cot, csc, sec, sqrt, erf, exp, log) from sympy.functions.elementary.hyperbolic import (acosh, asinh, atanh, acoth, acsch, asech, cosh, sinh, tanh, coth, sech, csch) from sympy.functions.elementary.trigonometric import (atan, acsc, asin, acot, acos, asec) A_, B_, C_, F_, G_, H_, a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, p_, q_, r_, t_, u_, v_, s_, w_, x_, y_, z_ = [WC(i) for i in 'ABCFGHabcdefghijklmnpqrtuvswxyz'] a1_, a2_, b1_, b2_, c1_, c2_, d1_, d2_, n1_, n2_, e1_, e2_, f1_, f2_, g1_, g2_, n1_, n2_, n3_, Pq_, Pm_, Px_, Qm_, Qr_, Qx_, jn_, mn_, non2_, RFx_, RGx_ = [WC(i) for i in ['a1', 'a2', 'b1', 'b2', 'c1', 'c2', 'd1', 'd2', 'n1', 'n2', 'e1', 'e2', 'f1', 'f2', 'g1', 'g2', 'n1', 'n2', 'n3', 'Pq', 'Pm', 'Px', 'Qm', 'Qr', 'Qx', 'jn', 'mn', 'non2', 'RFx', 'RGx']] _UseGamma = False def hyperbolic(rubi): pattern1 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule1 = ReplacementRule(pattern1, lambda m, e, x, f, d, c : -d*m*Int((c + d*x)**(m + S(-1))*Cosh(e + f*x), x)/f + (c + d*x)**m*Cosh(e + f*x)/f) rubi.add(rule1) pattern2 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule2 = ReplacementRule(pattern2, lambda m, e, x, f, d, c : -d*m*Int((c + d*x)**(m + S(-1))*sinh(e + f*x), x)/f + (c + d*x)**m*sinh(e + f*x)/f) rubi.add(rule2) pattern3 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*sinh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1)))) rule3 = ReplacementRule(pattern3, lambda m, e, x, f, d, c : -f*Int((c + d*x)**(m + S(1))*Cosh(e + f*x), x)/(d*(m + S(1))) + (c + d*x)**(m + S(1))*sinh(e + f*x)/(d*(m + S(1)))) rubi.add(rule3) pattern4 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*Cosh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1)))) rule4 = ReplacementRule(pattern4, lambda m, e, x, f, d, c : -f*Int((c + d*x)**(m + S(1))*sinh(e + f*x), x)/(d*(m + S(1))) + (c + d*x)**(m + S(1))*Cosh(e + f*x)/(d*(m + S(1)))) rubi.add(rule4) pattern5 = Pattern(Integral(sinh(x_*WC('f', S(1)) + WC('e', S(0)))/(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda d, f, e, c: ZeroQ(-c*f + d*e))) rule5 = ReplacementRule(pattern5, lambda e, x, f, d, c : SinhIntegral(e + f*x)/d) rubi.add(rule5) pattern6 = Pattern(Integral(Cosh(x_*WC('f', S(1)) + WC('e', S(0)))/(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda d, f, e, c: ZeroQ(-c*f + d*e))) rule6 = ReplacementRule(pattern6, lambda e, x, f, d, c : CoshIntegral(e + f*x)/d) rubi.add(rule6) pattern7 = Pattern(Integral(sinh(x_*WC('f', S(1)) + WC('e', S(0)))/(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda d, f, e, c: NonzeroQ(-c*f + d*e))) rule7 = ReplacementRule(pattern7, lambda e, x, f, d, c : Cosh((-c*f + d*e)/d)*Int(sinh(c*f/d + f*x)/(c + d*x), x) + Int(Cosh(c*f/d + f*x)/(c + d*x), x)*sinh((-c*f + d*e)/d)) rubi.add(rule7) pattern8 = Pattern(Integral(Cosh(x_*WC('f', S(1)) + WC('e', S(0)))/(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda d, f, e, c: NonzeroQ(-c*f + d*e))) rule8 = ReplacementRule(pattern8, lambda e, x, f, d, c : Cosh((-c*f + d*e)/d)*Int(Cosh(c*f/d + f*x)/(c + d*x), x) + Int(sinh(c*f/d + f*x)/(c + d*x), x)*sinh((-c*f + d*e)/d)) rubi.add(rule8) pattern9 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x))) rule9 = ReplacementRule(pattern9, lambda m, e, x, f, d, c : -Int((c + d*x)**m*exp(-e - f*x), x)/S(2) + Int((c + d*x)**m*exp(e + f*x), x)/S(2)) rubi.add(rule9) pattern10 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x))) rule10 = ReplacementRule(pattern10, lambda m, e, x, f, d, c : Int((c + d*x)**m*exp(-e - f*x), x)/S(2) + Int((c + d*x)**m*exp(e + f*x), x)/S(2)) rubi.add(rule10) pattern11 = Pattern(Integral((WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule11 = ReplacementRule(pattern11, lambda c, e, x, f, d, n, b : -b**S(2)*(n + S(-1))*Int((b*sinh(e + f*x))**(n + S(-2))*(c + d*x), x)/n + b*(b*sinh(e + f*x))**(n + S(-1))*(c + d*x)*Cosh(e + f*x)/(f*n) - d*(b*sinh(e + f*x))**n/(f**S(2)*n**S(2))) rubi.add(rule11) pattern12 = Pattern(Integral((Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule12 = ReplacementRule(pattern12, lambda e, x, f, d, n, b, c : b**S(2)*(n + S(-1))*Int((b*Cosh(e + f*x))**(n + S(-2))*(c + d*x), x)/n + b*(b*Cosh(e + f*x))**(n + S(-1))*(c + d*x)*sinh(e + f*x)/(f*n) - d*(b*Cosh(e + f*x))**n/(f**S(2)*n**S(2))) rubi.add(rule12) pattern13 = Pattern(Integral((WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Greater(m, S(1)))) rule13 = ReplacementRule(pattern13, lambda m, c, e, x, f, d, n, b : -b**S(2)*(n + S(-1))*Int((b*sinh(e + f*x))**(n + S(-2))*(c + d*x)**m, x)/n + b*(b*sinh(e + f*x))**(n + S(-1))*(c + d*x)**m*Cosh(e + f*x)/(f*n) + d**S(2)*m*(m + S(-1))*Int((b*sinh(e + f*x))**n*(c + d*x)**(m + S(-2)), x)/(f**S(2)*n**S(2)) - d*m*(b*sinh(e + f*x))**n*(c + d*x)**(m + S(-1))/(f**S(2)*n**S(2))) rubi.add(rule13) pattern14 = Pattern(Integral((Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Greater(m, S(1)))) rule14 = ReplacementRule(pattern14, lambda m, e, x, f, d, n, b, c : b**S(2)*(n + S(-1))*Int((b*Cosh(e + f*x))**(n + S(-2))*(c + d*x)**m, x)/n + b*(b*Cosh(e + f*x))**(n + S(-1))*(c + d*x)**m*sinh(e + f*x)/(f*n) + d**S(2)*m*(m + S(-1))*Int((b*Cosh(e + f*x))**n*(c + d*x)**(m + S(-2)), x)/(f**S(2)*n**S(2)) - d*m*(b*Cosh(e + f*x))**n*(c + d*x)**(m + S(-1))/(f**S(2)*n**S(2))) rubi.add(rule14) pattern15 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*sinh(x_*WC('f', S(1)) + WC('e', S(0)))**n_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Not(RationalQ(m)) | Inequality(S(-1), LessEqual, m, Less, S(1)))) rule15 = ReplacementRule(pattern15, lambda m, e, x, f, d, n, c : Int(ExpandTrigReduce((c + d*x)**m, sinh(e + f*x)**n, x), x)) rubi.add(rule15) pattern16 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*Cosh(x_*WC('f', S(1)) + WC('e', S(0)))**n_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Not(RationalQ(m)) | Inequality(S(-1), LessEqual, m, Less, S(1)))) rule16 = ReplacementRule(pattern16, lambda m, e, x, f, d, n, c : Int(ExpandTrigReduce((c + d*x)**m, Cosh(e + f*x)**n, x), x)) rubi.add(rule16) pattern17 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*sinh(x_*WC('f', S(1)) + WC('e', S(0)))**n_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Inequality(S(-2), LessEqual, m, Less, S(-1)))) rule17 = ReplacementRule(pattern17, lambda m, e, x, f, d, n, c : -f*n*Int(ExpandTrigReduce((c + d*x)**(m + S(1)), Cosh(e + f*x)*sinh(e + f*x)**(n + S(-1)), x), x)/(d*(m + S(1))) + (c + d*x)**(m + S(1))*sinh(e + f*x)**n/(d*(m + S(1)))) rubi.add(rule17) pattern18 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*Cosh(x_*WC('f', S(1)) + WC('e', S(0)))**n_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Inequality(S(-2), LessEqual, m, Less, S(-1)))) rule18 = ReplacementRule(pattern18, lambda m, e, x, f, d, n, c : -f*n*Int(ExpandTrigReduce((c + d*x)**(m + S(1)), Cosh(e + f*x)**(n + S(-1))*sinh(e + f*x), x), x)/(d*(m + S(1))) + (c + d*x)**(m + S(1))*Cosh(e + f*x)**n/(d*(m + S(1)))) rubi.add(rule18) pattern19 = Pattern(Integral((WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Less(m, S(-2)))) rule19 = ReplacementRule(pattern19, lambda m, c, e, x, f, d, n, b : b**S(2)*f**S(2)*n*(n + S(-1))*Int((b*sinh(e + f*x))**(n + S(-2))*(c + d*x)**(m + S(2)), x)/(d**S(2)*(m + S(1))*(m + S(2))) - b*f*n*(b*sinh(e + f*x))**(n + S(-1))*(c + d*x)**(m + S(2))*Cosh(e + f*x)/(d**S(2)*(m + S(1))*(m + S(2))) + (b*sinh(e + f*x))**n*(c + d*x)**(m + S(1))/(d*(m + S(1))) + f**S(2)*n**S(2)*Int((b*sinh(e + f*x))**n*(c + d*x)**(m + S(2)), x)/(d**S(2)*(m + S(1))*(m + S(2)))) rubi.add(rule19) pattern20 = Pattern(Integral((Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Less(m, S(-2)))) rule20 = ReplacementRule(pattern20, lambda m, e, x, f, d, n, b, c : -b**S(2)*f**S(2)*n*(n + S(-1))*Int((b*Cosh(e + f*x))**(n + S(-2))*(c + d*x)**(m + S(2)), x)/(d**S(2)*(m + S(1))*(m + S(2))) - b*f*n*(b*Cosh(e + f*x))**(n + S(-1))*(c + d*x)**(m + S(2))*sinh(e + f*x)/(d**S(2)*(m + S(1))*(m + S(2))) + (b*Cosh(e + f*x))**n*(c + d*x)**(m + S(1))/(d*(m + S(1))) + f**S(2)*n**S(2)*Int((b*Cosh(e + f*x))**n*(c + d*x)**(m + S(2)), x)/(d**S(2)*(m + S(1))*(m + S(2)))) rubi.add(rule20) pattern21 = Pattern(Integral((WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2)))) rule21 = ReplacementRule(pattern21, lambda c, e, x, f, d, n, b : (b*sinh(e + f*x))**(n + S(1))*(c + d*x)*Cosh(e + f*x)/(b*f*(n + S(1))) - d*(b*sinh(e + f*x))**(n + S(2))/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) - (n + S(2))*Int((b*sinh(e + f*x))**(n + S(2))*(c + d*x), x)/(b**S(2)*(n + S(1)))) rubi.add(rule21) pattern22 = Pattern(Integral((Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2)))) rule22 = ReplacementRule(pattern22, lambda e, x, f, d, n, b, c : (b*Cosh(e + f*x))**(n + S(1))*(-c - d*x)*sinh(e + f*x)/(b*f*(n + S(1))) + d*(b*Cosh(e + f*x))**(n + S(2))/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) + (n + S(2))*Int((b*Cosh(e + f*x))**(n + S(2))*(c + d*x), x)/(b**S(2)*(n + S(1)))) rubi.add(rule22) pattern23 = Pattern(Integral((WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2))), CustomConstraint(lambda m: Greater(m, S(1)))) rule23 = ReplacementRule(pattern23, lambda m, c, e, x, f, d, n, b : (b*sinh(e + f*x))**(n + S(1))*(c + d*x)**m*Cosh(e + f*x)/(b*f*(n + S(1))) + d**S(2)*m*(m + S(-1))*Int((b*sinh(e + f*x))**(n + S(2))*(c + d*x)**(m + S(-2)), x)/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) - d*m*(b*sinh(e + f*x))**(n + S(2))*(c + d*x)**(m + S(-1))/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) - (n + S(2))*Int((b*sinh(e + f*x))**(n + S(2))*(c + d*x)**m, x)/(b**S(2)*(n + S(1)))) rubi.add(rule23) pattern24 = Pattern(Integral((Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2))), CustomConstraint(lambda m: Greater(m, S(1)))) rule24 = ReplacementRule(pattern24, lambda m, e, x, f, d, n, b, c : -(b*Cosh(e + f*x))**(n + S(1))*(c + d*x)**m*sinh(e + f*x)/(b*f*(n + S(1))) - d**S(2)*m*(m + S(-1))*Int((b*Cosh(e + f*x))**(n + S(2))*(c + d*x)**(m + S(-2)), x)/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) + d*m*(b*Cosh(e + f*x))**(n + S(2))*(c + d*x)**(m + S(-1))/(b**S(2)*f**S(2)*(n + S(1))*(n + S(2))) + (n + S(2))*Int((b*Cosh(e + f*x))**(n + S(2))*(c + d*x)**m, x)/(b**S(2)*(n + S(1)))) rubi.add(rule24) pattern25 = Pattern(Integral((a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, m, b, a: PositiveIntegerQ(m) | Equal(n, S(1)) | NonzeroQ(a**S(2) + b**S(2)))) rule25 = ReplacementRule(pattern25, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (a + b*sinh(e + f*x))**n, x), x)) rubi.add(rule25) pattern26 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, m, b, a: PositiveIntegerQ(m) | Equal(n, S(1)) | NonzeroQ(a**S(2) - b**S(2)))) rule26 = ReplacementRule(pattern26, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (a + b*Cosh(e + f*x))**n, x), x)) rubi.add(rule26) pattern27 = Pattern(Integral((a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) + b**S(2))), CustomConstraint(lambda n: IntegerQ(n))) rule27 = ReplacementRule(pattern27, lambda m, c, e, x, f, d, a, n, b : (S(2)*a)**n*Int((c + d*x)**m*Cosh(-Pi*a/(S(4)*b) + e/S(2) + f*x/S(2))**(S(2)*n), x)) rubi.add(rule27) pattern28 = Pattern(Integral((a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) + b**S(2))), CustomConstraint(lambda n: IntegerQ(S(2)*n)), CustomConstraint(lambda n, m: PositiveIntegerQ(m) | Greater(n, S(0)))) rule28 = ReplacementRule(pattern28, lambda m, c, e, x, f, d, a, n, b : (S(2)*a)**IntPart(n)*(a + b*sinh(e + f*x))**FracPart(n)*Cosh(-Pi*a/(S(4)*b) + e/S(2) + f*x/S(2))**(-S(2)*FracPart(n))*Int((c + d*x)**m*Cosh(-Pi*a/(S(4)*b) + e/S(2) + f*x/S(2))**(S(2)*n), x)) rubi.add(rule28) pattern29 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a - b)), CustomConstraint(lambda n: IntegerQ(n))) rule29 = ReplacementRule(pattern29, lambda m, e, x, f, d, a, n, b, c : (S(2)*a)**n*Int((c + d*x)**m*Cosh(e/S(2) + f*x/S(2))**(S(2)*n), x)) rubi.add(rule29) pattern30 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a + b)), CustomConstraint(lambda n: IntegerQ(n))) rule30 = ReplacementRule(pattern30, lambda m, e, x, f, d, a, n, b, c : (-S(2)*a)**n*Int((c + d*x)**m*sinh(e/S(2) + f*x/S(2))**(S(2)*n), x)) rubi.add(rule30) pattern31 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a - b)), CustomConstraint(lambda n: IntegerQ(S(2)*n)), CustomConstraint(lambda n, m: PositiveIntegerQ(m) | Greater(n, S(0)))) rule31 = ReplacementRule(pattern31, lambda m, e, x, f, d, a, n, b, c : (S(2)*a)**IntPart(n)*(a + b*Cosh(e + f*x))**FracPart(n)*Cosh(e/S(2) + f*x/S(2))**(-S(2)*FracPart(n))*Int((c + d*x)**m*Cosh(e/S(2) + f*x/S(2))**(S(2)*n), x)) rubi.add(rule31) pattern32 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a + b)), CustomConstraint(lambda n: IntegerQ(S(2)*n)), CustomConstraint(lambda n, m: PositiveIntegerQ(m) | Greater(n, S(0)))) rule32 = ReplacementRule(pattern32, lambda m, e, x, f, d, a, n, b, c : (-S(2)*a)**IntPart(n)*(a + b*Cosh(e + f*x))**FracPart(n)*Int((c + d*x)**m*sinh(e/S(2) + f*x/S(2))**(S(2)*n), x)*sinh(e/S(2) + f*x/S(2))**(-S(2)*FracPart(n))) rubi.add(rule32) pattern33 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) + b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule33 = ReplacementRule(pattern33, lambda m, c, e, x, f, d, a, b : -S(2)*Int((c + d*x)**m*exp(e + f*x)/(-S(2)*a*exp(e + f*x) - b*exp(S(2)*e + S(2)*f*x) + b), x)) rubi.add(rule33) pattern34 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule34 = ReplacementRule(pattern34, lambda m, e, x, f, d, a, b, c : S(2)*Int((c + d*x)**m*exp(e + f*x)/(S(2)*a*exp(e + f*x) + b*exp(S(2)*e + S(2)*f*x) + b), x)) rubi.add(rule34) pattern35 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) + b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule35 = ReplacementRule(pattern35, lambda m, c, e, x, f, d, a, b : a*Int((c + d*x)**m/(a + b*sinh(e + f*x)), x)/(a**S(2) + b**S(2)) + b*d*m*Int((c + d*x)**(m + S(-1))*Cosh(e + f*x)/(a + b*sinh(e + f*x)), x)/(f*(a**S(2) + b**S(2))) - b*(c + d*x)**m*Cosh(e + f*x)/(f*(a + b*sinh(e + f*x))*(a**S(2) + b**S(2)))) rubi.add(rule35) pattern36 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule36 = ReplacementRule(pattern36, lambda m, e, x, f, d, a, b, c : a*Int((c + d*x)**m/(a + b*Cosh(e + f*x)), x)/(a**S(2) - b**S(2)) + b*d*m*Int((c + d*x)**(m + S(-1))*sinh(e + f*x)/(a + b*Cosh(e + f*x)), x)/(f*(a**S(2) - b**S(2))) - b*(c + d*x)**m*sinh(e + f*x)/(f*(a + b*Cosh(e + f*x))*(a**S(2) - b**S(2)))) rubi.add(rule36) pattern37 = Pattern(Integral((a_ + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) + b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n + S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule37 = ReplacementRule(pattern37, lambda m, c, e, x, f, d, a, n, b : a*Int((a + b*sinh(e + f*x))**(n + S(1))*(c + d*x)**m, x)/(a**S(2) + b**S(2)) - b*d*m*Int((a + b*sinh(e + f*x))**(n + S(1))*(c + d*x)**(m + S(-1))*Cosh(e + f*x), x)/(f*(a**S(2) + b**S(2))*(n + S(1))) - b*(n + S(2))*Int((a + b*sinh(e + f*x))**(n + S(1))*(c + d*x)**m*sinh(e + f*x), x)/((a**S(2) + b**S(2))*(n + S(1))) + b*(a + b*sinh(e + f*x))**(n + S(1))*(c + d*x)**m*Cosh(e + f*x)/(f*(a**S(2) + b**S(2))*(n + S(1)))) rubi.add(rule37) pattern38 = Pattern(Integral((a_ + Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n + S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule38 = ReplacementRule(pattern38, lambda m, e, x, f, d, a, n, b, c : a*Int((a + b*Cosh(e + f*x))**(n + S(1))*(c + d*x)**m, x)/(a**S(2) - b**S(2)) - b*d*m*Int((a + b*Cosh(e + f*x))**(n + S(1))*(c + d*x)**(m + S(-1))*sinh(e + f*x), x)/(f*(a**S(2) - b**S(2))*(n + S(1))) - b*(n + S(2))*Int((a + b*Cosh(e + f*x))**(n + S(1))*(c + d*x)**m*Cosh(e + f*x), x)/((a**S(2) - b**S(2))*(n + S(1))) + b*(a + b*Cosh(e + f*x))**(n + S(1))*(c + d*x)**m*sinh(e + f*x)/(f*(a**S(2) - b**S(2))*(n + S(1)))) rubi.add(rule38) pattern39 = Pattern(Integral(u_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(v_))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule39 = ReplacementRule(pattern39, lambda m, x, a, n, v, u, b : Int((a + b*sinh(ExpandToSum(v, x)))**n*ExpandToSum(u, x)**m, x)) rubi.add(rule39) pattern40 = Pattern(Integral(u_**WC('m', S(1))*(Cosh(v_)*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule40 = ReplacementRule(pattern40, lambda m, x, a, n, v, u, b : Int((a + b*Cosh(ExpandToSum(v, x)))**n*ExpandToSum(u, x)**m, x)) rubi.add(rule40) pattern41 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule41 = ReplacementRule(pattern41, lambda m, c, e, x, a, d, f, n, b : Int((a + b*sinh(e + f*x))**n*(c + d*x)**m, x)) rubi.add(rule41) pattern42 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*(Cosh(x_*WC('f', S(1)) + WC('e', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule42 = ReplacementRule(pattern42, lambda m, c, e, x, f, a, d, n, b : Int((a + b*Cosh(e + f*x))**n*(c + d*x)**m, x)) rubi.add(rule42) pattern43 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule43 = ReplacementRule(pattern43, lambda p, x, a, d, n, b, c : Int(ExpandIntegrand(sinh(c + d*x), (a + b*x**n)**p, x), x)) rubi.add(rule43) pattern44 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule44 = ReplacementRule(pattern44, lambda p, c, x, a, d, n, b : Int(ExpandIntegrand(Cosh(c + d*x), (a + b*x**n)**p, x), x)) rubi.add(rule44) pattern45 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n: Greater(n, S(2)))) rule45 = ReplacementRule(pattern45, lambda p, x, a, d, n, b, c : -d*Int(x**(-n + S(1))*(a + b*x**n)**(p + S(1))*Cosh(c + d*x), x)/(b*n*(p + S(1))) + x**(-n + S(1))*(a + b*x**n)**(p + S(1))*sinh(c + d*x)/(b*n*(p + S(1))) - (-n + S(1))*Int(x**(-n)*(a + b*x**n)**(p + S(1))*sinh(c + d*x), x)/(b*n*(p + S(1)))) rubi.add(rule45) pattern46 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n: Greater(n, S(2)))) rule46 = ReplacementRule(pattern46, lambda p, c, x, a, d, n, b : -d*Int(x**(-n + S(1))*(a + b*x**n)**(p + S(1))*sinh(c + d*x), x)/(b*n*(p + S(1))) + x**(-n + S(1))*(a + b*x**n)**(p + S(1))*Cosh(c + d*x)/(b*n*(p + S(1))) - (-n + S(1))*Int(x**(-n)*(a + b*x**n)**(p + S(1))*Cosh(c + d*x), x)/(b*n*(p + S(1)))) rubi.add(rule46) pattern47 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, p: Equal(n, S(2)) | Equal(p, S(-1)))) rule47 = ReplacementRule(pattern47, lambda p, x, a, d, n, b, c : Int(ExpandIntegrand(sinh(c + d*x), (a + b*x**n)**p, x), x)) rubi.add(rule47) pattern48 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, p: Equal(n, S(2)) | Equal(p, S(-1)))) rule48 = ReplacementRule(pattern48, lambda p, c, x, a, d, n, b : Int(ExpandIntegrand(Cosh(c + d*x), (a + b*x**n)**p, x), x)) rubi.add(rule48) pattern49 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule49 = ReplacementRule(pattern49, lambda p, x, a, d, n, b, c : Int(x**(n*p)*(a*x**(-n) + b)**p*sinh(c + d*x), x)) rubi.add(rule49) pattern50 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule50 = ReplacementRule(pattern50, lambda p, c, x, a, d, n, b : Int(x**(n*p)*(a*x**(-n) + b)**p*Cosh(c + d*x), x)) rubi.add(rule50) pattern51 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule51 = ReplacementRule(pattern51, lambda p, x, a, d, n, b, c : Int((a + b*x**n)**p*sinh(c + d*x), x)) rubi.add(rule51) pattern52 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule52 = ReplacementRule(pattern52, lambda p, c, x, a, d, n, b : Int((a + b*x**n)**p*Cosh(c + d*x), x)) rubi.add(rule52) pattern53 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule53 = ReplacementRule(pattern53, lambda p, m, e, x, a, d, n, b, c : Int(ExpandIntegrand(sinh(c + d*x), (e*x)**m*(a + b*x**n)**p, x), x)) rubi.add(rule53) pattern54 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule54 = ReplacementRule(pattern54, lambda p, m, c, e, x, a, d, n, b : Int(ExpandIntegrand(Cosh(c + d*x), (e*x)**m*(a + b*x**n)**p, x), x)) rubi.add(rule54) pattern55 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, e: IntegerQ(n) | PositiveQ(e))) rule55 = ReplacementRule(pattern55, lambda p, m, e, x, a, d, n, b, c : -d*e**m*Int((a + b*x**n)**(p + S(1))*Cosh(c + d*x), x)/(b*n*(p + S(1))) + e**m*(a + b*x**n)**(p + S(1))*sinh(c + d*x)/(b*n*(p + S(1)))) rubi.add(rule55) pattern56 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, e: IntegerQ(n) | PositiveQ(e))) rule56 = ReplacementRule(pattern56, lambda p, m, c, e, x, a, d, n, b : -d*e**m*Int((a + b*x**n)**(p + S(1))*sinh(c + d*x), x)/(b*n*(p + S(1))) + e**m*(a + b*x**n)**(p + S(1))*Cosh(c + d*x)/(b*n*(p + S(1)))) rubi.add(rule56) pattern57 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, m: Greater(n, S(2)) | Greater(m - n + S(1), S(0)))) rule57 = ReplacementRule(pattern57, lambda p, m, x, a, d, n, b, c : -d*Int(x**(m - n + S(1))*(a + b*x**n)**(p + S(1))*Cosh(c + d*x), x)/(b*n*(p + S(1))) + x**(m - n + S(1))*(a + b*x**n)**(p + S(1))*sinh(c + d*x)/(b*n*(p + S(1))) - (m - n + S(1))*Int(x**(m - n)*(a + b*x**n)**(p + S(1))*sinh(c + d*x), x)/(b*n*(p + S(1)))) rubi.add(rule57) pattern58 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, m: Greater(n, S(2)) | Greater(m - n + S(1), S(0)))) rule58 = ReplacementRule(pattern58, lambda p, m, c, x, a, d, n, b : -d*Int(x**(m - n + S(1))*(a + b*x**n)**(p + S(1))*sinh(c + d*x), x)/(b*n*(p + S(1))) + x**(m - n + S(1))*(a + b*x**n)**(p + S(1))*Cosh(c + d*x)/(b*n*(p + S(1))) - (m - n + S(1))*Int(x**(m - n)*(a + b*x**n)**(p + S(1))*Cosh(c + d*x), x)/(b*n*(p + S(1)))) rubi.add(rule58) pattern59 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda m: IntegerQ(m)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, p: Equal(n, S(2)) | Equal(p, S(-1)))) rule59 = ReplacementRule(pattern59, lambda p, m, x, a, d, n, b, c : Int(ExpandIntegrand(sinh(c + d*x), x**m*(a + b*x**n)**p, x), x)) rubi.add(rule59) pattern60 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda m: IntegerQ(m)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, p: Equal(n, S(2)) | Equal(p, S(-1)))) rule60 = ReplacementRule(pattern60, lambda p, m, c, x, a, d, n, b : Int(ExpandIntegrand(Cosh(c + d*x), x**m*(a + b*x**n)**p, x), x)) rubi.add(rule60) pattern61 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule61 = ReplacementRule(pattern61, lambda p, m, x, a, d, n, b, c : Int(x**(m + n*p)*(a*x**(-n) + b)**p*sinh(c + d*x), x)) rubi.add(rule61) pattern62 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**p_*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule62 = ReplacementRule(pattern62, lambda p, m, c, x, a, d, n, b : Int(x**(m + n*p)*(a*x**(-n) + b)**p*Cosh(c + d*x), x)) rubi.add(rule62) pattern63 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule63 = ReplacementRule(pattern63, lambda p, m, e, x, a, d, n, b, c : Int((e*x)**m*(a + b*x**n)**p*sinh(c + d*x), x)) rubi.add(rule63) pattern64 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**WC('p', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule64 = ReplacementRule(pattern64, lambda p, m, c, e, x, a, d, n, b : Int((e*x)**m*(a + b*x**n)**p*Cosh(c + d*x), x)) rubi.add(rule64) pattern65 = Pattern(Integral(sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule65 = ReplacementRule(pattern65, lambda d, n, x, c : -Int(exp(-c - d*x**n), x)/S(2) + Int(exp(c + d*x**n), x)/S(2)) rubi.add(rule65) pattern66 = Pattern(Integral(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule66 = ReplacementRule(pattern66, lambda d, n, x, c : Int(exp(-c - d*x**n), x)/S(2) + Int(exp(c + d*x**n), x)/S(2)) rubi.add(rule66) pattern67 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, p: IntegersQ(n, p)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda p: Greater(p, S(1)))) rule67 = ReplacementRule(pattern67, lambda p, x, a, d, n, b, c : Int(ExpandTrigReduce((a + b*sinh(c + d*x**n))**p, x), x)) rubi.add(rule67) pattern68 = Pattern(Integral((Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, p: IntegersQ(n, p)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda p: Greater(p, S(1)))) rule68 = ReplacementRule(pattern68, lambda p, x, a, d, n, b, c : Int(ExpandTrigReduce((a + b*Cosh(c + d*x**n))**p, x), x)) rubi.add(rule68) pattern69 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule69 = ReplacementRule(pattern69, lambda p, x, a, d, n, b, c : -Subst(Int((a + b*sinh(c + d*x**(-n)))**p/x**S(2), x), x, 1/x)) rubi.add(rule69) pattern70 = Pattern(Integral((Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule70 = ReplacementRule(pattern70, lambda p, x, a, d, n, b, c : -Subst(Int((a + b*Cosh(c + d*x**(-n)))**p/x**S(2), x), x, 1/x)) rubi.add(rule70) pattern71 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n)), ) def With71(p, x, a, d, n, b, c): k = Denominator(n) return k*Subst(Int(x**(k + S(-1))*(a + b*sinh(c + d*x**(k*n)))**p, x), x, x**(1/k)) rule71 = ReplacementRule(pattern71, lambda p, x, a, d, n, b, c : With71(p, x, a, d, n, b, c)) rubi.add(rule71) pattern72 = Pattern(Integral((Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n)), ) def With72(p, x, a, d, n, b, c): k = Denominator(n) return k*Subst(Int(x**(k + S(-1))*(a + b*Cosh(c + d*x**(k*n)))**p, x), x, x**(1/k)) rule72 = ReplacementRule(pattern72, lambda p, x, a, d, n, b, c : With72(p, x, a, d, n, b, c)) rubi.add(rule72) pattern73 = Pattern(Integral(sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule73 = ReplacementRule(pattern73, lambda d, n, x, c : -Int(exp(-c - d*x**n), x)/S(2) + Int(exp(c + d*x**n), x)/S(2)) rubi.add(rule73) pattern74 = Pattern(Integral(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule74 = ReplacementRule(pattern74, lambda d, n, x, c : Int(exp(-c - d*x**n), x)/S(2) + Int(exp(c + d*x**n), x)/S(2)) rubi.add(rule74) pattern75 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule75 = ReplacementRule(pattern75, lambda p, x, a, d, n, b, c : Int(ExpandTrigReduce((a + b*sinh(c + d*x**n))**p, x), x)) rubi.add(rule75) pattern76 = Pattern(Integral((Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule76 = ReplacementRule(pattern76, lambda p, x, a, d, n, b, c : Int(ExpandTrigReduce((a + b*Cosh(c + d*x**n))**p, x), x)) rubi.add(rule76) pattern77 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule77 = ReplacementRule(pattern77, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*sinh(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule77) pattern78 = Pattern(Integral((Cosh(u_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule78 = ReplacementRule(pattern78, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*Cosh(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule78) pattern79 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(u_**n_*WC('d', S(1)) + WC('c', S(0))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x))) rule79 = ReplacementRule(pattern79, lambda p, x, a, d, n, u, b, c : Int((a + b*sinh(c + d*u**n))**p, x)) rubi.add(rule79) pattern80 = Pattern(Integral((Cosh(u_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x))) rule80 = ReplacementRule(pattern80, lambda p, x, a, d, n, u, b, c : Int((a + b*Cosh(c + d*u**n))**p, x)) rubi.add(rule80) pattern81 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sinh(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule81 = ReplacementRule(pattern81, lambda p, x, a, u, b : Int((a + b*sinh(ExpandToSum(u, x)))**p, x)) rubi.add(rule81) pattern82 = Pattern(Integral((Cosh(u_)*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule82 = ReplacementRule(pattern82, lambda p, x, a, u, b : Int((a + b*Cosh(ExpandToSum(u, x)))**p, x)) rubi.add(rule82) pattern83 = Pattern(Integral(sinh(x_**n_*WC('d', S(1)))/x_, x_), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule83 = ReplacementRule(pattern83, lambda d, n, x : SinhIntegral(d*x**n)/n) rubi.add(rule83) pattern84 = Pattern(Integral(Cosh(x_**n_*WC('d', S(1)))/x_, x_), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule84 = ReplacementRule(pattern84, lambda d, n, x : CoshIntegral(d*x**n)/n) rubi.add(rule84) pattern85 = Pattern(Integral(sinh(c_ + x_**n_*WC('d', S(1)))/x_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule85 = ReplacementRule(pattern85, lambda d, n, x, c : Cosh(c)*Int(sinh(d*x**n)/x, x) + Int(Cosh(d*x**n)/x, x)*sinh(c)) rubi.add(rule85) pattern86 = Pattern(Integral(Cosh(c_ + x_**n_*WC('d', S(1)))/x_, x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule86 = ReplacementRule(pattern86, lambda d, n, x, c : Cosh(c)*Int(Cosh(d*x**n)/x, x) + Int(sinh(d*x**n)/x, x)*sinh(c)) rubi.add(rule86) pattern87 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda d, p, b, c, x, mn, a, n: IntegerQ(mn) & (Equal(p, S(1)) | Greater(mn, S(0))))) def With87(p, m, x, a, d, n, b, c): mn = (m + S(1))/n return Subst(Int(x**(mn + S(-1))*(a + b*sinh(c + d*x))**p, x), x, x**n)/n rule87 = ReplacementRule(pattern87, lambda p, m, x, a, d, n, b, c : With87(p, m, x, a, d, n, b, c)) rubi.add(rule87) pattern88 = Pattern(Integral(x_**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda d, p, b, c, x, mn, a, n: IntegerQ(mn) & (Equal(p, S(1)) | Greater(mn, S(0))))) def With88(p, m, x, a, d, n, b, c): mn = (m + S(1))/n return Subst(Int(x**(mn + S(-1))*(a + b*Cosh(c + d*x))**p, x), x, x**n)/n rule88 = ReplacementRule(pattern88, lambda p, m, x, a, d, n, b, c : With88(p, m, x, a, d, n, b, c)) rubi.add(rule88) pattern89 = Pattern(Integral((e_*x_)**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda d, m, p, c, b, x, mn, e, a, n: IntegerQ(mn) & (Equal(p, S(1)) | Greater(mn, S(0))))) def With89(p, m, e, x, a, d, n, b, c): mn = (m + S(1))/n return e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*sinh(c + d*x**n))**p, x) rule89 = ReplacementRule(pattern89, lambda p, m, e, x, a, d, n, b, c : With89(p, m, e, x, a, d, n, b, c)) rubi.add(rule89) pattern90 = Pattern(Integral((e_*x_)**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda d, m, p, c, b, x, mn, e, a, n: IntegerQ(mn) & (Equal(p, S(1)) | Greater(mn, S(0))))) def With90(p, m, e, x, a, d, n, b, c): mn = (m + S(1))/n return e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*Cosh(c + d*x**n))**p, x) rule90 = ReplacementRule(pattern90, lambda p, m, e, x, a, d, n, b, c : With90(p, m, e, x, a, d, n, b, c)) rubi.add(rule90) pattern91 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n, m: Less(S(0), n, m + S(1)))) rule91 = ReplacementRule(pattern91, lambda m, e, x, d, n, c : -e**n*(m - n + S(1))*Int((e*x)**(m - n)*Cosh(c + d*x**n), x)/(d*n) + e**(n + S(-1))*(e*x)**(m - n + S(1))*Cosh(c + d*x**n)/(d*n)) rubi.add(rule91) pattern92 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n, m: Less(S(0), n, m + S(1)))) rule92 = ReplacementRule(pattern92, lambda m, e, x, d, n, c : -e**n*(m - n + S(1))*Int((e*x)**(m - n)*sinh(c + d*x**n), x)/(d*n) + e**(n + S(-1))*(e*x)**(m - n + S(1))*sinh(c + d*x**n)/(d*n)) rubi.add(rule92) pattern93 = Pattern(Integral((x_*WC('e', S(1)))**m_*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1)))) rule93 = ReplacementRule(pattern93, lambda m, e, x, d, n, c : -d*e**(-n)*n*Int((e*x)**(m + n)*Cosh(c + d*x**n), x)/(m + S(1)) + (e*x)**(m + S(1))*sinh(c + d*x**n)/(e*(m + S(1)))) rubi.add(rule93) pattern94 = Pattern(Integral((x_*WC('e', S(1)))**m_*Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1)))) rule94 = ReplacementRule(pattern94, lambda m, e, x, d, n, c : -d*e**(-n)*n*Int((e*x)**(m + n)*sinh(c + d*x**n), x)/(m + S(1)) + (e*x)**(m + S(1))*Cosh(c + d*x**n)/(e*(m + S(1)))) rubi.add(rule94) pattern95 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule95 = ReplacementRule(pattern95, lambda m, e, x, d, n, c : -Int((e*x)**m*exp(-c - d*x**n), x)/S(2) + Int((e*x)**m*exp(c + d*x**n), x)/S(2)) rubi.add(rule95) pattern96 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule96 = ReplacementRule(pattern96, lambda m, e, x, d, n, c : Int((e*x)**m*exp(-c - d*x**n), x)/S(2) + Int((e*x)**m*exp(c + d*x**n), x)/S(2)) rubi.add(rule96) pattern97 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, p: IntegersQ(n, p)), CustomConstraint(lambda n, m: ZeroQ(m + n)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n: NonzeroQ(n + S(-1)))) rule97 = ReplacementRule(pattern97, lambda p, m, x, a, n, b : b*n*p*Int(Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(-1)), x)/(n + S(-1)) - x**(-n + S(1))*sinh(a + b*x**n)**p/(n + S(-1))) rubi.add(rule97) pattern98 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, p: IntegersQ(n, p)), CustomConstraint(lambda n, m: ZeroQ(m + n)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n: NonzeroQ(n + S(-1)))) rule98 = ReplacementRule(pattern98, lambda p, m, x, a, n, b : b*n*p*Int(Cosh(a + b*x**n)**(p + S(-1))*sinh(a + b*x**n), x)/(n + S(-1)) - x**(-n + S(1))*Cosh(a + b*x**n)**p/(n + S(-1))) rubi.add(rule98) pattern99 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - S(2)*n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1)))) rule99 = ReplacementRule(pattern99, lambda p, m, x, a, n, b : -(p + S(-1))*Int(x**m*sinh(a + b*x**n)**(p + S(-2)), x)/p + x**n*Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(-1))/(b*n*p) - sinh(a + b*x**n)**p/(b**S(2)*n*p**S(2))) rubi.add(rule99) pattern100 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - S(2)*n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1)))) rule100 = ReplacementRule(pattern100, lambda p, m, x, a, n, b : (p + S(-1))*Int(x**m*Cosh(a + b*x**n)**(p + S(-2)), x)/p + x**n*Cosh(a + b*x**n)**(p + S(-1))*sinh(a + b*x**n)/(b*n*p) - Cosh(a + b*x**n)**p/(b**S(2)*n*p**S(2))) rubi.add(rule100) pattern101 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, m + S(1)))) rule101 = ReplacementRule(pattern101, lambda p, m, x, a, n, b : -(p + S(-1))*Int(x**m*sinh(a + b*x**n)**(p + S(-2)), x)/p + x**(m - n + S(1))*Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(-1))/(b*n*p) + x**(m - S(2)*n + S(1))*(-m + n + S(-1))*sinh(a + b*x**n)**p/(b**S(2)*n**S(2)*p**S(2)) + (m - S(2)*n + S(1))*(m - n + S(1))*Int(x**(m - S(2)*n)*sinh(a + b*x**n)**p, x)/(b**S(2)*n**S(2)*p**S(2))) rubi.add(rule101) pattern102 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, m + S(1)))) rule102 = ReplacementRule(pattern102, lambda p, m, x, a, n, b : (p + S(-1))*Int(x**m*Cosh(a + b*x**n)**(p + S(-2)), x)/p + x**(m - n + S(1))*Cosh(a + b*x**n)**(p + S(-1))*sinh(a + b*x**n)/(b*n*p) + x**(m - S(2)*n + S(1))*(-m + n + S(-1))*Cosh(a + b*x**n)**p/(b**S(2)*n**S(2)*p**S(2)) + (m - S(2)*n + S(1))*(m - n + S(1))*Int(x**(m - S(2)*n)*Cosh(a + b*x**n)**p, x)/(b**S(2)*n**S(2)*p**S(2))) rubi.add(rule102) pattern103 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, -m + S(1))), CustomConstraint(lambda n, m: NonzeroQ(m + n + S(1)))) rule103 = ReplacementRule(pattern103, lambda p, m, x, a, n, b : b**S(2)*n**S(2)*p**S(2)*Int(x**(m + S(2)*n)*sinh(a + b*x**n)**p, x)/((m + S(1))*(m + n + S(1))) + b**S(2)*n**S(2)*p*(p + S(-1))*Int(x**(m + S(2)*n)*sinh(a + b*x**n)**(p + S(-2)), x)/((m + S(1))*(m + n + S(1))) - b*n*p*x**(m + n + S(1))*Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(-1))/((m + S(1))*(m + n + S(1))) + x**(m + S(1))*sinh(a + b*x**n)**p/(m + S(1))) rubi.add(rule103) pattern104 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, -m + S(1))), CustomConstraint(lambda n, m: NonzeroQ(m + n + S(1)))) rule104 = ReplacementRule(pattern104, lambda p, m, x, a, n, b : b**S(2)*n**S(2)*p**S(2)*Int(x**(m + S(2)*n)*Cosh(a + b*x**n)**p, x)/((m + S(1))*(m + n + S(1))) - b**S(2)*n**S(2)*p*(p + S(-1))*Int(x**(m + S(2)*n)*Cosh(a + b*x**n)**(p + S(-2)), x)/((m + S(1))*(m + n + S(1))) - b*n*p*x**(m + n + S(1))*Cosh(a + b*x**n)**(p + S(-1))*sinh(a + b*x**n)/((m + S(1))*(m + n + S(1))) + x**(m + S(1))*Cosh(a + b*x**n)**p/(m + S(1))) rubi.add(rule104) pattern105 = Pattern(Integral((x_*WC('e', S(1)))**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), ) def With105(p, m, e, x, a, d, n, b, c): k = Denominator(m) return k*Subst(Int(x**(k*(m + S(1)) + S(-1))*(a + b*sinh(c + d*e**(-n)*x**(k*n)))**p, x), x, (e*x)**(1/k))/e rule105 = ReplacementRule(pattern105, lambda p, m, e, x, a, d, n, b, c : With105(p, m, e, x, a, d, n, b, c)) rubi.add(rule105) pattern106 = Pattern(Integral((x_*WC('e', S(1)))**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), ) def With106(p, m, e, x, a, d, n, b, c): k = Denominator(m) return k*Subst(Int(x**(k*(m + S(1)) + S(-1))*(a + b*Cosh(c + d*e**(-n)*x**(k*n)))**p, x), x, (e*x)**(1/k))/e rule106 = ReplacementRule(pattern106, lambda p, m, e, x, a, d, n, b, c : With106(p, m, e, x, a, d, n, b, c)) rubi.add(rule106) pattern107 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: Greater(p, S(1)))) rule107 = ReplacementRule(pattern107, lambda p, m, e, x, a, d, n, b, c : Int(ExpandTrigReduce((e*x)**m, (a + b*sinh(c + d*x**n))**p, x), x)) rubi.add(rule107) pattern108 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: Greater(p, S(1)))) rule108 = ReplacementRule(pattern108, lambda p, m, e, x, a, d, n, b, c : Int(ExpandTrigReduce((e*x)**m, (a + b*Cosh(c + d*x**n))**p, x), x)) rubi.add(rule108) pattern109 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - S(2)*n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2)))) rule109 = ReplacementRule(pattern109, lambda p, m, x, a, n, b : -(p + S(2))*Int(x**m*sinh(a + b*x**n)**(p + S(2)), x)/(p + S(1)) + x**n*Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1))) - sinh(a + b*x**n)**(p + S(2))/(b**S(2)*n*(p + S(1))*(p + S(2)))) rubi.add(rule109) pattern110 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - S(2)*n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2)))) rule110 = ReplacementRule(pattern110, lambda p, m, x, a, n, b : (p + S(2))*Int(x**m*Cosh(a + b*x**n)**(p + S(2)), x)/(p + S(1)) - x**n*Cosh(a + b*x**n)**(p + S(1))*sinh(a + b*x**n)/(b*n*(p + S(1))) + Cosh(a + b*x**n)**(p + S(2))/(b**S(2)*n*(p + S(1))*(p + S(2)))) rubi.add(rule110) pattern111 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, m + S(1)))) rule111 = ReplacementRule(pattern111, lambda p, m, x, a, n, b : -(p + S(2))*Int(x**m*sinh(a + b*x**n)**(p + S(2)), x)/(p + S(1)) + x**(m - n + S(1))*Cosh(a + b*x**n)*sinh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1))) - x**(m - S(2)*n + S(1))*(m - n + S(1))*sinh(a + b*x**n)**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) + (m - S(2)*n + S(1))*(m - n + S(1))*Int(x**(m - S(2)*n)*sinh(a + b*x**n)**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule111) pattern112 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**n_*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda n, m: Less(S(0), S(2)*n, m + S(1)))) rule112 = ReplacementRule(pattern112, lambda p, m, x, a, n, b : (p + S(2))*Int(x**m*Cosh(a + b*x**n)**(p + S(2)), x)/(p + S(1)) - x**(m - n + S(1))*Cosh(a + b*x**n)**(p + S(1))*sinh(a + b*x**n)/(b*n*(p + S(1))) + x**(m - S(2)*n + S(1))*(m - n + S(1))*Cosh(a + b*x**n)**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) - (m - S(2)*n + S(1))*(m - n + S(1))*Int(x**(m - S(2)*n)*Cosh(a + b*x**n)**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule112) pattern113 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m))) rule113 = ReplacementRule(pattern113, lambda p, m, x, a, d, n, b, c : -Subst(Int(x**(-m + S(-2))*(a + b*sinh(c + d*x**(-n)))**p, x), x, 1/x)) rubi.add(rule113) pattern114 = Pattern(Integral(x_**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m))) rule114 = ReplacementRule(pattern114, lambda p, m, x, a, d, n, b, c : -Subst(Int(x**(-m + S(-2))*(a + b*Cosh(c + d*x**(-n)))**p, x), x, 1/x)) rubi.add(rule114) pattern115 = Pattern(Integral((x_*WC('e', S(1)))**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), ) def With115(p, m, e, x, a, d, n, b, c): k = Denominator(m) return -k*Subst(Int(x**(-k*(m + S(1)) + S(-1))*(a + b*sinh(c + d*e**(-n)*x**(-k*n)))**p, x), x, (e*x)**(-S(1)/k))/e rule115 = ReplacementRule(pattern115, lambda p, m, e, x, a, d, n, b, c : With115(p, m, e, x, a, d, n, b, c)) rubi.add(rule115) pattern116 = Pattern(Integral((x_*WC('e', S(1)))**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), ) def With116(p, m, e, x, a, d, n, b, c): k = Denominator(m) return -k*Subst(Int(x**(-k*(m + S(1)) + S(-1))*(a + b*Cosh(c + d*e**(-n)*x**(-k*n)))**p, x), x, (e*x)**(-S(1)/k))/e rule116 = ReplacementRule(pattern116, lambda p, m, e, x, a, d, n, b, c : With116(p, m, e, x, a, d, n, b, c)) rubi.add(rule116) pattern117 = Pattern(Integral((x_*WC('e', S(1)))**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: Not(RationalQ(m)))) rule117 = ReplacementRule(pattern117, lambda p, m, e, x, a, d, n, b, c : -(e*x)**m*(1/x)**m*Subst(Int(x**(-m + S(-2))*(a + b*sinh(c + d*x**(-n)))**p, x), x, 1/x)) rubi.add(rule117) pattern118 = Pattern(Integral((x_*WC('e', S(1)))**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: Not(RationalQ(m)))) rule118 = ReplacementRule(pattern118, lambda p, m, e, x, a, d, n, b, c : -(e*x)**m*(1/x)**m*Subst(Int(x**(-m + S(-2))*(a + b*Cosh(c + d*x**(-n)))**p, x), x, 1/x)) rubi.add(rule118) pattern119 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n)), ) def With119(p, m, x, a, d, n, b, c): k = Denominator(n) return k*Subst(Int(x**(k*(m + S(1)) + S(-1))*(a + b*sinh(c + d*x**(k*n)))**p, x), x, x**(1/k)) rule119 = ReplacementRule(pattern119, lambda p, m, x, a, d, n, b, c : With119(p, m, x, a, d, n, b, c)) rubi.add(rule119) pattern120 = Pattern(Integral(x_**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n)), ) def With120(p, m, x, a, d, n, b, c): k = Denominator(n) return k*Subst(Int(x**(k*(m + S(1)) + S(-1))*(a + b*Cosh(c + d*x**(k*n)))**p, x), x, x**(1/k)) rule120 = ReplacementRule(pattern120, lambda p, m, x, a, d, n, b, c : With120(p, m, x, a, d, n, b, c)) rubi.add(rule120) pattern121 = Pattern(Integral((e_*x_)**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n))) rule121 = ReplacementRule(pattern121, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*sinh(c + d*x**n))**p, x)) rubi.add(rule121) pattern122 = Pattern(Integral((e_*x_)**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda n: FractionQ(n))) rule122 = ReplacementRule(pattern122, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*Cosh(c + d*x**n))**p, x)) rubi.add(rule122) pattern123 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: PositiveIntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule123 = ReplacementRule(pattern123, lambda p, m, x, a, d, n, b, c : Subst(Int((a + b*sinh(c + d*x**(n/(m + S(1)))))**p, x), x, x**(m + S(1)))/(m + S(1))) rubi.add(rule123) pattern124 = Pattern(Integral(x_**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: PositiveIntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule124 = ReplacementRule(pattern124, lambda p, m, x, a, d, n, b, c : Subst(Int((a + b*Cosh(c + d*x**(n/(m + S(1)))))**p, x), x, x**(m + S(1)))/(m + S(1))) rubi.add(rule124) pattern125 = Pattern(Integral((e_*x_)**m_*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: PositiveIntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule125 = ReplacementRule(pattern125, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*sinh(c + d*x**n))**p, x)) rubi.add(rule125) pattern126 = Pattern(Integral((e_*x_)**m_*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: PositiveIntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule126 = ReplacementRule(pattern126, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*Cosh(c + d*x**n))**p, x)) rubi.add(rule126) pattern127 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule127 = ReplacementRule(pattern127, lambda m, e, x, d, n, c : -Int((e*x)**m*exp(-c - d*x**n), x)/S(2) + Int((e*x)**m*exp(c + d*x**n), x)/S(2)) rubi.add(rule127) pattern128 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule128 = ReplacementRule(pattern128, lambda m, e, x, d, n, c : Int((e*x)**m*exp(-c - d*x**n), x)/S(2) + Int((e*x)**m*exp(c + d*x**n), x)/S(2)) rubi.add(rule128) pattern129 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule129 = ReplacementRule(pattern129, lambda p, m, e, x, a, d, n, b, c : Int(ExpandTrigReduce((e*x)**m, (a + b*sinh(c + d*x**n))**p, x), x)) rubi.add(rule129) pattern130 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(Cosh(x_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p))) rule130 = ReplacementRule(pattern130, lambda p, m, e, x, a, d, n, b, c : Int(ExpandTrigReduce((e*x)**m, (a + b*Cosh(c + d*x**n))**p, x), x)) rubi.add(rule130) pattern131 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x)), CustomConstraint(lambda m: IntegerQ(m))) rule131 = ReplacementRule(pattern131, lambda p, m, x, a, d, n, b, u, c : Coefficient(u, x, S(1))**(-m + S(-1))*Subst(Int((a + b*sinh(c + d*x**n))**p*(x - Coefficient(u, x, S(0)))**m, x), x, u)) rubi.add(rule131) pattern132 = Pattern(Integral(x_**WC('m', S(1))*(Cosh(u_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x)), CustomConstraint(lambda m: IntegerQ(m))) rule132 = ReplacementRule(pattern132, lambda p, m, x, a, d, n, b, u, c : Coefficient(u, x, S(1))**(-m + S(-1))*Subst(Int((a + b*Cosh(c + d*x**n))**p*(x - Coefficient(u, x, S(0)))**m, x), x, u)) rubi.add(rule132) pattern133 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x))) rule133 = ReplacementRule(pattern133, lambda p, m, e, x, a, d, n, b, u, c : Int((e*x)**m*(a + b*sinh(c + d*u**n))**p, x)) rubi.add(rule133) pattern134 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(Cosh(u_**n_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x))) rule134 = ReplacementRule(pattern134, lambda p, m, e, x, a, d, n, b, u, c : Int((e*x)**m*(a + b*Cosh(c + d*u**n))**p, x)) rubi.add(rule134) pattern135 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sinh(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule135 = ReplacementRule(pattern135, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*sinh(ExpandToSum(u, x)))**p, x)) rubi.add(rule135) pattern136 = Pattern(Integral((e_*x_)**WC('m', S(1))*(Cosh(u_)*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule136 = ReplacementRule(pattern136, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*Cosh(ExpandToSum(u, x)))**p, x)) rubi.add(rule136) pattern137 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*sinh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule137 = ReplacementRule(pattern137, lambda p, m, x, a, n, b : sinh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1)))) rubi.add(rule137) pattern138 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sinh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule138 = ReplacementRule(pattern138, lambda p, m, x, a, n, b : Cosh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1)))) rubi.add(rule138) pattern139 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*sinh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n, m: Less(S(0), n, m + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule139 = ReplacementRule(pattern139, lambda p, m, x, a, n, b : x**(m - n + S(1))*sinh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1))) - (m - n + S(1))*Int(x**(m - n)*sinh(a + b*x**n)**(p + S(1)), x)/(b*n*(p + S(1)))) rubi.add(rule139) pattern140 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sinh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n, m: Less(S(0), n, m + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule140 = ReplacementRule(pattern140, lambda p, m, x, a, n, b : x**(m - n + S(1))*Cosh(a + b*x**n)**(p + S(1))/(b*n*(p + S(1))) - (m - n + S(1))*Int(x**(m - n)*Cosh(a + b*x**n)**(p + S(1)), x)/(b*n*(p + S(1)))) rubi.add(rule140) pattern141 = Pattern(Integral(sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x))) rule141 = ReplacementRule(pattern141, lambda c, b, x, a : -Int(exp(-a - b*x - c*x**S(2)), x)/S(2) + Int(exp(a + b*x + c*x**S(2)), x)/S(2)) rubi.add(rule141) pattern142 = Pattern(Integral(Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x))) rule142 = ReplacementRule(pattern142, lambda c, b, x, a : Int(exp(-a - b*x - c*x**S(2)), x)/S(2) + Int(exp(a + b*x + c*x**S(2)), x)/S(2)) rubi.add(rule142) pattern143 = Pattern(Integral(sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule143 = ReplacementRule(pattern143, lambda x, a, n, b, c : Int(ExpandTrigReduce(sinh(a + b*x + c*x**S(2))**n, x), x)) rubi.add(rule143) pattern144 = Pattern(Integral(Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule144 = ReplacementRule(pattern144, lambda x, a, n, b, c : Int(ExpandTrigReduce(Cosh(a + b*x + c*x**S(2))**n, x), x)) rubi.add(rule144) pattern145 = Pattern(Integral(sinh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, x: Not(QuadraticMatchQ(v, x)))) rule145 = ReplacementRule(pattern145, lambda n, v, x : Int(sinh(ExpandToSum(v, x))**n, x)) rubi.add(rule145) pattern146 = Pattern(Integral(Cosh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, x: Not(QuadraticMatchQ(v, x)))) rule146 = ReplacementRule(pattern146, lambda n, v, x : Int(Cosh(ExpandToSum(v, x))**n, x)) rubi.add(rule146) pattern147 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule147 = ReplacementRule(pattern147, lambda e, x, a, d, b, c : e*Cosh(a + b*x + c*x**S(2))/(S(2)*c)) rubi.add(rule147) pattern148 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule148 = ReplacementRule(pattern148, lambda e, x, a, d, b, c : e*sinh(a + b*x + c*x**S(2))/(S(2)*c)) rubi.add(rule148) pattern149 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule149 = ReplacementRule(pattern149, lambda e, x, a, d, b, c : e*Cosh(a + b*x + c*x**S(2))/(S(2)*c) - (b*e - S(2)*c*d)*Int(sinh(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule149) pattern150 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule150 = ReplacementRule(pattern150, lambda e, x, a, d, b, c : e*sinh(a + b*x + c*x**S(2))/(S(2)*c) - (b*e - S(2)*c*d)*Int(Cosh(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule150) pattern151 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(1))), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule151 = ReplacementRule(pattern151, lambda m, e, x, a, d, b, c : -e**S(2)*(m + S(-1))*Int((d + e*x)**(m + S(-2))*Cosh(a + b*x + c*x**S(2)), x)/(S(2)*c) + e*(d + e*x)**(m + S(-1))*Cosh(a + b*x + c*x**S(2))/(S(2)*c)) rubi.add(rule151) pattern152 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(1))), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule152 = ReplacementRule(pattern152, lambda m, e, x, a, d, b, c : -e**S(2)*(m + S(-1))*Int((d + e*x)**(m + S(-2))*sinh(a + b*x + c*x**S(2)), x)/(S(2)*c) + e*(d + e*x)**(m + S(-1))*sinh(a + b*x + c*x**S(2))/(S(2)*c)) rubi.add(rule152) pattern153 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(1))), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule153 = ReplacementRule(pattern153, lambda m, e, x, a, d, b, c : -e**S(2)*(m + S(-1))*Int((d + e*x)**(m + S(-2))*Cosh(a + b*x + c*x**S(2)), x)/(S(2)*c) + e*(d + e*x)**(m + S(-1))*Cosh(a + b*x + c*x**S(2))/(S(2)*c) - (b*e - S(2)*c*d)*Int((d + e*x)**(m + S(-1))*sinh(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule153) pattern154 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(1))), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule154 = ReplacementRule(pattern154, lambda m, e, x, a, d, b, c : -e**S(2)*(m + S(-1))*Int((d + e*x)**(m + S(-2))*sinh(a + b*x + c*x**S(2)), x)/(S(2)*c) + e*(d + e*x)**(m + S(-1))*sinh(a + b*x + c*x**S(2))/(S(2)*c) - (b*e - S(2)*c*d)*Int((d + e*x)**(m + S(-1))*Cosh(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule154) pattern155 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule155 = ReplacementRule(pattern155, lambda m, e, x, a, d, b, c : -S(2)*c*Int((d + e*x)**(m + S(2))*Cosh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1))) + (d + e*x)**(m + S(1))*sinh(a + b*x + c*x**S(2))/(e*(m + S(1)))) rubi.add(rule155) pattern156 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda d, c, e, b: ZeroQ(b*e - S(2)*c*d))) rule156 = ReplacementRule(pattern156, lambda m, e, x, a, d, b, c : -S(2)*c*Int((d + e*x)**(m + S(2))*sinh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1))) + (d + e*x)**(m + S(1))*Cosh(a + b*x + c*x**S(2))/(e*(m + S(1)))) rubi.add(rule156) pattern157 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule157 = ReplacementRule(pattern157, lambda m, e, x, a, d, b, c : -S(2)*c*Int((d + e*x)**(m + S(2))*Cosh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1))) + (d + e*x)**(m + S(1))*sinh(a + b*x + c*x**S(2))/(e*(m + S(1))) - (b*e - S(2)*c*d)*Int((d + e*x)**(m + S(1))*Cosh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1)))) rubi.add(rule157) pattern158 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**m_*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda d, c, e, b: NonzeroQ(b*e - S(2)*c*d))) rule158 = ReplacementRule(pattern158, lambda m, e, x, a, d, b, c : -S(2)*c*Int((d + e*x)**(m + S(2))*sinh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1))) + (d + e*x)**(m + S(1))*Cosh(a + b*x + c*x**S(2))/(e*(m + S(1))) - (b*e - S(2)*c*d)*Int((d + e*x)**(m + S(1))*sinh(a + b*x + c*x**S(2)), x)/(e**S(2)*(m + S(1)))) rubi.add(rule158) pattern159 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x))) rule159 = ReplacementRule(pattern159, lambda m, c, e, x, a, d, b : Int((d + e*x)**m*sinh(a + b*x + c*x**S(2)), x)) rubi.add(rule159) pattern160 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x))) rule160 = ReplacementRule(pattern160, lambda m, e, x, a, d, b, c : Int((d + e*x)**m*Cosh(a + b*x + c*x**S(2)), x)) rubi.add(rule160) pattern161 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*sinh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule161 = ReplacementRule(pattern161, lambda m, c, e, x, a, d, n, b : Int(ExpandTrigReduce((d + e*x)**m, sinh(a + b*x + c*x**S(2))**n, x), x)) rubi.add(rule161) pattern162 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*Cosh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule162 = ReplacementRule(pattern162, lambda m, e, x, a, d, n, b, c : Int(ExpandTrigReduce((d + e*x)**m, Cosh(a + b*x + c*x**S(2))**n, x), x)) rubi.add(rule162) pattern163 = Pattern(Integral(u_**WC('m', S(1))*sinh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(u, x) & QuadraticMatchQ(v, x)))) rule163 = ReplacementRule(pattern163, lambda m, x, n, v, u : Int(ExpandToSum(u, x)**m*sinh(ExpandToSum(v, x))**n, x)) rubi.add(rule163) pattern164 = Pattern(Integral(u_**WC('m', S(1))*Cosh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(u, x) & QuadraticMatchQ(v, x)))) rule164 = ReplacementRule(pattern164, lambda m, x, n, v, u : Int(Cosh(ExpandToSum(v, x))**n*ExpandToSum(u, x)**m, x)) rubi.add(rule164) pattern165 = Pattern(Integral((x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule165 = ReplacementRule(pattern165, lambda m, e, x, f, a, b : S(2)*Int((a + b*x)**m*exp(S(2)*e + S(2)*f*x)/(exp(S(2)*e + S(2)*f*x) + S(1)), x) - (a + b*x)**(m + S(1))/(b*(m + S(1)))) rubi.add(rule165) pattern166 = Pattern(Integral((x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule166 = ReplacementRule(pattern166, lambda m, e, x, a, f, b : -S(2)*Int((a + b*x)**m*exp(S(2)*e + S(2)*f*x)/(-exp(S(2)*e + S(2)*f*x) + S(1)), x) - (a + b*x)**(m + S(1))/(b*(m + S(1)))) rubi.add(rule166) pattern167 = Pattern(Integral((WC('c', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Greater(m, S(0)))) rule167 = ReplacementRule(pattern167, lambda m, e, x, a, f, n, b, c : b*c*m*Int((c*tanh(e + f*x))**(n + S(-1))*(a + b*x)**(m + S(-1)), x)/(f*(n + S(-1))) + c**S(2)*Int((c*tanh(e + f*x))**(n + S(-2))*(a + b*x)**m, x) - c*(c*tanh(e + f*x))**(n + S(-1))*(a + b*x)**m/(f*(n + S(-1)))) rubi.add(rule167) pattern168 = Pattern(Integral((WC('c', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda m: Greater(m, S(0)))) rule168 = ReplacementRule(pattern168, lambda m, c, e, x, a, f, n, b : b*c*m*Int((c*coth(e + f*x))**(n + S(-1))*(a + b*x)**(m + S(-1)), x)/(f*(n + S(-1))) + c**S(2)*Int((c*coth(e + f*x))**(n + S(-2))*(a + b*x)**m, x) - c*(c*coth(e + f*x))**(n + S(-1))*(a + b*x)**m/(f*(n + S(-1)))) rubi.add(rule168) pattern169 = Pattern(Integral((WC('c', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda m: Greater(m, S(0)))) rule169 = ReplacementRule(pattern169, lambda m, e, x, a, f, n, b, c : -b*m*Int((c*tanh(e + f*x))**(n + S(1))*(a + b*x)**(m + S(-1)), x)/(c*f*(n + S(1))) + (c*tanh(e + f*x))**(n + S(1))*(a + b*x)**m/(c*f*(n + S(1))) + Int((c*tanh(e + f*x))**(n + S(2))*(a + b*x)**m, x)/c**S(2)) rubi.add(rule169) pattern170 = Pattern(Integral((WC('c', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda m: Greater(m, S(0)))) rule170 = ReplacementRule(pattern170, lambda m, c, e, x, a, f, n, b : -b*m*Int((c*coth(e + f*x))**(n + S(1))*(a + b*x)**(m + S(-1)), x)/(c*f*(n + S(1))) + (c*coth(e + f*x))**(n + S(1))*(a + b*x)**m/(c*f*(n + S(1))) + Int((c*coth(e + f*x))**(n + S(2))*(a + b*x)**m, x)/c**S(2)) rubi.add(rule170) pattern171 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule171 = ReplacementRule(pattern171, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (a + b*tanh(e + f*x))**n, x), x)) rubi.add(rule171) pattern172 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule172 = ReplacementRule(pattern172, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (a + b*coth(e + f*x))**n, x), x)) rubi.add(rule172) pattern173 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule173 = ReplacementRule(pattern173, lambda m, c, e, x, f, d, a, b : a*d*m*Int((c + d*x)**(m + S(-1))/(a + b*tanh(e + f*x)), x)/(S(2)*b*f) - a*(c + d*x)**m/(S(2)*b*f*(a + b*tanh(e + f*x))) + (c + d*x)**(m + S(1))/(S(2)*a*d*(m + S(1)))) rubi.add(rule173) pattern174 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule174 = ReplacementRule(pattern174, lambda m, e, x, f, d, a, b, c : a*d*m*Int((c + d*x)**(m + S(-1))/(a + b*coth(e + f*x)), x)/(S(2)*b*f) - a*(c + d*x)**m/(S(2)*b*f*(a + b*coth(e + f*x))) + (c + d*x)**(m + S(1))/(S(2)*a*d*(m + S(1)))) rubi.add(rule174) pattern175 = Pattern(Integral(S(1)/((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))*(x_*WC('d', S(1)) + WC('c', S(0)))**S(2)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule175 = ReplacementRule(pattern175, lambda c, e, x, f, d, a, b : -S(1)/(d*(a + b*tanh(e + f*x))*(c + d*x)) - f*Int(Cosh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(b*d) + f*Int(sinh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(a*d)) rubi.add(rule175) pattern176 = Pattern(Integral(S(1)/((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))*(x_*WC('d', S(1)) + WC('c', S(0)))**S(2)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule176 = ReplacementRule(pattern176, lambda e, x, f, d, a, b, c : -S(1)/(d*(a + b*coth(e + f*x))*(c + d*x)) + f*Int(Cosh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(b*d) - f*Int(sinh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(a*d)) rubi.add(rule176) pattern177 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_/(a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda m: Unequal(m, S(-2)))) rule177 = ReplacementRule(pattern177, lambda m, c, e, x, f, d, a, b : (c + d*x)**(m + S(1))/(d*(a + b*tanh(e + f*x))*(m + S(1))) - f*(c + d*x)**(m + S(2))/(b*d**S(2)*(m + S(1))*(m + S(2))) + S(2)*b*f*Int((c + d*x)**(m + S(1))/(a + b*tanh(e + f*x)), x)/(a*d*(m + S(1)))) rubi.add(rule177) pattern178 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_/(a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda m: Unequal(m, S(-2)))) rule178 = ReplacementRule(pattern178, lambda m, e, x, f, d, a, b, c : (c + d*x)**(m + S(1))/(d*(a + b*coth(e + f*x))*(m + S(1))) - f*(c + d*x)**(m + S(2))/(b*d**S(2)*(m + S(1))*(m + S(2))) + S(2)*b*f*Int((c + d*x)**(m + S(1))/(a + b*coth(e + f*x)), x)/(a*d*(m + S(1)))) rubi.add(rule178) pattern179 = Pattern(Integral(S(1)/((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))*(x_*WC('d', S(1)) + WC('c', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule179 = ReplacementRule(pattern179, lambda c, e, x, f, d, a, b : -Int(sinh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(S(2)*b) + Int(Cosh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(S(2)*a) + log(c + d*x)/(S(2)*a*d)) rubi.add(rule179) pattern180 = Pattern(Integral(S(1)/((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))*(x_*WC('d', S(1)) + WC('c', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule180 = ReplacementRule(pattern180, lambda e, x, f, d, a, b, c : Int(sinh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(S(2)*b) - Int(Cosh(S(2)*e + S(2)*f*x)/(c + d*x), x)/(S(2)*a) + log(c + d*x)/(S(2)*a*d)) rubi.add(rule180) pattern181 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_/(a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: Not(IntegerQ(m)))) rule181 = ReplacementRule(pattern181, lambda m, c, e, x, f, d, a, b : Int((c + d*x)**m*exp(-S(2)*a*(e + f*x)/b), x)/(S(2)*a) + (c + d*x)**(m + S(1))/(S(2)*a*d*(m + S(1)))) rubi.add(rule181) pattern182 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_/(a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: Not(IntegerQ(m)))) rule182 = ReplacementRule(pattern182, lambda m, e, x, f, d, a, b, c : -Int((c + d*x)**m*exp(-S(2)*a*(e + f*x)/b), x)/(S(2)*a) + (c + d*x)**(m + S(1))/(S(2)*a*d*(m + S(1)))) rubi.add(rule182) pattern183 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n, m: NegativeIntegerQ(m, n))) rule183 = ReplacementRule(pattern183, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (-sinh(S(2)*e + S(2)*f*x)/(S(2)*b) + Cosh(S(2)*e + S(2)*f*x)/(S(2)*a) + S(1)/(S(2)*a))**(-n), x), x)) rubi.add(rule183) pattern184 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n, m: NegativeIntegerQ(m, n))) rule184 = ReplacementRule(pattern184, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (sinh(S(2)*e + S(2)*f*x)/(S(2)*b) - Cosh(S(2)*e + S(2)*f*x)/(S(2)*a) + S(1)/(S(2)*a))**(-n), x), x)) rubi.add(rule184) pattern185 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule185 = ReplacementRule(pattern185, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (S(1)/(S(2)*a) + exp(-S(2)*a*(e + f*x)/b)/(S(2)*a))**(-n), x), x)) rubi.add(rule185) pattern186 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**m_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule186 = ReplacementRule(pattern186, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (S(1)/(S(2)*a) - exp(-S(2)*a*(e + f*x)/b)/(S(2)*a))**(-n), x), x)) rubi.add(rule186) pattern187 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n + S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0))), ) def With187(m, c, e, x, f, d, a, n, b): u = IntHide((a + b*tanh(e + f*x))**n, x) return -d*m*Int(Dist((c + d*x)**(m + S(-1)), u, x), x) + Dist((c + d*x)**m, u, x) rule187 = ReplacementRule(pattern187, lambda m, c, e, x, f, d, a, n, b : With187(m, c, e, x, f, d, a, n, b)) rubi.add(rule187) pattern188 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n + S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0))), ) def With188(m, e, x, f, d, a, n, b, c): u = IntHide((a + b*coth(e + f*x))**n, x) return -d*m*Int(Dist((c + d*x)**(m + S(-1)), u, x), x) + Dist((c + d*x)**m, u, x) rule188 = ReplacementRule(pattern188, lambda m, e, x, f, d, a, n, b, c : With188(m, e, x, f, d, a, n, b, c)) rubi.add(rule188) pattern189 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule189 = ReplacementRule(pattern189, lambda m, c, e, x, f, d, a, b : -S(2)*b*Int((c + d*x)**m/(a**S(2) - b**S(2) + (a - b)**S(2)*exp(-S(2)*e - S(2)*f*x)), x) + (c + d*x)**(m + S(1))/(d*(a - b)*(m + S(1)))) rubi.add(rule189) pattern190 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))/(a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule190 = ReplacementRule(pattern190, lambda m, e, x, f, d, a, b, c : S(2)*b*Int((c + d*x)**m/(a**S(2) - b**S(2) - (a + b)**S(2)*exp(S(2)*e + S(2)*f*x)), x) + (c + d*x)**(m + S(1))/(d*(a + b)*(m + S(1)))) rubi.add(rule190) pattern191 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))/(a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2)))) rule191 = ReplacementRule(pattern191, lambda c, e, x, f, d, a, b : b*(c + d*x)/(f*(a + b*tanh(e + f*x))*(a**S(2) - b**S(2))) - Int((-S(2)*a*c*f - S(2)*a*d*f*x + b*d)/(a + b*tanh(e + f*x)), x)/(f*(a**S(2) - b**S(2))) - (c + d*x)**S(2)/(S(2)*d*(a**S(2) - b**S(2)))) rubi.add(rule191) pattern192 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))/(a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2)))) rule192 = ReplacementRule(pattern192, lambda e, x, f, d, a, b, c : b*(c + d*x)/(f*(a + b*coth(e + f*x))*(a**S(2) - b**S(2))) - Int((-S(2)*a*c*f - S(2)*a*d*f*x + b*d)/(a + b*coth(e + f*x)), x)/(f*(a**S(2) - b**S(2))) - (c + d*x)**S(2)/(S(2)*d*(a**S(2) - b**S(2)))) rubi.add(rule192) pattern193 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule193 = ReplacementRule(pattern193, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (-S(2)*b/(a**S(2) - b**S(2) + (a - b)**S(2)*exp(-S(2)*e - S(2)*f*x)) + 1/(a - b))**(-n), x), x)) rubi.add(rule193) pattern194 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**n_*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule194 = ReplacementRule(pattern194, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (S(2)*b/(a**S(2) - b**S(2) - (a + b)**S(2)*exp(S(2)*e + S(2)*f*x)) + 1/(a + b))**(-n), x), x)) rubi.add(rule194) pattern195 = Pattern(Integral(u_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(v_))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule195 = ReplacementRule(pattern195, lambda m, x, a, n, v, u, b : Int((a + b*tanh(ExpandToSum(v, x)))**n*ExpandToSum(u, x)**m, x)) rubi.add(rule195) pattern196 = Pattern(Integral(u_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(v_))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule196 = ReplacementRule(pattern196, lambda m, x, a, n, v, u, b : Int((a + b*coth(ExpandToSum(v, x)))**n*ExpandToSum(u, x)**m, x)) rubi.add(rule196) pattern197 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule197 = ReplacementRule(pattern197, lambda m, c, e, x, a, d, f, n, b : Int((a + b*tanh(e + f*x))**n*(c + d*x)**m, x)) rubi.add(rule197) pattern198 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule198 = ReplacementRule(pattern198, lambda m, c, e, x, f, a, d, n, b : Int((a + b*coth(e + f*x))**n*(c + d*x)**m, x)) rubi.add(rule198) pattern199 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n: PositiveIntegerQ(1/n)), CustomConstraint(lambda p: IntegerQ(p))) rule199 = ReplacementRule(pattern199, lambda p, x, a, d, n, b, c : Subst(Int(x**(S(-1) + 1/n)*(a + b*tanh(c + d*x))**p, x), x, x**n)/n) rubi.add(rule199) pattern200 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n: PositiveIntegerQ(1/n)), CustomConstraint(lambda p: IntegerQ(p))) rule200 = ReplacementRule(pattern200, lambda p, x, a, d, n, b, c : Subst(Int(x**(S(-1) + 1/n)*(a + b*coth(c + d*x))**p, x), x, x**n)/n) rubi.add(rule200) pattern201 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule201 = ReplacementRule(pattern201, lambda p, x, a, d, n, b, c : Int((a + b*tanh(c + d*x**n))**p, x)) rubi.add(rule201) pattern202 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule202 = ReplacementRule(pattern202, lambda p, x, a, d, n, b, c : Int((a + b*coth(c + d*x**n))**p, x)) rubi.add(rule202) pattern203 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*tanh(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule203 = ReplacementRule(pattern203, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*tanh(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule203) pattern204 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*coth(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule204 = ReplacementRule(pattern204, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*coth(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule204) pattern205 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*tanh(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule205 = ReplacementRule(pattern205, lambda p, x, a, u, b : Int((a + b*tanh(ExpandToSum(u, x)))**p, x)) rubi.add(rule205) pattern206 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*coth(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule206 = ReplacementRule(pattern206, lambda p, x, a, u, b : Int((a + b*coth(ExpandToSum(u, x)))**p, x)) rubi.add(rule206) pattern207 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: PositiveIntegerQ((m + S(1))/n)), CustomConstraint(lambda p: IntegerQ(p))) rule207 = ReplacementRule(pattern207, lambda p, m, x, a, d, n, b, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*tanh(c + d*x))**p, x), x, x**n)/n) rubi.add(rule207) pattern208 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: PositiveIntegerQ((m + S(1))/n)), CustomConstraint(lambda p: IntegerQ(p))) rule208 = ReplacementRule(pattern208, lambda p, m, x, a, d, n, b, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*coth(c + d*x))**p, x), x, x**n)/n) rubi.add(rule208) pattern209 = Pattern(Integral(x_**WC('m', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0)))**S(2), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule209 = ReplacementRule(pattern209, lambda m, x, d, n, c : Int(x**m, x) - x**(m - n + S(1))*tanh(c + d*x**n)/(d*n) + (m - n + S(1))*Int(x**(m - n)*tanh(c + d*x**n), x)/(d*n)) rubi.add(rule209) pattern210 = Pattern(Integral(x_**WC('m', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0)))**S(2), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule210 = ReplacementRule(pattern210, lambda m, x, d, n, c : Int(x**m, x) - x**(m - n + S(1))*coth(c + d*x**n)/(d*n) + (m - n + S(1))*Int(x**(m - n)*coth(c + d*x**n), x)/(d*n)) rubi.add(rule210) pattern211 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule211 = ReplacementRule(pattern211, lambda p, m, x, a, d, n, b, c : Int(x**m*(a + b*tanh(c + d*x**n))**p, x)) rubi.add(rule211) pattern212 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule212 = ReplacementRule(pattern212, lambda p, m, x, a, d, n, b, c : Int(x**m*(a + b*coth(c + d*x**n))**p, x)) rubi.add(rule212) pattern213 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule213 = ReplacementRule(pattern213, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*tanh(c + d*x**n))**p, x)) rubi.add(rule213) pattern214 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule214 = ReplacementRule(pattern214, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*coth(c + d*x**n))**p, x)) rubi.add(rule214) pattern215 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*tanh(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule215 = ReplacementRule(pattern215, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*tanh(ExpandToSum(u, x)))**p, x)) rubi.add(rule215) pattern216 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*coth(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule216 = ReplacementRule(pattern216, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*coth(ExpandToSum(u, x)))**p, x)) rubi.add(rule216) pattern217 = Pattern(Integral(x_**WC('m', S(1))*tanh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('q', S(1))*sech(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n, m: GreaterEqual(m - n, S(0))), CustomConstraint(lambda q: SameQ(q, S(1)))) rule217 = ReplacementRule(pattern217, lambda p, m, x, a, n, q, b : -x**(m - n + S(1))*sech(a + b*x**n)**p/(b*n*p) + (m - n + S(1))*Int(x**(m - n)*sech(a + b*x**n)**p, x)/(b*n*p)) rubi.add(rule217) pattern218 = Pattern(Integral(x_**WC('m', S(1))*coth(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('q', S(1))*csch(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n, m: GreaterEqual(m - n, S(0))), CustomConstraint(lambda q: SameQ(q, S(1)))) rule218 = ReplacementRule(pattern218, lambda p, m, x, a, n, q, b : -x**(m - n + S(1))*csch(a + b*x**n)**p/(b*n*p) + (m - n + S(1))*Int(x**(m - n)*csch(a + b*x**n)**p, x)/(b*n*p)) rubi.add(rule218) pattern219 = Pattern(Integral(tanh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule219 = ReplacementRule(pattern219, lambda x, a, n, b, c : Int(tanh(a + b*x + c*x**S(2))**n, x)) rubi.add(rule219) pattern220 = Pattern(Integral(coth(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule220 = ReplacementRule(pattern220, lambda x, a, n, b, c : Int(coth(a + b*x + c*x**S(2))**n, x)) rubi.add(rule220) pattern221 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*tanh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x))) rule221 = ReplacementRule(pattern221, lambda e, x, a, d, b, c : e*log(Cosh(a + b*x + c*x**S(2)))/(S(2)*c) + (-b*e + S(2)*c*d)*Int(tanh(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule221) pattern222 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))*coth(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x))) rule222 = ReplacementRule(pattern222, lambda e, x, a, d, b, c : e*log(sinh(a + b*x + c*x**S(2)))/(S(2)*c) + (-b*e + S(2)*c*d)*Int(coth(a + b*x + c*x**S(2)), x)/(S(2)*c)) rubi.add(rule222) pattern223 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*tanh(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule223 = ReplacementRule(pattern223, lambda m, c, e, x, a, d, n, b : Int((d + e*x)**m*tanh(a + b*x + c*x**S(2))**n, x)) rubi.add(rule223) pattern224 = Pattern(Integral((x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1))*coth(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule224 = ReplacementRule(pattern224, lambda m, e, x, a, d, n, b, c : Int((d + e*x)**m*coth(a + b*x + c*x**S(2))**n, x)) rubi.add(rule224) pattern225 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule225 = ReplacementRule(pattern225, lambda m, c, x, a, d, b : -ImaginaryI*d*m*Int((c + d*x)**(m + S(-1))*log(-ImaginaryI*exp(a + b*x) + S(1)), x)/b + ImaginaryI*d*m*Int((c + d*x)**(m + S(-1))*log(ImaginaryI*exp(a + b*x) + S(1)), x)/b + S(2)*(c + d*x)**m*ArcTan(exp(a + b*x))/b) rubi.add(rule225) pattern226 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule226 = ReplacementRule(pattern226, lambda m, x, a, d, b, c : -d*m*Int((c + d*x)**(m + S(-1))*log(-exp(a + b*x) + S(1)), x)/b + d*m*Int((c + d*x)**(m + S(-1))*log(exp(a + b*x) + S(1)), x)/b - S(2)*(c + d*x)**m*atanh(exp(a + b*x))/b) rubi.add(rule226) pattern227 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule227 = ReplacementRule(pattern227, lambda m, c, x, a, d, b : -d*m*Int((c + d*x)**(m + S(-1))*tanh(a + b*x), x)/b + (c + d*x)**m*tanh(a + b*x)/b) rubi.add(rule227) pattern228 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule228 = ReplacementRule(pattern228, lambda m, x, a, d, b, c : d*m*Int((c + d*x)**(m + S(-1))*coth(a + b*x), x)/b - (c + d*x)**m*coth(a + b*x)/b) rubi.add(rule228) pattern229 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2)))) rule229 = ReplacementRule(pattern229, lambda c, x, a, d, n, b : (n + S(-2))*Int((c + d*x)*sech(a + b*x)**(n + S(-2)), x)/(n + S(-1)) + (c + d*x)*tanh(a + b*x)*sech(a + b*x)**(n + S(-2))/(b*(n + S(-1))) + d*sech(a + b*x)**(n + S(-2))/(b**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule229) pattern230 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2)))) rule230 = ReplacementRule(pattern230, lambda x, a, d, n, b, c : -(n + S(-2))*Int((c + d*x)*csch(a + b*x)**(n + S(-2)), x)/(n + S(-1)) + (-c - d*x)*coth(a + b*x)*csch(a + b*x)**(n + S(-2))/(b*(n + S(-1))) - d*csch(a + b*x)**(n + S(-2))/(b**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule230) pattern231 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*sech(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2))), CustomConstraint(lambda m: Greater(m, S(1)))) rule231 = ReplacementRule(pattern231, lambda m, c, x, a, d, n, b : (n + S(-2))*Int((c + d*x)**m*sech(a + b*x)**(n + S(-2)), x)/(n + S(-1)) + (c + d*x)**m*tanh(a + b*x)*sech(a + b*x)**(n + S(-2))/(b*(n + S(-1))) - d**S(2)*m*(m + S(-1))*Int((c + d*x)**(m + S(-2))*sech(a + b*x)**(n + S(-2)), x)/(b**S(2)*(n + S(-2))*(n + S(-1))) + d*m*(c + d*x)**(m + S(-1))*sech(a + b*x)**(n + S(-2))/(b**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule231) pattern232 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*csch(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2))), CustomConstraint(lambda m: Greater(m, S(1)))) rule232 = ReplacementRule(pattern232, lambda m, x, a, d, n, b, c : -(n + S(-2))*Int((c + d*x)**m*csch(a + b*x)**(n + S(-2)), x)/(n + S(-1)) - (c + d*x)**m*coth(a + b*x)*csch(a + b*x)**(n + S(-2))/(b*(n + S(-1))) + d**S(2)*m*(m + S(-1))*Int((c + d*x)**(m + S(-2))*csch(a + b*x)**(n + S(-2)), x)/(b**S(2)*(n + S(-2))*(n + S(-1))) - d*m*(c + d*x)**(m + S(-1))*csch(a + b*x)**(n + S(-2))/(b**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule232) pattern233 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1)))) rule233 = ReplacementRule(pattern233, lambda c, x, a, d, n, b : (n + S(1))*Int((c + d*x)*sech(a + b*x)**(n + S(2)), x)/n - (c + d*x)*sinh(a + b*x)*sech(a + b*x)**(n + S(1))/(b*n) - d*sech(a + b*x)**n/(b**S(2)*n**S(2))) rubi.add(rule233) pattern234 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1)))) rule234 = ReplacementRule(pattern234, lambda x, a, d, n, b, c : -(n + S(1))*Int((c + d*x)*csch(a + b*x)**(n + S(2)), x)/n - (c + d*x)*Cosh(a + b*x)*csch(a + b*x)**(n + S(1))/(b*n) - d*csch(a + b*x)**n/(b**S(2)*n**S(2))) rubi.add(rule234) pattern235 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*sech(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda m: Greater(m, S(1)))) rule235 = ReplacementRule(pattern235, lambda m, c, x, a, d, n, b : (n + S(1))*Int((c + d*x)**m*sech(a + b*x)**(n + S(2)), x)/n - (c + d*x)**m*sinh(a + b*x)*sech(a + b*x)**(n + S(1))/(b*n) + d**S(2)*m*(m + S(-1))*Int((c + d*x)**(m + S(-2))*sech(a + b*x)**n, x)/(b**S(2)*n**S(2)) - d*m*(c + d*x)**(m + S(-1))*sech(a + b*x)**n/(b**S(2)*n**S(2))) rubi.add(rule235) pattern236 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**m_*csch(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda m: Greater(m, S(1)))) rule236 = ReplacementRule(pattern236, lambda m, x, a, d, n, b, c : -(n + S(1))*Int((c + d*x)**m*csch(a + b*x)**(n + S(2)), x)/n - (c + d*x)**m*Cosh(a + b*x)*csch(a + b*x)**(n + S(1))/(b*n) + d**S(2)*m*(m + S(-1))*Int((c + d*x)**(m + S(-2))*csch(a + b*x)**n, x)/(b**S(2)*n**S(2)) - d*m*(c + d*x)**(m + S(-1))*csch(a + b*x)**n/(b**S(2)*n**S(2))) rubi.add(rule236) pattern237 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule237 = ReplacementRule(pattern237, lambda m, c, x, a, d, n, b : Cosh(a + b*x)**n*Int((c + d*x)**m*Cosh(a + b*x)**(-n), x)*sech(a + b*x)**n) rubi.add(rule237) pattern238 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule238 = ReplacementRule(pattern238, lambda m, x, a, d, n, b, c : Int((c + d*x)**m*sinh(a + b*x)**(-n), x)*sinh(a + b*x)**n*csch(a + b*x)**n) rubi.add(rule238) pattern239 = Pattern(Integral((a_ + WC('b', S(1))*sech(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule239 = ReplacementRule(pattern239, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (a + b*sech(e + f*x))**n, x), x)) rubi.add(rule239) pattern240 = Pattern(Integral((a_ + WC('b', S(1))*csch(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule240 = ReplacementRule(pattern240, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (a + b*csch(e + f*x))**n, x), x)) rubi.add(rule240) pattern241 = Pattern(Integral((a_ + WC('b', S(1))*sech(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule241 = ReplacementRule(pattern241, lambda m, c, e, x, f, d, a, n, b : Int(ExpandIntegrand((c + d*x)**m, (a*Cosh(e + f*x) + b)**n*Cosh(e + f*x)**(-n), x), x)) rubi.add(rule241) pattern242 = Pattern(Integral((a_ + WC('b', S(1))*csch(x_*WC('f', S(1)) + WC('e', S(0))))**WC('n', S(1))*(x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule242 = ReplacementRule(pattern242, lambda m, e, x, f, d, a, n, b, c : Int(ExpandIntegrand((c + d*x)**m, (a*sinh(e + f*x) + b)**n*sinh(e + f*x)**(-n), x), x)) rubi.add(rule242) pattern243 = Pattern(Integral(u_**WC('m', S(1))*sech(v_)**WC('n', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule243 = ReplacementRule(pattern243, lambda m, x, n, v, u : Int(ExpandToSum(u, x)**m*sech(ExpandToSum(v, x))**n, x)) rubi.add(rule243) pattern244 = Pattern(Integral(u_**WC('m', S(1))*csch(v_)**WC('n', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule244 = ReplacementRule(pattern244, lambda m, x, n, v, u : Int(ExpandToSum(u, x)**m*csch(ExpandToSum(v, x))**n, x)) rubi.add(rule244) pattern245 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule245 = ReplacementRule(pattern245, lambda m, c, x, a, d, n, b : Int((c + d*x)**m*sech(a + b*x)**n, x)) rubi.add(rule245) pattern246 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule246 = ReplacementRule(pattern246, lambda m, x, a, d, n, b, c : Int((c + d*x)**m*csch(a + b*x)**n, x)) rubi.add(rule246) pattern247 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sech(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n: PositiveIntegerQ(1/n)), CustomConstraint(lambda p: IntegerQ(p))) rule247 = ReplacementRule(pattern247, lambda p, x, a, d, n, b, c : Subst(Int(x**(S(-1) + 1/n)*(a + b*sech(c + d*x))**p, x), x, x**n)/n) rubi.add(rule247) pattern248 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*csch(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n: PositiveIntegerQ(1/n)), CustomConstraint(lambda p: IntegerQ(p))) rule248 = ReplacementRule(pattern248, lambda p, x, a, d, n, b, c : Subst(Int(x**(S(-1) + 1/n)*(a + b*csch(c + d*x))**p, x), x, x**n)/n) rubi.add(rule248) pattern249 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sech(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule249 = ReplacementRule(pattern249, lambda p, x, a, d, n, b, c : Int((a + b*sech(c + d*x**n))**p, x)) rubi.add(rule249) pattern250 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*csch(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule250 = ReplacementRule(pattern250, lambda p, x, a, d, n, b, c : Int((a + b*csch(c + d*x**n))**p, x)) rubi.add(rule250) pattern251 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sech(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule251 = ReplacementRule(pattern251, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*sech(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule251) pattern252 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*csch(u_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: LinearQ(u, x)), CustomConstraint(lambda u, x: NonzeroQ(u - x))) rule252 = ReplacementRule(pattern252, lambda p, x, a, d, n, b, u, c : Subst(Int((a + b*csch(c + d*x**n))**p, x), x, u)/Coefficient(u, x, S(1))) rubi.add(rule252) pattern253 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*sech(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule253 = ReplacementRule(pattern253, lambda p, x, a, u, b : Int((a + b*sech(ExpandToSum(u, x)))**p, x)) rubi.add(rule253) pattern254 = Pattern(Integral((WC('a', S(0)) + WC('b', S(1))*csch(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule254 = ReplacementRule(pattern254, lambda p, x, a, u, b : Int((a + b*csch(ExpandToSum(u, x)))**p, x)) rubi.add(rule254) pattern255 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sech(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: PositiveIntegerQ((m + S(1))/n)), CustomConstraint(lambda p: IntegerQ(p))) rule255 = ReplacementRule(pattern255, lambda p, m, x, a, d, n, b, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*sech(c + d*x))**p, x), x, x**n)/n) rubi.add(rule255) pattern256 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*csch(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m: PositiveIntegerQ((m + S(1))/n)), CustomConstraint(lambda p: IntegerQ(p))) rule256 = ReplacementRule(pattern256, lambda p, m, x, a, d, n, b, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*csch(c + d*x))**p, x), x, x**n)/n) rubi.add(rule256) pattern257 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sech(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule257 = ReplacementRule(pattern257, lambda p, m, x, a, d, n, b, c : Int(x**m*(a + b*sech(c + d*x**n))**p, x)) rubi.add(rule257) pattern258 = Pattern(Integral(x_**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*csch(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule258 = ReplacementRule(pattern258, lambda p, m, x, a, d, n, b, c : Int(x**m*(a + b*csch(c + d*x**n))**p, x)) rubi.add(rule258) pattern259 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sech(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule259 = ReplacementRule(pattern259, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*sech(c + d*x**n))**p, x)) rubi.add(rule259) pattern260 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*csch(x_**n_*WC('d', S(1)) + WC('c', S(0))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x))) rule260 = ReplacementRule(pattern260, lambda p, m, e, x, a, d, n, b, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(a + b*csch(c + d*x**n))**p, x)) rubi.add(rule260) pattern261 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*sech(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule261 = ReplacementRule(pattern261, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*sech(ExpandToSum(u, x)))**p, x)) rubi.add(rule261) pattern262 = Pattern(Integral((e_*x_)**WC('m', S(1))*(WC('a', S(0)) + WC('b', S(1))*csch(u_))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda u, x: BinomialQ(u, x)), CustomConstraint(lambda u, x: Not(BinomialMatchQ(u, x)))) rule262 = ReplacementRule(pattern262, lambda p, m, e, x, a, u, b : Int((e*x)**m*(a + b*csch(ExpandToSum(u, x)))**p, x)) rubi.add(rule262) pattern263 = Pattern(Integral(x_**WC('m', S(1))*sinh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*sech(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n, m: GreaterEqual(m - n, S(0))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule263 = ReplacementRule(pattern263, lambda p, m, x, a, n, b : -x**(m - n + S(1))*sech(a + b*x**n)**(p + S(-1))/(b*n*(p + S(-1))) + (m - n + S(1))*Int(x**(m - n)*sech(a + b*x**n)**(p + S(-1)), x)/(b*n*(p + S(-1)))) rubi.add(rule263) pattern264 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*csch(x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n, m: GreaterEqual(m - n, S(0))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule264 = ReplacementRule(pattern264, lambda p, m, x, a, n, b : -x**(m - n + S(1))*csch(a + b*x**n)**(p + S(-1))/(b*n*(p + S(-1))) + (m - n + S(1))*Int(x**(m - n)*csch(a + b*x**n)**(p + S(-1)), x)/(b*n*(p + S(-1)))) rubi.add(rule264) pattern265 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('b', S(1)) + WC('a', S(0)))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule265 = ReplacementRule(pattern265, lambda m, x, a, d, n, b, c : -d*m*Int((c + d*x)**(m + S(-1))*sinh(a + b*x)**(n + S(1)), x)/(b*(n + S(1))) + (c + d*x)**m*sinh(a + b*x)**(n + S(1))/(b*(n + S(1)))) rubi.add(rule265) pattern266 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule266 = ReplacementRule(pattern266, lambda m, x, a, d, n, b, c : -d*m*Int((c + d*x)**(m + S(-1))*Cosh(a + b*x)**(n + S(1)), x)/(b*(n + S(1))) + (c + d*x)**m*Cosh(a + b*x)**(n + S(1))/(b*(n + S(1)))) rubi.add(rule266) pattern267 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(n, p))) rule267 = ReplacementRule(pattern267, lambda p, m, x, a, d, n, b, c : Int(ExpandTrigReduce((c + d*x)**m, Cosh(a + b*x)**p*sinh(a + b*x)**n, x), x)) rubi.add(rule267) pattern268 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(n, p))) rule268 = ReplacementRule(pattern268, lambda p, m, c, x, a, d, n, b : Int((c + d*x)**m*sinh(a + b*x)**n*tanh(a + b*x)**(p + S(-2)), x) - Int((c + d*x)**m*sinh(a + b*x)**(n + S(-2))*tanh(a + b*x)**p, x)) rubi.add(rule268) pattern269 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*Cosh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(n, p))) rule269 = ReplacementRule(pattern269, lambda p, m, x, a, d, n, b, c : Int((c + d*x)**m*Cosh(a + b*x)**n*coth(a + b*x)**(p + S(-2)), x) + Int((c + d*x)**m*Cosh(a + b*x)**(n + S(-2))*coth(a + b*x)**p, x)) rubi.add(rule269) pattern270 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: SameQ(p, S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule270 = ReplacementRule(pattern270, lambda p, m, c, x, a, d, n, b : d*m*Int((c + d*x)**(m + S(-1))*sech(a + b*x)**n, x)/(b*n) - (c + d*x)**m*sech(a + b*x)**n/(b*n)) rubi.add(rule270) pattern271 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: SameQ(p, S(1))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0)))) rule271 = ReplacementRule(pattern271, lambda p, m, x, a, d, n, b, c : d*m*Int((c + d*x)**(m + S(-1))*csch(a + b*x)**n, x)/(b*n) - (c + d*x)**m*csch(a + b*x)**n/(b*n)) rubi.add(rule271) pattern272 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule272 = ReplacementRule(pattern272, lambda m, c, x, a, d, n, b : -d*m*Int((c + d*x)**(m + S(-1))*tanh(a + b*x)**(n + S(1)), x)/(b*(n + S(1))) + (c + d*x)**m*tanh(a + b*x)**(n + S(1))/(b*(n + S(1)))) rubi.add(rule272) pattern273 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule273 = ReplacementRule(pattern273, lambda m, x, a, d, n, b, c : d*m*Int((c + d*x)**(m + S(-1))*coth(a + b*x)**(n + S(1)), x)/(b*(n + S(1))) - (c + d*x)**m*coth(a + b*x)**(n + S(1))/(b*(n + S(1)))) rubi.add(rule273) pattern274 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**p_*sech(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: PositiveIntegerQ(p/S(2)))) rule274 = ReplacementRule(pattern274, lambda p, m, c, x, a, d, b : Int((c + d*x)**m*tanh(a + b*x)**(p + S(-2))*sech(a + b*x), x) - Int((c + d*x)**m*tanh(a + b*x)**(p + S(-2))*sech(a + b*x)**S(3), x)) rubi.add(rule274) pattern275 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**p_*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p/S(2)))) rule275 = ReplacementRule(pattern275, lambda p, m, c, x, a, d, n, b : Int((c + d*x)**m*tanh(a + b*x)**(p + S(-2))*sech(a + b*x)**n, x) - Int((c + d*x)**m*tanh(a + b*x)**(p + S(-2))*sech(a + b*x)**(n + S(2)), x)) rubi.add(rule275) pattern276 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**p_*csch(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: PositiveIntegerQ(p/S(2)))) rule276 = ReplacementRule(pattern276, lambda p, m, x, a, d, b, c : Int((c + d*x)**m*coth(a + b*x)**(p + S(-2))*csch(a + b*x), x) + Int((c + d*x)**m*coth(a + b*x)**(p + S(-2))*csch(a + b*x)**S(3), x)) rubi.add(rule276) pattern277 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**p_*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p/S(2)))) rule277 = ReplacementRule(pattern277, lambda p, m, x, a, d, n, b, c : Int((c + d*x)**m*coth(a + b*x)**(p + S(-2))*csch(a + b*x)**n, x) + Int((c + d*x)**m*coth(a + b*x)**(p + S(-2))*csch(a + b*x)**(n + S(2)), x)) rubi.add(rule277) pattern278 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*tanh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n, p: EvenQ(n) | OddQ(p)), ) def With278(p, m, c, x, a, d, n, b): u = IntHide(tanh(a + b*x)**p*sech(a + b*x)**n, x) return -d*m*Int(u*(c + d*x)**(m + S(-1)), x) + Dist((c + d*x)**m, u, x) rule278 = ReplacementRule(pattern278, lambda p, m, c, x, a, d, n, b : With278(p, m, c, x, a, d, n, b)) rubi.add(rule278) pattern279 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*coth(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n, p: EvenQ(n) | OddQ(p)), ) def With279(p, m, x, a, d, n, b, c): u = IntHide(coth(a + b*x)**p*csch(a + b*x)**n, x) return -d*m*Int(u*(c + d*x)**(m + S(-1)), x) + Dist((c + d*x)**m, u, x) rule279 = ReplacementRule(pattern279, lambda p, m, x, a, d, n, b, c : With279(p, m, x, a, d, n, b, c)) rubi.add(rule279) pattern280 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda n: IntegerQ(n))) rule280 = ReplacementRule(pattern280, lambda m, x, a, d, n, b, c : S(2)**n*Int((c + d*x)**m*csch(S(2)*a + S(2)*b*x)**n, x)) rubi.add(rule280) pattern281 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*csch(x_*WC('b', S(1)) + WC('a', S(0)))**WC('n', S(1))*sech(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, p: IntegersQ(n, p)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0))), CustomConstraint(lambda n, p: Unequal(n, p)), ) def With281(p, m, x, a, d, n, b, c): u = IntHide(csch(a + b*x)**n*sech(a + b*x)**p, x) return -d*m*Int(u*(c + d*x)**(m + S(-1)), x) + Dist((c + d*x)**m, u, x) rule281 = ReplacementRule(pattern281, lambda p, m, x, a, d, n, b, c : With281(p, m, x, a, d, n, b, c)) rubi.add(rule281) pattern282 = Pattern(Integral(F_**v_*G_**w_*u_**WC('m', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda F: HyperbolicQ(F)), CustomConstraint(lambda G: HyperbolicQ(G)), CustomConstraint(lambda v, w: ZeroQ(v - w)), CustomConstraint(lambda v, u, x, w: LinearQ(List(u, v, w), x)), CustomConstraint(lambda v, u, x, w: Not(LinearMatchQ(List(u, v, w), x)))) rule282 = ReplacementRule(pattern282, lambda p, m, x, w, n, v, u, F, G : Int(ExpandToSum(u, x)**m*F(ExpandToSum(v, x))**n*G(ExpandToSum(v, x))**p, x)) rubi.add(rule282) pattern283 = Pattern(Integral((a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule283 = ReplacementRule(pattern283, lambda m, e, x, f, d, a, n, b, c : -f*m*Int((a + b*sinh(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) + (a + b*sinh(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule283) pattern284 = Pattern(Integral((a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule284 = ReplacementRule(pattern284, lambda m, c, e, x, f, d, a, n, b : -f*m*Int((a + b*Cosh(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) + (a + b*Cosh(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule284) pattern285 = Pattern(Integral((a_ + WC('b', S(1))*tanh(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sech(x_*WC('d', S(1)) + WC('c', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule285 = ReplacementRule(pattern285, lambda m, e, x, f, d, a, n, b, c : -f*m*Int((a + b*tanh(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) + (a + b*tanh(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule285) pattern286 = Pattern(Integral((a_ + WC('b', S(1))*coth(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*csch(x_*WC('d', S(1)) + WC('c', S(0)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule286 = ReplacementRule(pattern286, lambda m, c, e, x, f, d, a, n, b : f*m*Int((a + b*coth(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) - (a + b*coth(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule286) pattern287 = Pattern(Integral((a_ + WC('b', S(1))*sech(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*tanh(x_*WC('d', S(1)) + WC('c', S(0)))*sech(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule287 = ReplacementRule(pattern287, lambda m, e, x, f, d, a, n, b, c : f*m*Int((a + b*sech(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) - (a + b*sech(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule287) pattern288 = Pattern(Integral((a_ + WC('b', S(1))*csch(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*coth(x_*WC('d', S(1)) + WC('c', S(0)))*csch(x_*WC('d', S(1)) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: NonzeroQ(n + S(1)))) rule288 = ReplacementRule(pattern288, lambda m, c, e, x, f, d, a, n, b : f*m*Int((a + b*csch(c + d*x))**(n + S(1))*(e + f*x)**(m + S(-1)), x)/(b*d*(n + S(1))) - (a + b*csch(c + d*x))**(n + S(1))*(e + f*x)**m/(b*d*(n + S(1)))) rubi.add(rule288) pattern289 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))**WC('q', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda m: IntegerQ(m))) rule289 = ReplacementRule(pattern289, lambda p, m, c, e, x, a, f, d, q, b : Int(ExpandTrigReduce((e + f*x)**m, sinh(a + b*x)**p*sinh(c + d*x)**q, x), x)) rubi.add(rule289) pattern290 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**WC('q', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda m: IntegerQ(m))) rule290 = ReplacementRule(pattern290, lambda p, m, e, x, a, d, f, b, q, c : Int(ExpandTrigReduce((e + f*x)**m, Cosh(a + b*x)**p*Cosh(c + d*x)**q, x), x)) rubi.add(rule290) pattern291 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**WC('q', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q))) rule291 = ReplacementRule(pattern291, lambda p, m, e, x, f, d, a, b, q, c : Int(ExpandTrigReduce((e + f*x)**m, Cosh(c + d*x)**q*sinh(a + b*x)**p, x), x)) rubi.add(rule291) pattern292 = Pattern(Integral(F_**(x_*WC('b', S(1)) + WC('a', S(0)))*G_**(x_*WC('d', S(1)) + WC('c', S(0)))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda F: MemberQ(List(Sinh, Cosh), F)), CustomConstraint(lambda G: MemberQ(List(Sech, Csch), G)), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda d, c, a, b: ZeroQ(-a*d + b*c)), CustomConstraint(lambda d, b: PositiveIntegerQ(b/d + S(-1)))) rule292 = ReplacementRule(pattern292, lambda p, m, c, e, x, a, f, d, F, q, G, b : Int(ExpandTrigExpand((e + f*x)**m*G(c + d*x)**q, F, c + d*x, p, b/d, x), x)) rubi.add(rule292) pattern293 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sinh(x_*WC('e', S(1)) + WC('d', S(0))), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda F, c, e, b: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)))) rule293 = ReplacementRule(pattern293, lambda c, e, x, a, d, F, b : -F**(c*(a + b*x))*b*c*log(F)*sinh(d + e*x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)) + F**(c*(a + b*x))*e*Cosh(d + e*x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2))) rubi.add(rule293) pattern294 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('e', S(1)) + WC('d', S(0))), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda F, c, e, b: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)))) rule294 = ReplacementRule(pattern294, lambda c, e, x, a, d, F, b : -F**(c*(a + b*x))*b*c*Cosh(d + e*x)*log(F)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)) + F**(c*(a + b*x))*e*sinh(d + e*x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2))) rubi.add(rule294) pattern295 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule295 = ReplacementRule(pattern295, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*sinh(d + e*x)**n/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) + F**(c*(a + b*x))*e*n*Cosh(d + e*x)*sinh(d + e*x)**(n + S(-1))/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) - e**S(2)*n*(n + S(-1))*Int(F**(c*(a + b*x))*sinh(d + e*x)**(n + S(-2)), x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))) rubi.add(rule295) pattern296 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1)))) rule296 = ReplacementRule(pattern296, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*Cosh(d + e*x)**n*log(F)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) + F**(c*(a + b*x))*e*n*Cosh(d + e*x)**(n + S(-1))*sinh(d + e*x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) + e**S(2)*n*(n + S(-1))*Int(F**(c*(a + b*x))*Cosh(d + e*x)**(n + S(-2)), x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))) rubi.add(rule296) pattern297 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda e, n, b, F, c: ZeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))), CustomConstraint(lambda n: NonzeroQ(n + S(1))), CustomConstraint(lambda n: NonzeroQ(n + S(2)))) rule297 = ReplacementRule(pattern297, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*sinh(d + e*x)**(n + S(2))/(e**S(2)*(n + S(1))*(n + S(2))) + F**(c*(a + b*x))*Cosh(d + e*x)*sinh(d + e*x)**(n + S(1))/(e*(n + S(1)))) rubi.add(rule297) pattern298 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda e, n, b, F, c: ZeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))), CustomConstraint(lambda n: NonzeroQ(n + S(1))), CustomConstraint(lambda n: NonzeroQ(n + S(2)))) rule298 = ReplacementRule(pattern298, lambda c, e, x, a, d, n, F, b : F**(c*(a + b*x))*b*c*Cosh(d + e*x)**(n + S(2))*log(F)/(e**S(2)*(n + S(1))*(n + S(2))) - F**(c*(a + b*x))*Cosh(d + e*x)**(n + S(1))*sinh(d + e*x)/(e*(n + S(1)))) rubi.add(rule298) pattern299 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2)))) rule299 = ReplacementRule(pattern299, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*sinh(d + e*x)**(n + S(2))/(e**S(2)*(n + S(1))*(n + S(2))) + F**(c*(a + b*x))*Cosh(d + e*x)*sinh(d + e*x)**(n + S(1))/(e*(n + S(1))) - (-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))*Int(F**(c*(a + b*x))*sinh(d + e*x)**(n + S(2)), x)/(e**S(2)*(n + S(1))*(n + S(2)))) rubi.add(rule299) pattern300 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1))), CustomConstraint(lambda n: Unequal(n, S(-2)))) rule300 = ReplacementRule(pattern300, lambda c, e, x, a, d, n, F, b : F**(c*(a + b*x))*b*c*Cosh(d + e*x)**(n + S(2))*log(F)/(e**S(2)*(n + S(1))*(n + S(2))) - F**(c*(a + b*x))*Cosh(d + e*x)**(n + S(1))*sinh(d + e*x)/(e*(n + S(1))) + (-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(2))**S(2))*Int(F**(c*(a + b*x))*Cosh(d + e*x)**(n + S(2)), x)/(e**S(2)*(n + S(1))*(n + S(2)))) rubi.add(rule300) pattern301 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule301 = ReplacementRule(pattern301, lambda c, e, x, a, d, n, F, b : (exp(S(2)*d + S(2)*e*x) + S(-1))**(-n)*Int(F**(c*(a + b*x))*(exp(S(2)*d + S(2)*e*x) + S(-1))**n*exp(-n*(d + e*x)), x)*exp(n*(d + e*x))*sinh(d + e*x)**n) rubi.add(rule301) pattern302 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule302 = ReplacementRule(pattern302, lambda c, e, x, a, d, n, F, b : (exp(S(2)*d + S(2)*e*x) + S(1))**(-n)*Cosh(d + e*x)**n*Int(F**(c*(a + b*x))*(exp(S(2)*d + S(2)*e*x) + S(1))**n*exp(-n*(d + e*x)), x)*exp(n*(d + e*x))) rubi.add(rule302) pattern303 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*tanh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: IntegerQ(n))) rule303 = ReplacementRule(pattern303, lambda c, e, x, a, d, n, F, b : Int(ExpandIntegrand(F**(c*(a + b*x))*(exp(S(2)*d + S(2)*e*x) + S(-1))**n*(exp(S(2)*d + S(2)*e*x) + S(1))**(-n), x), x)) rubi.add(rule303) pattern304 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*coth(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: IntegerQ(n))) rule304 = ReplacementRule(pattern304, lambda e, x, a, d, n, b, F, c : Int(ExpandIntegrand(F**(c*(a + b*x))*(exp(S(2)*d + S(2)*e*x) + S(-1))**(-n)*(exp(S(2)*d + S(2)*e*x) + S(1))**n, x), x)) rubi.add(rule304) pattern305 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1)))) rule305 = ReplacementRule(pattern305, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*sech(d + e*x)**n/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) - F**(c*(a + b*x))*e*n*sinh(d + e*x)*sech(d + e*x)**(n + S(1))/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) + e**S(2)*n*(n + S(1))*Int(F**(c*(a + b*x))*sech(d + e*x)**(n + S(2)), x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))) rubi.add(rule305) pattern306 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Less(n, S(-1)))) rule306 = ReplacementRule(pattern306, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*csch(d + e*x)**n/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) - F**(c*(a + b*x))*e*n*Cosh(d + e*x)*csch(d + e*x)**(n + S(1))/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2)) - e**S(2)*n*(n + S(1))*Int(F**(c*(a + b*x))*csch(d + e*x)**(n + S(2)), x)/(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*n**S(2))) rubi.add(rule306) pattern307 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda e, n, b, F, c: ZeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))), CustomConstraint(lambda n: NonzeroQ(n + S(-1))), CustomConstraint(lambda n: NonzeroQ(n + S(-2)))) rule307 = ReplacementRule(pattern307, lambda c, e, x, a, d, n, F, b : F**(c*(a + b*x))*b*c*log(F)*sech(d + e*x)**(n + S(-2))/(e**S(2)*(n + S(-2))*(n + S(-1))) + F**(c*(a + b*x))*sinh(d + e*x)*sech(d + e*x)**(n + S(-1))/(e*(n + S(-1)))) rubi.add(rule307) pattern308 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda e, n, b, F, c: ZeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))), CustomConstraint(lambda n: NonzeroQ(n + S(-1))), CustomConstraint(lambda n: NonzeroQ(n + S(-2)))) rule308 = ReplacementRule(pattern308, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*csch(d + e*x)**(n + S(-2))/(e**S(2)*(n + S(-2))*(n + S(-1))) - F**(c*(a + b*x))*Cosh(d + e*x)*csch(d + e*x)**(n + S(-1))/(e*(n + S(-1)))) rubi.add(rule308) pattern309 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2)))) rule309 = ReplacementRule(pattern309, lambda c, e, x, a, d, n, F, b : F**(c*(a + b*x))*b*c*log(F)*sech(d + e*x)**(n + S(-2))/(e**S(2)*(n + S(-2))*(n + S(-1))) + F**(c*(a + b*x))*sinh(d + e*x)*sech(d + e*x)**(n + S(-1))/(e*(n + S(-1))) + (-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))*Int(F**(c*(a + b*x))*sech(d + e*x)**(n + S(-2)), x)/(e**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule309) pattern310 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**n_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda e, n, b, F, c: NonzeroQ(-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda n: Unequal(n, S(2)))) rule310 = ReplacementRule(pattern310, lambda c, e, x, a, d, n, F, b : -F**(c*(a + b*x))*b*c*log(F)*csch(d + e*x)**(n + S(-2))/(e**S(2)*(n + S(-2))*(n + S(-1))) - F**(c*(a + b*x))*Cosh(d + e*x)*csch(d + e*x)**(n + S(-1))/(e*(n + S(-1))) - (-b**S(2)*c**S(2)*log(F)**S(2) + e**S(2)*(n + S(-2))**S(2))*Int(F**(c*(a + b*x))*csch(d + e*x)**(n + S(-2)), x)/(e**S(2)*(n + S(-2))*(n + S(-1)))) rubi.add(rule310) pattern311 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: IntegerQ(n))) rule311 = ReplacementRule(pattern311, lambda c, e, x, a, d, n, F, b : S(2)**n*F**(c*(a + b*x))*Hypergeometric2F1(n, b*c*log(F)/(S(2)*e) + n/S(2), b*c*log(F)/(S(2)*e) + n/S(2) + S(1), -exp(S(2)*d + S(2)*e*x))*exp(n*(d + e*x))/(b*c*log(F) + e*n)) rubi.add(rule311) pattern312 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: IntegerQ(n))) rule312 = ReplacementRule(pattern312, lambda e, x, a, d, n, b, F, c : (S(-2))**n*F**(c*(a + b*x))*Hypergeometric2F1(n, b*c*log(F)/(S(2)*e) + n/S(2), b*c*log(F)/(S(2)*e) + n/S(2) + S(1), exp(S(2)*d + S(2)*e*x))*exp(n*(d + e*x))/(b*c*log(F) + e*n)) rubi.add(rule312) pattern313 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule313 = ReplacementRule(pattern313, lambda c, e, x, a, d, n, F, b : (exp(S(2)*d + S(2)*e*x) + S(1))**n*Int(SimplifyIntegrand(F**(c*(a + b*x))*(exp(S(2)*d + S(2)*e*x) + S(1))**(-n)*exp(n*(d + e*x)), x), x)*exp(-n*(d + e*x))*sech(d + e*x)**n) rubi.add(rule313) pattern314 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n: Not(IntegerQ(n)))) rule314 = ReplacementRule(pattern314, lambda e, x, a, d, n, b, F, c : (-exp(-S(2)*d - S(2)*e*x) + S(1))**n*Int(SimplifyIntegrand(F**(c*(a + b*x))*(-exp(-S(2)*d - S(2)*e*x) + S(1))**(-n)*exp(-n*(d + e*x)), x), x)*exp(n*(d + e*x))*csch(d + e*x)**n) rubi.add(rule314) pattern315 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + WC('g', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f**S(2) + g**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule315 = ReplacementRule(pattern315, lambda c, e, x, a, d, f, g, n, F, b : S(2)**n*f**n*Int(F**(c*(a + b*x))*Cosh(-Pi*f/(S(4)*g) + d/S(2) + e*x/S(2))**(S(2)*n), x)) rubi.add(rule315) pattern316 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('g', S(1)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f - g)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule316 = ReplacementRule(pattern316, lambda e, x, a, d, f, g, n, b, F, c : S(2)**n*g**n*Int(F**(c*(a + b*x))*Cosh(d/S(2) + e*x/S(2))**(S(2)*n), x)) rubi.add(rule316) pattern317 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('g', S(1)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f + g)), CustomConstraint(lambda n: NegativeIntegerQ(n))) rule317 = ReplacementRule(pattern317, lambda e, x, a, d, f, g, n, b, F, c : S(2)**n*g**n*Int(F**(c*(a + b*x))*sinh(d/S(2) + e*x/S(2))**(S(2)*n), x)) rubi.add(rule317) pattern318 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + WC('g', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0))))**WC('n', S(1))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f**S(2) + g**S(2))), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda n, m: Equal(m + n, S(0)))) rule318 = ReplacementRule(pattern318, lambda m, e, x, a, d, f, g, n, b, F, c : g**n*Int(F**(c*(a + b*x))*tanh(-Pi*f/(S(4)*g) + d/S(2) + e*x/S(2))**m, x)) rubi.add(rule318) pattern319 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('g', S(1)))**WC('n', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f - g)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda n, m: Equal(m + n, S(0)))) rule319 = ReplacementRule(pattern319, lambda m, e, x, a, d, f, g, n, b, F, c : g**n*Int(F**(c*(a + b*x))*tanh(d/S(2) + e*x/S(2))**m, x)) rubi.add(rule319) pattern320 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(f_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('g', S(1)))**WC('n', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda g, f: ZeroQ(f + g)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda n, m: Equal(m + n, S(0)))) rule320 = ReplacementRule(pattern320, lambda m, e, x, a, d, f, g, n, b, F, c : g**n*Int(F**(c*(a + b*x))*coth(d/S(2) + e*x/S(2))**m, x)) rubi.add(rule320) pattern321 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(h_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('i', S(1)))/(f_ + WC('g', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda g, f: ZeroQ(f**S(2) + g**S(2))), CustomConstraint(lambda h, i: ZeroQ(h**S(2) - i**S(2))), CustomConstraint(lambda h, g, i, f: ZeroQ(-f*i + g*h))) rule321 = ReplacementRule(pattern321, lambda h, c, e, x, a, d, f, g, F, i, b : S(2)*i*Int(F**(c*(a + b*x))*Cosh(d + e*x)/(f + g*sinh(d + e*x)), x) + Int(F**(c*(a + b*x))*(h - i*Cosh(d + e*x))/(f + g*sinh(d + e*x)), x)) rubi.add(rule321) pattern322 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*(h_ + WC('i', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0))))/(f_ + Cosh(x_*WC('e', S(1)) + WC('d', S(0)))*WC('g', S(1))), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda g, f: ZeroQ(f**S(2) - g**S(2))), CustomConstraint(lambda h, i: ZeroQ(h**S(2) + i**S(2))), CustomConstraint(lambda h, g, i, f: ZeroQ(f*i + g*h))) rule322 = ReplacementRule(pattern322, lambda h, e, x, a, d, f, g, F, b, i, c : S(2)*i*Int(F**(c*(a + b*x))*sinh(d + e*x)/(f + g*Cosh(d + e*x)), x) + Int(F**(c*(a + b*x))*(h - i*sinh(d + e*x))/(f + g*Cosh(d + e*x)), x)) rubi.add(rule322) pattern323 = Pattern(Integral(F_**(u_*WC('c', S(1)))*G_**v_, x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda G: HyperbolicQ(G)), CustomConstraint(lambda v, u, x: LinearQ(List(u, v), x)), CustomConstraint(lambda v, u, x: Not(LinearMatchQ(List(u, v), x)))) rule323 = ReplacementRule(pattern323, lambda x, n, v, u, F, G, c : Int(F**(c*ExpandToSum(u, x))*G(ExpandToSum(v, x))**n, x)) rubi.add(rule323) pattern324 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*x_**WC('m', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0))), CustomConstraint(lambda n: PositiveIntegerQ(n)), ) def With324(m, c, e, x, a, d, n, F, b): u = IntHide(F**(c*(a + b*x))*sinh(d + e*x)**n, x) return u*x**m - Dist(m, Int(u*x**(m + S(-1)), x)) rule324 = ReplacementRule(pattern324, lambda m, c, e, x, a, d, n, F, b : With324(m, c, e, x, a, d, n, F, b)) rubi.add(rule324) pattern325 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*x_**WC('m', S(1))*Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m, S(0))), CustomConstraint(lambda n: PositiveIntegerQ(n)), ) def With325(m, e, x, a, d, n, b, F, c): u = IntHide(F**(c*(a + b*x))*Cosh(d + e*x)**n, x) return u*x**m - Dist(m, Int(u*x**(m + S(-1)), x)) rule325 = ReplacementRule(pattern325, lambda m, e, x, a, d, n, b, F, c : With325(m, e, x, a, d, n, b, F, c)) rubi.add(rule325) pattern326 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*Cosh(x_*WC('g', S(1)) + WC('f', S(0)))**WC('n', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule326 = ReplacementRule(pattern326, lambda m, e, x, a, f, d, g, n, b, F, c : Int(ExpandTrigReduce(F**(c*(a + b*x)), Cosh(f + g*x)**n*sinh(d + e*x)**m, x), x)) rubi.add(rule326) pattern327 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*x_**WC('p', S(1))*Cosh(x_*WC('g', S(1)) + WC('f', S(0)))**WC('n', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, m, p: PositiveIntegerQ(m, n, p))) rule327 = ReplacementRule(pattern327, lambda p, m, e, x, a, f, d, g, n, b, F, c : Int(ExpandTrigReduce(F**(c*(a + b*x))*x**p, Cosh(f + g*x)**n*sinh(d + e*x)**m, x), x)) rubi.add(rule327) pattern328 = Pattern(Integral(F_**((x_*WC('b', S(1)) + WC('a', S(0)))*WC('c', S(1)))*G_**(x_*WC('e', S(1)) + WC('d', S(0)))*H_**(x_*WC('e', S(1)) + WC('d', S(0))), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n)), CustomConstraint(lambda G: HyperbolicQ(G)), CustomConstraint(lambda H: HyperbolicQ(H))) rule328 = ReplacementRule(pattern328, lambda m, H, c, e, x, a, d, n, F, G, b : Int(ExpandTrigToExp(F**(c*(a + b*x)), G(d + e*x)**m*H(d + e*x)**n, x), x)) rubi.add(rule328) pattern329 = Pattern(Integral(F_**u_*sinh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda u, x: LinearQ(u, x) | PolyQ(u, x, S(2))), CustomConstraint(lambda v, x: LinearQ(v, x) | PolyQ(v, x, S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule329 = ReplacementRule(pattern329, lambda x, n, v, u, F : Int(ExpandTrigToExp(F**u, sinh(v)**n, x), x)) rubi.add(rule329) pattern330 = Pattern(Integral(F_**u_*Cosh(v_)**WC('n', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda u, x: LinearQ(u, x) | PolyQ(u, x, S(2))), CustomConstraint(lambda v, x: LinearQ(v, x) | PolyQ(v, x, S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule330 = ReplacementRule(pattern330, lambda x, n, v, u, F : Int(ExpandTrigToExp(F**u, Cosh(v)**n, x), x)) rubi.add(rule330) pattern331 = Pattern(Integral(F_**u_*Cosh(v_)**WC('n', S(1))*sinh(v_)**WC('m', S(1)), x_), CustomConstraint(lambda F, x: FreeQ(F, x)), CustomConstraint(lambda u, x: LinearQ(u, x) | PolyQ(u, x, S(2))), CustomConstraint(lambda v, x: LinearQ(v, x) | PolyQ(v, x, S(2))), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule331 = ReplacementRule(pattern331, lambda m, x, n, v, u, F : Int(ExpandTrigToExp(F**u, Cosh(v)**n*sinh(v)**m, x), x)) rubi.add(rule331) pattern332 = Pattern(Integral(sinh(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, p, b: RationalQ(b, n, p))) rule332 = ReplacementRule(pattern332, lambda p, c, x, n, b : Int(((c*x**n)**b/S(2) - (c*x**n)**(-b)/S(2))**p, x)) rubi.add(rule332) pattern333 = Pattern(Integral(Cosh(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, p, b: RationalQ(b, n, p))) rule333 = ReplacementRule(pattern333, lambda p, c, x, n, b : Int(((c*x**n)**b/S(2) + (c*x**n)**(-b)/S(2))**p, x)) rubi.add(rule333) pattern334 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule334 = ReplacementRule(pattern334, lambda p, x, a, n, b, c : -x*(p + S(2))*sinh(a + b*log(c*x**n))**(p + S(2))/(p + S(1)) + x*sinh(a + b*log(c*x**n))**(p + S(2))*coth(a + b*log(c*x**n))/(b*n*(p + S(1)))) rubi.add(rule334) pattern335 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1))), CustomConstraint(lambda p: NonzeroQ(p + S(1)))) rule335 = ReplacementRule(pattern335, lambda p, x, a, n, b, c : x*(p + S(2))*Cosh(a + b*log(c*x**n))**(p + S(2))/(p + S(1)) - x*Cosh(a + b*log(c*x**n))**(p + S(2))*tanh(a + b*log(c*x**n))/(b*n*(p + S(1)))) rubi.add(rule335) pattern336 = Pattern(Integral(sqrt(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: ZeroQ(b*n + S(-2)))) rule336 = ReplacementRule(pattern336, lambda x, a, n, b, c : x*Int(sqrt((c*x**n)**(S(4)/n)*exp(S(2)*a) + S(-1))/x, x)*sqrt(sinh(a + b*log(c*x**n)))/sqrt((c*x**n)**(S(4)/n)*exp(S(2)*a) + S(-1))) rubi.add(rule336) pattern337 = Pattern(Integral(sqrt(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: ZeroQ(b*n + S(-2)))) rule337 = ReplacementRule(pattern337, lambda x, a, n, b, c : x*sqrt(Cosh(a + b*log(c*x**n)))*Int(sqrt((c*x**n)**(S(4)/n)*exp(S(2)*a) + S(1))/x, x)/sqrt((c*x**n)**(S(4)/n)*exp(S(2)*a) + S(1))) rubi.add(rule337) pattern338 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule338 = ReplacementRule(pattern338, lambda p, x, a, n, b, c : Int(ExpandIntegrand(((c*x**n)**(S(1)/(n*p))*exp(a*b*n*p)/(S(2)*b*n*p) - (c*x**n)**(-S(1)/(n*p))*exp(-a*b*n*p)/(S(2)*b*n*p))**p, x), x)) rubi.add(rule338) pattern339 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule339 = ReplacementRule(pattern339, lambda p, x, a, n, b, c : Int(ExpandIntegrand(((c*x**n)**(S(1)/(n*p))*exp(a*b*n*p)/S(2) + (c*x**n)**(-S(1)/(n*p))*exp(-a*b*n*p)/S(2))**p, x), x)) rubi.add(rule339) pattern340 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: NonzeroQ(b**S(2)*n**S(2) + S(-1)))) rule340 = ReplacementRule(pattern340, lambda x, a, n, b, c : b*n*x*Cosh(a + b*log(c*x**n))/(b**S(2)*n**S(2) + S(-1)) - x*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2) + S(-1))) rubi.add(rule340) pattern341 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: NonzeroQ(b**S(2)*n**S(2) + S(-1)))) rule341 = ReplacementRule(pattern341, lambda x, a, n, b, c : b*n*x*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2) + S(-1)) - x*Cosh(a + b*log(c*x**n))/(b**S(2)*n**S(2) + S(-1))) rubi.add(rule341) pattern342 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule342 = ReplacementRule(pattern342, lambda p, x, a, n, b, c : -b**S(2)*n**S(2)*p*(p + S(-1))*Int(sinh(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*p**S(2) + S(-1)) + b*n*p*x*Cosh(a + b*log(c*x**n))*sinh(a + b*log(c*x**n))**(p + S(-1))/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - x*sinh(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) + S(-1))) rubi.add(rule342) pattern343 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule343 = ReplacementRule(pattern343, lambda p, x, a, n, b, c : b**S(2)*n**S(2)*p*(p + S(-1))*Int(Cosh(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*p**S(2) + S(-1)) + b*n*p*x*Cosh(a + b*log(c*x**n))**(p + S(-1))*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - x*Cosh(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) + S(-1))) rubi.add(rule343) pattern344 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1)))) rule344 = ReplacementRule(pattern344, lambda p, x, a, n, b, c : x*sinh(a + b*log(c*x**n))**(p + S(2))*coth(a + b*log(c*x**n))/(b*n*(p + S(1))) - x*sinh(a + b*log(c*x**n))**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) - (b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1))*Int(sinh(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule344) pattern345 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1)))) rule345 = ReplacementRule(pattern345, lambda p, x, a, n, b, c : -x*Cosh(a + b*log(c*x**n))**(p + S(2))*tanh(a + b*log(c*x**n))/(b*n*(p + S(1))) + x*Cosh(a + b*log(c*x**n))**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) + (b**S(2)*n**S(2)*(p + S(2))**S(2) + S(-1))*Int(Cosh(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule345) pattern346 = Pattern(Integral(sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule346 = ReplacementRule(pattern346, lambda p, x, a, n, b, c : x*(S(2) - S(2)*(c*x**n)**(-S(2)*b)*exp(-S(2)*a))**(-p)*((c*x**n)**b*exp(a) - (c*x**n)**(-b)*exp(-a))**p*Hypergeometric2F1(-p, (-b*n*p + S(-1))/(S(2)*b*n), S(1) - (b*n*p + S(1))/(S(2)*b*n), (c*x**n)**(-S(2)*b)*exp(-S(2)*a))/(b*n*p + S(1))) rubi.add(rule346) pattern347 = Pattern(Integral(Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule347 = ReplacementRule(pattern347, lambda p, x, a, n, b, c : x*(S(2) + S(2)*(c*x**n)**(-S(2)*b)*exp(-S(2)*a))**(-p)*((c*x**n)**b*exp(a) + (c*x**n)**(-b)*exp(-a))**p*Hypergeometric2F1(-p, (-b*n*p + S(-1))/(S(2)*b*n), S(1) - (b*n*p + S(1))/(S(2)*b*n), -(c*x**n)**(-S(2)*b)*exp(-S(2)*a))/(b*n*p + S(1))) rubi.add(rule347) pattern348 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: NonzeroQ(p + S(1))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule348 = ReplacementRule(pattern348, lambda p, m, x, a, n, b, c : x**(m + S(1))*(-p + S(-2))*sinh(a + b*log(c*x**n))**(p + S(2))/((m + S(1))*(p + S(1))) + x**(m + S(1))*sinh(a + b*log(c*x**n))**(p + S(2))*coth(a + b*log(c*x**n))/(b*n*(p + S(1)))) rubi.add(rule348) pattern349 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: NonzeroQ(p + S(1))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule349 = ReplacementRule(pattern349, lambda p, m, x, a, n, b, c : x**(m + S(1))*(p + S(2))*Cosh(a + b*log(c*x**n))**(p + S(2))/((m + S(1))*(p + S(1))) - x**(m + S(1))*Cosh(a + b*log(c*x**n))**(p + S(2))*tanh(a + b*log(c*x**n))/(b*n*(p + S(1)))) rubi.add(rule349) pattern350 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule350 = ReplacementRule(pattern350, lambda p, m, x, a, n, b, c : S(2)**(-p)*Int(ExpandIntegrand(x**m*((c*x**n)**((-m + S(-1))/(n*p))*(-m + S(-1))*exp(-a*b*n*p/(m + S(1)))/(b*n*p) + (c*x**n)**((m + S(1))/(n*p))*(m + S(1))*exp(a*b*n*p/(m + S(1)))/(b*n*p))**p, x), x)) rubi.add(rule350) pattern351 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule351 = ReplacementRule(pattern351, lambda p, m, x, a, n, b, c : S(2)**(-p)*Int(ExpandIntegrand(x**m*((c*x**n)**((-m + S(-1))/(n*p))*exp(-a*b*n*p/(m + S(1))) + (c*x**n)**((m + S(1))/(n*p))*exp(a*b*n*p/(m + S(1))))**p, x), x)) rubi.add(rule351) pattern352 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, b: NonzeroQ(b**S(2)*n**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule352 = ReplacementRule(pattern352, lambda m, x, a, n, b, c : b*n*x**(m + S(1))*Cosh(a + b*log(c*x**n))/(b**S(2)*n**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2) - (m + S(1))**S(2))) rubi.add(rule352) pattern353 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, b: NonzeroQ(b**S(2)*n**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule353 = ReplacementRule(pattern353, lambda m, x, a, n, b, c : b*n*x**(m + S(1))*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*Cosh(a + b*log(c*x**n))/(b**S(2)*n**S(2) - (m + S(1))**S(2))) rubi.add(rule353) pattern354 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule354 = ReplacementRule(pattern354, lambda p, m, x, a, n, b, c : -b**S(2)*n**S(2)*p*(p + S(-1))*Int(x**m*sinh(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + b*n*p*x**(m + S(1))*Cosh(a + b*log(c*x**n))*sinh(a + b*log(c*x**n))**(p + S(-1))/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*sinh(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))) rubi.add(rule354) pattern355 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule355 = ReplacementRule(pattern355, lambda p, m, x, a, n, b, c : b**S(2)*n**S(2)*p*(p + S(-1))*Int(x**m*Cosh(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + b*n*p*x**(m + S(1))*Cosh(a + b*log(c*x**n))**(p + S(-1))*sinh(a + b*log(c*x**n))/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*Cosh(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))) rubi.add(rule355) pattern356 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule356 = ReplacementRule(pattern356, lambda p, m, x, a, n, b, c : x**(m + S(1))*sinh(a + b*log(c*x**n))**(p + S(2))*coth(a + b*log(c*x**n))/(b*n*(p + S(1))) - x**(m + S(1))*(m + S(1))*sinh(a + b*log(c*x**n))**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) - (b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))*Int(x**m*sinh(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule356) pattern357 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda p: Unequal(p, S(-2))), CustomConstraint(lambda m: NonzeroQ(m + S(1)))) rule357 = ReplacementRule(pattern357, lambda p, m, x, a, n, b, c : -x**(m + S(1))*Cosh(a + b*log(c*x**n))**(p + S(2))*tanh(a + b*log(c*x**n))/(b*n*(p + S(1))) + x**(m + S(1))*(m + S(1))*Cosh(a + b*log(c*x**n))**(p + S(2))/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2))) + (b**S(2)*n**S(2)*(p + S(2))**S(2) - (m + S(1))**S(2))*Int(x**m*Cosh(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*(p + S(1))*(p + S(2)))) rubi.add(rule357) pattern358 = Pattern(Integral(x_**WC('m', S(1))*sinh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule358 = ReplacementRule(pattern358, lambda p, m, x, a, n, b, c : x**(m + S(1))*(S(2) - S(2)*(c*x**n)**(-S(2)*b)*exp(-S(2)*a))**(-p)*((c*x**n)**b*exp(a) - (c*x**n)**(-b)*exp(-a))**p*Hypergeometric2F1(-p, (-b*n*p - m + S(-1))/(S(2)*b*n), S(1) - (b*n*p + m + S(1))/(S(2)*b*n), (c*x**n)**(-S(2)*b)*exp(-S(2)*a))/(b*n*p + m + S(1))) rubi.add(rule358) pattern359 = Pattern(Integral(x_**WC('m', S(1))*Cosh(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule359 = ReplacementRule(pattern359, lambda p, m, x, a, n, b, c : x**(m + S(1))*(S(2) + S(2)*(c*x**n)**(-S(2)*b)*exp(-S(2)*a))**(-p)*((c*x**n)**b*exp(a) + (c*x**n)**(-b)*exp(-a))**p*Hypergeometric2F1(-p, (-b*n*p - m + S(-1))/(S(2)*b*n), S(1) - (b*n*p + m + S(1))/(S(2)*b*n), -(c*x**n)**(-S(2)*b)*exp(-S(2)*a))/(b*n*p + m + S(1))) rubi.add(rule359) pattern360 = Pattern(Integral(sech(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, p, b: RationalQ(b, n, p))) rule360 = ReplacementRule(pattern360, lambda p, c, x, n, b : S(2)**p*Int(((c*x**n)**b/((c*x**n)**(S(2)*b) + S(1)))**p, x)) rubi.add(rule360) pattern361 = Pattern(Integral(csch(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, p, b: RationalQ(b, n, p))) rule361 = ReplacementRule(pattern361, lambda p, c, x, n, b : S(2)**p*Int(((c*x**n)**b/((c*x**n)**(S(2)*b) + S(-1)))**p, x)) rubi.add(rule361) pattern362 = Pattern(Integral(sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: ZeroQ(b**S(2)*n**S(2) + S(-1)))) rule362 = ReplacementRule(pattern362, lambda x, a, n, b, c : S(2)*Int((c*x**n)**(1/n)/((c*x**n)**(S(2)/n) + exp(-S(2)*a*b*n)), x)*exp(-a*b*n)) rubi.add(rule362) pattern363 = Pattern(Integral(csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, b: ZeroQ(b**S(2)*n**S(2) + S(-1)))) rule363 = ReplacementRule(pattern363, lambda x, a, n, b, c : -S(2)*b*n*Int((c*x**n)**(1/n)/(-(c*x**n)**(S(2)/n) + exp(-S(2)*a*b*n)), x)*exp(-a*b*n)) rubi.add(rule363) pattern364 = Pattern(Integral(sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule364 = ReplacementRule(pattern364, lambda p, x, a, n, b, c : x*(p + S(-2))*sech(a + b*log(c*x**n))**(p + S(-2))/(p + S(-1)) + x*tanh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1)))) rubi.add(rule364) pattern365 = Pattern(Integral(csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule365 = ReplacementRule(pattern365, lambda p, x, a, n, b, c : x*(-p + S(2))*csch(a + b*log(c*x**n))**(p + S(-2))/(p + S(-1)) - x*coth(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1)))) rubi.add(rule365) pattern366 = Pattern(Integral(sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda p: Unequal(p, S(2))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1)))) rule366 = ReplacementRule(pattern366, lambda p, x, a, n, b, c : x*tanh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1))) + x*sech(a + b*log(c*x**n))**(p + S(-2))/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1))) + (b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1))*Int(sech(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1)))) rubi.add(rule366) pattern367 = Pattern(Integral(csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda p: Unequal(p, S(2))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1)))) rule367 = ReplacementRule(pattern367, lambda p, x, a, n, b, c : -x*coth(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1))) - x*csch(a + b*log(c*x**n))**(p + S(-2))/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1))) - (b**S(2)*n**S(2)*(p + S(-2))**S(2) + S(-1))*Int(csch(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1)))) rubi.add(rule367) pattern368 = Pattern(Integral(sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule368 = ReplacementRule(pattern368, lambda p, x, a, n, b, c : b**S(2)*n**S(2)*p*(p + S(1))*Int(sech(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - b*n*p*x*sinh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(1))/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - x*sech(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) + S(-1))) rubi.add(rule368) pattern369 = Pattern(Integral(csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule369 = ReplacementRule(pattern369, lambda p, x, a, n, b, c : -b**S(2)*n**S(2)*p*(p + S(1))*Int(csch(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - b*n*p*x*Cosh(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(1))/(b**S(2)*n**S(2)*p**S(2) + S(-1)) - x*csch(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) + S(-1))) rubi.add(rule369) pattern370 = Pattern(Integral(sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule370 = ReplacementRule(pattern370, lambda p, x, a, n, b, c : S(2)**p*x*((c*x**n)**b*exp(a)/((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(1)))**p*((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(1))**p*Hypergeometric2F1(p, (b*n*p + S(1))/(S(2)*b*n), S(1) + (b*n*p + S(1))/(S(2)*b*n), -(c*x**n)**(S(2)*b)*exp(S(2)*a))/(b*n*p + S(1))) rubi.add(rule370) pattern371 = Pattern(Integral(csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) + S(-1)))) rule371 = ReplacementRule(pattern371, lambda p, x, a, n, b, c : x*((c*x**n)**b*exp(a)/((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(-1)))**p*(-S(2)*(c*x**n)**(S(2)*b)*exp(S(2)*a) + S(2))**p*Hypergeometric2F1(p, (b*n*p + S(1))/(S(2)*b*n), S(1) + (b*n*p + S(1))/(S(2)*b*n), (c*x**n)**(S(2)*b)*exp(S(2)*a))/(b*n*p + S(1))) rubi.add(rule371) pattern372 = Pattern(Integral(x_**WC('m', S(1))*sech(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, m, p, b: RationalQ(b, m, n, p))) rule372 = ReplacementRule(pattern372, lambda p, m, c, x, n, b : S(2)**p*Int(x**m*((c*x**n)**b/((c*x**n)**(S(2)*b) + S(1)))**p, x)) rubi.add(rule372) pattern373 = Pattern(Integral(x_**WC('m', S(1))*csch(WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda n, m, p, b: RationalQ(b, m, n, p))) rule373 = ReplacementRule(pattern373, lambda p, m, c, x, n, b : S(2)**p*Int(x**m*((c*x**n)**b/((c*x**n)**(S(2)*b) + S(-1)))**p, x)) rubi.add(rule373) pattern374 = Pattern(Integral(x_**WC('m', S(1))*sec(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, b: ZeroQ(b**S(2)*n**S(2) - (m + S(1))**S(2)))) rule374 = ReplacementRule(pattern374, lambda m, x, a, n, b, c : S(2)*Int(x**m*(c*x**n)**((m + S(1))/n)/((c*x**n)**(S(2)*(m + S(1))/n) + exp(-S(2)*a*b*n/(m + S(1)))), x)*exp(-a*b*n/(m + S(1)))) rubi.add(rule374) pattern375 = Pattern(Integral(x_**WC('m', S(1))*csc(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m, b: ZeroQ(b**S(2)*n**S(2) - (m + S(1))**S(2)))) rule375 = ReplacementRule(pattern375, lambda m, x, a, n, b, c : -S(2)*b*n*Int(x**m*(c*x**n)**((m + S(1))/n)/(-(c*x**n)**(S(2)*(m + S(1))/n) + exp(-S(2)*a*b*n/(m + S(1)))), x)*exp(-a*b*n/(m + S(1)))/(m + S(1))) rubi.add(rule375) pattern376 = Pattern(Integral(x_**WC('m', S(1))*sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + (m + S(1))**S(2))), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule376 = ReplacementRule(pattern376, lambda p, m, x, a, n, b, c : x**(m + S(1))*(p + S(-2))*sech(a + b*log(c*x**n))**(p + S(-2))/((m + S(1))*(p + S(-1))) + x**(m + S(1))*tanh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1)))) rubi.add(rule376) pattern377 = Pattern(Integral(x_**WC('m', S(1))*csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: ZeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) + (m + S(1))**S(2))), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda p: NonzeroQ(p + S(-1)))) rule377 = ReplacementRule(pattern377, lambda p, m, x, a, n, b, c : x**(m + S(1))*(-p + S(2))*csch(a + b*log(c*x**n))**(p + S(-2))/((m + S(1))*(p + S(-1))) - x**(m + S(1))*coth(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1)))) rubi.add(rule377) pattern378 = Pattern(Integral(x_**WC('m', S(1))*sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda p: Unequal(p, S(2))), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) - (m + S(1))**S(2)))) rule378 = ReplacementRule(pattern378, lambda p, m, x, a, n, b, c : x**(m + S(1))*tanh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1))) + x**(m + S(1))*(m + S(1))*sech(a + b*log(c*x**n))**(p + S(-2))/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1))) + (b**S(2)*n**S(2)*(p + S(-2))**S(2) - (m + S(1))**S(2))*Int(x**m*sech(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1)))) rubi.add(rule378) pattern379 = Pattern(Integral(x_**WC('m', S(1))*csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(1))), CustomConstraint(lambda p: Unequal(p, S(2))), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*(p + S(-2))**S(2) - (m + S(1))**S(2)))) rule379 = ReplacementRule(pattern379, lambda p, m, x, a, n, b, c : -x**(m + S(1))*coth(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(-2))/(b*n*(p + S(-1))) - x**(m + S(1))*(m + S(1))*csch(a + b*log(c*x**n))**(p + S(-2))/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1))) - (b**S(2)*n**S(2)*(p + S(-2))**S(2) - (m + S(1))**S(2))*Int(x**m*csch(a + b*log(c*x**n))**(p + S(-2)), x)/(b**S(2)*n**S(2)*(p + S(-2))*(p + S(-1)))) rubi.add(rule379) pattern380 = Pattern(Integral(x_**WC('m', S(1))*sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule380 = ReplacementRule(pattern380, lambda p, m, x, a, n, b, c : b**S(2)*n**S(2)*p*(p + S(1))*Int(x**m*sech(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) - b*n*p*x**(m + S(1))*sinh(a + b*log(c*x**n))*sech(a + b*log(c*x**n))**(p + S(1))/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*sech(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))) rubi.add(rule380) pattern381 = Pattern(Integral(x_**WC('m', S(1))*csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule381 = ReplacementRule(pattern381, lambda p, m, x, a, n, b, c : -b**S(2)*n**S(2)*p*(p + S(1))*Int(x**m*csch(a + b*log(c*x**n))**(p + S(2)), x)/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) - b*n*p*x**(m + S(1))*Cosh(a + b*log(c*x**n))*csch(a + b*log(c*x**n))**(p + S(1))/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)) + x**(m + S(1))*(-m + S(-1))*csch(a + b*log(c*x**n))**p/(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2))) rubi.add(rule381) pattern382 = Pattern(Integral(x_**WC('m', S(1))*sech(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule382 = ReplacementRule(pattern382, lambda p, m, x, a, n, b, c : S(2)**p*x**(m + S(1))*((c*x**n)**b*exp(a)/((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(1)))**p*((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(1))**p*Hypergeometric2F1(p, (b*n*p + m + S(1))/(S(2)*b*n), S(1) + (b*n*p + m + S(1))/(S(2)*b*n), -(c*x**n)**(S(2)*b)*exp(S(2)*a))/(b*n*p + m + S(1))) rubi.add(rule382) pattern383 = Pattern(Integral(x_**WC('m', S(1))*csch(WC('a', S(0)) + WC('b', S(1))*log(x_**WC('n', S(1))*WC('c', S(1))))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, m, p, b: NonzeroQ(b**S(2)*n**S(2)*p**S(2) - (m + S(1))**S(2)))) rule383 = ReplacementRule(pattern383, lambda p, m, x, a, n, b, c : S(2)**p*x**(m + S(1))*((c*x**n)**b*exp(a)/((c*x**n)**(S(2)*b)*exp(S(2)*a) + S(-1)))**p*(-(c*x**n)**(S(2)*b)*exp(S(2)*a) + S(1))**p*Hypergeometric2F1(p, (b*n*p + m + S(1))/(S(2)*b*n), S(1) + (b*n*p + m + S(1))/(S(2)*b*n), (c*x**n)**(S(2)*b)*exp(S(2)*a))/(b*n*p + m + S(1))) rubi.add(rule383) pattern384 = Pattern(Integral(log(x_*WC('b', S(1)))**WC('p', S(1))*sinh(x_*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule384 = ReplacementRule(pattern384, lambda p, x, a, b : -p*Int(log(b*x)**(p + S(-1))*sinh(a*x*log(b*x)**p), x) + Cosh(a*x*log(b*x)**p)/a) rubi.add(rule384) pattern385 = Pattern(Integral(Cosh(x_*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1)))*log(x_*WC('b', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule385 = ReplacementRule(pattern385, lambda p, x, a, b : -p*Int(Cosh(a*x*log(b*x)**p)*log(b*x)**(p + S(-1)), x) + sinh(a*x*log(b*x)**p)/a) rubi.add(rule385) pattern386 = Pattern(Integral(log(x_*WC('b', S(1)))**WC('p', S(1))*sinh(x_**n_*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, p: RationalQ(n, p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule386 = ReplacementRule(pattern386, lambda p, x, a, n, b : -p*Int(log(b*x)**(p + S(-1))*sinh(a*x**n*log(b*x)**p), x)/n + x**(-n + S(1))*Cosh(a*x**n*log(b*x)**p)/(a*n) + (n + S(-1))*Int(x**(-n)*Cosh(a*x**n*log(b*x)**p), x)/(a*n)) rubi.add(rule386) pattern387 = Pattern(Integral(Cosh(x_**n_*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1)))*log(x_*WC('b', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, p: RationalQ(n, p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule387 = ReplacementRule(pattern387, lambda p, x, a, n, b : -p*Int(Cosh(a*x**n*log(b*x)**p)*log(b*x)**(p + S(-1)), x)/n + x**(-n + S(1))*sinh(a*x**n*log(b*x)**p)/(a*n) + (n + S(-1))*Int(x**(-n)*sinh(a*x**n*log(b*x)**p), x)/(a*n)) rubi.add(rule387) pattern388 = Pattern(Integral(x_**WC('m', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1))*sinh(x_**WC('n', S(1))*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule388 = ReplacementRule(pattern388, lambda p, m, x, a, n, b : -p*Int(x**(n + S(-1))*log(b*x)**(p + S(-1))*sinh(a*x**n*log(b*x)**p), x)/n - Cosh(a*x**n*log(b*x)**p)/(a*n)) rubi.add(rule388) pattern389 = Pattern(Integral(x_**WC('m', S(1))*Cosh(x_**WC('n', S(1))*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1)))*log(x_*WC('b', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0)))) rule389 = ReplacementRule(pattern389, lambda p, m, x, a, n, b : -p*Int(x**(n + S(-1))*Cosh(a*x**n*log(b*x)**p)*log(b*x)**(p + S(-1)), x)/n + sinh(a*x**n*log(b*x)**p)/(a*n)) rubi.add(rule389) pattern390 = Pattern(Integral(x_**m_*log(x_*WC('b', S(1)))**WC('p', S(1))*sinh(x_**WC('n', S(1))*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m, p: RationalQ(m, n, p)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda n, m: NonzeroQ(m - n + S(1)))) rule390 = ReplacementRule(pattern390, lambda p, m, x, a, n, b : -p*Int(x**m*log(b*x)**(p + S(-1))*sinh(a*x**n*log(b*x)**p), x)/n + x**(m - n + S(1))*Cosh(a*x**n*log(b*x)**p)/(a*n) - (m - n + S(1))*Int(x**(m - n)*Cosh(a*x**n*log(b*x)**p), x)/(a*n)) rubi.add(rule390) pattern391 = Pattern(Integral(x_**m_*Cosh(x_**WC('n', S(1))*WC('a', S(1))*log(x_*WC('b', S(1)))**WC('p', S(1)))*log(x_*WC('b', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m, p: RationalQ(m, n, p)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda n, m: NonzeroQ(m - n + S(1)))) rule391 = ReplacementRule(pattern391, lambda p, m, x, a, n, b : -p*Int(x**m*Cosh(a*x**n*log(b*x)**p)*log(b*x)**(p + S(-1)), x)/n + x**(m - n + S(1))*sinh(a*x**n*log(b*x)**p)/(a*n) - (m - n + S(1))*Int(x**(m - n)*sinh(a*x**n*log(b*x)**p), x)/(a*n)) rubi.add(rule391) pattern392 = Pattern(Integral(sinh(WC('a', S(1))/(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule392 = ReplacementRule(pattern392, lambda x, a, d, n, c : -Subst(Int(sinh(a*x)**n/x**S(2), x), x, 1/(c + d*x))/d) rubi.add(rule392) pattern393 = Pattern(Integral(Cosh(WC('a', S(1))/(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: PositiveIntegerQ(n))) rule393 = ReplacementRule(pattern393, lambda x, a, d, n, c : -Subst(Int(Cosh(a*x)**n/x**S(2), x), x, 1/(c + d*x))/d) rubi.add(rule393) pattern394 = Pattern(Integral(sinh((x_*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule394 = ReplacementRule(pattern394, lambda e, x, a, d, n, b, c : -Subst(Int(sinh(b*e/d - e*x*(-a*d + b*c)/d)**n/x**S(2), x), x, 1/(c + d*x))/d) rubi.add(rule394) pattern395 = Pattern(Integral(Cosh((x_*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule395 = ReplacementRule(pattern395, lambda e, x, a, d, n, b, c : -Subst(Int(Cosh(b*e/d - e*x*(-a*d + b*c)/d)**n/x**S(2), x), x, 1/(c + d*x))/d) rubi.add(rule395) pattern396 = Pattern(Integral(sinh(u_)**WC('n', S(1)), x_), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda u, x: QuotientOfLinearsQ(u, x)), ) def With396(n, u, x): lst = QuotientOfLinearsParts(u, x) return Int(sinh((x*Part(lst, S(2)) + Part(lst, S(1)))/(x*Part(lst, S(4)) + Part(lst, S(3))))**n, x) rule396 = ReplacementRule(pattern396, lambda n, u, x : With396(n, u, x)) rubi.add(rule396) pattern397 = Pattern(Integral(Cosh(u_)**WC('n', S(1)), x_), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda u, x: QuotientOfLinearsQ(u, x)), ) def With397(n, u, x): lst = QuotientOfLinearsParts(u, x) return Int(Cosh((x*Part(lst, S(2)) + Part(lst, S(1)))/(x*Part(lst, S(4)) + Part(lst, S(3))))**n, x) rule397 = ReplacementRule(pattern397, lambda n, u, x : With397(n, u, x)) rubi.add(rule397) pattern398 = Pattern(Integral(WC('u', S(1))*sinh(v_)**WC('p', S(1))*sinh(w_)**WC('q', S(1)), x_), CustomConstraint(lambda v, w: ZeroQ(v - w))) rule398 = ReplacementRule(pattern398, lambda p, x, w, v, u, q : Int(u*sinh(v)**(p + q), x)) rubi.add(rule398) pattern399 = Pattern(Integral(Cosh(v_)**WC('p', S(1))*Cosh(w_)**WC('q', S(1))*WC('u', S(1)), x_), CustomConstraint(lambda v, w: ZeroQ(v - w))) rule399 = ReplacementRule(pattern399, lambda p, x, w, v, u, q : Int(u*Cosh(v)**(p + q), x)) rubi.add(rule399) pattern400 = Pattern(Integral(sinh(v_)**WC('p', S(1))*sinh(w_)**WC('q', S(1)), x_), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule400 = ReplacementRule(pattern400, lambda p, x, w, v, q : Int(ExpandTrigReduce(sinh(v)**p*sinh(w)**q, x), x)) rubi.add(rule400) pattern401 = Pattern(Integral(Cosh(v_)**WC('p', S(1))*Cosh(w_)**WC('q', S(1)), x_), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule401 = ReplacementRule(pattern401, lambda p, x, w, v, q : Int(ExpandTrigReduce(Cosh(v)**p*Cosh(w)**q, x), x)) rubi.add(rule401) pattern402 = Pattern(Integral(x_**WC('m', S(1))*sinh(v_)**WC('p', S(1))*sinh(w_)**WC('q', S(1)), x_), CustomConstraint(lambda p, m, q: PositiveIntegerQ(m, p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule402 = ReplacementRule(pattern402, lambda p, m, x, w, v, q : Int(ExpandTrigReduce(x**m, sinh(v)**p*sinh(w)**q, x), x)) rubi.add(rule402) pattern403 = Pattern(Integral(x_**WC('m', S(1))*Cosh(v_)**WC('p', S(1))*Cosh(w_)**WC('q', S(1)), x_), CustomConstraint(lambda p, m, q: PositiveIntegerQ(m, p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule403 = ReplacementRule(pattern403, lambda p, m, x, w, v, q : Int(ExpandTrigReduce(x**m, Cosh(v)**p*Cosh(w)**q, x), x)) rubi.add(rule403) pattern404 = Pattern(Integral(Cosh(w_)**WC('p', S(1))*WC('u', S(1))*sinh(v_)**WC('p', S(1)), x_), CustomConstraint(lambda v, w: ZeroQ(v - w)), CustomConstraint(lambda p: IntegerQ(p))) rule404 = ReplacementRule(pattern404, lambda p, x, w, v, u : S(2)**(-p)*Int(u*sinh(S(2)*v)**p, x)) rubi.add(rule404) pattern405 = Pattern(Integral(Cosh(w_)**WC('q', S(1))*sinh(v_)**WC('p', S(1)), x_), CustomConstraint(lambda p, q: PositiveIntegerQ(p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule405 = ReplacementRule(pattern405, lambda p, x, w, v, q : Int(ExpandTrigReduce(Cosh(w)**q*sinh(v)**p, x), x)) rubi.add(rule405) pattern406 = Pattern(Integral(x_**WC('m', S(1))*Cosh(w_)**WC('q', S(1))*sinh(v_)**WC('p', S(1)), x_), CustomConstraint(lambda p, m, q: PositiveIntegerQ(m, p, q)), CustomConstraint(lambda v, x, w: (PolynomialQ(v, x) & PolynomialQ(w, x)) | (BinomialQ(List(v, w), x) & IndependentQ(v/w, x)))) rule406 = ReplacementRule(pattern406, lambda p, m, x, w, v, q : Int(ExpandTrigReduce(x**m, Cosh(w)**q*sinh(v)**p, x), x)) rubi.add(rule406) pattern407 = Pattern(Integral(sinh(v_)*tanh(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule407 = ReplacementRule(pattern407, lambda n, v, x, w : -Cosh(v - w)*Int(tanh(w)**(n + S(-1))*sech(w), x) + Int(Cosh(v)*tanh(w)**(n + S(-1)), x)) rubi.add(rule407) pattern408 = Pattern(Integral(Cosh(v_)*coth(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule408 = ReplacementRule(pattern408, lambda n, v, x, w : Cosh(v - w)*Int(coth(w)**(n + S(-1))*csch(w), x) + Int(sinh(v)*coth(w)**(n + S(-1)), x)) rubi.add(rule408) pattern409 = Pattern(Integral(sinh(v_)*coth(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule409 = ReplacementRule(pattern409, lambda n, v, x, w : Int(Cosh(v)*coth(w)**(n + S(-1)), x) + Int(coth(w)**(n + S(-1))*csch(w), x)*sinh(v - w)) rubi.add(rule409) pattern410 = Pattern(Integral(Cosh(v_)*tanh(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule410 = ReplacementRule(pattern410, lambda n, v, x, w : Int(sinh(v)*tanh(w)**(n + S(-1)), x) - Int(tanh(w)**(n + S(-1))*sech(w), x)*sinh(v - w)) rubi.add(rule410) pattern411 = Pattern(Integral(sinh(v_)*sech(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule411 = ReplacementRule(pattern411, lambda n, v, x, w : Cosh(v - w)*Int(tanh(w)*sech(w)**(n + S(-1)), x) + Int(sech(w)**(n + S(-1)), x)*sinh(v - w)) rubi.add(rule411) pattern412 = Pattern(Integral(Cosh(v_)*csch(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule412 = ReplacementRule(pattern412, lambda n, v, x, w : Cosh(v - w)*Int(coth(w)*csch(w)**(n + S(-1)), x) + Int(csch(w)**(n + S(-1)), x)*sinh(v - w)) rubi.add(rule412) pattern413 = Pattern(Integral(sinh(v_)*csch(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule413 = ReplacementRule(pattern413, lambda n, v, x, w : Cosh(v - w)*Int(csch(w)**(n + S(-1)), x) + Int(coth(w)*csch(w)**(n + S(-1)), x)*sinh(v - w)) rubi.add(rule413) pattern414 = Pattern(Integral(Cosh(v_)*sech(w_)**WC('n', S(1)), x_), CustomConstraint(lambda v, x: FreeQ(v, x)), CustomConstraint(lambda w: FreeQ(Mul(S(-1), w), x)), CustomConstraint(lambda n: RationalQ(n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda v, w: NonzeroQ(v - w))) rule414 = ReplacementRule(pattern414, lambda n, v, x, w : Cosh(v - w)*Int(sech(w)**(n + S(-1)), x) + Int(tanh(w)*sech(w)**(n + S(-1)), x)*sinh(v - w)) rubi.add(rule414) pattern415 = Pattern(Integral((a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))))**WC('n', S(1))*(x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x))) rule415 = ReplacementRule(pattern415, lambda m, e, x, f, d, a, n, b, c : Int((a + b*sinh(S(2)*c + S(2)*d*x)/S(2))**n*(e + f*x)**m, x)) rubi.add(rule415) pattern416 = Pattern(Integral(x_**WC('m', S(1))*(a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))**S(2))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda b, a: NonzeroQ(a - b)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda m: Greater(m, S(0))), CustomConstraint(lambda n: Less(n, S(0))), CustomConstraint(lambda n, m: Equal(n, S(-1)) | (Equal(m, S(1)) & Equal(n, S(-2))))) rule416 = ReplacementRule(pattern416, lambda m, x, a, d, n, b, c : S(2)**(-n)*Int(x**m*(S(2)*a + b*Cosh(S(2)*c + S(2)*d*x) - b)**n, x)) rubi.add(rule416) pattern417 = Pattern(Integral(x_**WC('m', S(1))*(a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**S(2)*WC('b', S(1)))**n_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda b, a: NonzeroQ(a + b)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda m: Greater(m, S(0))), CustomConstraint(lambda n: Less(n, S(0))), CustomConstraint(lambda n, m: Equal(n, S(-1)) | (Equal(m, S(1)) & Equal(n, S(-2))))) rule417 = ReplacementRule(pattern417, lambda m, c, x, a, d, n, b : S(2)**(-n)*Int(x**m*(S(2)*a + b*Cosh(S(2)*c + S(2)*d*x) + b)**n, x)) rubi.add(rule417) pattern418 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh((c_ + x_*WC('d', S(1)))**n_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda p: RationalQ(p))) rule418 = ReplacementRule(pattern418, lambda p, m, c, e, x, a, f, d, n, b : d**(-m + S(-1))*Subst(Int((-c*f + d*e + f*x)**m*sinh(a + b*x**n)**p, x), x, c + d*x)) rubi.add(rule418) pattern419 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh((c_ + x_*WC('d', S(1)))**n_*WC('b', S(1)) + WC('a', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda p: RationalQ(p))) rule419 = ReplacementRule(pattern419, lambda p, m, c, e, x, a, d, f, n, b : d**(-m + S(-1))*Subst(Int((-c*f + d*e + f*x)**m*Cosh(a + b*x**n)**p, x), x, c + d*x)) rubi.add(rule419) pattern420 = Pattern(Integral((x_*WC('g', S(1)) + WC('f', S(0)))**WC('m', S(1))/(Cosh(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)*WC('b', S(1)) + WC('a', S(0)) + WC('c', S(1))*sinh(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda b, a: NonzeroQ(a + b)), CustomConstraint(lambda c, a: NonzeroQ(a + c))) rule420 = ReplacementRule(pattern420, lambda m, c, e, x, a, d, f, g, b : S(2)*Int((f + g*x)**m/(S(2)*a + b - c + (b + c)*Cosh(S(2)*d + S(2)*e*x)), x)) rubi.add(rule420) pattern421 = Pattern(Integral((x_*WC('g', S(1)) + WC('f', S(0)))**WC('m', S(1))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)/(b_ + WC('c', S(1))*tanh(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule421 = ReplacementRule(pattern421, lambda m, e, x, f, d, g, b, c : S(2)*Int((f + g*x)**m/(b - c + (b + c)*Cosh(S(2)*d + S(2)*e*x)), x)) rubi.add(rule421) pattern422 = Pattern(Integral((x_*WC('g', S(1)) + WC('f', S(0)))**WC('m', S(1))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)/(WC('a', S(1))*sech(x_*WC('e', S(1)) + WC('d', S(0)))**S(2) + WC('b', S(0)) + WC('c', S(1))*tanh(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda b, a: NonzeroQ(a + b)), CustomConstraint(lambda c, a: NonzeroQ(a + c))) rule422 = ReplacementRule(pattern422, lambda m, c, e, x, f, d, a, g, b : S(2)*Int((f + g*x)**m/(S(2)*a + b - c + (b + c)*Cosh(S(2)*d + S(2)*e*x)), x)) rubi.add(rule422) pattern423 = Pattern(Integral((x_*WC('g', S(1)) + WC('f', S(0)))**WC('m', S(1))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)/(c_ + WC('b', S(1))*coth(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)), x_), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule423 = ReplacementRule(pattern423, lambda m, c, e, x, f, d, g, b : S(2)*Int((f + g*x)**m/(b - c + (b + c)*Cosh(S(2)*d + S(2)*e*x)), x)) rubi.add(rule423) pattern424 = Pattern(Integral((x_*WC('g', S(1)) + WC('f', S(0)))**WC('m', S(1))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**S(2)/(WC('a', S(1))*csch(x_*WC('e', S(1)) + WC('d', S(0)))**S(2) + WC('b', S(1))*coth(x_*WC('e', S(1)) + WC('d', S(0)))**S(2) + WC('c', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda b, a: NonzeroQ(a + b)), CustomConstraint(lambda c, a: NonzeroQ(a + c))) rule424 = ReplacementRule(pattern424, lambda m, e, x, a, d, f, g, b, c : S(2)*Int((f + g*x)**m/(S(2)*a + b - c + (b + c)*Cosh(S(2)*d + S(2)*e*x)), x)) rubi.add(rule424) pattern425 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))/(a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule425 = ReplacementRule(pattern425, lambda m, e, x, f, d, a, b, c : Int((e + f*x)**m*exp(c + d*x)/(a + b*exp(c + d*x) - Rt(a**S(2) + b**S(2), S(2))), x) + Int((e + f*x)**m*exp(c + d*x)/(a + b*exp(c + d*x) + Rt(a**S(2) + b**S(2), S(2))), x) - (e + f*x)**(m + S(1))/(b*f*(m + S(1)))) rubi.add(rule425) pattern426 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))/(a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m))) rule426 = ReplacementRule(pattern426, lambda m, c, e, x, f, d, a, b : Int((e + f*x)**m*exp(c + d*x)/(a + b*exp(c + d*x) - Rt(a**S(2) - b**S(2), S(2))), x) + Int((e + f*x)**m*exp(c + d*x)/(a + b*exp(c + d*x) + Rt(a**S(2) - b**S(2), S(2))), x) - (e + f*x)**(m + S(1))/(b*f*(m + S(1)))) rubi.add(rule426) pattern427 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**n_/(a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda b, a: ZeroQ(a**S(2) + b**S(2)))) rule427 = ReplacementRule(pattern427, lambda m, e, x, f, d, a, n, b, c : Int((e + f*x)**m*Cosh(c + d*x)**(n + S(-2))*sinh(c + d*x), x)/b + Int((e + f*x)**m*Cosh(c + d*x)**(n + S(-2)), x)/a) rubi.add(rule427) pattern428 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))**n_/(a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule428 = ReplacementRule(pattern428, lambda m, c, e, x, f, d, a, n, b : Int((e + f*x)**m*Cosh(c + d*x)*sinh(c + d*x)**(n + S(-2)), x)/b + Int((e + f*x)**m*sinh(c + d*x)**(n + S(-2)), x)/a) rubi.add(rule428) pattern429 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**n_/(a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) + b**S(2)))) rule429 = ReplacementRule(pattern429, lambda m, e, x, f, d, a, n, b, c : -a*Int((e + f*x)**m*Cosh(c + d*x)**(n + S(-2)), x)/b**S(2) + Int((e + f*x)**m*Cosh(c + d*x)**(n + S(-2))*sinh(c + d*x), x)/b + (a**S(2) + b**S(2))*Int((e + f*x)**m*Cosh(c + d*x)**(n + S(-2))/(a + b*sinh(c + d*x)), x)/b**S(2)) rubi.add(rule429) pattern430 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))**n_/(a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda m: PositiveIntegerQ(m)), CustomConstraint(lambda n: IntegerQ(n)), CustomConstraint(lambda n: Greater(n, S(1))), CustomConstraint(lambda b, a: NonzeroQ(a**S(2) - b**S(2)))) rule430 = ReplacementRule(pattern430, lambda m, c, e, x, f, d, a, n, b : -a*Int((e + f*x)**m*sinh(c + d*x)**(n + S(-2)), x)/b**S(2) + Int((e + f*x)**m*Cosh(c + d*x)*sinh(c + d*x)**(n + S(-2)), x)/b + (a**S(2) - b**S(2))*Int((e + f*x)**m*sinh(c + d*x)**(n + S(-2))/(a + b*Cosh(c + d*x)), x)/b**S(2)) rubi.add(rule430) pattern431 = Pattern(Integral((A_ + WC('B', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))))*(x_*WC('f', S(1)) + WC('e', S(0)))/(a_ + WC('b', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0))))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda A, B, b, a: ZeroQ(A*a + B*b))) rule431 = ReplacementRule(pattern431, lambda A, e, x, f, d, a, b, B, c : -B*f*Int(Cosh(c + d*x)/(a + b*sinh(c + d*x)), x)/(a*d) + B*(e + f*x)*Cosh(c + d*x)/(a*d*(a + b*sinh(c + d*x)))) rubi.add(rule431) pattern432 = Pattern(Integral((A_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('B', S(1)))*(x_*WC('f', S(1)) + WC('e', S(0)))/(a_ + Cosh(x_*WC('d', S(1)) + WC('c', S(0)))*WC('b', S(1)))**S(2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda A, B, b, a: ZeroQ(A*a - B*b))) rule432 = ReplacementRule(pattern432, lambda A, c, e, x, f, d, a, B, b : -B*f*Int(sinh(c + d*x)/(a + b*Cosh(c + d*x)), x)/(a*d) + B*(e + f*x)*sinh(c + d*x)/(a*d*(a + b*Cosh(c + d*x)))) rubi.add(rule432) pattern433 = Pattern(Integral((a_ + WC('b', S(1))*tanh(v_))**WC('n', S(1))*sech(v_)**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda n, m: Equal(m + n, S(0))), CustomConstraint(lambda m: OddQ(m))) rule433 = ReplacementRule(pattern433, lambda m, x, a, n, v, b : Int((a*Cosh(v) + b*sinh(v))**n, x)) rubi.add(rule433) pattern434 = Pattern(Integral((a_ + WC('b', S(1))*coth(v_))**WC('n', S(1))*csch(v_)**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, m: IntegersQ(m, n)), CustomConstraint(lambda n, m: Equal(m + n, S(0))), CustomConstraint(lambda m: OddQ(m))) rule434 = ReplacementRule(pattern434, lambda m, x, a, n, v, b : Int((a*sinh(v) + b*Cosh(v))**n, x)) rubi.add(rule434) pattern435 = Pattern(Integral(WC('u', S(1))*sinh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1))*sinh(x_*WC('d', S(1)) + WC('c', S(0)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule435 = ReplacementRule(pattern435, lambda m, x, a, d, n, u, b, c : Int(ExpandTrigReduce(u, sinh(a + b*x)**m*sinh(c + d*x)**n, x), x)) rubi.add(rule435) pattern436 = Pattern(Integral(Cosh(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1))*Cosh(x_*WC('d', S(1)) + WC('c', S(0)))**WC('n', S(1))*WC('u', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda n, m: PositiveIntegerQ(m, n))) rule436 = ReplacementRule(pattern436, lambda m, x, a, d, n, b, u, c : Int(ExpandTrigReduce(u, Cosh(a + b*x)**m*Cosh(c + d*x)**n, x), x)) rubi.add(rule436) pattern437 = Pattern(Integral(sech(c_ + x_*WC('d', S(1)))*sech(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda d, b: ZeroQ(b**S(2) - d**S(2))), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule437 = ReplacementRule(pattern437, lambda x, a, d, b, c : -Int(tanh(a + b*x), x)*csch((-a*d + b*c)/d) + Int(tanh(c + d*x), x)*csch((-a*d + b*c)/b)) rubi.add(rule437) pattern438 = Pattern(Integral(csch(c_ + x_*WC('d', S(1)))*csch(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda d, b: ZeroQ(b**S(2) - d**S(2))), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule438 = ReplacementRule(pattern438, lambda x, a, d, b, c : Int(coth(a + b*x), x)*csch((-a*d + b*c)/b) - Int(coth(c + d*x), x)*csch((-a*d + b*c)/d)) rubi.add(rule438) pattern439 = Pattern(Integral(tanh(c_ + x_*WC('d', S(1)))*tanh(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda d, b: ZeroQ(b**S(2) - d**S(2))), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule439 = ReplacementRule(pattern439, lambda x, a, d, b, c : b*x/d - b*Cosh((-a*d + b*c)/d)*Int(sech(a + b*x)*sech(c + d*x), x)/d) rubi.add(rule439) pattern440 = Pattern(Integral(coth(c_ + x_*WC('d', S(1)))*coth(x_*WC('b', S(1)) + WC('a', S(0))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda d, b: ZeroQ(b**S(2) - d**S(2))), CustomConstraint(lambda d, c, a, b: NonzeroQ(-a*d + b*c))) rule440 = ReplacementRule(pattern440, lambda x, a, d, b, c : b*x/d + Cosh((-a*d + b*c)/d)*Int(csch(a + b*x)*csch(c + d*x), x)) rubi.add(rule440) pattern441 = Pattern(Integral((Cosh(v_)*WC('a', S(1)) + WC('b', S(1))*sinh(v_))**WC('n', S(1))*WC('u', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda b, a: ZeroQ(a**S(2) - b**S(2)))) rule441 = ReplacementRule(pattern441, lambda x, a, n, v, u, b : Int(u*(a*exp(a*v/b))**n, x)) rubi.add(rule441) return rubi
168.992973
6,553
0.590928
58,376
312,637
3.132023
0.024873
0.372653
0.325058
0.011212
0.842853
0.839429
0.835967
0.830082
0.822944
0.812804
0
0.037411
0.132796
312,637
1,849
6,554
169.08437
0.636958
0
0
0.014968
0
0
0.007593
0.000099
0
0
0
0
0
1
0.015681
false
0
0.00784
0
0.039202
0
0
0
0
null
1
1
0
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
81abee3b092f13cd9c71d75f75376475e917729a
7,324
py
Python
rest_api/migrations/0010_auto_20201112_1718.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
2
2021-10-01T16:11:20.000Z
2022-01-15T10:55:40.000Z
rest_api/migrations/0010_auto_20201112_1718.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
3
2021-06-10T19:17:55.000Z
2022-03-05T08:37:46.000Z
rest_api/migrations/0010_auto_20201112_1718.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
1
2022-03-05T08:37:53.000Z
2022-03-05T08:37:53.000Z
# Generated by Django 3.0.7 on 2020-11-12 20:18 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('rest_api', '0009_auto_20201112_1716'), ] operations = [ migrations.AlterField( model_name='agency', name='agency_email', field=models.EmailField(blank=True, max_length=255, null=True), ), migrations.AlterField( model_name='agency', name='agency_fare_url', field=models.URLField(blank=True, max_length=255, null=True), ), migrations.AlterField( model_name='agency', name='agency_lang', field=models.CharField(blank=True, max_length=10, null=True), ), migrations.AlterField( model_name='agency', name='agency_phone', field=models.CharField(blank=True, max_length=20, null=True), ), migrations.AlterField( model_name='fareattribute', name='transfers', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='route', name='route_color', field=models.CharField(blank=True, max_length=10, null=True), ), migrations.AlterField( model_name='route', name='route_desc', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='route', name='route_id', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='route', name='route_long_name', field=models.CharField(blank=True, max_length=200, null=True), ), migrations.AlterField( model_name='route', name='route_short_name', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='route', name='route_text_color', field=models.CharField(blank=True, max_length=10, null=True), ), migrations.AlterField( model_name='route', name='route_url', field=models.URLField(blank=True, null=True), ), migrations.AlterField( model_name='stop', name='level', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='rest_api.Level'), ), migrations.AlterField( model_name='stop', name='location_type', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='stop', name='parent_station', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='rest_api.Stop'), ), migrations.AlterField( model_name='stop', name='platform_code', field=models.CharField(blank=True, max_length=200, null=True), ), migrations.AlterField( model_name='stop', name='stop_code', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='stop', name='stop_desc', field=models.CharField(blank=True, max_length=200, null=True), ), migrations.AlterField( model_name='stop', name='stop_timezone', field=models.CharField(blank=True, max_length=200, null=True), ), migrations.AlterField( model_name='stop', name='stop_url', field=models.URLField(blank=True, null=True), ), migrations.AlterField( model_name='stop', name='wheelchair_boarding', field=models.CharField(blank=True, max_length=200, null=True), ), migrations.AlterField( model_name='stop', name='zone_id', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='stoptime', name='arrival_time', field=models.TimeField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='continuous_dropoff', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='continuous_pickup', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='departure_time', field=models.TimeField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='drop_off_type', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='pickup_type', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='shape_dist_traveled', field=models.FloatField(blank=True, null=True), ), migrations.AlterField( model_name='stoptime', name='stop_headsign', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='stoptime', name='timepoint', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='transfer', name='min_transfer_time', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='trip', name='bikes_allowed', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='trip', name='block_id', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='trip', name='direction_id', field=models.BooleanField(blank=True, null=True), ), migrations.AlterField( model_name='trip', name='shape', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='rest_api.Shape'), ), migrations.AlterField( model_name='trip', name='trip_headsign', field=models.CharField(blank=True, max_length=100, null=True), ), migrations.AlterField( model_name='trip', name='trip_short_name', field=models.CharField(blank=True, max_length=50, null=True), ), migrations.AlterField( model_name='trip', name='wheelchair_accessible', field=models.IntegerField(blank=True, null=True), ), ]
34.87619
126
0.55953
719
7,324
5.541029
0.143255
0.195783
0.244729
0.283886
0.862952
0.862952
0.829568
0.7874
0.75753
0.743474
0
0.015863
0.320044
7,324
209
127
35.043062
0.784137
0.006144
0
0.714286
1
0
0.106637
0.006046
0
0
0
0
0
1
0
false
0
0.009852
0
0.024631
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
81bf13112d29e0ce10b612d15abc2b5cdbb7a730
99,858
py
Python
openprocurement/auctions/insider/tests/tender.py
kukirokuk/dutchsales
41f6fca69c8ecd9dd4c4bba567635b418d371203
[ "Apache-2.0" ]
null
null
null
openprocurement/auctions/insider/tests/tender.py
kukirokuk/dutchsales
41f6fca69c8ecd9dd4c4bba567635b418d371203
[ "Apache-2.0" ]
null
null
null
openprocurement/auctions/insider/tests/tender.py
kukirokuk/dutchsales
41f6fca69c8ecd9dd4c4bba567635b418d371203
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- import unittest from copy import deepcopy from datetime import timedelta, time from uuid import uuid4 from iso8601 import parse_date from openprocurement.api.utils import ROUTE_PREFIX from openprocurement.api.models import get_now, SANDBOX_MODE, TZ from openprocurement.auctions.insider.models import DGFOtherAssets, DGFFinancialAssets, DGF_ID_REQUIRED_FROM from openprocurement.auctions.insider.tests.base import ( test_auction_data, test_financial_auction_data, test_organization, test_financial_organization, BaseWebTest, BaseAuctionWebTest, test_financial_auction_data_with_schema, test_auction_data_with_schema) class AuctionTest(BaseWebTest): auction = DGFOtherAssets initial_data = test_auction_data def test_simple_add_auction(self): u = self.auction(self.initial_data) u.auctionID = "UA-EA-X" assert u.id is None assert u.rev is None u.store(self.db) assert u.id is not None assert u.rev is not None fromdb = self.db.get(u.id) assert u.auctionID == fromdb['auctionID'] assert u.doc_type == "Auction" u.delete_instance(self.db) def test_create_role(self): fields = set([ 'awardCriteriaDetails', 'awardCriteriaDetails_en', 'awardCriteriaDetails_ru', 'description', 'description_en', 'description_ru', 'dgfID', 'tenderAttempts', 'features', 'guarantee', 'hasEnquiries', 'items', 'lots', 'minimalStep', 'mode', 'procurementMethodRationale', 'procurementMethodRationale_en', 'procurementMethodRationale_ru', 'procurementMethodType', 'procuringEntity', 'submissionMethodDetails', 'submissionMethodDetails_en', 'submissionMethodDetails_ru', 'title', 'title_en', 'title_ru', 'value', 'auctionPeriod', 'dgfDecisionDate', 'dgfDecisionID', ]) if SANDBOX_MODE: fields.add('procurementMethodDetails') self.assertEqual(set(self.auction._fields) - self.auction._options.roles['create'].fields, fields) def test_edit_role(self): fields = set([ 'features', 'hasEnquiries', 'description', 'description_en', 'description_ru', 'title', 'title_en', 'title_ru', 'dgfID', 'dgfDecisionDate', 'dgfDecisionID', 'tenderAttempts', ]) if SANDBOX_MODE: fields.add('procurementMethodDetails') self.assertEqual(set(self.auction._fields) - self.auction._options.roles['edit_active.tendering'].fields, fields) class AuctionResourceTest(BaseWebTest): initial_data = test_auction_data initial_organization = test_organization def test_empty_listing(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], []) self.assertNotIn('{\n "', response.body) self.assertNotIn('callback({', response.body) self.assertEqual(response.json['next_page']['offset'], '') self.assertNotIn('prev_page', response.json) response = self.app.get('/auctions?opt_jsonp=callback') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/javascript') self.assertNotIn('{\n "', response.body) self.assertIn('callback({', response.body) response = self.app.get('/auctions?opt_pretty=1') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertIn('{\n "', response.body) self.assertNotIn('callback({', response.body) response = self.app.get('/auctions?opt_jsonp=callback&opt_pretty=1') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/javascript') self.assertIn('{\n "', response.body) self.assertIn('callback({', response.body) response = self.app.get('/auctions?offset=2015-01-01T00:00:00+02:00&descending=1&limit=10') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], []) self.assertIn('descending=1', response.json['next_page']['uri']) self.assertIn('limit=10', response.json['next_page']['uri']) self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertIn('limit=10', response.json['prev_page']['uri']) response = self.app.get('/auctions?feed=changes') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], []) self.assertEqual(response.json['next_page']['offset'], '') self.assertNotIn('prev_page', response.json) response = self.app.get('/auctions?feed=changes&offset=0', status=404) self.assertEqual(response.status, '404 Not Found') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Offset expired/invalid', u'location': u'params', u'name': u'offset'} ]) response = self.app.get('/auctions?feed=changes&descending=1&limit=10') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], []) self.assertIn('descending=1', response.json['next_page']['uri']) self.assertIn('limit=10', response.json['next_page']['uri']) self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertIn('limit=10', response.json['prev_page']['uri']) def test_listing(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) auctions = [] for i in range(3): offset = get_now().isoformat() response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auctions.append(response.json['data']) ids = ','.join([i['id'] for i in auctions]) while True: response = self.app.get('/auctions') self.assertTrue(ids.startswith(','.join([i['id'] for i in response.json['data']]))) if len(response.json['data']) == 3: break self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified'])) self.assertEqual(set([i['id'] for i in response.json['data']]), set([i['id'] for i in auctions])) self.assertEqual(set([i['dateModified'] for i in response.json['data']]), set([i['dateModified'] for i in auctions])) self.assertEqual([i['dateModified'] for i in response.json['data']], sorted([i['dateModified'] for i in auctions])) while True: response = self.app.get('/auctions?offset={}'.format(offset)) self.assertEqual(response.status, '200 OK') if len(response.json['data']) == 1: break self.assertEqual(len(response.json['data']), 1) response = self.app.get('/auctions?limit=2') self.assertEqual(response.status, '200 OK') self.assertNotIn('prev_page', response.json) self.assertEqual(len(response.json['data']), 2) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 1) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 0) response = self.app.get('/auctions', params=[('opt_fields', 'status')]) self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified', u'status'])) self.assertIn('opt_fields=status', response.json['next_page']['uri']) response = self.app.get('/auctions', params=[('opt_fields', 'status,enquiryPeriod')]) self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified', u'status', u'enquiryPeriod'])) self.assertIn('opt_fields=status%2CenquiryPeriod', response.json['next_page']['uri']) response = self.app.get('/auctions?descending=1') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified'])) self.assertEqual(set([i['id'] for i in response.json['data']]), set([i['id'] for i in auctions])) self.assertEqual([i['dateModified'] for i in response.json['data']], sorted([i['dateModified'] for i in auctions], reverse=True)) response = self.app.get('/auctions?descending=1&limit=2') self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 2) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 1) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 0) test_auction_data2 = self.initial_data.copy() test_auction_data2['mode'] = 'test' response = self.app.post_json('/auctions', {'data': test_auction_data2}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') while True: response = self.app.get('/auctions?mode=test') self.assertEqual(response.status, '200 OK') if len(response.json['data']) == 1: break self.assertEqual(len(response.json['data']), 1) response = self.app.get('/auctions?mode=_all_') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 4) def test_listing_changes(self): response = self.app.get('/auctions?feed=changes') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) auctions = [] for i in range(3): response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auctions.append(response.json['data']) ids = ','.join([i['id'] for i in auctions]) while True: response = self.app.get('/auctions?feed=changes') self.assertTrue(ids.startswith(','.join([i['id'] for i in response.json['data']]))) if len(response.json['data']) == 3: break self.assertEqual(','.join([i['id'] for i in response.json['data']]), ids) self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified'])) self.assertEqual(set([i['id'] for i in response.json['data']]), set([i['id'] for i in auctions])) self.assertEqual(set([i['dateModified'] for i in response.json['data']]), set([i['dateModified'] for i in auctions])) self.assertEqual([i['dateModified'] for i in response.json['data']], sorted([i['dateModified'] for i in auctions])) response = self.app.get('/auctions?feed=changes&limit=2') self.assertEqual(response.status, '200 OK') self.assertNotIn('prev_page', response.json) self.assertEqual(len(response.json['data']), 2) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 1) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 0) response = self.app.get('/auctions?feed=changes', params=[('opt_fields', 'status')]) self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified', u'status'])) self.assertIn('opt_fields=status', response.json['next_page']['uri']) response = self.app.get('/auctions?feed=changes', params=[('opt_fields', 'status,enquiryPeriod')]) self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified', u'status', u'enquiryPeriod'])) self.assertIn('opt_fields=status%2CenquiryPeriod', response.json['next_page']['uri']) response = self.app.get('/auctions?feed=changes&descending=1') self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified'])) self.assertEqual(set([i['id'] for i in response.json['data']]), set([i['id'] for i in auctions])) self.assertEqual([i['dateModified'] for i in response.json['data']], sorted([i['dateModified'] for i in auctions], reverse=True)) response = self.app.get('/auctions?feed=changes&descending=1&limit=2') self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 2) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 1) response = self.app.get(response.json['next_page']['path'].replace(ROUTE_PREFIX, '')) self.assertEqual(response.status, '200 OK') self.assertNotIn('descending=1', response.json['prev_page']['uri']) self.assertEqual(len(response.json['data']), 0) test_auction_data2 = self.initial_data.copy() test_auction_data2['mode'] = 'test' response = self.app.post_json('/auctions', {'data': test_auction_data2}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') while True: response = self.app.get('/auctions?feed=changes&mode=test') self.assertEqual(response.status, '200 OK') if len(response.json['data']) == 1: break self.assertEqual(len(response.json['data']), 1) response = self.app.get('/auctions?feed=changes&mode=_all_') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 4) def test_listing_draft(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) auctions = [] data = self.initial_data.copy() data.update({'status': 'draft'}) for i in range(3): response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auctions.append(response.json['data']) response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') ids = ','.join([i['id'] for i in auctions]) while True: response = self.app.get('/auctions') self.assertTrue(ids.startswith(','.join([i['id'] for i in response.json['data']]))) if len(response.json['data']) == 3: break self.assertEqual(len(response.json['data']), 3) self.assertEqual(set(response.json['data'][0]), set([u'id', u'dateModified'])) self.assertEqual(set([i['id'] for i in response.json['data']]), set([i['id'] for i in auctions])) self.assertEqual(set([i['dateModified'] for i in response.json['data']]), set([i['dateModified'] for i in auctions])) self.assertEqual([i['dateModified'] for i in response.json['data']], sorted([i['dateModified'] for i in auctions])) def test_create_auction_invalid(self): request_path = '/auctions' response = self.app.post(request_path, 'data', status=415) self.assertEqual(response.status, '415 Unsupported Media Type') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u"Content-Type header should be one of ['application/json']", u'location': u'header', u'name': u'Content-Type'} ]) response = self.app.post( request_path, 'data', content_type='application/json', status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'No JSON object could be decoded', u'location': u'body', u'name': u'data'} ]) response = self.app.post_json(request_path, 'data', status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Data not available', u'location': u'body', u'name': u'data'} ]) response = self.app.post_json(request_path, {'not_data': {}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Data not available', u'location': u'body', u'name': u'data'} ]) response = self.app.post_json(request_path, {'data': []}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Data not available', u'location': u'body', u'name': u'data'} ]) response = self.app.post_json(request_path, {'data': {'procurementMethodType': 'invalid_value'}}, status=415) self.assertEqual(response.status, '415 Unsupported Media Type') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Not implemented', u'location': u'data', u'name': u'procurementMethodType'} ]) response = self.app.post_json(request_path, {'data': {'invalid_field': 'invalid_value', 'procurementMethodType': self.initial_data['procurementMethodType']}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Rogue field', u'location': u'body', u'name': u'invalid_field'} ]) response = self.app.post_json(request_path, {'data': {'value': 'invalid_value', 'procurementMethodType': self.initial_data['procurementMethodType']}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [ u'Please use a mapping for this field or Value instance instead of unicode.'], u'location': u'body', u'name': u'value'} ]) response = self.app.post_json(request_path, {'data': {'procurementMethod': 'invalid_value', 'procurementMethodType': self.initial_data['procurementMethodType']}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertIn({u'description': [u"Value must be one of ['open', 'selective', 'limited']."], u'location': u'body', u'name': u'procurementMethod'}, response.json['errors']) #self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'tenderPeriod'}, response.json['errors']) self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'minimalStep'}, response.json['errors']) self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'items'}, response.json['errors']) #self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'enquiryPeriod'}, response.json['errors']) self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'value'}, response.json['errors']) self.assertIn({u'description': [u'This field is required.'], u'location': u'body', u'name': u'items'}, response.json['errors']) response = self.app.post_json(request_path, {'data': {'enquiryPeriod': {'endDate': 'invalid_value'}, 'procurementMethodType': self.initial_data['procurementMethodType']}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': {u'endDate': [u"Could not parse invalid_value. Should be ISO8601."]}, u'location': u'body', u'name': u'enquiryPeriod'} ]) response = self.app.post_json(request_path, {'data': {'enquiryPeriod': {'endDate': '9999-12-31T23:59:59.999999'}, 'procurementMethodType': self.initial_data['procurementMethodType']}}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': {u'endDate': [u'date value out of range']}, u'location': u'body', u'name': u'enquiryPeriod'} ]) self.initial_data['tenderPeriod'] = self.initial_data.pop('auctionPeriod') response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data['auctionPeriod'] = self.initial_data.pop('tenderPeriod') self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': {u'startDate': [u'This field is required.']}, u'location': u'body', u'name': u'auctionPeriod'} ]) self.initial_data['tenderPeriod'] = {'startDate': '2014-10-31T00:00:00', 'endDate': '2014-10-01T00:00:00'} response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data.pop('tenderPeriod') self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': {u'startDate': [u'period should begin before its end']}, u'location': u'body', u'name': u'tenderPeriod'} ]) #data = self.initial_data['tenderPeriod'] #self.initial_data['tenderPeriod'] = {'startDate': '2014-10-31T00:00:00', 'endDate': '2015-10-01T00:00:00'} #response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) #self.initial_data['tenderPeriod'] = data #self.assertEqual(response.status, '422 Unprocessable Entity') #self.assertEqual(response.content_type, 'application/json') #self.assertEqual(response.json['status'], 'error') #self.assertEqual(response.json['errors'], [ #{u'description': [u'period should begin after enquiryPeriod'], u'location': u'body', u'name': u'tenderPeriod'} #]) now = get_now() #self.initial_data['awardPeriod'] = {'startDate': now.isoformat(), 'endDate': now.isoformat()} #response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) #del self.initial_data['awardPeriod'] #self.assertEqual(response.status, '422 Unprocessable Entity') #self.assertEqual(response.content_type, 'application/json') #self.assertEqual(response.json['status'], 'error') #self.assertEqual(response.json['errors'], [ #{u'description': [u'period should begin after tenderPeriod'], u'location': u'body', u'name': u'awardPeriod'} #]) data = self.initial_data['auctionPeriod'] self.initial_data['auctionPeriod'] = {'startDate': (now + timedelta(days=15)).isoformat(), 'endDate': (now + timedelta(days=15)).isoformat()} self.initial_data['awardPeriod'] = {'startDate': (now + timedelta(days=14)).isoformat(), 'endDate': (now + timedelta(days=14)).isoformat()} response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data['auctionPeriod'] = data del self.initial_data['awardPeriod'] self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'period should begin after auctionPeriod'], u'location': u'body', u'name': u'awardPeriod'} ]) data = self.initial_data['minimalStep'] self.initial_data['minimalStep'] = {'amount': '1000.0'} response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data['minimalStep'] = data self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'value should be less than value of auction'], u'location': u'body', u'name': u'minimalStep'} ]) data = self.initial_data['minimalStep'] self.initial_data['minimalStep'] = {'amount': '100.0', 'valueAddedTaxIncluded': False} response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data['minimalStep'] = data self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'valueAddedTaxIncluded should be identical to valueAddedTaxIncluded of value of auction'], u'location': u'body', u'name': u'minimalStep'} ]) data = self.initial_data['minimalStep'] self.initial_data['minimalStep'] = {'amount': '100.0', 'currency': "USD"} response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data['minimalStep'] = data self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'currency should be identical to currency of value of auction'], u'location': u'body', u'name': u'minimalStep'} ]) auction_data = deepcopy(self.initial_data) auction_data['value'] = {'amount': '100.0', 'currency': "USD"} auction_data['minimalStep'] = {'amount': '5.0', 'currency': "USD"} response = self.app.post_json(request_path, {'data': auction_data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'currency should be only UAH'], u'location': u'body', u'name': u'value'} ]) data = self.initial_data["procuringEntity"]["contactPoint"]["telephone"] del self.initial_data["procuringEntity"]["contactPoint"]["telephone"] response = self.app.post_json(request_path, {'data': self.initial_data}, status=422) self.initial_data["procuringEntity"]["contactPoint"]["telephone"] = data self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': {u'contactPoint': {u'email': [u'telephone or email should be present']}}, u'location': u'body', u'name': u'procuringEntity'} ]) @unittest.skipIf(get_now() < DGF_ID_REQUIRED_FROM, "Can`t create auction without dgfID only from {}".format(DGF_ID_REQUIRED_FROM)) def test_required_dgf_id(self): data = self.initial_data.copy() del data['dgfID'] response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [{"location": "body", "name": "dgfID", "description": ["This field is required."]}]) data['dgfID'] = self.initial_data['dgfID'] response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertIn('dgfID', auction) self.assertEqual(data['dgfID'], auction['dgfID']) def test_create_auction_auctionPeriod(self): data = self.initial_data.copy() #tenderPeriod = data.pop('tenderPeriod') #data['auctionPeriod'] = {'startDate': tenderPeriod['endDate']} response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertIn('tenderPeriod', auction) self.assertIn('auctionPeriod', auction) self.assertNotIn('startDate', auction['auctionPeriod']) self.assertEqual(parse_date(data['auctionPeriod']['startDate']).date(), parse_date(auction['auctionPeriod']['shouldStartAfter'], TZ).date()) if SANDBOX_MODE: auction_startDate = parse_date(data['auctionPeriod']['startDate'], None) if not auction_startDate.tzinfo: auction_startDate = TZ.localize(auction_startDate) tender_endDate = parse_date(auction['tenderPeriod']['endDate'], None) if not tender_endDate.tzinfo: tender_endDate = TZ.localize(tender_endDate) self.assertLessEqual((auction_startDate - tender_endDate).total_seconds(), 70) else: self.assertEqual(parse_date(auction['tenderPeriod']['endDate']).date(), parse_date(data['auctionPeriod']['startDate'], TZ).date() - timedelta(days=1)) self.assertEqual(parse_date(auction['tenderPeriod']['endDate']).time(), time(20, 0)) def test_create_auction_generated(self): data = self.initial_data.copy() #del data['awardPeriod'] data.update({'id': 'hash', 'doc_id': 'hash2', 'auctionID': 'hash3'}) response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] if 'procurementMethodDetails' in auction: auction.pop('procurementMethodDetails') self.assertEqual(set(auction), set([ u'procurementMethodType', u'id', u'date', u'dateModified', u'auctionID', u'status', u'enquiryPeriod', u'tenderPeriod', u'minimalStep', u'items', u'value', u'procuringEntity', u'next_check', u'dgfID', u'procurementMethod', u'awardCriteria', u'submissionMethod', u'title', u'owner', u'auctionPeriod', u'dgfDecisionDate', u'dgfDecisionID', u'documents', u'tenderAttempts', ])) self.assertNotEqual(data['id'], auction['id']) self.assertNotEqual(data['doc_id'], auction['id']) self.assertNotEqual(data['auctionID'], auction['auctionID']) def test_create_auction_draft(self): data = self.initial_data.copy() data.update({'status': 'draft'}) response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertEqual(auction['status'], 'draft') response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'value': {'amount': 100}}}, status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u"Can't update auction in current (draft) status", u'location': u'body', u'name': u'data'} ]) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'status': 'active.tendering'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertEqual(auction['status'], 'active.tendering') response = self.app.get('/auctions/{}'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertEqual(auction['status'], 'active.tendering') def test_create_auction(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) response = self.app.post_json('/auctions', {"data": self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] if self.initial_organization == test_financial_organization: self.assertEqual(set(auction) - set(self.initial_data), set([ u'id', u'dateModified', u'auctionID', u'date', u'status', u'procurementMethod', 'documents', u'awardCriteria', u'submissionMethod', u'next_check', u'owner', u'enquiryPeriod', u'tenderPeriod', u'eligibilityCriteria_en', u'eligibilityCriteria', u'eligibilityCriteria_ru', ])) else: self.assertEqual(set(auction) - set(self.initial_data), set([ u'id', u'dateModified', u'auctionID', u'date', u'status', u'procurementMethod', 'documents', u'awardCriteria', u'submissionMethod', u'next_check', u'owner', u'enquiryPeriod', u'tenderPeriod', ])) self.assertIn(auction['id'], response.headers['Location']) response = self.app.get('/auctions/{}'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(set(response.json['data']), set(auction)) self.assertEqual(response.json['data'], auction) response = self.app.post_json('/auctions?opt_jsonp=callback', {"data": self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/javascript') self.assertIn('callback({"', response.body) response = self.app.post_json('/auctions?opt_pretty=1', {"data": self.initial_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') self.assertIn('{\n "', response.body) response = self.app.post_json('/auctions', {"data": self.initial_data, "options": {"pretty": True}}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') self.assertIn('{\n "', response.body) auction_data = deepcopy(self.initial_data) auction_data['guarantee'] = {"amount": 100500, "currency": "USD"} response = self.app.post_json('/auctions', {'data': auction_data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') data = response.json['data'] self.assertIn('guarantee', data) self.assertEqual(data['guarantee']['amount'], 100500) self.assertEqual(data['guarantee']['currency'], "USD") def test_get_auction(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') auction = response.json['data'] response = self.app.get('/auctions/{}'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], auction) response = self.app.get('/auctions/{}?opt_jsonp=callback'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/javascript') self.assertIn('callback({"data": {"', response.body) response = self.app.get('/auctions/{}?opt_pretty=1'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertIn('{\n "data": {\n "', response.body) @unittest.skip("option not available") def test_auction_features_invalid(self): data = self.initial_data.copy() item = data['items'][0].copy() item['id'] = "1" data['items'] = [item, item.copy()] response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'Item id should be uniq for all items'], u'location': u'body', u'name': u'items'} ]) data['items'][0]["id"] = "0" data['features'] = [ { "code": "OCDS-123454-AIR-INTAKE", "featureOf": "lot", "title": u"Потужність всмоктування", "enum": [ { "value": 0.1, "title": u"До 1000 Вт" }, { "value": 0.15, "title": u"Більше 1000 Вт" } ] } ] response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [{u'relatedItem': [u'This field is required.']}], u'location': u'body', u'name': u'features'} ]) data['features'][0]["relatedItem"] = "2" response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [{u'relatedItem': [u'relatedItem should be one of lots']}], u'location': u'body', u'name': u'features'} ]) data['features'][0]["featureOf"] = "item" response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [{u'relatedItem': [u'relatedItem should be one of items']}], u'location': u'body', u'name': u'features'} ]) data['features'][0]["relatedItem"] = "1" data['features'][0]["enum"][0]["value"] = 0.5 response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [{u'enum': [{u'value': [u'Float value should be less than 0.3.']}]}], u'location': u'body', u'name': u'features'} ]) data['features'][0]["enum"][0]["value"] = 0.15 response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [{u'enum': [u'Feature value should be uniq for feature']}], u'location': u'body', u'name': u'features'} ]) data['features'][0]["enum"][0]["value"] = 0.1 data['features'].append(data['features'][0].copy()) response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'Feature code should be uniq for all features'], u'location': u'body', u'name': u'features'} ]) data['features'][1]["code"] = u"OCDS-123454-YEARS" data['features'][1]["enum"][0]["value"] = 0.2 response = self.app.post_json('/auctions', {'data': data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': [u'Sum of max value of all features should be less then or equal to 30%'], u'location': u'body', u'name': u'features'} ]) @unittest.skip("option not available") def test_auction_features(self): data = self.initial_data.copy() item = data['items'][0].copy() item['id'] = "1" data['items'] = [item] data['features'] = [ { "code": "OCDS-123454-AIR-INTAKE", "featureOf": "item", "relatedItem": "1", "title": u"Потужність всмоктування", "title_en": u"Air Intake", "description": u"Ефективна потужність всмоктування пилососа, в ватах (аероватах)", "enum": [ { "value": 0.05, "title": u"До 1000 Вт" }, { "value": 0.1, "title": u"Більше 1000 Вт" } ] }, { "code": "OCDS-123454-YEARS", "featureOf": "tenderer", "title": u"Років на ринку", "title_en": u"Years trading", "description": u"Кількість років, які організація учасник працює на ринку", "enum": [ { "value": 0.05, "title": u"До 3 років" }, { "value": 0.1, "title": u"Більше 3 років" } ] }, { "code": "OCDS-123454-POSTPONEMENT", "featureOf": "tenderer", "title": u"Відстрочка платежу", "title_en": u"Postponement of payment", "description": u"Термін відстрочки платежу", "enum": [ { "value": 0.05, "title": u"До 90 днів" }, { "value": 0.1, "title": u"Більше 90 днів" } ] } ] response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] self.assertEqual(auction['features'], data['features']) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'features': [{ "featureOf": "tenderer", "relatedItem": None }, {}, {}]}}) self.assertEqual(response.status, '200 OK') self.assertIn('features', response.json['data']) self.assertNotIn('relatedItem', response.json['data']['features'][0]) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'tenderPeriod': {'startDate': None}}}) self.assertEqual(response.status, '200 OK') self.assertIn('features', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'features': []}}) self.assertEqual(response.status, '200 OK') self.assertNotIn('features', response.json['data']) @unittest.skip("this test requires fixed version of jsonpatch library") def test_patch_tender_jsonpatch(self): response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') tender = response.json['data'] owner_token = response.json['access']['token'] dateModified = tender.pop('dateModified') import random response = self.app.patch_json('/auctions/{}'.format(tender['id']), {'data': {'items': [{"additionalClassifications": [ { "scheme": "ДКПП", "id": "{}".format(i), "description": "description #{}".format(i) } for i in random.sample(range(30), 25) ]}]}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') response = self.app.patch_json('/auctions/{}'.format(tender['id']), {'data': {'items': [{"additionalClassifications": [ { "scheme": "ДКПП", "id": "{}".format(i), "description": "description #{}".format(i) } for i in random.sample(range(30), 20) ]}]}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') def test_patch_auction(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') auction = response.json['data'] owner_token = response.json['access']['token'] dateModified = auction.pop('dateModified') response = self.app.patch_json('/auctions/{}?acc_token={}'.format(auction['id'], owner_token), {'data': {'status': 'cancelled'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertNotEqual(response.json['data']['status'], 'cancelled') response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'status': 'cancelled'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertNotEqual(response.json['data']['status'], 'cancelled') response = self.app.patch_json('/auctions/{}?acc_token={}'.format(auction['id'], owner_token), {'data': {'procuringEntity': {'kind': 'defense'}}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertNotIn('kind', response.json['data']['procuringEntity']) #response = self.app.patch_json('/auctions/{}'.format( #auction['id']), {'data': {'tenderPeriod': {'startDate': None}}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #self.assertNotIn('startDate', response.json['data']['tenderPeriod']) #response = self.app.patch_json('/auctions/{}'.format( #auction['id']), {'data': {'tenderPeriod': {'startDate': auction['enquiryPeriod']['endDate']}}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #self.assertIn('startDate', response.json['data']['tenderPeriod']) response = self.app.patch_json('/auctions/{}'.format( auction['id']), {'data': {'procurementMethodRationale': 'Open'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') new_auction = response.json['data'] new_dateModified = new_auction.pop('dateModified') #auction['procurementMethodRationale'] = 'Open' self.assertEqual(auction, new_auction) self.assertEqual(dateModified, new_dateModified) response = self.app.patch_json('/auctions/{}'.format( auction['id']), {'data': {'dateModified': new_dateModified}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') new_auction2 = response.json['data'] new_dateModified2 = new_auction2.pop('dateModified') self.assertEqual(new_auction, new_auction2) self.assertEqual(new_dateModified, new_dateModified2) revisions = self.db.get(auction['id']).get('revisions') self.assertEqual(revisions[-1][u'changes'][0]['op'], u'remove') self.assertEqual(revisions[-1][u'changes'][0]['path'], u'/procurementMethod') response = self.app.patch_json('/auctions/{}'.format( auction['id']), {'data': {'items': [self.initial_data['items'][0]]}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') #response = self.app.patch_json('/auctions/{}'.format( #auction['id']), {'data': {'items': [{}, self.initial_data['items'][0]]}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #item0 = response.json['data']['items'][0] #item1 = response.json['data']['items'][1] #self.assertNotEqual(item0.pop('id'), item1.pop('id')) #self.assertEqual(item0, item1) #response = self.app.patch_json('/auctions/{}'.format( #auction['id']), {'data': {'items': [{}]}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #self.assertEqual(len(response.json['data']['items']), 1) #response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'items': [{"classification": { #"scheme": u"CAV", #"id": u"04000000-8", #"description": u"Нерухоме майно" #}}]}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'items': [{"additionalClassifications": [auction['items'][0]["classification"]]}]}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') response = self.app.patch_json('/auctions/{}'.format( auction['id']), {'data': {'enquiryPeriod': {'endDate': new_dateModified2}}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') new_auction = response.json['data'] self.assertIn('startDate', new_auction['enquiryPeriod']) #response = self.app.patch_json('/auctions/{}?acc_token={}'.format(auction['id'], owner_token), {"data": {"guarantee": {"amount": 12, "valueAddedTaxIncluded": True}}}, status=422) #self.assertEqual(response.status, '422 Unprocessable Entity') #self.assertEqual(response.json['errors'][0], {u'description': {u'valueAddedTaxIncluded': u'Rogue field'}, u'location': u'body', u'name': u'guarantee'}) #response = self.app.patch_json('/auctions/{}?acc_token={}'.format(auction['id'], owner_token), {"data": {"guarantee": {"amount": 12}}}) #self.assertEqual(response.status, '200 OK') #self.assertIn('guarantee', response.json['data']) #self.assertEqual(response.json['data']['guarantee']['amount'], 12) #self.assertEqual(response.json['data']['guarantee']['currency'], 'UAH') #response = self.app.patch_json('/auctions/{}?acc_token={}'.format(auction['id'], owner_token), {"data": {"guarantee": {"currency": "USD"}}}) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.json['data']['guarantee']['currency'], 'USD') #response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'status': 'active.auction'}}) #self.assertEqual(response.status, '200 OK') #response = self.app.get('/auctions/{}'.format(auction['id'])) #self.assertEqual(response.status, '200 OK') #self.assertEqual(response.content_type, 'application/json') #self.assertIn('auctionUrl', response.json['data']) auction_data = self.db.get(auction['id']) auction_data['status'] = 'complete' self.db.save(auction_data) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'status': 'active.auction'}}, status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'][0]["description"], "Can't update auction in current (complete) status") def test_dateModified_auction(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') auction = response.json['data'] dateModified = auction['dateModified'] response = self.app.get('/auctions/{}'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data']['dateModified'], dateModified) response = self.app.patch_json('/auctions/{}'.format( auction['id']), {'data': {'procurementMethodRationale': 'Open'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data']['dateModified'], dateModified) auction = response.json['data'] dateModified = auction['dateModified'] response = self.app.get('/auctions/{}'.format(auction['id'])) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data'], auction) self.assertEqual(response.json['data']['dateModified'], dateModified) def test_auction_not_found(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) response = self.app.get('/auctions/some_id', status=404) self.assertEqual(response.status, '404 Not Found') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Not Found', u'location': u'url', u'name': u'auction_id'} ]) response = self.app.patch_json( '/auctions/some_id', {'data': {}}, status=404) self.assertEqual(response.status, '404 Not Found') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['status'], 'error') self.assertEqual(response.json['errors'], [ {u'description': u'Not Found', u'location': u'url', u'name': u'auction_id'} ]) # put custom document object into database to check tender construction on non-Tender data data = {'contract': 'test', '_id': uuid4().hex} self.db.save(data) response = self.app.get('/auctions/{}'.format(data['_id']), status=404) self.assertEqual(response.status, '404 Not Found') def test_guarantee(self): data = deepcopy(self.initial_data) data['guarantee'] = {"amount": 100, "currency": "UAH"} response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertIn('guarantee', response.json['data']) self.assertEqual(response.json['data']['guarantee']['amount'], 100) self.assertEqual(response.json['data']['guarantee']['currency'], 'UAH') def test_auction_Administrator_change(self): response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') auction = response.json['data'] response = self.app.post_json('/auctions/{}/questions'.format(auction['id']), {'data': {'title': 'question title', 'description': 'question description', 'author': self.initial_organization}}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') question = response.json['data'] authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'mode': u'test', 'procuringEntity': {"identifier": {"id": "00000000"}}}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data']['mode'], u'test') self.assertEqual(response.json['data']["procuringEntity"]["identifier"]["id"], "00000000") response = self.app.patch_json('/auctions/{}/questions/{}'.format(auction['id'], question['id']), {"data": {"answer": "answer"}}, status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'], [ {"location": "url", "name": "role", "description": "Forbidden"} ]) self.app.authorization = authorization response = self.app.post_json('/auctions', {'data': self.initial_data}) self.assertEqual(response.status, '201 Created') auction = response.json['data'] response = self.app.post_json('/auctions/{}/cancellations'.format(auction['id']), {'data': {'reason': 'cancellation reason', 'status': 'active'}}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction['id']), {'data': {'mode': u'test'}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['data']['mode'], u'test') class AuctionProcessTest(BaseAuctionWebTest): #setUp = BaseWebTest.setUp def setUp(self): super(AuctionProcessTest.__bases__[0], self).setUp() @unittest.skip("option not available") def test_invalid_auction_conditions(self): self.app.authorization = ('Basic', ('broker', '')) # empty auctions listing response = self.app.get('/auctions') self.assertEqual(response.json['data'], []) # create auction response = self.app.post_json('/auctions', {"data": self.initial_data}) auction_id = self.auction_id = response.json['data']['id'] owner_token = response.json['access']['token'] # switch to active.tendering self.set_status('active.tendering') # create compaint response = self.app.post_json('/auctions/{}/complaints'.format(auction_id), {'data': {'title': 'invalid conditions', 'description': 'description', 'author': self.initial_organization, 'status': 'claim'}}) complaint_id = response.json['data']['id'] complaint_owner_token = response.json['access']['token'] # answering claim self.app.patch_json('/auctions/{}/complaints/{}?acc_token={}'.format(auction_id, complaint_id, owner_token), {"data": { "status": "answered", "resolutionType": "resolved", "resolution": "I will cancel the auction" }}) # satisfying resolution self.app.patch_json('/auctions/{}/complaints/{}?acc_token={}'.format(auction_id, complaint_id, complaint_owner_token), {"data": { "satisfied": True, "status": "resolved" }}) # cancellation self.app.post_json('/auctions/{}/cancellations?acc_token={}'.format(auction_id, owner_token), {'data': { 'reason': 'invalid conditions', 'status': 'active' }}) # check status response = self.app.get('/auctions/{}'.format(auction_id)) self.assertEqual(response.json['data']['status'], 'cancelled') def _test_one_valid_bid_auction(self): self.app.authorization = ('Basic', ('broker', '')) # empty auctions listing response = self.app.get('/auctions') self.assertEqual(response.json['data'], []) # create auction response = self.app.post_json('/auctions', {"data": self.initial_data}) auction_id = self.auction_id = response.json['data']['id'] owner_token = response.json['access']['token'] # switch to active.tendering response = self.set_status('active.tendering', {"auctionPeriod": {"startDate": (get_now() + timedelta(days=10)).isoformat()}}) self.assertIn("auctionPeriod", response.json['data']) # create bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 500}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 500}, 'qualified': True}}) # switch to active.qualification self.set_status('active.auction', {'status': 'active.tendering'}) self.app.authorization = ('Basic', ('chronograph', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"id": auction_id}}) self.assertNotIn('auctionPeriod', response.json['data']) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending'][0] award_date = [i['date'] for i in response.json['data'] if i['status'] == 'pending'][0] # set award as active response = self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "active"}}) self.assertNotEqual(response.json['data']['date'], award_date) # get contract id response = self.app.get('/auctions/{}'.format(auction_id)) contract_id = response.json['data']['contracts'][-1]['id'] # after stand slill period self.app.authorization = ('Basic', ('chronograph', '')) self.set_status('complete', {'status': 'active.awarded'}) # time travel auction = self.db.get(auction_id) for i in auction.get('awards', []): i['complaintPeriod']['endDate'] = i['complaintPeriod']['startDate'] self.db.save(auction) # sign contract self.app.authorization = ('Basic', ('broker', '')) self.app.patch_json('/auctions/{}/contracts/{}?acc_token={}'.format(auction_id, contract_id, owner_token), {"data": {"status": "active"}}) # check status self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}'.format(auction_id)) self.assertEqual(response.json['data']['status'], 'complete') def _test_one_invalid_bid_auction(self): self.app.authorization = ('Basic', ('broker', '')) # empty auctions listing response = self.app.get('/auctions') self.assertEqual(response.json['data'], []) # create auction response = self.app.post_json('/auctions', {"data": self.initial_data}) auction_id = self.auction_id = response.json['data']['id'] owner_token = response.json['access']['token'] # switch to active.tendering self.set_status('active.tendering') # create bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True}}) # switch to active.qualification self.set_status('active.auction', {"auctionPeriod": {"startDate": None}, 'status': 'active.tendering'}) self.app.authorization = ('Basic', ('chronograph', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"id": auction_id}}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending'][0] # set award as unsuccessful response = self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "unsuccessful"}}) # time travel auction = self.db.get(auction_id) for i in auction.get('awards', []): i['complaintPeriod']['endDate'] = i['complaintPeriod']['startDate'] self.db.save(auction) # set auction status after stand slill period self.app.authorization = ('Basic', ('chronograph', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"id": auction_id}}) # check status self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}'.format(auction_id)) self.assertEqual(response.json['data']['status'], 'unsuccessful') def test_first_bid_auction(self): self.app.authorization = ('Basic', ('broker', '')) # empty auctions listing response = self.app.get('/auctions') self.assertEqual(response.json['data'], []) # create auction response = self.app.post_json('/auctions', {"data": self.initial_data}) auction_id = self.auction_id = response.json['data']['id'] owner_token = response.json['access']['token'] # switch to active.tendering self.set_status('active.tendering') # create bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True}}) bid_id = response.json['data']['id'] bid_token = response.json['access']['token'] bids_tokens = {bid_id: bid_token} # create second bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True}}) bids_tokens[response.json['data']['id']] = response.json['access']['token'] # switch to active.auction self.set_status('active.auction') # get auction info self.app.authorization = ('Basic', ('auction', '')) response = self.app.get('/auctions/{}/auction'.format(auction_id)) auction_bids_data = response.json['data']['bids'] # posting auction urls response = self.app.patch_json('/auctions/{}/auction'.format(auction_id), { 'data': { 'auctionUrl': 'https://auction.auction.url', 'bids': [ { 'id': i['id'], 'participationUrl': 'https://auction.auction.url/for_bid/{}'.format(i['id']) } for i in auction_bids_data ] } }) # view bid participationUrl self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/bids/{}?acc_token={}'.format(auction_id, bid_id, bid_token)) self.assertEqual(response.json['data']['participationUrl'], 'https://auction.auction.url/for_bid/{}'.format(bid_id)) # posting auction results self.app.authorization = ('Basic', ('auction', '')) response = self.app.post_json('/auctions/{}/auction'.format(auction_id), {'data': {'bids': auction_bids_data}}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending.verification award award = [i for i in response.json['data'] if i['status'] == 'pending.verification'][0] award_id = award['id'] # Upload auction protocol self.app.authorization = ('Basic', ('broker', '')) response = self.app.post('/auctions/{}/awards/{}/documents?acc_token={}'.format( self.auction_id, award_id, owner_token), upload_files=[('file', 'auction_protocol.pdf', 'content')]) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') doc_id = response.json["data"]['id'] response = self.app.patch_json('/auctions/{}/awards/{}/documents/{}?acc_token={}'.format(self.auction_id, award_id, doc_id, owner_token), {"data": { "description": "auction protocol", "documentType": 'auctionProtocol' }}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json["data"]["documentType"], 'auctionProtocol') self.assertEqual(response.json["data"]["author"], 'auction_owner') # set award as unsuccessful response = self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "unsuccessful"}}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award2 = [i for i in response.json['data'] if i['status'] == 'pending.verification'][0] award2_id = award2['id'] self.assertNotEqual(award_id, award2_id) # create first award complaint # self.app.authorization = ('Basic', ('broker', '')) # response = self.app.post_json('/auctions/{}/awards/{}/complaints?acc_token={}'.format(auction_id, award_id, bid_token), # {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': self.initial_organization, 'status': 'claim'}}) # complaint_id = response.json['data']['id'] # complaint_owner_token = response.json['access']['token'] # # create first award complaint #2 # response = self.app.post_json('/auctions/{}/awards/{}/complaints?acc_token={}'.format(auction_id, award_id, bid_token), # {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': self.initial_organization}}) # # answering claim # self.app.patch_json('/auctions/{}/awards/{}/complaints/{}?acc_token={}'.format(auction_id, award_id, complaint_id, owner_token), {"data": { # "status": "answered", # "resolutionType": "resolved", # "resolution": "resolution text " * 2 # }}) # # satisfying resolution # self.app.patch_json('/auctions/{}/awards/{}/complaints/{}?acc_token={}'.format(auction_id, award_id, complaint_id, complaint_owner_token), {"data": { # "satisfied": True, # "status": "resolved" # }}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award = [i for i in response.json['data'] if i['status'] == 'pending.verification'][0] award_id = award['id'] # Upload auction protocol self.app.authorization = ('Basic', ('broker', '')) response = self.app.post('/auctions/{}/awards/{}/documents?acc_token={}'.format( self.auction_id, award_id, owner_token), upload_files=[('file', 'auction_protocol.pdf', 'content')]) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') doc_id = response.json["data"]['id'] response = self.app.patch_json('/auctions/{}/awards/{}/documents/{}?acc_token={}'.format(self.auction_id, award_id, doc_id, owner_token), {"data": { "description": "auction protocol", "documentType": 'auctionProtocol' }}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json["data"]["documentType"], 'auctionProtocol') self.assertEqual(response.json["data"]["author"], 'auction_owner') # set award as "pending.payment self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "pending.payment"}}) # set award as active self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "active"}}) # get contract id response = self.app.get('/auctions/{}'.format(auction_id)) contract_id = response.json['data']['contracts'][-1]['id'] # create auction contract document for test response = self.app.post('/auctions/{}/contracts/{}/documents?acc_token={}'.format(auction_id, contract_id, owner_token), upload_files=[('file', 'name.doc', 'content')], status=201) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') doc_id = response.json["data"]['id'] self.assertIn(doc_id, response.headers['Location']) # after stand slill period self.app.authorization = ('Basic', ('chronograph', '')) self.set_status('complete', {'status': 'active.awarded'}) # time travel auction = self.db.get(auction_id) for i in auction.get('awards', []): i['complaintPeriod']['endDate'] = i['complaintPeriod']['startDate'] self.db.save(auction) # sign contract self.app.authorization = ('Basic', ('broker', '')) self.app.patch_json('/auctions/{}/contracts/{}?acc_token={}'.format(auction_id, contract_id, owner_token), {"data": {"status": "active"}}) # check status self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}'.format(auction_id)) self.assertEqual(response.json['data']['status'], 'complete') response = self.app.post('/auctions/{}/contracts/{}/documents?acc_token={}'.format(auction_id, contract_id, owner_token), upload_files=[('file', 'name.doc', 'content')], status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'][0]["description"], "Can't add document in current (complete) auction status") response = self.app.patch_json('/auctions/{}/contracts/{}/documents/{}?acc_token={}'.format(auction_id, contract_id, doc_id, owner_token), {"data": {"description": "document description"}}, status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'][0]["description"], "Can't update document in current (complete) auction status") response = self.app.put('/auctions/{}/contracts/{}/documents/{}?acc_token={}'.format(auction_id, contract_id, doc_id, owner_token), upload_files=[('file', 'name.doc', 'content3')], status=403) self.assertEqual(response.status, '403 Forbidden') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'][0]["description"], "Can't update document in current (complete) auction status") def test_suspended_auction(self): self.app.authorization = ('Basic', ('broker', '')) # empty auctions listing response = self.app.get('/auctions') self.assertEqual(response.json['data'], []) # create auction auction_data = deepcopy(self.initial_data) auction_data['suspended'] = True response = self.app.post_json('/auctions', {"data": auction_data}) auction_id = self.auction_id = response.json['data']['id'] owner_token = response.json['access']['token'] self.assertNotIn('suspended', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}, status=403) self.assertEqual(response.status, '403 Forbidden') authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], True) self.assertNotIn('next_check', response.json['data']) self.app.authorization = authorization response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}, status=403) self.assertEqual(response.status, '403 Forbidden') self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], False) self.assertIn('next_check', response.json['data']) self.app.authorization = authorization # switch to active.tendering self.set_status('active.tendering') # create bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True}}) bid_id = response.json['data']['id'] bid_token = response.json['access']['token'] # create second bid self.app.authorization = ('Basic', ('broker', '')) if self.initial_organization == test_financial_organization: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True, 'eligible': True}}) else: response = self.app.post_json('/auctions/{}/bids'.format(auction_id), {'data': {'tenderers': [self.initial_organization], "value": {"amount": 450}, 'qualified': True}}) authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], True) self.assertNotIn('next_check', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], False) self.assertIn('next_check', response.json['data']) self.app.authorization = authorization # switch to active.auction self.set_status('active.auction') # get auction info self.app.authorization = ('Basic', ('auction', '')) response = self.app.get('/auctions/{}/auction'.format(auction_id)) auction_bids_data = response.json['data']['bids'] # posting auction urls response = self.app.patch_json('/auctions/{}/auction'.format(auction_id), { 'data': { 'auctionUrl': 'https://auction.auction.url', 'bids': [ { 'id': i['id'], 'participationUrl': 'https://auction.auction.url/for_bid/{}'.format(i['id']) } for i in auction_bids_data ] } }) # view bid participationUrl self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/bids/{}?acc_token={}'.format(auction_id, bid_id, bid_token)) self.assertEqual(response.json['data']['participationUrl'], 'https://auction.auction.url/for_bid/{}'.format(bid_id)) # posting auction results self.app.authorization = ('Basic', ('auction', '')) response = self.app.post_json('/auctions/{}/auction'.format(auction_id), {'data': {'bids': auction_bids_data}}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending.verification'][0] authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], True) self.assertNotIn('next_check', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], False) self.app.authorization = authorization # set award as unsuccessful response = self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "unsuccessful"}}) # get awards self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award2_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending.verification'][0] self.assertNotEqual(award_id, award2_id) self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}/awards?acc_token={}'.format(auction_id, owner_token)) # get pending award award_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending.verification'][0] response = self.app.post('/auctions/{}/awards/{}/documents?acc_token={}'.format( self.auction_id, award_id, owner_token), upload_files=[('file', 'auction_protocol.pdf', 'content')]) doc_id = response.json["data"]['id'] response = self.app.patch_json('/auctions/{}/awards/{}/documents/{}?acc_token={}'.format(auction_id, award_id, doc_id, owner_token), {"data": {"documentType": 'auctionProtocol'}}) # set award as active self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "pending.payment"}}) authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], True) self.assertNotIn('next_check', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], False) self.app.authorization = authorization self.app.patch_json('/auctions/{}/awards/{}?acc_token={}'.format(auction_id, award_id, owner_token), {"data": {"status": "active"}}) # get contract id response = self.app.get('/auctions/{}'.format(auction_id)) contract_id = response.json['data']['contracts'][-1]['id'] authorization = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": True}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], True) self.assertNotIn('next_check', response.json['data']) response = self.app.patch_json('/auctions/{}'.format(auction_id), {"data": {"suspended": False}}) self.assertEqual(response.status, '200 OK') self.assertEqual(response.json['data']['suspended'], False) self.app.authorization = authorization # create auction contract document for test response = self.app.post('/auctions/{}/contracts/{}/documents?acc_token={}'.format(auction_id, contract_id, owner_token), upload_files=[('file', 'name.doc', 'content')], status=201) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') doc_id = response.json["data"]['id'] self.assertIn(doc_id, response.headers['Location']) # after stand slill period self.app.authorization = ('Basic', ('chronograph', '')) self.set_status('complete', {'status': 'active.awarded'}) # time travel auction = self.db.get(auction_id) for i in auction.get('awards', []): i['complaintPeriod']['endDate'] = i['complaintPeriod']['startDate'] self.db.save(auction) # sign contract self.app.authorization = ('Basic', ('broker', '')) self.app.patch_json('/auctions/{}/contracts/{}?acc_token={}'.format(auction_id, contract_id, owner_token), {"data": {"status": "active"}}) # check status self.app.authorization = ('Basic', ('broker', '')) response = self.app.get('/auctions/{}'.format(auction_id)) self.assertEqual(response.json['data']['status'], 'complete') class FinancialAuctionTest(AuctionTest): auction = DGFFinancialAssets class FinancialAuctionResourceTest(AuctionResourceTest): initial_data = test_financial_auction_data initial_organization = test_financial_organization def test_create_auction_generated(self): data = self.initial_data.copy() #del data['awardPeriod'] data.update({'id': 'hash', 'doc_id': 'hash2', 'auctionID': 'hash3'}) response = self.app.post_json('/auctions', {'data': data}) self.assertEqual(response.status, '201 Created') self.assertEqual(response.content_type, 'application/json') auction = response.json['data'] if 'procurementMethodDetails' in auction: auction.pop('procurementMethodDetails') self.assertEqual(set(auction), set([ u'procurementMethodType', u'id', u'date', u'dateModified', u'auctionID', u'status', u'enquiryPeriod', u'tenderPeriod', u'minimalStep', u'items', u'value', u'procuringEntity', u'next_check', u'dgfID', u'procurementMethod', u'awardCriteria', u'submissionMethod', u'title', u'owner', u'auctionPeriod', u'eligibilityCriteria', u'eligibilityCriteria_en', u'eligibilityCriteria_ru', 'documents', u'dgfDecisionDate', u'dgfDecisionID', u'tenderAttempts', ])) self.assertNotEqual(data['id'], auction['id']) self.assertNotEqual(data['doc_id'], auction['id']) self.assertNotEqual(data['auctionID'], auction['auctionID']) self.assertEqual(auction['eligibilityCriteria'], u"До участі допускаються лише ліцензовані фінансові установи.") self.assertEqual(auction['eligibilityCriteria_en'], u"Only licensed financial institutions are eligible to participate.") self.assertEqual(auction['eligibilityCriteria_ru'], u"К участию допускаются только лицензированные финансовые учреждения.") class FinancialAuctionProcessTest(AuctionProcessTest): initial_data = test_financial_auction_data initial_organization = test_financial_organization class AuctionSchemaResourceTest(AuctionResourceTest): initial_data = test_auction_data_with_schema def test_create_auction_with_bad_schemas_code(self): response = self.app.get('/auctions') self.assertEqual(response.status, '200 OK') self.assertEqual(len(response.json['data']), 0) bad_initial_data = deepcopy(self.initial_data) bad_initial_data['items'][0]['classification']['id'] = "42124210-6" response = self.app.post_json('/auctions', {"data": bad_initial_data}, status=422) self.assertEqual(response.status, '422 Unprocessable Entity') self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.json['errors'], [{ "location": "body", "name": "items", "description": [{ "schema_properties": ["classification id mismatch with schema_properties code"] }] }]) class AuctionSchemaProcessTest(AuctionProcessTest): initial_data = test_auction_data_with_schema class FinancialAuctionSchemaResourceTest(FinancialAuctionResourceTest): initial_data = test_financial_auction_data_with_schema class FinancialAuctionSchemaProcessTest(FinancialAuctionProcessTest): initial_data = test_financial_auction_data_with_schema def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(AuctionProcessTest)) suite.addTest(unittest.makeSuite(AuctionResourceTest)) suite.addTest(unittest.makeSuite(AuctionTest)) suite.addTest(unittest.makeSuite(FinancialAuctionProcessTest)) suite.addTest(unittest.makeSuite(FinancialAuctionResourceTest)) suite.addTest(unittest.makeSuite(FinancialAuctionTest)) suite.addTest(unittest.makeSuite(AuctionSchemaResourceTest)) suite.addTest(unittest.makeSuite(AuctionSchemaProcessTest)) suite.addTest(unittest.makeSuite(FinancialAuctionSchemaResourceTest)) suite.addTest(unittest.makeSuite(FinancialAuctionSchemaProcessTest)) return suite if __name__ == '__main__': unittest.main(defaultTest='suite')
55.415094
209
0.613691
10,698
99,858
5.629277
0.04627
0.116071
0.14513
0.076567
0.866544
0.847813
0.83433
0.816164
0.797101
0.784381
0
0.01441
0.218881
99,858
1,801
210
55.445863
0.757657
0.07778
0
0.70702
0
0.000716
0.24052
0.037049
0
0
0
0
0.375358
1
0.022206
false
0
0.007163
0
0.046562
0
0
0
0
null
0
0
0
1
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
7
c4e10054fb2b36e390d33bb02cb4d604008384ca
67
py
Python
Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.6-sum-in-deffernet-data-type.py
shihab4t/Books-Code
b637b6b2ad42e11faf87d29047311160fe3b2490
[ "Unlicense" ]
null
null
null
Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.6-sum-in-deffernet-data-type.py
shihab4t/Books-Code
b637b6b2ad42e11faf87d29047311160fe3b2490
[ "Unlicense" ]
null
null
null
Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.6-sum-in-deffernet-data-type.py
shihab4t/Books-Code
b637b6b2ad42e11faf87d29047311160fe3b2490
[ "Unlicense" ]
null
null
null
a = 1 b = 2.5 c = a + b print(c) a = 1 b = '2' c = a + b print(c)
6.7
9
0.402985
19
67
1.421053
0.368421
0.222222
0.222222
0.296296
0.666667
0
0
0
0
0
0
0.119048
0.373134
67
9
10
7.444444
0.52381
0
0
0.75
0
0
0.014925
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
1
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c4f81c787d5cb44241cf1a8139ab97effc7e4578
8,152
py
Python
chia_tea/cli/test_start.py
Tea-n-Tech/chia-tea
a5bd327b9d5e048e55e9f5d8cefca2dbcd5eae96
[ "BSD-3-Clause" ]
6
2021-08-05T21:31:15.000Z
2021-11-15T20:54:25.000Z
chia_tea/cli/test_start.py
Tea-n-Tech/chia-tea
a5bd327b9d5e048e55e9f5d8cefca2dbcd5eae96
[ "BSD-3-Clause" ]
49
2021-08-05T19:33:08.000Z
2022-03-30T19:33:38.000Z
chia_tea/cli/test_start.py
Tea-n-Tech/chia-tea
a5bd327b9d5e048e55e9f5d8cefca2dbcd5eae96
[ "BSD-3-Clause" ]
1
2022-01-09T17:08:32.000Z
2022-01-09T17:08:32.000Z
import unittest from unittest.mock import patch from typer.testing import CliRunner from ..utils.config import DEFAULT_CONFIG_FILEPATH from .main import app runner = CliRunner() class TestStartCmd(unittest.TestCase): # CONFIG @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_copy") def test_copy_cmd_runs(self, run_copy_mock, read_config_mock): result = runner.invoke(app, ["start", "copy"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_copy_mock.assert_called_once() run_copy_mock.reset_mock() read_config_mock.reset_mock() config_filepath = "some/path/to/config.yml" result = runner.invoke(app, ["start", "copy", "--config", config_filepath]) self.assertEqual(result.exit_code, 0) read_config_mock.assert_called_once_with(filepath=config_filepath) run_copy_mock.assert_called_once() @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_copy") def test_copy_cmd_interrupted_by_keyboard(self, run_copy_mock, read_config_mock): run_copy_mock.side_effect = KeyboardInterrupt() result = runner.invoke(app, ["start", "copy"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_copy_mock.assert_called_once() self.assertEqual(result.exit_code, 0) self.assertIn("Stopping copy", result.output) @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_copy") def test_copy_cmd_some_other_error(self, run_copy_mock, read_config_mock): err_msg = "Blablabla" run_copy_mock.side_effect = Exception(err_msg) result = runner.invoke(app, ["start", "copy"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_copy_mock.assert_called_once() self.assertEqual(result.exit_code, 1) self.assertIn("Error", result.output) self.assertIn(err_msg, result.output) # MONITORING CLIENT @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_client") def test_monitoring_client_cmd_runs(self, run_monitoring_client_mock, read_config_mock): result = runner.invoke(app, ["start", "monitoring-client"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_client_mock.assert_called_once() run_monitoring_client_mock.reset_mock() read_config_mock.reset_mock() config_filepath = "some/path/to/config.yml" result = runner.invoke(app, ["start", "monitoring-client", "--config", config_filepath]) self.assertEqual(result.exit_code, 0) read_config_mock.assert_called_once_with(filepath=config_filepath) run_monitoring_client_mock.assert_called_once() @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_client") def test_monitoring_client_cmd_interrupted_by_keyboard( self, run_monitoring_client_mock, read_config_mock ): run_monitoring_client_mock.side_effect = KeyboardInterrupt() result = runner.invoke(app, ["start", "monitoring-client"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_client_mock.assert_called_once() self.assertEqual(result.exit_code, 0) self.assertIn("Shutting down", result.output) @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_client") def test_monitoring_client_cmd_some_other_error( self, run_monitoring_client_mock, read_config_mock ): err_msg = "Blablabla" run_monitoring_client_mock.side_effect = Exception(err_msg) result = runner.invoke(app, ["start", "monitoring-client"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_client_mock.assert_called_once() self.assertEqual(result.exit_code, 1) self.assertIn("Error", result.output) self.assertIn(err_msg, result.output) # MONITORING SERVER @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_server") def test_monitoring_server_cmd_runs(self, run_monitoring_server_mock, read_config_mock): result = runner.invoke(app, ["start", "monitoring-server"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_server_mock.assert_called_once() run_monitoring_server_mock.reset_mock() read_config_mock.reset_mock() config_filepath = "some/path/to/config.yml" result = runner.invoke(app, ["start", "monitoring-server", "--config", config_filepath]) self.assertEqual(result.exit_code, 0) read_config_mock.assert_called_once_with(filepath=config_filepath) run_monitoring_server_mock.assert_called_once() @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_server") def test_monitoring_server_cmd_interrupted_by_keyboard( self, run_monitoring_server_mock, read_config_mock ): run_monitoring_server_mock.side_effect = KeyboardInterrupt() result = runner.invoke(app, ["start", "monitoring-server"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_server_mock.assert_called_once() self.assertEqual(result.exit_code, 0) self.assertIn("Shutting down", result.output) @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_monitoring_server") def test_monitoring_server_cmd_some_other_error( self, run_monitoring_server_mock, read_config_mock ): err_msg = "Blablabla" run_monitoring_server_mock.side_effect = Exception(err_msg) result = runner.invoke(app, ["start", "monitoring-server"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) run_monitoring_server_mock.assert_called_once() self.assertEqual(result.exit_code, 1) self.assertIn("Error", result.output) self.assertIn(err_msg, result.output) # DISCORD BOT @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_discord_bot") def test_discord_bot_cmd_runs(self, discord_bot_mock, read_config_mock): result = runner.invoke(app, ["start", "discord-bot"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) discord_bot_mock.assert_called_once() discord_bot_mock.reset_mock() read_config_mock.reset_mock() config_filepath = "some/path/to/config.yml" result = runner.invoke(app, ["start", "discord-bot", "--config", config_filepath]) self.assertEqual(result.exit_code, 0) read_config_mock.assert_called_once_with(filepath=config_filepath) discord_bot_mock.assert_called_once() @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_discord_bot") def test_discord_bot_cmd_interrupted_by_keyboard(self, discord_bot_mock, read_config_mock): discord_bot_mock.side_effect = KeyboardInterrupt() result = runner.invoke(app, ["start", "discord-bot"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) discord_bot_mock.assert_called_once() self.assertEqual(result.exit_code, 0) self.assertIn("Shutting down", result.output) @patch("chia_tea.cli.start.read_config") @patch("chia_tea.cli.start.run_discord_bot") def test_discord_bot_cmd_some_other_error(self, discord_bot_mock, read_config_mock): err_msg = "Blablabla" discord_bot_mock.side_effect = Exception(err_msg) result = runner.invoke(app, ["start", "discord-bot"]) read_config_mock.assert_called_once_with(filepath=DEFAULT_CONFIG_FILEPATH) discord_bot_mock.assert_called_once() self.assertEqual(result.exit_code, 1) self.assertIn("Error", result.output) self.assertIn(err_msg, result.output)
45.288889
96
0.731722
1,066
8,152
5.182927
0.06379
0.079638
0.081086
0.115837
0.955294
0.941357
0.919457
0.876742
0.836199
0.799638
0
0.001763
0.165113
8,152
179
97
45.541899
0.810021
0.006624
0
0.755102
0
0
0.159521
0.108118
0
0
0
0
0.380952
1
0.081633
false
0
0.034014
0
0.122449
0
0
0
0
null
0
0
0
1
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
7
1ee9fa01a361201b8f0d6f5a691ae92b14caa94a
23,942
py
Python
seglearn/tests/test_transform.py
tylerwmarrs/seglearn
01fa65b3e326091671043f30c0310eead0e78bc2
[ "BSD-3-Clause" ]
null
null
null
seglearn/tests/test_transform.py
tylerwmarrs/seglearn
01fa65b3e326091671043f30c0310eead0e78bc2
[ "BSD-3-Clause" ]
null
null
null
seglearn/tests/test_transform.py
tylerwmarrs/seglearn
01fa65b3e326091671043f30c0310eead0e78bc2
[ "BSD-3-Clause" ]
null
null
null
# Author: David Burns # License: BSD import pytest import numpy as np import seglearn.transform as transform from seglearn.base import TS_Data from seglearn.feature_functions import all_features, mean from seglearn.util import get_ts_data_parts def test_sliding_window(): N = 1000 width = 10 ts = np.random.rand(N) for step in 1 + np.arange(width): sts = transform.sliding_window(ts, width, step) sts_c = transform.sliding_window(ts, width, step, 'C') assert sts.flags.f_contiguous and sts_c.flags.c_contiguous assert sts.shape[1] == width and sts_c.shape[1] == width Nsts = 1 + (N - width) // step assert Nsts == sts.shape[0] and Nsts == sts_c.shape[0] assert np.all(np.isin(sts, ts)) and np.all(np.isin(sts_c, ts)) # reconstruct the ts if step == 1: assert np.array_equal(np.concatenate((sts[:, 0], sts[-1, 1:width])), ts) assert np.array_equal(np.concatenate((sts_c[:, 0], sts_c[-1, 1:width])), ts) if step == width: assert np.array_equal(sts.ravel(), ts) assert np.array_equal(sts_c.ravel(), ts) def test_sliding_tensor(): N = 1000 V = 5 width = 10 ts = np.random.rand(N, V) for step in 1 + np.arange(width): sts = transform.sliding_tensor(ts, width, step) assert sts.shape[1] == width assert sts.shape[2] == V Nsts = 1 + (N - width) // step assert Nsts == sts.shape[0] for j in range(V): assert np.all(np.isin(sts[:, :, j], ts[:, j])) # todo: reconstruct tensor ts final_tensor = [] for step in 1 + np.arange(width): sts = transform.sliding_tensor(ts, width, step, 'C') final_tensor.append(sts) assert sts.flags.c_contiguous assert sts.shape[1] == width assert sts.shape[2] == V Nsts = 1 + (N - width) // step assert Nsts == sts.shape[0] for j in range(V): assert np.all(np.isin(sts[:, :, j], ts[:, j])) assert np.concatenate(final_tensor).flags.c_contiguous def test_feature_rep(): # multivariate ts frep = transform.FeatureRep(features=all_features()) X = np.random.rand(100, 10, 5) y = np.ones(100) frep.fit(X, y) Xt = frep.transform(X) assert Xt.shape[0] == len(X) assert len(frep.f_labels) == Xt.shape[1] # univariate ts X = np.random.rand(100, 10) y = np.ones(100) frep.fit(X, y) Xt = frep.transform(X) assert Xt.shape[0] == len(X) assert len(frep.f_labels) == Xt.shape[1] # single feature frep = transform.FeatureRep(features={'mean': mean}) frep.fit(X, y) Xt = frep.transform(X) assert Xt.shape[0] == len(X) assert len(frep.f_labels) == Xt.shape[1] assert Xt.shape[1] == 1 # ts with multivariate contextual data frep = transform.FeatureRep(features=all_features()) X = TS_Data(np.random.rand(100, 10, 5), np.random.rand(100, 3)) y = np.ones(100) frep.fit(X, y) Xt = frep.transform(X) assert Xt.shape[0] == len(X) assert len(frep.f_labels) == Xt.shape[1] # ts with univariate contextual data X = TS_Data(np.random.rand(100, 10, 5), np.random.rand(100)) y = np.ones(100) frep.fit(X, y) Xt = frep.transform(X) assert Xt.shape[0] == len(X) assert len(frep.f_labels) == Xt.shape[1] def test_segmentx(): # test illegal parameter settings with pytest.raises(ValueError): transform.SegmentX(width=0) # illegal width value with pytest.raises(ValueError): transform.SegmentX(overlap=None, step=None) # either overlap or step must be defined with pytest.raises(ValueError): transform.SegmentX(overlap=-1, step=None) # illegal overlap value with pytest.raises(ValueError): transform.SegmentX(step=0) # illegal step value with pytest.raises(ValueError): transform.SegmentX(order=None) # illegal order # test _step property working as expected seg = transform.SegmentX(width=10, overlap=0.5) assert seg._step == 5 # test precedence of step over overlap seg = transform.SegmentX(width=10, overlap=1, step=1) assert seg._step == 1 # illegal overlap value, but valid step value seg = transform.SegmentX(overlap=-1, step=1) assert seg._step == 1 # test shape of segmented data width = 5 nvars = 5 seg = transform.SegmentX(width=width) # multivariate ts data without context data X = [np.random.rand(100, nvars), np.random.rand(100, nvars), np.random.rand(100, nvars)] y = np.random.rand(3) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width, nvars) # univariate ts data without context X = [np.random.rand(100), np.random.rand(100), np.random.rand(100)] y = np.random.rand(3) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width) # multivariate ts data with context data Xt = [np.random.rand(100, nvars), np.random.rand(200, nvars), np.random.rand(50, nvars)] Xc = np.random.rand(3, 4) y = np.random.rand(3) X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 4) # ts data with univariate context data Xt = [np.random.rand(100), np.random.rand(200), np.random.rand(50)] Xc = np.random.rand(3) y = np.random.rand(3) X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width) assert Xsc.shape == (N, 1) # same number as context vars and time vars # this would cause broadcasting failure before implementation of TS_Data class Xt = [np.random.rand(100, nvars), np.random.rand(200, nvars), np.random.rand(50, nvars)] Xc = np.random.rand(3, nvars) y = np.random.rand(3) X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 5) def test_segmentxy(): # test illegal parameter settings with pytest.raises(ValueError): transform.SegmentXY(width=0) # illegal width value with pytest.raises(ValueError): transform.SegmentXY(overlap=None, step=None) # either overlap or step must be defined with pytest.raises(ValueError): transform.SegmentXY(overlap=-1, step=None) # illegal overlap value with pytest.raises(ValueError): transform.SegmentXY(step=0) # illegal step value with pytest.raises(ValueError): transform.SegmentXY(order=None) # illegal order # test _step property working as expected seg = transform.SegmentXY(width=10, overlap=0.5) assert seg._step == 5 # test precedence of step over overlap seg = transform.SegmentXY(width=10, overlap=1, step=1) assert seg._step == 1 # illegal overlap value, but valid step value seg = transform.SegmentXY(overlap=-1, step=1) assert seg._step == 1 # test shape of segmented data Nt = 100 width = 5 nvars = 5 seg = transform.SegmentXY(width=width) # multivariate ts data without context data X = [np.random.rand(Nt, nvars), np.random.rand(Nt, nvars), np.random.rand(Nt, nvars)] y = [np.random.rand(Nt), np.random.rand(Nt), np.random.rand(Nt)] seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width, nvars) # univariate ts data without context data X = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(3 * Nt)] y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(3 * Nt)] seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width) # multivariate ts data with context data Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3, 4) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 4) # ts data with univariate context data Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 1) # same number as context vars and time vars # this would cause broadcasting failure before implementation of TS_Data class Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3, nvars) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 5) def test_segmentxyforecast(): # test illegal parameter settings with pytest.raises(ValueError): transform.SegmentXYForecast(width=0) # illegal width value with pytest.raises(ValueError): transform.SegmentXYForecast(overlap=None, step=None) # either overlap or step must be defined with pytest.raises(ValueError): transform.SegmentXYForecast(overlap=-1, step=None) # illegal overlap value with pytest.raises(ValueError): transform.SegmentXYForecast(step=0) # illegal step value with pytest.raises(ValueError): transform.SegmentXYForecast(order=None) # illegal order with pytest.raises(ValueError): transform.SegmentXYForecast(forecast=0) # illegal forecast value # test _step property working as expected seg = transform.SegmentXYForecast(width=10, overlap=0.5) assert seg._step == 5 # test precedence of step over overlap seg = transform.SegmentXYForecast(width=10, overlap=1, step=1) assert seg._step == 1 # illegal overlap value, but valid step value seg = transform.SegmentXYForecast(overlap=-1, step=1) assert seg._step == 1 # test shape of segmented data Nt = 100 width = 5 nvars = 5 # lets do a forecast test seg = transform.SegmentXYForecast(width=width, forecast=5) Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3, 4) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 4) # univariate X nvars = 1 seg = transform.SegmentXYForecast(width=width, forecast=5) X = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width) def test_pad_trunc(): Nt = 100 width = 5 nvars = 5 seg = transform.PadTrunc(width=width) # multivariate ts data without context data X = [np.random.rand(Nt, nvars), np.random.rand(Nt, nvars), np.random.rand(Nt, nvars)] y = [np.random.rand(Nt), np.random.rand(Nt), np.random.rand(Nt)] seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width, nvars) assert np.all([np.equal(X[i][0:width], Xs[i]) for i in range(len(X))]) assert np.all([np.equal(y[i][0:width], ys[i]) for i in range(len(y))]) # univariate ts data without context data X = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(3 * Nt)] y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(3 * Nt)] seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width) assert np.all([np.equal(X[i][0:width], Xs[i]) for i in range(len(X))]) assert np.all([np.equal(y[i][0:width], ys[i]) for i in range(len(y))]) # multivariate ts data with context data Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3, 4) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 4) assert np.all([np.equal(Xt[i][0:width], Xst[i]) for i in range(len(Xt))]) assert np.all([np.equal(Xc[i], Xsc[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i][0:width], ys[i]) for i in range(len(y))]) # ts data with univariate context data Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N,) assert np.all([np.equal(Xt[i][0:width], Xst[i]) for i in range(len(Xt))]) assert np.all([np.equal(Xc[i], Xsc[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i][0:width], ys[i]) for i in range(len(y))]) # same number as context vars and time vars # this would cause broadcasting failure before implementation of TS_Data class Xt = [np.random.rand(Nt, nvars), np.random.rand(2 * Nt, nvars), np.random.rand(Nt, nvars)] Xc = np.random.rand(3, nvars) y = [np.random.rand(Nt), np.random.rand(2 * Nt), np.random.rand(Nt)] X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 5) assert np.all([np.equal(Xt[i][0:width], Xst[i]) for i in range(len(Xt))]) assert np.all([np.equal(Xc[i], Xsc[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i][0:width], ys[i]) for i in range(len(y))]) width = 5 nvars = 5 seg = transform.PadTrunc(width=width) # multivariate ts data without context data X = [np.random.rand(100, nvars), np.random.rand(100, nvars), np.random.rand(100, nvars)] y = np.random.rand(3) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width, nvars) assert np.all([np.equal(X[i][0:width], Xs[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i], ys[i]) for i in range(len(y))]) # univariate ts data without context X = [np.random.rand(100), np.random.rand(100), np.random.rand(100)] y = np.random.rand(3) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) N = len(ys) assert Xs.shape == (N, width) assert np.all([np.equal(X[i][0:width], Xs[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i], ys[i]) for i in range(len(y))]) # multivariate ts data with context data Xt = [np.random.rand(100, nvars), np.random.rand(200, nvars), np.random.rand(50, nvars)] Xc = np.random.rand(3, 4) y = np.random.rand(3) X = TS_Data(Xt, Xc) seg.fit(X, y) Xs, ys, _ = seg.transform(X, y) Xst, Xsc = get_ts_data_parts(Xs) N = len(ys) assert Xst.shape == (N, width, nvars) assert Xsc.shape == (N, 4) assert np.all([np.equal(Xt[i][0:width], Xst[i]) for i in range(len(Xt))]) assert np.all([np.equal(Xc[i], Xsc[i]) for i in range(len(Xt))]) assert np.all([np.equal(y[i], ys[i]) for i in range(len(y))]) def test_interp(): # univariate time series N = 100 t = np.arange(N) + np.random.rand(N) X = [np.column_stack([t, np.random.rand(N)])] y = [np.random.rand(N)] interp = transform.Interp(2) interp.fit(X) Xc, yc, swt = interp.transform(X, y) assert len(Xc[0]) == N / 2 assert len(yc[0]) == N / 2 assert np.ndim(Xc[0]) == 1 y = [np.random.randint(0, 5, N)] interp = transform.Interp(5, kind='cubic', categorical_target=True) interp.fit(X, y) Xc, yc, swt = interp.transform(X, y) assert len(Xc[0]) == N / 5 assert len(yc[0]) == N / 5 assert np.ndim(Xc[0]) == 1 assert np.all(np.isin(yc, np.arange(6))) # multivariate time series N = 100 D = 5 t = np.arange(N) + np.random.rand(N) X = [np.column_stack([t, np.random.rand(N,D)])] y = [np.random.rand(N)] interp = transform.Interp(2) interp.fit(X) Xc, yc, swt = interp.transform(X, y) assert len(Xc[0]) == N / 2 assert len(yc[0]) == N / 2 assert Xc[0].shape[1] == D y = [np.random.randint(0, 5, N)] interp = transform.Interp(5, kind='cubic', categorical_target=True) interp.fit(X, y) Xc, yc, swt = interp.transform(X, y) assert len(Xc[0]) == N / 5 assert len(yc[0]) == N / 5 assert Xc[0].shape[1] == D assert np.all(np.isin(yc, np.arange(6))) # sorthing case N = 100 t = np.arange(N) t[0:3] = 0 X = [np.column_stack([t, np.random.rand(N)])] y = [np.random.rand(N)] interp = transform.Interp(sample_period=2, assume_sorted=False) interp.fit(X) Xc, yc, swt = interp.transform(X, y) assert len(Xc[0]) == N / 2 assert len(yc[0]) == N / 2 assert np.ndim(Xc[0]) == 1 assert np.count_nonzero(np.isnan(Xc)) == 0 def test_interp_long_to_wide(): # Test 1 t = np.array([1.1, 1.2, 2.1, 3.3, 3.4, 3.5]).astype(float) s = np.array([0, 1, 0, 0, 1, 1]).astype(float) v1 = np.array([3, 4, 5, 7, 15, 25]).astype(float) v2 = np.array([5, 7, 6, 9, 22, 35]).astype(float) y = np.array([1, 2, 2, 2, 3, 3]).astype(float) df = np.column_stack([t, s, v1, v2]) X = [df, df] y = [y, y] stacked_interp = transform.InterpLongToWide(0.5) stacked_interp.fit(X, y) Xc, yc, swt = stacked_interp.transform(X, y) # --Checks-- # linearly sampled time within bounds = 1.2, 1.7, 2.2, 2.7, 3.2 --> len(Xc[0]) = 5 assert len(Xc[0]) == 5 # Xc shape[1] = unique(s) * no. dimensions of values (V1) = 2 * 2 = 4 assert Xc[0].shape[1] == 4 assert swt is None # Test 2 y = [1, 2] stacked_interp.fit(X, y) Xc, yc, swt = stacked_interp.transform(X, y) assert np.array_equal(yc, y) # Test 3 N = 100 sample_period = 0.5 t = np.arange(N) + np.random.rand(N) s = np.array([1, 2] * int(N/2)) np.random.shuffle(s) v1 = np.arange(N) + np.random.rand(N) v2 = np.arange(N) + np.random.rand(N) v3 = np.arange(N) + np.random.rand(N) df = np.column_stack([t, s, v1, v2, v3]) X = [df, df, df] dm = np.arange(N) + np.random.rand(N) y = [dm, dm, dm] stacked_interp = transform.InterpLongToWide(sample_period) stacked_interp.fit(X, y) Xc, yc, swt = stacked_interp.transform(X, y) # --Checks-- assert Xc[0].shape[1] == len(np.unique(s)) * (X[0].shape[1]-2) assert len(Xc[0]) <= N/sample_period # Test 3 - duplicate entries for t t = np.array([1.1, 1.1, 1.2, 2.1, 3.3, 3.4, 3.5]).astype(float) s = np.array([0, 0, 1, 0, 0, 1, 1]).astype(float) v1 = np.array([3, 3, 4, 5, 7, 15, 25]).astype(float) v2 = np.array([5, 5, 7, 6, 9, 22, 35]).astype(float) y = np.array([1, 1, 2, 2, 2, 3, 3]).astype(float) df = np.column_stack([t, s, v1, v2]) X = [df, df] y = [y, y] stacked_interp = transform.InterpLongToWide(0.5) stacked_interp.fit(X, y) Xc, yc, swt = stacked_interp.transform(X, y) # --Checks-- assert len(Xc[0]) == 5 assert Xc[0].shape[1] == 4 assert swt is None assert np.count_nonzero(np.isnan(Xc)) == 0 def test_feature_rep_mix(): union = transform.FeatureRepMix([ ('a', transform.FeatureRep(features={'mean': mean}), 0), ('b', transform.FeatureRep(features={'mean': mean}), 1), ('c', transform.FeatureRep(features={'mean': mean}), [2,3]), ('d', transform.FeatureRep(features={'mean': mean}), slice(0,2)), ('e', transform.FeatureRep(features={'mean': mean}), [False, False, True, True]), ]) # multivariate ts X = np.random.rand(100, 10, 4) y = np.ones(100) union.fit(X, y) Xt = union.transform(X) assert Xt.shape[0] == len(X) assert len(union.f_labels) == Xt.shape[1] # ts with multivariate contextual data X = TS_Data(np.random.rand(100, 10, 4), np.random.rand(100, 3)) y = np.ones(100) union.fit(X, y) Xt = union.transform(X) assert Xt.shape[0] == len(X) assert len(union.f_labels) == Xt.shape[1] # ts with univariate contextual data X = TS_Data(np.random.rand(100, 10, 4), np.random.rand(100)) y = np.ones(100) union.fit(X, y) Xt = union.transform(X) assert Xt.shape[0] == len(X) assert len(union.f_labels) == Xt.shape[1] # univariate ts uni_union = transform.FeatureRepMix([ ('a', transform.FeatureRep(features={'mean': mean}), 0), ('b', transform.FeatureRep(features={'mean': mean}), [0]), ('c', transform.FeatureRep(features={'mean': mean}), slice(0,1)), ('d', transform.FeatureRep(features={'mean': mean}), [True]), ]) X = np.random.rand(100, 10) y = np.ones(100) uni_union.fit(X, y) Xt = uni_union.transform(X) assert Xt.shape[0] == len(X) assert len(uni_union.f_labels) == Xt.shape[1] def test_function_transform(): constant = 10 identity = transform.FunctionTransformer() def replace(Xt, value): return np.ones(Xt.shape) * value custom = transform.FunctionTransformer(replace, func_kwargs={"value": constant}) # univariate ts X = np.random.rand(100, 10) y = np.ones(100) identity.fit(X, y) Xtrans = identity.transform(X) assert Xtrans is X custom.fit(X, y) Xtrans = custom.transform(X) assert np.array_equal(Xtrans, np.ones(X.shape) * constant) # multivariate ts X = np.random.rand(100, 10, 4) y = np.ones(100) identity.fit(X, y) Xtrans = identity.transform(X) assert Xtrans is X custom.fit(X, y) Xtrans = custom.transform(X) assert np.array_equal(Xtrans, np.ones(X.shape) * constant) # ts with univariate contextual data Xt = np.random.rand(100, 10, 4) Xc = np.random.rand(100) X = TS_Data(Xt, Xc) y = np.ones(100) identity.fit(X, y) Xtrans = identity.transform(X) assert Xtrans is X custom.fit(X, y) Xtrans = custom.transform(X) Xtt, Xtc = get_ts_data_parts(Xtrans) assert np.array_equal(Xtt, np.ones(Xt.shape) * constant) assert Xtc is Xc # ts with multivariate contextual data Xt = np.random.rand(100, 10, 4) Xc = np.random.rand(100, 3) X = TS_Data(Xt, Xc) y = np.ones(100) identity.fit(X, y) Xtrans = identity.transform(X) assert Xtrans is X custom.fit(X, y) Xtrans = custom.transform(X) Xtt, Xtc = get_ts_data_parts(Xtrans) assert np.array_equal(Xtt, np.ones(Xt.shape) * constant) assert Xtc is Xc # test resampling def resample(Xt): return Xt.reshape(1, -1) illegal_resampler = transform.FunctionTransformer(resample) X = np.random.rand(100, 10) y = np.ones(100) illegal_resampler.fit(X, y) with pytest.raises(ValueError): Xtrans = illegal_resampler.transform(X)
33.673699
102
0.603709
3,873
23,942
3.6819
0.057836
0.085273
0.125386
0.047125
0.890673
0.87209
0.840603
0.79467
0.784502
0.764376
0
0.033879
0.2344
23,942
710
103
33.721127
0.744081
0.108763
0
0.756554
0
0
0.003105
0
0
0
0
0.001408
0.252809
1
0.024345
false
0
0.011236
0.003745
0.039326
0
0
0
0
null
0
0
0
1
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
7
481874097ba905a931d12af24fe9c1766ffbbd4f
24,671
py
Python
python/tests/test_qualify_service.py
Asher-Wang/ambassador
393a52832d081e0d8d0e0ecd5a14cfe18c62b837
[ "Apache-2.0" ]
1
2021-01-05T18:27:18.000Z
2021-01-05T18:27:18.000Z
python/tests/test_qualify_service.py
Asher-Wang/ambassador
393a52832d081e0d8d0e0ecd5a14cfe18c62b837
[ "Apache-2.0" ]
190
2021-04-22T11:35:09.000Z
2022-03-30T22:12:03.000Z
python/tests/test_qualify_service.py
Asher-Wang/ambassador
393a52832d081e0d8d0e0ecd5a14cfe18c62b837
[ "Apache-2.0" ]
2
2020-10-01T18:59:27.000Z
2021-02-04T06:23:18.000Z
from typing import Optional import logging import sys import pytest logging.basicConfig( level=logging.INFO, format="%(asctime)s test %(levelname)s: %(message)s", datefmt='%Y-%m-%d %H:%M:%S' ) logger = logging.getLogger("ambassador") from ambassador import Config, IR from ambassador.fetch import ResourceFetcher from ambassador.utils import NullSecretHandler from ambassador.ir import IRResource from ambassador.ir.irbasemapping import normalize_service_name yaml = ''' --- apiVersion: getambassador.io/v1 kind: Module name: ambassador config: {} ''' def qualify_service_name(ir: 'IR', service: str, namespace: Optional[str], rkey: Optional[str]=None) -> str: return normalize_service_name(ir, service, namespace, 'KubernetesTestResolver', rkey=rkey) def test_qualify_service(): aconf = Config() fetcher = ResourceFetcher(logger, aconf) fetcher.parse_yaml(yaml) aconf.load_all(fetcher.sorted()) secret_handler = NullSecretHandler(logger, None, None, "0") ir = IR(aconf, file_checker=lambda path: True, secret_handler=secret_handler) assert ir, "could not create an IR" assert qualify_service_name(ir, "backoffice", None) == "backoffice" assert qualify_service_name(ir, "backoffice", "default") == "backoffice" assert qualify_service_name(ir, "backoffice", "otherns") == "backoffice.otherns" assert qualify_service_name(ir, "backoffice.otherns", None) == "backoffice.otherns" assert qualify_service_name(ir, "backoffice.otherns", "default") == "backoffice.otherns" assert qualify_service_name(ir, "backoffice.otherns", "otherns") == "backoffice.otherns" assert normalize_service_name(ir, "backoffice", None, 'ConsulResolver') == "backoffice" assert normalize_service_name(ir, "backoffice", "default", 'ConsulResolver') == "backoffice" assert normalize_service_name(ir, "backoffice", "otherns", 'ConsulResolver') == "backoffice" assert normalize_service_name(ir, "backoffice.otherns", None, 'ConsulResolver') == "backoffice.otherns" assert normalize_service_name(ir, "backoffice.otherns", "default", 'ConsulResolver') == "backoffice.otherns" assert normalize_service_name(ir, "backoffice.otherns", "otherns", 'ConsulResolver') == "backoffice.otherns" assert qualify_service_name(ir, "backoffice:80", None) == "backoffice:80" assert qualify_service_name(ir, "backoffice:80", "default") == "backoffice:80" assert qualify_service_name(ir, "backoffice:80", "otherns") == "backoffice.otherns:80" assert qualify_service_name(ir, "backoffice.otherns:80", None) == "backoffice.otherns:80" assert qualify_service_name(ir, "backoffice.otherns:80", "default") == "backoffice.otherns:80" assert qualify_service_name(ir, "backoffice.otherns:80", "otherns") == "backoffice.otherns:80" assert normalize_service_name(ir, "backoffice:80", None, 'ConsulResolver') == "backoffice:80" assert normalize_service_name(ir, "backoffice:80", "default", 'ConsulResolver') == "backoffice:80" assert normalize_service_name(ir, "backoffice:80", "otherns", 'ConsulResolver') == "backoffice:80" assert normalize_service_name(ir, "backoffice.otherns:80", None, 'ConsulResolver') == "backoffice.otherns:80" assert normalize_service_name(ir, "backoffice.otherns:80", "default", 'ConsulResolver') == "backoffice.otherns:80" assert normalize_service_name(ir, "backoffice.otherns:80", "otherns", 'ConsulResolver') == "backoffice.otherns:80" assert qualify_service_name(ir, "http://backoffice", None) == "http://backoffice" assert qualify_service_name(ir, "http://backoffice", "default") == "http://backoffice" assert qualify_service_name(ir, "http://backoffice", "otherns") == "http://backoffice.otherns" assert qualify_service_name(ir, "http://backoffice.otherns", None) == "http://backoffice.otherns" assert qualify_service_name(ir, "http://backoffice.otherns", "default") == "http://backoffice.otherns" assert qualify_service_name(ir, "http://backoffice.otherns", "otherns") == "http://backoffice.otherns" assert normalize_service_name(ir, "http://backoffice", None, 'ConsulResolver') == "http://backoffice" assert normalize_service_name(ir, "http://backoffice", "default", 'ConsulResolver') == "http://backoffice" assert normalize_service_name(ir, "http://backoffice", "otherns", 'ConsulResolver') == "http://backoffice" assert normalize_service_name(ir, "http://backoffice.otherns", None, 'ConsulResolver') == "http://backoffice.otherns" assert normalize_service_name(ir, "http://backoffice.otherns", "default", 'ConsulResolver') == "http://backoffice.otherns" assert normalize_service_name(ir, "http://backoffice.otherns", "otherns", 'ConsulResolver') == "http://backoffice.otherns" assert qualify_service_name(ir, "http://backoffice:80", None) == "http://backoffice:80" assert qualify_service_name(ir, "http://backoffice:80", "default") == "http://backoffice:80" assert qualify_service_name(ir, "http://backoffice:80", "otherns") == "http://backoffice.otherns:80" assert qualify_service_name(ir, "http://backoffice.otherns:80", None) == "http://backoffice.otherns:80" assert qualify_service_name(ir, "http://backoffice.otherns:80", "default") == "http://backoffice.otherns:80" assert qualify_service_name(ir, "http://backoffice.otherns:80", "otherns") == "http://backoffice.otherns:80" assert normalize_service_name(ir, "http://backoffice:80", None, 'ConsulResolver') == "http://backoffice:80" assert normalize_service_name(ir, "http://backoffice:80", "default", 'ConsulResolver') == "http://backoffice:80" assert normalize_service_name(ir, "http://backoffice:80", "otherns", 'ConsulResolver') == "http://backoffice:80" assert normalize_service_name(ir, "http://backoffice.otherns:80", None, 'ConsulResolver') == "http://backoffice.otherns:80" assert normalize_service_name(ir, "http://backoffice.otherns:80", "default", 'ConsulResolver') == "http://backoffice.otherns:80" assert normalize_service_name(ir, "http://backoffice.otherns:80", "otherns", 'ConsulResolver') == "http://backoffice.otherns:80" assert qualify_service_name(ir, "https://backoffice", None) == "https://backoffice" assert qualify_service_name(ir, "https://backoffice", "default") == "https://backoffice" assert qualify_service_name(ir, "https://backoffice", "otherns") == "https://backoffice.otherns" assert qualify_service_name(ir, "https://backoffice.otherns", None) == "https://backoffice.otherns" assert qualify_service_name(ir, "https://backoffice.otherns", "default") == "https://backoffice.otherns" assert qualify_service_name(ir, "https://backoffice.otherns", "otherns") == "https://backoffice.otherns" assert normalize_service_name(ir, "https://backoffice", None, 'ConsulResolver') == "https://backoffice" assert normalize_service_name(ir, "https://backoffice", "default", 'ConsulResolver') == "https://backoffice" assert normalize_service_name(ir, "https://backoffice", "otherns", 'ConsulResolver') == "https://backoffice" assert normalize_service_name(ir, "https://backoffice.otherns", None, 'ConsulResolver') == "https://backoffice.otherns" assert normalize_service_name(ir, "https://backoffice.otherns", "default", 'ConsulResolver') == "https://backoffice.otherns" assert normalize_service_name(ir, "https://backoffice.otherns", "otherns", 'ConsulResolver') == "https://backoffice.otherns" assert qualify_service_name(ir, "https://backoffice:443", None) == "https://backoffice:443" assert qualify_service_name(ir, "https://backoffice:443", "default") == "https://backoffice:443" assert qualify_service_name(ir, "https://backoffice:443", "otherns") == "https://backoffice.otherns:443" assert qualify_service_name(ir, "https://backoffice.otherns:443", None) == "https://backoffice.otherns:443" assert qualify_service_name(ir, "https://backoffice.otherns:443", "default") == "https://backoffice.otherns:443" assert qualify_service_name(ir, "https://backoffice.otherns:443", "otherns") == "https://backoffice.otherns:443" assert normalize_service_name(ir, "https://backoffice:443", None, 'ConsulResolver') == "https://backoffice:443" assert normalize_service_name(ir, "https://backoffice:443", "default", 'ConsulResolver') == "https://backoffice:443" assert normalize_service_name(ir, "https://backoffice:443", "otherns", 'ConsulResolver') == "https://backoffice:443" assert normalize_service_name(ir, "https://backoffice.otherns:443", None, 'ConsulResolver') == "https://backoffice.otherns:443" assert normalize_service_name(ir, "https://backoffice.otherns:443", "default", 'ConsulResolver') == "https://backoffice.otherns:443" assert normalize_service_name(ir, "https://backoffice.otherns:443", "otherns", 'ConsulResolver') == "https://backoffice.otherns:443" assert qualify_service_name(ir, "localhost", None) == "localhost" assert qualify_service_name(ir, "localhost", "default") == "localhost" assert qualify_service_name(ir, "localhost", "otherns") == "localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "localhost.otherns", None) == "localhost.otherns" assert qualify_service_name(ir, "localhost.otherns", "default") == "localhost.otherns" assert qualify_service_name(ir, "localhost.otherns", "otherns") == "localhost.otherns" assert normalize_service_name(ir, "localhost", None, 'ConsulResolver') == "localhost" assert normalize_service_name(ir, "localhost", "default", 'ConsulResolver') == "localhost" assert normalize_service_name(ir, "localhost", "otherns", 'ConsulResolver') == "localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "localhost.otherns", None, 'ConsulResolver') == "localhost.otherns" assert normalize_service_name(ir, "localhost.otherns", "default", 'ConsulResolver') == "localhost.otherns" assert normalize_service_name(ir, "localhost.otherns", "otherns", 'ConsulResolver') == "localhost.otherns" assert qualify_service_name(ir, "localhost:80", None) == "localhost:80" assert qualify_service_name(ir, "localhost:80", "default") == "localhost:80" assert qualify_service_name(ir, "localhost:80", "otherns") == "localhost:80" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "localhost.otherns:80", None) == "localhost.otherns:80" assert qualify_service_name(ir, "localhost.otherns:80", "default") == "localhost.otherns:80" assert qualify_service_name(ir, "localhost.otherns:80", "otherns") == "localhost.otherns:80" assert normalize_service_name(ir, "localhost:80", None, 'ConsulResolver') == "localhost:80" assert normalize_service_name(ir, "localhost:80", "default", 'ConsulResolver') == "localhost:80" assert normalize_service_name(ir, "localhost:80", "otherns", 'ConsulResolver') == "localhost:80" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "localhost.otherns:80", None, 'ConsulResolver') == "localhost.otherns:80" assert normalize_service_name(ir, "localhost.otherns:80", "default", 'ConsulResolver') == "localhost.otherns:80" assert normalize_service_name(ir, "localhost.otherns:80", "otherns", 'ConsulResolver') == "localhost.otherns:80" assert qualify_service_name(ir, "http://localhost", None) == "http://localhost" assert qualify_service_name(ir, "http://localhost", "default") == "http://localhost" assert qualify_service_name(ir, "http://localhost", "otherns") == "http://localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "http://localhost.otherns", None) == "http://localhost.otherns" assert qualify_service_name(ir, "http://localhost.otherns", "default") == "http://localhost.otherns" assert qualify_service_name(ir, "http://localhost.otherns", "otherns") == "http://localhost.otherns" assert normalize_service_name(ir, "http://localhost", None, 'ConsulResolver') == "http://localhost" assert normalize_service_name(ir, "http://localhost", "default", 'ConsulResolver') == "http://localhost" assert normalize_service_name(ir, "http://localhost", "otherns", 'ConsulResolver') == "http://localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "http://localhost.otherns", None, 'ConsulResolver') == "http://localhost.otherns" assert normalize_service_name(ir, "http://localhost.otherns", "default", 'ConsulResolver') == "http://localhost.otherns" assert normalize_service_name(ir, "http://localhost.otherns", "otherns", 'ConsulResolver') == "http://localhost.otherns" assert qualify_service_name(ir, "http://localhost:80", None) == "http://localhost:80" assert qualify_service_name(ir, "http://localhost:80", "default") == "http://localhost:80" assert qualify_service_name(ir, "http://localhost:80", "otherns") == "http://localhost:80" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "http://localhost.otherns:80", None) == "http://localhost.otherns:80" assert qualify_service_name(ir, "http://localhost.otherns:80", "default") == "http://localhost.otherns:80" assert qualify_service_name(ir, "http://localhost.otherns:80", "otherns") == "http://localhost.otherns:80" assert normalize_service_name(ir, "http://localhost:80", None, 'ConsulResolver') == "http://localhost:80" assert normalize_service_name(ir, "http://localhost:80", "default", 'ConsulResolver') == "http://localhost:80" assert normalize_service_name(ir, "http://localhost:80", "otherns", 'ConsulResolver') == "http://localhost:80" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "http://localhost.otherns:80", None, 'ConsulResolver') == "http://localhost.otherns:80" assert normalize_service_name(ir, "http://localhost.otherns:80", "default", 'ConsulResolver') == "http://localhost.otherns:80" assert normalize_service_name(ir, "http://localhost.otherns:80", "otherns", 'ConsulResolver') == "http://localhost.otherns:80" assert qualify_service_name(ir, "https://localhost", None) == "https://localhost" assert qualify_service_name(ir, "https://localhost", "default") == "https://localhost" assert qualify_service_name(ir, "https://localhost", "otherns") == "https://localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "https://localhost.otherns", None) == "https://localhost.otherns" assert qualify_service_name(ir, "https://localhost.otherns", "default") == "https://localhost.otherns" assert qualify_service_name(ir, "https://localhost.otherns", "otherns") == "https://localhost.otherns" assert normalize_service_name(ir, "https://localhost", None, 'ConsulResolver') == "https://localhost" assert normalize_service_name(ir, "https://localhost", "default", 'ConsulResolver') == "https://localhost" assert normalize_service_name(ir, "https://localhost", "otherns", 'ConsulResolver') == "https://localhost" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "https://localhost.otherns", None, 'ConsulResolver') == "https://localhost.otherns" assert normalize_service_name(ir, "https://localhost.otherns", "default", 'ConsulResolver') == "https://localhost.otherns" assert normalize_service_name(ir, "https://localhost.otherns", "otherns", 'ConsulResolver') == "https://localhost.otherns" assert qualify_service_name(ir, "https://localhost:443", None) == "https://localhost:443" assert qualify_service_name(ir, "https://localhost:443", "default") == "https://localhost:443" assert qualify_service_name(ir, "https://localhost:443", "otherns") == "https://localhost:443" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert qualify_service_name(ir, "https://localhost.otherns:443", None) == "https://localhost.otherns:443" assert qualify_service_name(ir, "https://localhost.otherns:443", "default") == "https://localhost.otherns:443" assert qualify_service_name(ir, "https://localhost.otherns:443", "otherns") == "https://localhost.otherns:443" assert normalize_service_name(ir, "https://localhost:443", None, 'ConsulResolver') == "https://localhost:443" assert normalize_service_name(ir, "https://localhost:443", "default", 'ConsulResolver') == "https://localhost:443" assert normalize_service_name(ir, "https://localhost:443", "otherns", 'ConsulResolver') == "https://localhost:443" # It's not meaningful to actually say "localhost.otherns", but it should passed through unchanged. assert normalize_service_name(ir, "https://localhost.otherns:443", None, 'ConsulResolver') == "https://localhost.otherns:443" assert normalize_service_name(ir, "https://localhost.otherns:443", "default", 'ConsulResolver') == "https://localhost.otherns:443" assert normalize_service_name(ir, "https://localhost.otherns:443", "otherns", 'ConsulResolver') == "https://localhost.otherns:443" assert qualify_service_name(ir, "ambassador://foo.ns", "otherns") == "ambassador://foo.ns" # let's not introduce silly semantics assert qualify_service_name(ir, "//foo.ns:1234", "otherns") == "foo.ns:1234" # we tell people "URL-ish", actually support URL-ish assert qualify_service_name(ir, "foo.ns:1234", "otherns") == "foo.ns:1234" assert normalize_service_name(ir, "ambassador://foo.ns", "otherns", 'ConsulResolver') == "ambassador://foo.ns" # let's not introduce silly semantics assert normalize_service_name(ir, "//foo.ns:1234", "otherns", 'ConsulResolver') == "foo.ns:1234" # we tell people "URL-ish", actually support URL-ish assert normalize_service_name(ir, "foo.ns:1234", "otherns", 'ConsulResolver') == "foo.ns:1234" errors = ir.aconf.errors assert not errors assert qualify_service_name(ir, "https://bad-service:443:443", "otherns") == "https://bad-service:443:443" assert qualify_service_name(ir, "https://bad-service:443:443", "otherns", rkey="test-rkey") == "https://bad-service:443:443" assert qualify_service_name(ir, "bad-service:443:443", "otherns") == "bad-service:443:443" assert qualify_service_name(ir, "https://[fe80::e022:9cff:fecc:c7c4:443", "otherns") == "https://[fe80::e022:9cff:fecc:c7c4:443" assert qualify_service_name(ir, "https://[fe80::e022:9cff:fecc:c7c4", "otherns") == "https://[fe80::e022:9cff:fecc:c7c4" assert qualify_service_name(ir, "https://fe80::e022:9cff:fecc:c7c4", "otherns") == "https://fe80::e022:9cff:fecc:c7c4" assert qualify_service_name(ir, "https://bad-service:-1", "otherns") == "https://bad-service:-1" assert qualify_service_name(ir, "https://bad-service:70000", "otherns") == "https://bad-service:70000" assert normalize_service_name(ir, "https://bad-service:443:443", "otherns", 'ConsulResolver') == "https://bad-service:443:443" assert normalize_service_name(ir, "https://bad-service:443:443", "otherns", 'ConsulResolver', rkey="test-rkey") == "https://bad-service:443:443" assert normalize_service_name(ir, "bad-service:443:443", "otherns", 'ConsulResolver') == "bad-service:443:443" assert normalize_service_name(ir, "https://[fe80::e022:9cff:fecc:c7c4:443", "otherns", 'ConsulResolver') == "https://[fe80::e022:9cff:fecc:c7c4:443" assert normalize_service_name(ir, "https://[fe80::e022:9cff:fecc:c7c4", "otherns", 'ConsulResolver') == "https://[fe80::e022:9cff:fecc:c7c4" assert normalize_service_name(ir, "https://fe80::e022:9cff:fecc:c7c4", "otherns", 'ConsulResolver') == "https://fe80::e022:9cff:fecc:c7c4" assert normalize_service_name(ir, "https://bad-service:-1", "otherns", 'ConsulResolver') == "https://bad-service:-1" assert normalize_service_name(ir, "https://bad-service:70000", "otherns", 'ConsulResolver') == "https://bad-service:70000" errors = ir.aconf.errors assert "-global-" in errors errors = errors["-global-"] assert len(errors) == 16 # Ugg, different versions of Python have different error messages. Let's recognize the "Port could not be cast to # integer value as" to keep pytest working on peoples up-to-date laptops with Python 3.8, and let's recognize # "invalid literal for int() with base 10:" for the Python 3.7 in the builder container. assert not errors[0]["ok"] assert (errors[0]["error"] == "Malformed service 'https://bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[0]["error"] == "Malformed service 'https://bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[1]["ok"] assert (errors[1]["error"] == "test-rkey: Malformed service 'https://bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[1]["error"] == "test-rkey: Malformed service 'https://bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[2]["ok"] assert (errors[2]["error"] == "Malformed service 'bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[2]["error"] == "Malformed service 'bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[3]["ok"] assert errors[3]["error"] == "Malformed service 'https://[fe80::e022:9cff:fecc:c7c4:443': Invalid IPv6 URL" assert not errors[4]["ok"] assert errors[4]["error"] == "Malformed service 'https://[fe80::e022:9cff:fecc:c7c4': Invalid IPv6 URL" assert not errors[5]["ok"] assert (errors[5]["error"] == "Malformed service 'https://fe80::e022:9cff:fecc:c7c4': Port could not be cast to integer value as ':e022:9cff:fecc:c7c4'" or errors[5]["error"] == "Malformed service 'https://fe80::e022:9cff:fecc:c7c4': invalid literal for int() with base 10: ':e022:9cff:fecc:c7c4'") assert not errors[6]["ok"] assert errors[6]["error"] == "Malformed service 'https://bad-service:-1': Port out of range 0-65535" assert not errors[7]["ok"] assert errors[7]["error"] == "Malformed service 'https://bad-service:70000': Port out of range 0-65535" assert not errors[8]["ok"] assert (errors[8]["error"] == "Malformed service 'https://bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[8]["error"] == "Malformed service 'https://bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[9]["ok"] assert (errors[9]["error"] == "test-rkey: Malformed service 'https://bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[9]["error"] == "test-rkey: Malformed service 'https://bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[10]["ok"] assert (errors[10]["error"] == "Malformed service 'bad-service:443:443': Port could not be cast to integer value as '443:443'" or errors[10]["error"] == "Malformed service 'bad-service:443:443': invalid literal for int() with base 10: '443:443'") assert not errors[11]["ok"] assert errors[11]["error"] == "Malformed service 'https://[fe80::e022:9cff:fecc:c7c4:443': Invalid IPv6 URL" assert not errors[12]["ok"] assert errors[12]["error"] == "Malformed service 'https://[fe80::e022:9cff:fecc:c7c4': Invalid IPv6 URL" assert not errors[13]["ok"] assert (errors[13]["error"] == "Malformed service 'https://fe80::e022:9cff:fecc:c7c4': Port could not be cast to integer value as ':e022:9cff:fecc:c7c4'" or errors[13]["error"] == "Malformed service 'https://fe80::e022:9cff:fecc:c7c4': invalid literal for int() with base 10: ':e022:9cff:fecc:c7c4'") assert not errors[14]["ok"] assert errors[14]["error"] == "Malformed service 'https://bad-service:-1': Port out of range 0-65535" assert not errors[15]["ok"] assert errors[15]["error"] == "Malformed service 'https://bad-service:70000': Port out of range 0-65535" if __name__ == '__main__': pytest.main(sys.argv)
76.380805
160
0.710551
3,055
24,671
5.622259
0.055646
0.108232
0.127154
0.097811
0.916628
0.899395
0.879192
0.840126
0.789939
0.699348
0
0.042751
0.118236
24,671
322
161
76.618012
0.746805
0.066677
0
0.00813
0
0.065041
0.502434
0.020473
0
0
0
0
0.821138
1
0.00813
false
0
0.036585
0.004065
0.04878
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
1
0
0
0
0
0
0
0
0
0
7
4851f64de833f7d957b296225856f44a9c545807
199
py
Python
ss_util.py
bkkrueger/secret_santa
3b0854b682e6d6f32f58c017138efd14ad23659a
[ "MIT" ]
null
null
null
ss_util.py
bkkrueger/secret_santa
3b0854b682e6d6f32f58c017138efd14ad23659a
[ "MIT" ]
1
2019-09-07T20:44:36.000Z
2019-09-07T20:44:36.000Z
ss_util.py
bkkrueger/secret_santa
3b0854b682e6d6f32f58c017138efd14ad23659a
[ "MIT" ]
null
null
null
# Imports import math # ============================================================================= # Miscellaneous support functions def digits(N): return(int(math.floor(math.log10(N))+1))
19.9
79
0.427136
17
199
5
0.823529
0
0
0
0
0
0
0
0
0
0
0.01676
0.100503
199
9
80
22.111111
0.458101
0.58794
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
7
485ebe2ad205666c76d1db93a16cc4c0cdaa2ad0
6,640
py
Python
tests/test_router_verify.py
chatalyan/fastapi-users
2d6db3deea0fd7d4805ff2c5f6783fca8fc0fa34
[ "MIT" ]
null
null
null
tests/test_router_verify.py
chatalyan/fastapi-users
2d6db3deea0fd7d4805ff2c5f6783fca8fc0fa34
[ "MIT" ]
2
2022-02-18T04:38:15.000Z
2022-03-07T04:36:52.000Z
tests/test_router_verify.py
chatalyan/fastapi-users
2d6db3deea0fd7d4805ff2c5f6783fca8fc0fa34
[ "MIT" ]
null
null
null
from typing import Any, AsyncGenerator, Dict, cast import httpx import pytest from fastapi import FastAPI, status from fastapi_users.manager import ( InvalidVerifyToken, UserAlreadyVerified, UserInactive, UserNotExists, ) from fastapi_users.router import ErrorCode, get_verify_router from tests.conftest import AsyncMethodMocker, User, UserDB, UserManagerMock @pytest.fixture @pytest.mark.asyncio async def test_app_client( get_user_manager, get_test_client, ) -> AsyncGenerator[httpx.AsyncClient, None]: verify_router = get_verify_router( get_user_manager, User, ) app = FastAPI() app.include_router(verify_router) async for client in get_test_client(app): yield client @pytest.mark.router @pytest.mark.asyncio class TestVerifyTokenRequest: async def test_empty_body( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): response = await test_app_client.post("/request-verify-token", json={}) assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY assert user_manager.request_verify.called is False async def test_wrong_email( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): json = {"email": "king.arthur"} response = await test_app_client.post("/request-verify-token", json=json) assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY assert user_manager.request_verify.called is False async def test_user_not_exists( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): user_manager.get_by_email.side_effect = UserNotExists() json = {"email": "user@example.com"} response = await test_app_client.post("/request-verify-token", json=json) assert response.status_code == status.HTTP_202_ACCEPTED assert user_manager.request_verify.called is False async def test_user_inactive( self, async_method_mocker: AsyncMethodMocker, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, user: UserDB, ): async_method_mocker(user_manager, "get_by_email", return_value=user) user_manager.request_verify.side_effect = UserInactive() json = {"email": "user@example.com"} response = await test_app_client.post("/request-verify-token", json=json) assert response.status_code == status.HTTP_202_ACCEPTED async def test_user_already_verified( self, async_method_mocker: AsyncMethodMocker, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, user: UserDB, ): async_method_mocker(user_manager, "get_by_email", return_value=user) user_manager.request_verify.side_effect = UserAlreadyVerified() json = {"email": "user@example.com"} response = await test_app_client.post("/request-verify-token", json=json) assert response.status_code == status.HTTP_202_ACCEPTED async def test_user_not_verified( self, async_method_mocker: AsyncMethodMocker, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, user: UserDB, ): async_method_mocker(user_manager, "get_by_email", return_value=user) async_method_mocker(user_manager, "request_verify", return_value=None) json = {"email": "user@example.com"} response = await test_app_client.post("/request-verify-token", json=json) assert response.status_code == status.HTTP_202_ACCEPTED async def test_token_namespace( self, get_user_manager, ): verify_router = get_verify_router( get_user_manager, User, ) app = FastAPI() app.include_router(verify_router) assert app.url_path_for("request_verify_token") == "/request-verify-token" @pytest.mark.router @pytest.mark.asyncio class TestVerify: async def test_empty_body( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): response = await test_app_client.post("/verify", json={}) assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY assert user_manager.verify.called is False async def test_invalid_verify_token( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): user_manager.verify.side_effect = InvalidVerifyToken() response = await test_app_client.post("/verify", json={"token": "foo"}) assert response.status_code == status.HTTP_400_BAD_REQUEST data = cast(Dict[str, Any], response.json()) assert data["detail"] == ErrorCode.VERIFY_USER_BAD_TOKEN async def test_user_not_exists( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): user_manager.verify.side_effect = UserNotExists() response = await test_app_client.post("/verify", json={"token": "foo"}) assert response.status_code == status.HTTP_400_BAD_REQUEST data = cast(Dict[str, Any], response.json()) assert data["detail"] == ErrorCode.VERIFY_USER_BAD_TOKEN async def test_user_already_verified( self, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, ): user_manager.verify.side_effect = UserAlreadyVerified() response = await test_app_client.post("/verify", json={"token": "foo"}) assert response.status_code == status.HTTP_400_BAD_REQUEST data = cast(Dict[str, Any], response.json()) assert data["detail"] == ErrorCode.VERIFY_USER_ALREADY_VERIFIED async def test_success( self, async_method_mocker: AsyncMethodMocker, test_app_client: httpx.AsyncClient, user_manager: UserManagerMock, user: UserDB, ): async_method_mocker(user_manager, "verify", return_value=user) response = await test_app_client.post("/verify", json={"token": "foo"}) assert response.status_code == status.HTTP_200_OK data = cast(Dict[str, Any], response.json()) assert data["id"] == str(user.id) async def test_verify_namespace( self, get_user_manager, ): verify_router = get_verify_router( get_user_manager, User, ) app = FastAPI() app.include_router(verify_router) assert app.url_path_for("verify") == "/verify"
34.051282
82
0.678916
767
6,640
5.571056
0.125163
0.082378
0.069974
0.046337
0.808565
0.79897
0.79897
0.768781
0.767377
0.744208
0
0.006449
0.229367
6,640
194
83
34.226804
0.828611
0
0
0.718563
0
0
0.063705
0.022139
0
0
0
0
0.125749
1
0
false
0
0.041916
0
0.053892
0
0
0
0
null
0
0
0
1
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
7
4870bc7f1c7521185f9065d06883a2c8dc838202
16,967
py
Python
lib/model/faster_rcnn/alt_parts/resnet.py
Arieszhang1994/faster-rcnn_pytorch
a25dcf2bb9aeb22b508e67edb5ba093a482a30ad
[ "MIT" ]
4
2018-11-16T12:32:49.000Z
2019-05-09T10:03:21.000Z
lib/model/faster_rcnn/alt_parts/resnet.py
Arieszhang1994/faster-rcnn_pytorch
a25dcf2bb9aeb22b508e67edb5ba093a482a30ad
[ "MIT" ]
null
null
null
lib/model/faster_rcnn/alt_parts/resnet.py
Arieszhang1994/faster-rcnn_pytorch
a25dcf2bb9aeb22b508e67edb5ba093a482a30ad
[ "MIT" ]
1
2019-01-02T12:50:36.000Z
2019-01-02T12:50:36.000Z
# -------------------------------------------------------- # Pytorch Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Aries Zhang # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ import print_function import random import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torchvision.models as models from torch.autograd import Variable import numpy as np from model.utils.config import cfg from model.rpn.rpn import _RPN from model.faster_rcnn.detector import _detector import math import torchvision.models as models import torch.utils.model_zoo as model_zoo from model.faster_rcnn.resnetparts import resnet101, resnet50, resnet152 class resnet_step1(nn.Module): '''step1 for resnet''' def __init__(self, classes, num_layers=101, fix_cnn_base=False, \ class_agnostic=False, pretrained=False, base_model='resnet101'): super(resnet_step1, self).__init__() if num_layers == 101: self.model_path = 'data/pretrained_model/resnet101_caffe.pth' elif num_layers == 50: self.model_path = 'data/pretrained_model/resnet50_caffe.pth' elif num_layers == 152: self.model_path = 'data/pretrained_model/resnet152_caffe.pth' self.dout_base_model = 1024 self.pretrained = pretrained self.class_agnostic = class_agnostic self.num_layer = num_layers self.fix_cnn_base = fix_cnn_base self.classes = classes self.n_classes = len(classes) # loss self.RCNN_loss_cls = 0 self.RCNN_loss_bbox = 0 #define base if self.num_layer == 101: resnet = resnet101() elif self.num_layer == 50: resnet = resnet50() elif self.num_layer == 152: resnet = resnet152() if self.pretrained: print("Step1: Loading pretrained weights from %s" %(self.model_path)) state_dict = torch.load(self.model_path) resnet.load_state_dict({k:v for k,v in state_dict.items() if k in resnet.state_dict()}) # Build resnet. self.RCNN_base = nn.Sequential(resnet.conv1, resnet.bn1,resnet.relu, \ resnet.maxpool,resnet.layer1,resnet.layer2,resnet.layer3) # Fix blocks if fix_cnn_base: for p in self.RCNN_base[0].parameters(): p.requires_grad=False for p in self.RCNN_base[1].parameters(): p.requires_grad=False assert (0 <= cfg.RESNET.FIXED_BLOCKS < 4) if cfg.RESNET.FIXED_BLOCKS >= 3: for p in self.RCNN_base[6].parameters(): p.requires_grad=False if cfg.RESNET.FIXED_BLOCKS >= 2: for p in self.RCNN_base[5].parameters(): p.requires_grad=False if cfg.RESNET.FIXED_BLOCKS >= 1: for p in self.RCNN_base[4].parameters(): p.requires_grad=False def set_bn_fix(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: for p in m.parameters(): p.requires_grad=False self.RCNN_base.apply(set_bn_fix) # define rpn self.RCNN_rpn = _RPN(self.dout_base_model) #init weight def normal_init(m, mean, stddev, truncated=False): """ weight initalizer: truncated normal and random normal. """ # x is a parameter if truncated: m.weight.data.normal_().fmod_(2).mul_(stddev).add_(mean) # not a perfect approximation else: m.weight.data.normal_(mean, stddev) m.bias.data.zero_() normal_init(self.RCNN_rpn.RPN_Conv, 0, 0.01, cfg.TRAIN.TRUNCATED) normal_init(self.RCNN_rpn.RPN_cls_score, 0, 0.01, cfg.TRAIN.TRUNCATED) normal_init(self.RCNN_rpn.RPN_bbox_pred, 0, 0.01, cfg.TRAIN.TRUNCATED) def forward(self, im_data, im_info, gt_boxes, num_boxes): batch_size = im_data.size(0) im_info = im_info.data gt_boxes = gt_boxes.data num_boxes = num_boxes.data # feed image data to base model to obtain base feature map base_feat = self.RCNN_base(im_data) # feed base feature map tp RPN to obtain rois rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes) return rois, rpn_loss_cls, rpn_loss_bbox def train(self, mode=True): # Override train so that the training mode is set as we want nn.Module.train(self, mode) if mode and self.fix_cnn_base: # Set fixed blocks to be in eval mode self.RCNN_base.eval() self.RCNN_base[5].train() self.RCNN_base[6].train() def set_bn_eval(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: m.eval() self.RCNN_base.apply(set_bn_eval) #self.detector.RCNN_top.apply(set_bn_eval) class resnet_step2(nn.Module): '''step2 for resnet''' def __init__(self, classes, step1_model_path, num_layers=101, fix_cnn_base=False, \ class_agnostic=False, pretrained=False, base_model='resnet101'): super(resnet_step2, self).__init__() if num_layers == 101: self.model_path = 'data/pretrained_model/resnet101_caffe.pth' elif num_layers == 50: self.model_path = 'data/pretrained_model/resnet50_caffe.pth' elif num_layers == 152: self.model_path = 'data/pretrained_model/resnet152_caffe.pth' self.dout_base_model = 1024 self.pretrained = pretrained self.class_agnostic = class_agnostic self.num_layer = num_layers self.fix_cnn_base = fix_cnn_base self.classes = classes self.n_classes = len(classes) self.base_model = 'resnet'+str(self.num_layer) # loss self.RCNN_loss_cls = 0 self.RCNN_loss_bbox = 0 #define base if self.num_layer == 101: resnet = resnet101() elif self.num_layer == 50: resnet = resnet50() elif self.num_layer == 152: resnet = resnet152() if self.pretrained: print("Step2: Loading pretrained weights from %s" %(self.model_path)) state_dict = torch.load(self.model_path) resnet.load_state_dict({k:v for k,v in state_dict.items() if k in resnet.state_dict()}) # Build resnet. self.RCNN_base = nn.Sequential(resnet.conv1, resnet.bn1,resnet.relu, \ resnet.maxpool,resnet.layer1,resnet.layer2,resnet.layer3) # Fix blocks if fix_cnn_base: for p in self.RCNN_base[0].parameters(): p.requires_grad=False for p in self.RCNN_base[1].parameters(): p.requires_grad=False assert (0 <= cfg.RESNET.FIXED_BLOCKS < 4) if cfg.RESNET.FIXED_BLOCKS >= 3: for p in self.RCNN_base[6].parameters(): p.requires_grad=False if cfg.RESNET.FIXED_BLOCKS >= 2: for p in self.RCNN_base[5].parameters(): p.requires_grad=False if cfg.RESNET.FIXED_BLOCKS >= 1: for p in self.RCNN_base[4].parameters(): p.requires_grad=False def set_bn_fix(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: for p in m.parameters(): p.requires_grad=False self.RCNN_base.apply(set_bn_fix) # define rpn self.RCNN_rpn = _RPN(self.dout_base_model) #init weight of rpn state_dict_rpn = torch.load(step1_model_path) self.RCNN_rpn.load_state_dict({k.replace('RCNN_rpn.',''):v for k,v in state_dict_rpn['model'].items() if 'RCNN_rpn' in k}) for key, value in dict(self.RCNN_rpn.named_parameters()).items(): value.requires_grad = False # define detector self.detector = _detector(self.classes, self.class_agnostic,pretrained, base_model=self.base_model) #init weight of detector def normal_init(m, mean, stddev, truncated=False): """ weight initalizer: truncated normal and random normal. """ # x is a parameter if truncated: m.weight.data.normal_().fmod_(2).mul_(stddev).add_(mean) # not a perfect approximation else: m.weight.data.normal_(mean, stddev) m.bias.data.zero_() normal_init(self.detector.RCNN_cls_score, 0, 0.01, cfg.TRAIN.TRUNCATED) normal_init(self.detector.RCNN_bbox_pred, 0, 0.001, cfg.TRAIN.TRUNCATED) def forward(self, im_data, im_info, gt_boxes, num_boxes): batch_size = im_data.size(0) im_info = im_info.data gt_boxes = gt_boxes.data num_boxes = num_boxes.data # feed image data to base model to obtain base feature map base_feat = self.RCNN_base(im_data) # feed base feature map tp RPN to obtain rois rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes, alt=True) if not self.training: rpn_loss_cls = 0 rpn_loss_bbox = 0 # detector part rois, cls_prob, bbox_pred, \ RCNN_loss_cls, RCNN_loss_bbox, \ rois_label = self.detector(base_feat, rois, batch_size,gt_boxes, num_boxes) return rois, cls_prob, bbox_pred, rpn_loss_cls, rpn_loss_bbox, RCNN_loss_cls, RCNN_loss_bbox, rois_label def train(self, mode=True): # Override train so that the training mode is set as we want nn.Module.train(self, mode) if mode and self.fix_cnn_base: # Set fixed blocks to be in eval mode self.RCNN_base.eval() self.RCNN_base[5].train() self.RCNN_base[6].train() def set_bn_eval(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: m.eval() self.RCNN_base.apply(set_bn_eval) self.detector.RCNN_top.apply(set_bn_eval) class resnet_step3(nn.Module): '''step3 for resnet''' def __init__(self, classes, step2_model_path, num_layers=101, fix_cnn_base=False, \ class_agnostic=False, pretrained=False, base_model='resnet101'): super(resnet_step3, self).__init__() self.model_path = step2_model_path self.dout_base_model = 1024 self.pretrained = pretrained self.class_agnostic = class_agnostic self.num_layer = num_layers self.fix_cnn_base = fix_cnn_base self.classes = classes self.n_classes = len(classes) self.base_model = 'resnet'+str(self.num_layer) # loss self.RCNN_loss_cls = 0 self.RCNN_loss_bbox = 0 if self.num_layer == 101: resnet = resnet101() elif self.num_layer == 50: resnet = resnet50() elif self.num_layer == 152: resnet = resnet152() print("Step3: Loading pretrained weights from %s" %(self.model_path)) state_dict = torch.load(self.model_path) # Build resnet. self.RCNN_base = nn.Sequential(resnet.conv1, resnet.bn1,resnet.relu, resnet.maxpool,resnet.layer1,resnet.layer2,resnet.layer3) self.RCNN_base.load_state_dict({k.replace('RCNN_base.',''):v for k,v in state_dict['model'].items() if 'RCNN_base' in k}) for key, value in dict(self.RCNN_base.named_parameters()).items(): value.requires_grad = False # define rpn self.RCNN_rpn = _RPN(self.dout_base_model) self.RCNN_rpn.load_state_dict({k.replace('RCNN_rpn.',''):v for k,v in state_dict['model'].items() if 'RCNN_rpn' in k}) def forward(self, im_data, im_info, gt_boxes, num_boxes): batch_size = im_data.size(0) im_info = im_info.data gt_boxes = gt_boxes.data num_boxes = num_boxes.data # feed image data to base model to obtain base feature map base_feat = self.RCNN_base(im_data) # feed base feature map tp RPN to obtain rois rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes) return rois, rpn_loss_cls, rpn_loss_bbox def train(self, mode=True): # Override train so that the training mode is set as we want nn.Module.train(self, mode) if mode and self.fix_cnn_base: # Set fixed blocks to be in eval mode self.RCNN_base.eval() self.RCNN_base[5].train() self.RCNN_base[6].train() def set_bn_eval(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: m.eval() self.RCNN_base.apply(set_bn_eval) #self.detector.RCNN_top.apply(set_bn_eval) class resnet_step4(nn.Module): '''step4 for resnet''' def __init__(self, classes, step2_model_path, step3_model_path, num_layers=101, fix_cnn_base=False, \ class_agnostic=False, pretrained=False, base_model='resnet101'): super(resnet_step4, self).__init__() self.step2_model_path = step2_model_path self.step3_model_path = step3_model_path self.dout_base_model = 1024 self.pretrained = pretrained self.class_agnostic = class_agnostic self.num_layer = num_layers self.fix_cnn_base = fix_cnn_base self.classes = classes self.n_classes = len(classes) self.base_model = 'resnet'+str(self.num_layer) # loss self.RCNN_loss_cls = 0 self.RCNN_loss_bbox = 0 #define base if self.num_layer == 101: resnet = resnet101() elif self.num_layer == 50: resnet = resnet50() elif self.num_layer == 152: resnet = resnet152() print("Step4: Loading pretrained weights from %s and %s" %(step2_model_path,step3_model_path)) state_dict_step2 = torch.load(self.step2_model_path) state_dict_step3 = torch.load(self.step3_model_path) # not using the last maxpool layer # Build resnet. self.RCNN_base = nn.Sequential(resnet.conv1, resnet.bn1,resnet.relu, resnet.maxpool,resnet.layer1,resnet.layer2,resnet.layer3) self.RCNN_base.load_state_dict({k.replace('RCNN_base.',''):v for k,v in state_dict_step3['model'].items() if 'RCNN_base' in k}) for key, value in dict(self.RCNN_base.named_parameters()).items(): value.requires_grad = False # define rpn self.RCNN_rpn = _RPN(self.dout_base_model) #init weight of rpn self.RCNN_rpn.load_state_dict({k.replace('RCNN_rpn.',''):v for k,v in state_dict_step3['model'].items() if 'RCNN_rpn' in k}) for key, value in dict(self.RCNN_rpn.named_parameters()).items(): value.requires_grad = False # define detector self.detector = _detector(self.classes, self.class_agnostic,pretrained, base_model=base_model) self.detector.load_state_dict({k.replace('detector.',''):v for k,v in state_dict_step2['model'].items() if 'detector' in k}) def forward(self, im_data, im_info, gt_boxes, num_boxes): batch_size = im_data.size(0) im_info = im_info.data gt_boxes = gt_boxes.data num_boxes = num_boxes.data # feed image data to base model to obtain base feature map base_feat = self.RCNN_base(im_data) # feed base feature map tp RPN to obtain rois rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes, alt=True) if not self.training: rpn_loss_cls = 0 rpn_loss_bbox = 0 # detector part rois, cls_prob, bbox_pred, \ RCNN_loss_cls, RCNN_loss_bbox, \ rois_label = self.detector(base_feat, rois, batch_size,gt_boxes, num_boxes) return rois, cls_prob, bbox_pred, rpn_loss_cls, rpn_loss_bbox, RCNN_loss_cls, RCNN_loss_bbox, rois_label def train(self, mode=True): # Override train so that the training mode is set as we want nn.Module.train(self, mode) if mode and self.fix_cnn_base: # Set fixed blocks to be in eval mode self.RCNN_base.eval() self.RCNN_base[5].train() self.RCNN_base[6].train() def set_bn_eval(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: m.eval() self.RCNN_base.apply(set_bn_eval) self.detector.RCNN_top.apply(set_bn_eval)
39.735363
135
0.619084
2,325
16,967
4.24172
0.082581
0.051916
0.048672
0.027986
0.914419
0.897688
0.875786
0.873758
0.873758
0.866356
0
0.022244
0.279307
16,967
426
136
39.828639
0.784266
0.099428
0
0.831615
0
0
0.043513
0.016111
0
0
0
0
0.006873
1
0.068729
false
0
0.061856
0
0.158076
0.017182
0
0
0
null
0
0
0
1
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
7
4881d14daccfe500478871fca0b1d3da52462ac2
52,413
py
Python
thirdparty/blender_autocomplete-master/2.82/bpy/ops/transform.py
Ray1184/HPMSBatch
3852710e7366361cb9e90f471ddccbbce5ffe8ee
[ "MIT" ]
null
null
null
thirdparty/blender_autocomplete-master/2.82/bpy/ops/transform.py
Ray1184/HPMSBatch
3852710e7366361cb9e90f471ddccbbce5ffe8ee
[ "MIT" ]
null
null
null
thirdparty/blender_autocomplete-master/2.82/bpy/ops/transform.py
Ray1184/HPMSBatch
3852710e7366361cb9e90f471ddccbbce5ffe8ee
[ "MIT" ]
null
null
null
import sys import typing def bend(value: float = (0.0), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Bend selected items between the 3D cursor and the mouse :param value: Angle :type value: float :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def create_orientation(name: str = "", use_view: bool = False, use: bool = False, overwrite: bool = False): '''Create transformation orientation from selection :param name: Name, Name of the new custom orientation :type name: str :param use_view: Use View, Use the current view instead of the active object to create the new orientation :type use_view: bool :param use: Use After Creation, Select orientation after its creation :type use: bool :param overwrite: Overwrite Previous, Overwrite previously created orientation with same name :type overwrite: bool ''' pass def delete_orientation(): '''Delete transformation orientation ''' pass def edge_bevelweight(value: float = 0.0, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Change the bevel weight of edges :param value: Factor :type value: float :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def edge_crease(value: float = 0.0, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Change the crease of edges :param value: Factor :type value: float :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def edge_slide(value: float = 0.0, single_side: bool = False, use_even: bool = False, flipped: bool = False, use_clamp: bool = True, mirror: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), correct_uv: bool = True, release_confirm: bool = False, use_accurate: bool = False): '''Slide an edge loop along a mesh :param value: Factor :type value: float :param single_side: Single Side :type single_side: bool :param use_even: Even, Make the edge loop match the shape of the adjacent edge loop :type use_even: bool :param flipped: Flipped, When Even mode is active, flips between the two adjacent edge loops :type flipped: bool :param use_clamp: Clamp, Clamp within the edge extents :type use_clamp: bool :param mirror: Mirror Editing :type mirror: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param correct_uv: Correct UVs, Correct UV coordinates when transforming :type correct_uv: bool :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def from_gizmo(): '''Transform selected items by mode type ''' pass def mirror(orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Mirror selected items around one or more axes :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def push_pull(value: float = 0.0, mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Push/Pull selected items :param value: Distance :type value: float :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def resize(value: float = (1.0, 1.0, 1.0), orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, texture_space: bool = False, remove_on_cancel: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Scale (resize) selected items :param value: Scale :type value: float :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param texture_space: Edit Texture Space, Edit Object data texture space :type texture_space: bool :param remove_on_cancel: Remove on Cancel, Remove elements on cancel :type remove_on_cancel: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def rotate(value: float = 0.0, orient_axis: typing.Union[str, int] = 'Z', orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Rotate selected items :param value: Angle :type value: float :param orient_axis: Axis :type orient_axis: typing.Union[str, int] :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def rotate_normal(value: float = 0.0, orient_axis: typing.Union[str, int] = 'Z', orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, release_confirm: bool = False, use_accurate: bool = False): '''Rotate split normal of selected items :param value: Angle :type value: float :param orient_axis: Axis :type orient_axis: typing.Union[str, int] :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def select_orientation(orientation: typing.Union[str, int] = 'GLOBAL'): '''Select transformation orientation :param orientation: Orientation, Transformation orientation :type orientation: typing.Union[str, int] ''' pass def seq_slide(value: float = (0.0, 0.0), snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Slide a sequence strip in time :param value: Offset :type value: float :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def shear(value: float = 0.0, orient_axis: typing.Union[str, int] = 'Z', orient_axis_ortho: typing.Union[str, int] = 'X', orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, release_confirm: bool = False, use_accurate: bool = False): '''Shear selected items along the horizontal screen axis :param value: Offset :type value: float :param orient_axis: Axis :type orient_axis: typing.Union[str, int] :param orient_axis_ortho: Axis Ortho :type orient_axis_ortho: typing.Union[str, int] :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def shrink_fatten(value: float = 0.0, use_even_offset: bool = False, mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Shrink/fatten selected vertices along normals :param value: Offset :type value: float :param use_even_offset: Offset Even, Scale the offset to give more even thickness :type use_even_offset: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def skin_resize(value: float = (1.0, 1.0, 1.0), orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Scale selected vertices’ skin radii :param value: Scale :type value: float :param orient_type: Orientation, Transformation orientation :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix Orientation :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def tilt(value: float = 0.0, mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Tilt selected control vertices of 3D curve :param value: Angle :type value: float :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def tosphere(value: float = 0.0, mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Move selected vertices outward in a spherical shape around mesh center :param value: Factor :type value: float :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def trackball(value: float = (0.0, 0.0), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Trackball style rotation of selected items :param value: Angle :type value: float :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def transform(mode: typing.Union[str, int] = 'TRANSLATION', value: float = (0.0, 0.0, 0.0, 0.0), orient_axis: typing.Union[str, int] = 'Z', orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, center_override: float = (0.0, 0.0, 0.0), release_confirm: bool = False, use_accurate: bool = False): '''Transform selected items by mode type :param mode: Mode :type mode: typing.Union[str, int] :param value: Values :type value: float :param orient_axis: Axis :type orient_axis: typing.Union[str, int] :param orient_type: Orientation, Transformation orientationGLOBAL Global, Align the transformation axes to world space.LOCAL Local, Align the transformation axes to the selected objects’ local space.NORMAL Normal, Align the transformation axes to average normal of selected elements (bone Y axis for pose mode).GIMBAL Gimbal, Align each axis to the Euler rotation axis as used for input.VIEW View, Align the transformation axes to the window.CURSOR Cursor, Align the transformation axes to the 3D cursor. :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix OrientationGLOBAL Global, Align the transformation axes to world space.LOCAL Local, Align the transformation axes to the selected objects’ local space.NORMAL Normal, Align the transformation axes to average normal of selected elements (bone Y axis for pose mode).GIMBAL Gimbal, Align each axis to the Euler rotation axis as used for input.VIEW View, Align the transformation axes to the window.CURSOR Cursor, Align the transformation axes to the 3D cursor. :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param center_override: Center Override, Force using this center value (when set) :type center_override: float :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def translate(value: float = (0.0, 0.0, 0.0), orient_type: typing.Union[str, int] = 'GLOBAL', orient_matrix: float = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), orient_matrix_type: typing.Union[str, int] = 'GLOBAL', constraint_axis: bool = (False, False, False), mirror: bool = False, use_proportional_edit: bool = False, proportional_edit_falloff: typing.Union[str, int] = 'SMOOTH', proportional_size: float = 1.0, use_proportional_connected: bool = False, use_proportional_projected: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), gpencil_strokes: bool = False, cursor_transform: bool = False, texture_space: bool = False, remove_on_cancel: bool = False, release_confirm: bool = False, use_accurate: bool = False): '''Move selected items :param value: Move :type value: float :param orient_type: Orientation, Transformation orientationGLOBAL Global, Align the transformation axes to world space.LOCAL Local, Align the transformation axes to the selected objects’ local space.NORMAL Normal, Align the transformation axes to average normal of selected elements (bone Y axis for pose mode).GIMBAL Gimbal, Align each axis to the Euler rotation axis as used for input.VIEW View, Align the transformation axes to the window.CURSOR Cursor, Align the transformation axes to the 3D cursor. :type orient_type: typing.Union[str, int] :param orient_matrix: Matrix :type orient_matrix: float :param orient_matrix_type: Matrix OrientationGLOBAL Global, Align the transformation axes to world space.LOCAL Local, Align the transformation axes to the selected objects’ local space.NORMAL Normal, Align the transformation axes to average normal of selected elements (bone Y axis for pose mode).GIMBAL Gimbal, Align each axis to the Euler rotation axis as used for input.VIEW View, Align the transformation axes to the window.CURSOR Cursor, Align the transformation axes to the 3D cursor. :type orient_matrix_type: typing.Union[str, int] :param constraint_axis: Constraint Axis :type constraint_axis: bool :param mirror: Mirror Editing :type mirror: bool :param use_proportional_edit: Proportional Editing :type use_proportional_edit: bool :param proportional_edit_falloff: Proportional Falloff, Falloff type for proportional editing modeSMOOTH Smooth, Smooth falloff.SPHERE Sphere, Spherical falloff.ROOT Root, Root falloff.INVERSE_SQUARE Inverse Square, Inverse Square falloff.SHARP Sharp, Sharp falloff.LINEAR Linear, Linear falloff.CONSTANT Constant, Constant falloff.RANDOM Random, Random falloff. :type proportional_edit_falloff: typing.Union[str, int] :param proportional_size: Proportional Size :type proportional_size: float :param use_proportional_connected: Connected :type use_proportional_connected: bool :param use_proportional_projected: Projected (2D) :type use_proportional_projected: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param gpencil_strokes: Edit Grease Pencil, Edit selected Grease Pencil strokes :type gpencil_strokes: bool :param cursor_transform: Transform Cursor :type cursor_transform: bool :param texture_space: Edit Texture Space, Edit Object data texture space :type texture_space: bool :param remove_on_cancel: Remove on Cancel, Remove elements on cancel :type remove_on_cancel: bool :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def vert_slide(value: float = 0.0, use_even: bool = False, flipped: bool = False, use_clamp: bool = True, mirror: bool = False, snap: bool = False, snap_target: typing.Union[str, int] = 'CLOSEST', snap_point: float = (0.0, 0.0, 0.0), snap_align: bool = False, snap_normal: float = (0.0, 0.0, 0.0), correct_uv: bool = True, release_confirm: bool = False, use_accurate: bool = False): '''Slide a vertex along a mesh :param value: Factor :type value: float :param use_even: Even, Make the edge loop match the shape of the adjacent edge loop :type use_even: bool :param flipped: Flipped, When Even mode is active, flips between the two adjacent edge loops :type flipped: bool :param use_clamp: Clamp, Clamp within the edge extents :type use_clamp: bool :param mirror: Mirror Editing :type mirror: bool :param snap: Use Snapping Options :type snap: bool :param snap_target: TargetCLOSEST Closest, Snap closest point onto target.CENTER Center, Snap transformation center onto target.MEDIAN Median, Snap median onto target.ACTIVE Active, Snap active onto target. :type snap_target: typing.Union[str, int] :param snap_point: Point :type snap_point: float :param snap_align: Align with Point Normal :type snap_align: bool :param snap_normal: Normal :type snap_normal: float :param correct_uv: Correct UVs, Correct UV coordinates when transforming :type correct_uv: bool :param release_confirm: Confirm on Release, Always confirm operation when releasing button :type release_confirm: bool :param use_accurate: Accurate, Use accurate transformation :type use_accurate: bool ''' pass def vertex_random(offset: float = 0.0, uniform: float = 0.0, normal: float = 0.0, seed: int = 0, wait_for_input: bool = True): '''Randomize vertices :param offset: Amount, Distance to offset :type offset: float :param uniform: Uniform, Increase for uniform offset distance :type uniform: float :param normal: Normal, Align offset direction to normals :type normal: float :param seed: Random Seed, Seed for the random number generator :type seed: int :param wait_for_input: Wait for Input :type wait_for_input: bool ''' pass def vertex_warp(warp_angle: float = 6.28319, offset_angle: float = 0.0, min: float = -1, max: float = 1.0, viewmat: float = ((0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0)), center: float = (0.0, 0.0, 0.0)): '''Warp vertices around the cursor :param warp_angle: Warp Angle, Amount to warp about the cursor :type warp_angle: float :param offset_angle: Offset Angle, Angle to use as the basis for warping :type offset_angle: float :param min: Min :type min: float :param max: Max :type max: float :param viewmat: Matrix :type viewmat: float :param center: Center :type center: float ''' pass
47.346883
509
0.677733
6,611
52,413
5.230071
0.035244
0.024063
0.029847
0.033318
0.936025
0.932092
0.928447
0.92437
0.923386
0.922721
0
0.014017
0.244558
52,413
1,106
510
47.389693
0.859225
0.638677
0
0.869186
0
0
0.019386
0
0
0
0
0
0
1
0.072674
false
0.072674
0.005814
0
0.078488
0
0
0
0
null
0
0
0
1
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
1
0
0
0
0
0
8
6fd98b24b0f317cce296b8f3c1d52ddebbf8aa14
811
py
Python
config/mysql.py
ibegyourpardon/flask_api_scaffold
43df8f4a53f2611bb9e2577e798c22c57102fa17
[ "Apache-2.0" ]
null
null
null
config/mysql.py
ibegyourpardon/flask_api_scaffold
43df8f4a53f2611bb9e2577e798c22c57102fa17
[ "Apache-2.0" ]
null
null
null
config/mysql.py
ibegyourpardon/flask_api_scaffold
43df8f4a53f2611bb9e2577e798c22c57102fa17
[ "Apache-2.0" ]
null
null
null
""" MySQL配置 防止变量污染,用函数组织 """ def mysql_config_dev(): mysql_config = { "DB_HOST" : "localhost", "DB_PORT" : "3306", "DB_NAME" : "root", "DB_USER" : "root", "DB_PWD" : "123456", "DB_CHARSET" : "utf8mb4", "DB_MAX_OPEN_CONNS" : "20", # 连接池最大连接数 "DB_MAX_IDLE_CONNS" : "10", # 连接池最大空闲数 "DB_MAX_LIFETIME_CONNS" : "7200", # 连接池链接最长生命周期 } return mysql_config def mysql_config_prod(): mysql_config = { "DB_HOST" : "localhost", "DB_PORT" : "3306", "DB_NAME" : "root", "DB_USER" : "root", "DB_PWD" : "123456", "DB_CHARSET" : "utf8mb4", "DB_MAX_OPEN_CONNS" : "20", # 连接池最大连接数 "DB_MAX_IDLE_CONNS" : "10", # 连接池最大空闲数 "DB_MAX_LIFETIME_CONNS" : "7200", # 连接池链接最长生命周期 } return mysql_config
23.852941
53
0.55857
93
811
4.462366
0.344086
0.159036
0.06747
0.081928
0.872289
0.872289
0.872289
0.872289
0.872289
0.872289
0
0.068259
0.277435
811
33
54
24.575758
0.639932
0.099877
0
0.846154
0
0
0.412281
0.061404
0
0
0
0
0
1
0.076923
false
0
0
0
0.153846
0
0
0
0
null
0
0
0
1
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
7
b504dfd372f3be8352a5c2c059f376aecbefbbf3
65
py
Python
collection/1.py
nemero/py_neural
87f151097f8c331a06f13b96c4cec9a1ee663abf
[ "MIT" ]
null
null
null
collection/1.py
nemero/py_neural
87f151097f8c331a06f13b96c4cec9a1ee663abf
[ "MIT" ]
1
2017-01-18T18:35:03.000Z
2017-01-25T08:55:49.000Z
collection/1.py
nemero/py_neural
87f151097f8c331a06f13b96c4cec9a1ee663abf
[ "MIT" ]
null
null
null
0 0 0 0 1 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
8.125
9
0.507692
33
65
1
0.060606
0.848485
0.636364
0.727273
0.848485
0.848485
0.666667
0.666667
0.666667
0.666667
0
1
0.492308
65
8
10
8.125
0
0
0
0.625
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
1
null
1
1
1
1
1
0
0
0
1
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
11
b506ca1064873f8fddb5565e9d51a1c86deeb8c2
7,989
py
Python
migrations/versions/29d131f4c8bf_logintest2.py
Oday1024/cdt-auth
9b5a76abcd84779286010a619c04384a863eacb8
[ "MIT" ]
null
null
null
migrations/versions/29d131f4c8bf_logintest2.py
Oday1024/cdt-auth
9b5a76abcd84779286010a619c04384a863eacb8
[ "MIT" ]
null
null
null
migrations/versions/29d131f4c8bf_logintest2.py
Oday1024/cdt-auth
9b5a76abcd84779286010a619c04384a863eacb8
[ "MIT" ]
null
null
null
"""logintest2 Revision ID: 29d131f4c8bf Revises: d00f3b9c7dbf Create Date: 2018-03-08 00:30:16.239569 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '29d131f4c8bf' down_revision = 'd00f3b9c7dbf' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('td_log', sa.Column('id', sa.Integer(), nullable=False), sa.Column('log_time', sa.DateTime(), nullable=True), sa.Column('account', sa.String(length=128), nullable=True), sa.Column('res_id', sa.String(length=128), nullable=True), sa.Column('res_path', sa.String(length=128), nullable=True), sa.Column('sys_res_id', sa.String(length=128), nullable=True), sa.Column('sys_res_name', sa.String(length=128), nullable=True), sa.Column('sys_res_path', sa.String(length=128), nullable=True), sa.Column('page_res_id', sa.String(length=128), nullable=True), sa.Column('page_res_name', sa.String(length=128), nullable=True), sa.Column('page_res_path', sa.String(length=128), nullable=True), sa.Column('func_res_id', sa.String(length=128), nullable=True), sa.Column('func_res_name', sa.String(length=128), nullable=True), sa.Column('func_res_path', sa.String(length=128), nullable=True), sa.Column('params', sa.String(length=128), nullable=True), sa.Column('log_date', sa.Date(), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_menu', sa.Column('id', sa.Integer(), nullable=False), sa.Column('menu_id', sa.String(length=128), nullable=True), sa.Column('menu_name', sa.String(length=128), nullable=True), sa.Column('menu_res_path', sa.String(length=128), nullable=True), sa.Column('p_menu_id', sa.String(length=128), nullable=True), sa.Column('sys_res_id', sa.String(length=128), nullable=True), sa.Column('sys_res_name', sa.String(length=128), nullable=True), sa.Column('sys_res_path', sa.String(length=128), nullable=True), sa.Column('page_res_id', sa.String(length=128), nullable=True), sa.Column('page_res_name', sa.String(length=128), nullable=True), sa.Column('page_res_path', sa.String(length=128), nullable=True), sa.Column('sort_id', sa.Integer(), nullable=True), sa.Column('icon', sa.String(length=128), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_res', sa.Column('id', sa.Integer(), nullable=False), sa.Column('res_id', sa.String(length=128), nullable=True), sa.Column('res_name', sa.String(length=128), nullable=True), sa.Column('func_name', sa.String(length=128), nullable=True), sa.Column('res_flag', sa.String(length=128), nullable=True), sa.Column('res_path', sa.String(length=128), nullable=True), sa.Column('res_type_id', sa.Integer(), nullable=True), sa.Column('res_type', sa.String(length=128), nullable=True), sa.Column('p_res_id', sa.String(length=128), nullable=True), sa.Column('p_res_name', sa.String(length=128), nullable=True), sa.Column('api_url', sa.String(length=128), nullable=True), sa.Column('sys_res_id', sa.String(length=128), nullable=True), sa.Column('sys_res_name', sa.String(length=128), nullable=True), sa.Column('sys_name', sa.String(length=128), nullable=True), sa.Column('sys_flag', sa.String(length=128), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.Column('update_time', sa.DateTime(), nullable=True), sa.Column('updater', sa.String(length=128), nullable=True), sa.Column('create_time', sa.DateTime(), nullable=True), sa.Column('creater', sa.String(length=128), nullable=True), sa.Column('data_access_level', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_res_type', sa.Column('id', sa.Integer(), nullable=False), sa.Column('res_type', sa.String(length=128), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('res_type'), schema='sys' ) op.create_table('td_role', sa.Column('id', sa.Integer(), nullable=False), sa.Column('role_id', sa.String(length=128), nullable=True), sa.Column('role_name', sa.String(length=128), nullable=True), sa.Column('data_scope', sa.Integer(), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.Column('b_inside', sa.Integer(), nullable=True), sa.Column('b_super', sa.Integer(), nullable=True), sa.Column('update_time', sa.DateTime(), nullable=True), sa.Column('updater', sa.String(length=128), nullable=True), sa.Column('create_time', sa.DateTime(), nullable=True), sa.Column('creater', sa.String(length=128), nullable=True), sa.Column('data_role', sa.String(length=128), nullable=True), sa.Column('data_access_level', sa.Integer(), nullable=True), sa.Column('inside_default_open_id', sa.String(length=128), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_role_res', sa.Column('id', sa.Integer(), nullable=False), sa.Column('role_id', sa.String(length=128), nullable=True), sa.Column('res_id', sa.String(length=128), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.Column('update_time', sa.DateTime(), nullable=True), sa.Column('updater', sa.String(length=128), nullable=True), sa.Column('create_time', sa.DateTime(), nullable=True), sa.Column('creater', sa.String(length=128), nullable=True), sa.Column('data_role', sa.String(length=128), nullable=True), sa.Column('data_access_level', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_role_user', sa.Column('id', sa.Integer(), nullable=False), sa.Column('role_id', sa.String(length=128), nullable=True), sa.Column('open_id', sa.String(length=128), nullable=True), sa.Column('deleted', sa.Integer(), nullable=True), sa.Column('update_time', sa.DateTime(), nullable=True), sa.Column('updater', sa.String(length=128), nullable=True), sa.Column('create_time', sa.DateTime(), nullable=True), sa.Column('creater', sa.String(length=128), nullable=True), sa.Column('data_role', sa.String(length=128), nullable=True), sa.Column('data_access_level', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) op.create_table('td_user', sa.Column('id', sa.Integer(), nullable=False), sa.Column('open_id', sa.String(length=128), nullable=False), sa.Column('account', sa.String(length=128), nullable=False), sa.Column('password', sa.String(length=128), nullable=False), sa.Column('deleted', sa.Integer(), nullable=True), sa.Column('b_inside', sa.Integer(), nullable=True), sa.Column('update_time', sa.DateTime(), nullable=True), sa.Column('updater', sa.String(length=128), nullable=True), sa.Column('create_time', sa.DateTime(), nullable=True), sa.Column('creater', sa.String(length=128), nullable=True), sa.Column('data_role', sa.String(length=128), nullable=True), sa.Column('data_access_level', sa.Integer(), nullable=True), sa.Column('inside_default_role_id', sa.String(length=128), nullable=True), sa.PrimaryKeyConstraint('id'), schema='sys' ) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_table('td_user', schema='sys') op.drop_table('td_role_user', schema='sys') op.drop_table('td_role_res', schema='sys') op.drop_table('td_role', schema='sys') op.drop_table('td_res_type', schema='sys') op.drop_table('td_res', schema='sys') op.drop_table('td_menu', schema='sys') op.drop_table('td_log', schema='sys') # ### end Alembic commands ###
47.272189
78
0.680185
1,144
7,989
4.624126
0.077797
0.152741
0.238185
0.310019
0.931002
0.920416
0.9138
0.874102
0.81966
0.768053
0
0.033572
0.12755
7,989
168
79
47.553571
0.725395
0.03655
0
0.573333
0
0
0.148564
0.005744
0
0
0
0
0
1
0.013333
false
0.006667
0.013333
0
0.026667
0
0
0
0
null
0
1
1
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
8
82efb14dac4baaa02b7ebfbe2c760805e7e1ebcd
42
py
Python
src/lib/os2emxpath.py
DTenore/skulpt
098d20acfb088d6db85535132c324b7ac2f2d212
[ "MIT" ]
2,671
2015-01-03T08:23:25.000Z
2022-03-31T06:15:48.000Z
src/lib/os2emxpath.py
wakeupmuyunhe/skulpt
a8fb11a80fb6d7c016bab5dfe3712517a350b347
[ "MIT" ]
972
2015-01-05T08:11:00.000Z
2022-03-29T13:47:15.000Z
src/lib/os2emxpath.py
wakeupmuyunhe/skulpt
a8fb11a80fb6d7c016bab5dfe3712517a350b347
[ "MIT" ]
845
2015-01-03T19:53:36.000Z
2022-03-29T18:34:22.000Z
import _sk_fail; _sk_fail._("os2emxpath")
21
41
0.785714
6
42
4.666667
0.666667
0.428571
0
0
0
0
0
0
0
0
0
0.025641
0.071429
42
1
42
42
0.692308
0
0
0
0
0
0.238095
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
d2050ba81058c1284ca359db5619fc486fca04d2
259,155
py
Python
tests/examples/minlplib/fdesign25.py
ouyang-w-19/decogo
52546480e49776251d4d27856e18a46f40c824a1
[ "MIT" ]
2
2021-07-03T13:19:10.000Z
2022-02-06T10:48:13.000Z
tests/examples/minlplib/fdesign25.py
ouyang-w-19/decogo
52546480e49776251d4d27856e18a46f40c824a1
[ "MIT" ]
1
2021-07-04T14:52:14.000Z
2021-07-15T10:17:11.000Z
tests/examples/minlplib/fdesign25.py
ouyang-w-19/decogo
52546480e49776251d4d27856e18a46f40c824a1
[ "MIT" ]
null
null
null
# NLP written by GAMS Convert at 04/21/18 13:52:11 # # Equation counts # Total E G L N X C B # 307 2 1 304 0 0 0 0 # # Variable counts # x b i s1s s2s sc si # Total cont binary integer sos1 sos2 scont sint # 30 30 0 0 0 0 0 0 # FX 1 1 0 0 0 0 0 0 # # Nonzero counts # Total const NL DLL # 7791 7788 3 0 from pyomo.environ import * model = m = ConcreteModel() m.x1 = Var(within=Reals,bounds=(None,None),initialize=0) m.x2 = Var(within=Reals,bounds=(None,None),initialize=0) m.x3 = Var(within=Reals,bounds=(None,None),initialize=0) m.x4 = Var(within=Reals,bounds=(None,None),initialize=0) m.x5 = Var(within=Reals,bounds=(None,None),initialize=0) m.x6 = Var(within=Reals,bounds=(None,None),initialize=0) m.x7 = Var(within=Reals,bounds=(None,None),initialize=0) m.x8 = Var(within=Reals,bounds=(None,None),initialize=0) m.x9 = Var(within=Reals,bounds=(None,None),initialize=0) m.x10 = Var(within=Reals,bounds=(None,None),initialize=0) m.x11 = Var(within=Reals,bounds=(None,None),initialize=0) m.x12 = Var(within=Reals,bounds=(None,None),initialize=0) m.x13 = Var(within=Reals,bounds=(None,None),initialize=0) m.x14 = Var(within=Reals,bounds=(None,None),initialize=0) m.x15 = Var(within=Reals,bounds=(None,None),initialize=0) m.x16 = Var(within=Reals,bounds=(None,None),initialize=0) m.x17 = Var(within=Reals,bounds=(None,None),initialize=0) m.x18 = Var(within=Reals,bounds=(None,None),initialize=0) m.x19 = Var(within=Reals,bounds=(None,None),initialize=0) m.x20 = Var(within=Reals,bounds=(None,None),initialize=0) m.x21 = Var(within=Reals,bounds=(None,None),initialize=0) m.x22 = Var(within=Reals,bounds=(None,None),initialize=0) m.x23 = Var(within=Reals,bounds=(None,None),initialize=0) m.x24 = Var(within=Reals,bounds=(None,None),initialize=0) m.x25 = Var(within=Reals,bounds=(None,None),initialize=0) m.x26 = Var(within=Reals,bounds=(1,None),initialize=1) m.x27 = Var(within=Reals,bounds=(None,None),initialize=0) m.x28 = Var(within=Reals,bounds=(0,None),initialize=0) m.x29 = Var(within=Reals,bounds=(0,None),initialize=0) m.x30 = Var(within=Reals,bounds=(2,2),initialize=2) m.obj = Objective(expr=m.x26, sense=minimize) m.c1 = Constraint(expr= 2*m.x1 + 2*m.x2 + 2*m.x3 + 2*m.x4 + 2*m.x5 + 2*m.x6 + 2*m.x7 + 2*m.x8 + 2*m.x9 + 2*m.x10 + 2*m.x11 + 2*m.x12 + 2*m.x13 + 2*m.x14 + 2*m.x15 + 2*m.x16 + 2*m.x17 + 2*m.x18 + 2*m.x19 + 2*m.x20 + 2*m.x21 + 2*m.x22 + 2*m.x23 + 2*m.x24 + 2*m.x25 - m.x26 <= 0) m.c2 = Constraint(expr= 1.81992254175309*m.x1 + 1.83412014877025*m.x2 + 1.84775906502257*m.x3 + 1.86083513596405*m.x4 + 1.8733443784968*m.x5 + 1.88528298218436*m.x6 + 1.8966473104124*m.x7 + 1.90743390149645*m.x8 + 1.91763946973639*m.x9 + 1.92726090641725*m.x10 + 1.93629528075622*m.x11 + 1.94473984079535*m.x12 + 1.95259201423987*m.x13 + 1.95984940924166*m.x14 + 1.96650981512791*m.x15 + 1.97257120307446*m.x16 + 1.97803172672383*m.x17 + 1.98288972274762*m.x18 + 1.98714371135317*m.x19 + 1.99079239673436*m.x20 + 1.99383466746626*m.x21 + 1.99626959684373*m.x22 + 1.99809644316372*m.x23 + 1.99931464995111*m.x24 + 1.99992384612834*m.x25 - m.x26 <= 0) m.c3 = Constraint(expr= 1.31211805798101*m.x1 + 1.363996720125*m.x2 + 1.4142135623731*m.x3 + 1.46270740323834*m.x4 + 1.50941916044554*m.x5 + 1.55429192291394*m.x6 + 1.59727102009459*m.x7 + 1.63830408857798*m.x8 + 1.67734113589085*m.x9 + 1.71433460140422*m.x10 + 1.74923941427879*m.x11 + 1.78201304837674*m.x12 + 1.8126155740733*m.x13 + 1.84100970690488*m.x14 + 1.8671608529944*m.x15 + 1.89103715119863*m.x16 + 1.91260951192607*m.x17 + 1.93185165257814*m.x18 + 1.94874012957047*m.x19 + 1.96325436689533*m.x20 + 1.97537668119028*m.x21 + 1.98509230328264*m.x22 + 1.99238939618349*m.x23 + 1.99725906950915*m.x24 + 1.99969539031278*m.x25 - m.x26 <= 0) m.c4 = Constraint(expr= 0.568030689407845*m.x1 + 0.667613718467542*m.x2 + 0.76536686473018*m.x3 + 0.86102219361659*m.x4 + 0.954317520519217*m.x5 + 1.0449971294319*m.x6 + 1.13281247384967*m.x7 + 1.21752285801744*m.x8 + 1.29889609666037*m.x9 + 1.37670915138751*m.x10 + 1.45074874202458*m.x11 + 1.52081193120006*m.x12 + 1.58670668058247*m.x13 + 1.64825237724403*m.x14 + 1.70528032870818*m.x15 + 1.75763422532393*m.x16 + 1.80517056869972*m.x17 + 1.84775906502257*m.x18 + 1.88528298218436*m.x19 + 1.91763946973639*m.x20 + 1.94473984079535*m.x21 + 1.96650981512791*m.x22 + 1.98288972274762*m.x23 + 1.99383466746626*m.x24 + 1.99931464995111*m.x25 - m.x26 <= 0) m.c5 = Constraint(expr= - 0.278346201920131*m.x1 - 0.139512947488251*m.x2 + 1.22464679914735E-16*m.x3 + 0.13951294748825*m.x4 + 0.278346201920131*m.x5 + 0.415823381635519*m.x6 + 0.551274711633998*m.x7 + 0.684040286651338*m.x8 + 0.8134732861516*m.x9 + 0.938943125571782*m.x10 + 1.05983852846641*m.x11 + 1.17557050458495*m.x12 + 1.28557521937308*m.x13 + 1.38931674091799*m.x14 + 1.48628965095479*m.x15 + 1.57602150721344*m.x16 + 1.65807514511008*m.x17 + 1.73205080756888*m.x18 + 1.79758809259833*m.x19 + 1.85436770913357*m.x20 + 1.90211303259031*m.x21 + 1.94059145255199*m.x22 + 1.96961550602442*m.x23 + 1.98904379073655*m.x24 + 1.99878165403819*m.x25 - m.x26 <= 0) m.c6 = Constraint(expr= - 1.07459921669365*m.x1 - 0.923497226470067*m.x2 - 0.765366864730179*m.x3 - 0.601411599008546*m.x4 - 0.432879227876206*m.x5 - 0.261052384440103*m.x6 - 0.0872387747306718*m.x7 + 0.087238774730672*m.x8 + 0.261052384440103*m.x9 + 0.432879227876206*m.x10 + 0.601411599008547*m.x11 + 0.76536686473018*m.x12 + 0.923497226470068*m.x13 + 1.07459921669365*m.x14 + 1.21752285801744*m.x15 + 1.35118041523132*m.x16 + 1.47455467362025*m.x17 + 1.58670668058247*m.x18 + 1.68678289162577*m.x19 + 1.77402166635644*m.x20 + 1.84775906502257*m.x21 + 1.90743390149645*m.x22 + 1.95259201423987*m.x23 + 1.98288972274762*m.x24 + 1.99809644316372*m.x25 - m.x26 <= 0) m.c7 = Constraint(expr= - 1.67734113589085*m.x1 - 1.55429192291394*m.x2 - 1.41421356237309*m.x3 - 1.25864078209968*m.x4 - 1.08927807003005*m.x5 - 0.907980999479093*m.x6 - 0.716735899090601*m.x7 - 0.517638090205042*m.x8 - 0.312868930080462*m.x9 - 0.104671912485888*m.x10 + 0.104671912485887*m.x11 + 0.312868930080461*m.x12 + 0.517638090205041*m.x13 + 0.7167358990906*m.x14 + 0.907980999479094*m.x15 + 1.08927807003005*m.x16 + 1.25864078209968*m.x17 + 1.41421356237309*m.x18 + 1.55429192291394*m.x19 + 1.67734113589085*m.x20 + 1.78201304837674*m.x21 + 1.8671608529944*m.x22 + 1.93185165257814*m.x23 + 1.97537668119028*m.x24 + 1.99725906950915*m.x25 - m.x26 <= 0) m.c8 = Constraint(expr= - 1.97803172672383*m.x1 - 1.92726090641725*m.x2 - 1.84775906502257*m.x3 - 1.7407113918798*m.x4 - 1.60771372123443*m.x5 - 1.45074874202458*m.x6 - 1.27215644055553*m.x7 - 1.07459921669365*m.x8 - 0.861022193616591*m.x9 - 0.634609312810184*m.x10 - 0.398735868834395*m.x11 - 0.15691819145569*m.x12 + 0.087238774730672*m.x13 + 0.330095211721355*m.x14 + 0.568030689407845*m.x15 + 0.797498137850493*m.x16 + 1.01507672592141*m.x17 + 1.21752285801744*m.x18 + 1.4018185285997*m.x19 + 1.56521631370483*m.x20 + 1.70528032870818*m.x21 + 1.81992254175309*m.x22 + 1.90743390149645*m.x23 + 1.96650981512791*m.x24 + 1.99626959684373*m.x25 - m.x26 <= 0) m.c9 = Constraint(expr= - 1.92252339187664*m.x1 - 1.98053613748314*m.x2 - 2*m.x3 - 1.98053613748314*m.x4 - 1.92252339187664*m.x5 - 1.8270909152852*m.x6 - 1.69609619231285*m.x7 - 1.53208888623796*m.x8 - 1.33826121271772*m.x9 - 1.11838580694149*m.x10 - 0.876742293578155*m.x11 - 0.618033988749895*m.x12 - 0.347296355333861*m.x13 - 0.0697989934050019*m.x14 + 0.209056926535307*m.x15 + 0.483843791199335*m.x16 + 0.749213186831824*m.x17 + m.x18 + 1.23132295065132*m.x19 + 1.4386796006773*m.x20 + 1.61803398874989*m.x21 + 1.76589518571785*m.x22 + 1.87938524157182*m.x23 + 1.95629520146761*m.x24 + 1.99512810051965*m.x25 - m.x26 <= 0) m.c10 = Constraint(expr= - 1.52081193120006*m.x1 - 1.70528032870818*m.x2 - 1.84775906502257*m.x3 - 1.94473984079535*m.x4 - 1.99383466746626*m.x5 - 1.99383466746626*m.x6 - 1.94473984079535*m.x7 - 1.84775906502257*m.x8 - 1.70528032870818*m.x9 - 1.52081193120006*m.x10 - 1.29889609666037*m.x11 - 1.0449971294319*m.x12 - 0.765366864730179*m.x13 - 0.466890727711811*m.x14 - 0.15691819145569*m.x15 + 0.15691819145569*m.x16 + 0.466890727711811*m.x17 + 0.76536686473018*m.x18 + 1.0449971294319*m.x19 + 1.29889609666037*m.x20 + 1.52081193120006*m.x21 + 1.70528032870818*m.x22 + 1.84775906502257*m.x23 + 1.94473984079535*m.x24 + 1.99383466746626*m.x25 - m.x26 <= 0) m.c11 = Constraint(expr= - 0.8452365234814*m.x1 - 1.14715287270209*m.x2 - 1.4142135623731*m.x3 - 1.63830408857798*m.x4 - 1.8126155740733*m.x5 - 1.93185165257814*m.x6 - 1.99238939618349*m.x7 - 1.99238939618349*m.x8 - 1.93185165257814*m.x9 - 1.8126155740733*m.x10 - 1.63830408857798*m.x11 - 1.41421356237309*m.x12 - 1.14715287270209*m.x13 - 0.845236523481399*m.x14 - 0.517638090205041*m.x15 - 0.174311485495316*m.x16 + 0.174311485495317*m.x17 + 0.517638090205041*m.x18 + 0.845236523481399*m.x19 + 1.14715287270209*m.x20 + 1.4142135623731*m.x21 + 1.63830408857798*m.x22 + 1.8126155740733*m.x23 + 1.93185165257814*m.x24 + 1.99238939618349*m.x25 - m.x26 <= 0) m.c12 = Constraint(expr= - 0.0174530709967489*m.x1 - 0.398735868834395*m.x2 - 0.765366864730181*m.x3 - 1.10387397062412*m.x4 - 1.4018185285997*m.x5 - 1.64825237724403*m.x6 - 1.83412014877025*m.x7 - 1.95259201423987*m.x8 - 1.99931464995111*m.x9 - 1.97257120307446*m.x10 - 1.8733443784968*m.x11 - 1.70528032870818*m.x12 - 1.47455467362025*m.x13 - 1.18964557350268*m.x14 - 0.86102219361659*m.x15 - 0.500760008108883*m.x16 - 0.122097079069714*m.x17 + 0.261052384440103*m.x18 + 0.634609312810185*m.x19 + 0.984847120206934*m.x20 + 1.29889609666037*m.x21 + 1.56521631370483*m.x22 + 1.77402166635644*m.x23 + 1.91763946973639*m.x24 + 1.99079239673436*m.x25 - m.x26 <= 0) m.c13 = Constraint(expr= 0.813473286151601*m.x1 + 0.415823381635519*m.x2 - 3.67394039744206E-16*m.x3 - 0.415823381635518*m.x4 - 0.8134732861516*m.x5 - 1.17557050458495*m.x6 - 1.48628965095479*m.x7 - 1.73205080756888*m.x8 - 1.90211303259031*m.x9 - 1.98904379073655*m.x10 - 1.98904379073655*m.x11 - 1.90211303259031*m.x12 - 1.73205080756888*m.x13 - 1.48628965095479*m.x14 - 1.17557050458495*m.x15 - 0.813473286151601*m.x16 - 0.415823381635519*m.x17 - 3.21624529935327E-16*m.x18 + 0.415823381635518*m.x19 + 0.8134732861516*m.x20 + 1.17557050458495*m.x21 + 1.48628965095479*m.x22 + 1.73205080756888*m.x23 + 1.90211303259031*m.x24 + 1.98904379073655*m.x25 - m.x26 <= 0) m.c14 = Constraint(expr= 1.497911441578*m.x1 + 1.16140591142188*m.x2 + 0.76536686473018*m.x3 + 0.330095211721356*m.x4 - 0.122097079069714*m.x5 - 0.568030689407845*m.x6 - 0.984847120206934*m.x7 - 1.35118041523132*m.x8 - 1.64825237724403*m.x9 - 1.86083513596405*m.x10 - 1.97803172672383*m.x11 - 1.99383466746626*m.x12 - 1.90743390149645*m.x13 - 1.72325832088305*m.x14 - 1.45074874202458*m.x15 - 1.10387397062412*m.x16 - 0.700414762518935*m.x17 - 0.261052384440103*m.x18 + 0.191691505040448*m.x19 + 0.634609312810184*m.x20 + 1.0449971294319*m.x21 + 1.4018185285997*m.x22 + 1.68678289162577*m.x23 + 1.88528298218436*m.x24 + 1.98714371135317*m.x25 - m.x26 <= 0) m.c15 = Constraint(expr= 1.91260951192607*m.x1 + 1.71433460140422*m.x2 + 1.41421356237309*m.x3 + 1.03007614982011*m.x4 + 0.584743409445473*m.x5 + 0.104671912485888*m.x6 - 0.381617990753089*m.x7 - 0.845236523481398*m.x8 - 1.25864078209967*m.x9 - 1.59727102009459*m.x10 - 1.84100970690488*m.x11 - 1.97537668119028*m.x12 - 1.99238939618349*m.x13 - 1.89103715119863*m.x14 - 1.67734113589085*m.x15 - 1.363996720125*m.x16 - 0.969619240492674*m.x17 - 0.517638090205042*m.x18 - 0.034904812874567*m.x19 + 0.44990210868773*m.x20 + 0.907980999479094*m.x21 + 1.31211805798101*m.x22 + 1.63830408857798*m.x23 + 1.8671608529944*m.x24 + 1.98509230328264*m.x25 - m.x26 <= 0) m.c16 = Constraint(expr= 1.98288972274762*m.x1 + 1.98288972274762*m.x2 + 1.84775906502257*m.x3 + 1.58670668058247*m.x4 + 1.21752285801744*m.x5 + 0.765366864730178*m.x6 + 0.261052384440103*m.x7 - 0.261052384440105*m.x8 - 0.765366864730181*m.x9 - 1.21752285801744*m.x10 - 1.58670668058247*m.x11 - 1.84775906502257*m.x12 - 1.98288972274762*m.x13 - 1.98288972274762*m.x14 - 1.84775906502257*m.x15 - 1.58670668058247*m.x16 - 1.21752285801744*m.x17 - 0.765366864730179*m.x18 - 0.261052384440103*m.x19 + 0.261052384440103*m.x20 + 0.76536686473018*m.x21 + 1.21752285801744*m.x22 + 1.58670668058247*m.x23 + 1.84775906502257*m.x24 + 1.98288972274762*m.x25 - m.x26 <= 0) m.c17 = Constraint(expr= 1.69609619231285*m.x1 + 1.92252339187664*m.x2 + 2*m.x3 + 1.92252339187664*m.x4 + 1.69609619231285*m.x5 + 1.33826121271772*m.x6 + 0.876742293578155*m.x7 + 0.34729635533386*m.x8 - 0.209056926535307*m.x9 - 0.749213186831825*m.x10 - 1.23132295065132*m.x11 - 1.61803398874989*m.x12 - 1.87938524157182*m.x13 - 1.99512810051965*m.x14 - 1.95629520146761*m.x15 - 1.76589518571785*m.x16 - 1.4386796006773*m.x17 - m.x18 - 0.483843791199336*m.x19 + 0.0697989934050022*m.x20 + 0.618033988749895*m.x21 + 1.11838580694149*m.x22 + 1.53208888623796*m.x23 + 1.8270909152852*m.x24 + 1.98053613748314*m.x25 - m.x26 <= 0) m.c18 = Constraint(expr= 1.10387397062412*m.x1 + 1.54324916677544*m.x2 + 1.84775906502257*m.x3 + 1.99079239673436*m.x4 + 1.95984940924166*m.x5 + 1.75763422532393*m.x6 + 1.4018185285997*m.x7 + 0.923497226470068*m.x8 + 0.364471050984295*m.x9 - 0.226406427535812*m.x10 - 0.797498137850492*m.x11 - 1.29889609666037*m.x12 - 1.68678289162577*m.x13 - 1.92726090641725*m.x14 - 1.99931464995111*m.x15 - 1.8966473104124*m.x16 - 1.62823103671264*m.x17 - 1.21752285801744*m.x18 - 0.700414762518935*m.x19 - 0.122097079069714*m.x20 + 0.466890727711811*m.x21 + 1.01507672592141*m.x22 + 1.47455467362025*m.x23 + 1.80517056869972*m.x24 + 1.97803172672383*m.x25 - m.x26 <= 0) m.c19 = Constraint(expr= 0.312868930080462*m.x1 + 0.907980999479094*m.x2 + 1.4142135623731*m.x3 + 1.78201304837674*m.x4 + 1.97537668119028*m.x5 + 1.97537668119028*m.x6 + 1.78201304837674*m.x7 + 1.41421356237309*m.x8 + 0.907980999479093*m.x9 + 0.312868930080461*m.x10 - 0.312868930080462*m.x11 - 0.907980999479094*m.x12 - 1.4142135623731*m.x13 - 1.78201304837674*m.x14 - 1.97537668119028*m.x15 - 1.97537668119028*m.x16 - 1.78201304837674*m.x17 - 1.41421356237309*m.x18 - 0.907980999479093*m.x19 - 0.312868930080462*m.x20 + 0.312868930080462*m.x21 + 0.907980999479094*m.x22 + 1.4142135623731*m.x23 + 1.78201304837674*m.x24 + 1.97537668119028*m.x25 - m.x26 <= 0) m.c20 = Constraint(expr= - 0.534476752156515*m.x1 + 0.122097079069714*m.x2 + 0.765366864730179*m.x3 + 1.32524009643147*m.x4 + 1.7407113918798*m.x5 + 1.96650981512791*m.x6 + 1.97803172672383*m.x7 + 1.77402166635644*m.x8 + 1.37670915138751*m.x9 + 0.829386485312478*m.x10 + 0.191691505040448*m.x11 - 0.46689072771181*m.x12 - 1.07459921669365*m.x13 - 1.56521631370483*m.x14 - 1.88528298218436*m.x15 - 1.99992384612834*m.x16 - 1.8966473104124*m.x17 - 1.58670668058247*m.x18 - 1.10387397062412*m.x19 - 0.500760008108883*m.x20 + 0.15691819145569*m.x21 + 0.797498137850492*m.x22 + 1.35118041523132*m.x23 + 1.75763422532393*m.x24 + 1.97257120307446*m.x25 - m.x26 <= 0) m.c21 = Constraint(expr= - 1.28557521937308*m.x1 - 0.684040286651336*m.x2 + 6.12323399573677E-16*m.x3 + 0.684040286651339*m.x4 + 1.28557521937308*m.x5 + 1.73205080756888*m.x6 + 1.96961550602442*m.x7 + 1.96961550602442*m.x8 + 1.73205080756888*m.x9 + 1.28557521937308*m.x10 + 0.684040286651336*m.x11 - 3.67394039744206E-16*m.x12 - 0.684040286651339*m.x13 - 1.28557521937308*m.x14 - 1.73205080756888*m.x15 - 1.96961550602442*m.x16 - 1.96961550602442*m.x17 - 1.73205080756888*m.x18 - 1.28557521937308*m.x19 - 0.684040286651337*m.x20 + 1.22464679914735E-16*m.x21 + 0.684040286651338*m.x22 + 1.28557521937308*m.x23 + 1.73205080756888*m.x24 + 1.96961550602442*m.x25 - m.x26 <= 0) m.c22 = Constraint(expr= - 1.80517056869972*m.x1 - 1.37670915138751*m.x2 - 0.76536686473018*m.x3 - 0.052353896615746*m.x4 + 0.667613718467541*m.x5 + 1.29889609666037*m.x6 + 1.75763422532393*m.x7 + 1.98288972274762*m.x8 + 1.94473984079535*m.x9 + 1.64825237724403*m.x10 + 1.13281247384966*m.x11 + 0.466890727711811*m.x12 - 0.261052384440103*m.x13 - 0.954317520519217*m.x14 - 1.52081193120006*m.x15 - 1.88528298218436*m.x16 - 1.99931464995111*m.x17 - 1.84775906502257*m.x18 - 1.45074874202458*m.x19 - 0.861022193616591*m.x20 - 0.15691819145569*m.x21 + 0.568030689407845*m.x22 + 1.21752285801744*m.x23 + 1.70528032870818*m.x24 + 1.96650981512791*m.x25 - m.x26 <= 0) m.c23 = Constraint(expr= - 1.99969539031278*m.x1 - 1.84100970690488*m.x2 - 1.41421356237309*m.x3 - 0.781462256978547*m.x4 - 0.034904812874566*m.x5 + 0.716735899090602*m.x6 + 1.363996720125*m.x7 + 1.8126155740733*m.x8 + 1.99725906950915*m.x9 + 1.89103715119863*m.x10 + 1.50941916044554*m.x11 + 0.907980999479093*m.x12 + 0.174311485495316*m.x13 - 0.584743409445474*m.x14 - 1.25864078209968*m.x15 - 1.74923941427879*m.x16 - 1.98509230328264*m.x17 - 1.93185165257814*m.x18 - 1.59727102009459*m.x19 - 1.03007614982011*m.x20 - 0.312868930080462*m.x21 + 0.44990210868773*m.x22 + 1.14715287270209*m.x23 + 1.67734113589085*m.x24 + 1.96325436689533*m.x25 - m.x26 <= 0) m.c24 = Constraint(expr= - 1.83412014877025*m.x1 - 1.99992384612834*m.x2 - 1.84775906502257*m.x3 - 1.4018185285997*m.x4 - 0.733002453448593*m.x5 + 0.0523538966157472*m.x6 + 0.829386485312479*m.x7 + 1.47455467362025*m.x8 + 1.88528298218436*m.x9 + 1.99626959684373*m.x10 + 1.78986872320405*m.x11 + 1.29889609666037*m.x12 + 0.601411599008547*m.x13 - 0.191691505040449*m.x14 - 0.954317520519217*m.x15 - 1.56521631370483*m.x16 - 1.92726090641725*m.x17 - 1.98288972274762*m.x18 - 1.72325832088305*m.x19 - 1.18964557350268*m.x20 - 0.466890727711811*m.x21 + 0.330095211721355*m.x22 + 1.07459921669365*m.x23 + 1.64825237724403*m.x24 + 1.95984940924166*m.x25 - m.x26 <= 0) m.c25 = Constraint(expr= - 1.33826121271772*m.x1 - 1.8270909152852*m.x2 - 2*m.x3 - 1.8270909152852*m.x4 - 1.33826121271772*m.x5 - 0.618033988749894*m.x6 + 0.209056926535307*m.x7 + m.x8 + 1.61803398874989*m.x9 + 1.95629520146761*m.x10 + 1.95629520146761*m.x11 + 1.6180339887499*m.x12 + m.x13 + 0.209056926535308*m.x14 - 0.618033988749895*m.x15 - 1.33826121271772*m.x16 - 1.8270909152852*m.x17 - 2*m.x18 - 1.8270909152852*m.x19 - 1.33826121271772*m.x20 - 0.618033988749895*m.x21 + 0.209056926535307*m.x22 + m.x23 + 1.61803398874989*m.x24 + 1.95629520146761*m.x25 - m.x26 <= 0) m.c26 = Constraint(expr= - 0.601411599008548*m.x1 - 1.35118041523132*m.x2 - 1.84775906502257*m.x3 - 1.99809644316372*m.x4 - 1.77402166635644*m.x5 - 1.21752285801744*m.x6 - 0.432879227876206*m.x7 + 0.432879227876206*m.x8 + 1.21752285801744*m.x9 + 1.77402166635644*m.x10 + 1.99809644316372*m.x11 + 1.84775906502257*m.x12 + 1.35118041523132*m.x13 + 0.601411599008545*m.x14 - 0.261052384440103*m.x15 - 1.07459921669365*m.x16 - 1.68678289162577*m.x17 - 1.98288972274762*m.x18 - 1.90743390149645*m.x19 - 1.47455467362025*m.x20 - 0.765366864730179*m.x21 + 0.087238774730672*m.x22 + 0.923497226470068*m.x23 + 1.58670668058247*m.x24 + 1.95259201423987*m.x25 - m.x26 <= 0) m.c27 = Constraint(expr= 0.243738686810297*m.x1 - 0.651136308914312*m.x2 - 1.41421356237309*m.x3 - 1.89103715119863*m.x4 - 1.98509230328264*m.x5 - 1.67734113589085*m.x6 - 1.03007614982011*m.x7 - 0.174311485495317*m.x8 + 0.7167358990906*m.x9 + 1.46270740323834*m.x10 + 1.91260951192607*m.x11 + 1.97537668119028*m.x12 + 1.63830408857798*m.x13 + 0.969619240492675*m.x14 + 0.104671912485888*m.x15 - 0.781462256978548*m.x16 - 1.50941916044554*m.x17 - 1.93185165257814*m.x18 - 1.96325436689533*m.x19 - 1.59727102009459*m.x20 - 0.907980999479093*m.x21 - 0.034904812874567*m.x22 + 0.845236523481399*m.x23 + 1.55429192291394*m.x24 + 1.94874012957047*m.x25 - m.x26 <= 0) m.c28 = Constraint(expr= 1.0449971294319*m.x1 + 0.15691819145569*m.x2 - 0.765366864730181*m.x3 - 1.52081193120006*m.x4 - 1.94473984079535*m.x5 - 1.94473984079535*m.x6 - 1.52081193120006*m.x7 - 0.76536686473018*m.x8 + 0.156918191455691*m.x9 + 1.0449971294319*m.x10 + 1.70528032870819*m.x11 + 1.99383466746626*m.x12 + 1.84775906502257*m.x13 + 1.29889609666037*m.x14 + 0.46689072771181*m.x15 - 0.46689072771181*m.x16 - 1.29889609666037*m.x17 - 1.84775906502257*m.x18 - 1.99383466746626*m.x19 - 1.70528032870818*m.x20 - 1.0449971294319*m.x21 - 0.15691819145569*m.x22 + 0.76536686473018*m.x23 + 1.52081193120006*m.x24 + 1.94473984079535*m.x25 - m.x26 <= 0) m.c29 = Constraint(expr= 1.65807514511008*m.x1 + 0.93894312557178*m.x2 - 8.57252759403147E-16*m.x3 - 0.938943125571782*m.x4 - 1.65807514511008*m.x5 - 1.98904379073655*m.x6 - 1.85436770913358*m.x7 - 1.28557521937308*m.x8 - 0.41582338163552*m.x9 + 0.551274711633998*m.x10 + 1.38931674091799*m.x11 + 1.90211303259031*m.x12 + 1.96961550602442*m.x13 + 1.57602150721344*m.x14 + 0.813473286151601*m.x15 - 0.139512947488251*m.x16 - 1.05983852846641*m.x17 - 1.73205080756888*m.x18 - 1.99878165403819*m.x19 - 1.79758809259833*m.x20 - 1.17557050458495*m.x21 - 0.278346201920131*m.x22 + 0.684040286651338*m.x23 + 1.48628965095479*m.x24 + 1.94059145255199*m.x25 - m.x26 <= 0) m.c30 = Constraint(expr= 1.97257120307446*m.x1 + 1.56521631370483*m.x2 + 0.76536686473018*m.x3 - 0.226406427535811*m.x4 - 1.16140591142188*m.x5 - 1.80517056869972*m.x6 - 1.99626959684373*m.x7 - 1.68678289162577*m.x8 - 0.954317520519218*m.x9 + 0.0174530709967474*m.x10 + 0.984847120206933*m.x11 + 1.70528032870818*m.x12 + 1.99809644316372*m.x13 + 1.78986872320405*m.x14 + 1.13281247384967*m.x15 + 0.191691505040448*m.x16 - 0.797498137850492*m.x17 - 1.58670668058247*m.x18 - 1.97803172672383*m.x19 - 1.8733443784968*m.x20 - 1.29889609666037*m.x21 - 0.398735868834395*m.x22 + 0.601411599008546*m.x23 + 1.45074874202458*m.x24 + 1.93629528075622*m.x25 - m.x26 <= 0) m.c31 = Constraint(expr= 1.93185165257814*m.x1 + 1.93185165257814*m.x2 + 1.41421356237309*m.x3 + 0.51763809020504*m.x4 - 0.517638090205045*m.x5 - 1.4142135623731*m.x6 - 1.93185165257814*m.x7 - 1.93185165257814*m.x8 - 1.41421356237309*m.x9 - 0.51763809020504*m.x10 + 0.517638090205043*m.x11 + 1.4142135623731*m.x12 + 1.93185165257814*m.x13 + 1.93185165257814*m.x14 + 1.41421356237309*m.x15 + 0.517638090205041*m.x16 - 0.517638090205043*m.x17 - 1.4142135623731*m.x18 - 1.93185165257814*m.x19 - 1.93185165257814*m.x20 - 1.41421356237309*m.x21 - 0.517638090205041*m.x22 + 0.517638090205042*m.x23 + 1.4142135623731*m.x24 + 1.93185165257814*m.x25 - m.x26 <= 0) m.c32 = Constraint(expr= 1.54324916677544*m.x1 + 1.97803172672383*m.x2 + 1.84775906502257*m.x3 + 1.18964557350268*m.x4 + 0.191691505040446*m.x5 - 0.861022193616592*m.x6 - 1.66777164413434*m.x7 - 1.99809644316372*m.x8 - 1.75763422532393*m.x9 - 1.01507672592141*m.x10 + 0.0174530709967492*m.x11 + 1.0449971294319*m.x12 + 1.77402166635644*m.x13 + 1.99626959684373*m.x14 + 1.64825237724403*m.x15 + 0.829386485312478*m.x16 - 0.226406427535814*m.x17 - 1.21752285801744*m.x18 - 1.86083513596405*m.x19 - 1.97257120307446*m.x20 - 1.52081193120006*m.x21 - 0.634609312810184*m.x22 + 0.432879227876206*m.x23 + 1.37670915138751*m.x24 + 1.92726090641725*m.x25 - m.x26 <= 0) m.c33 = Constraint(expr= 0.876742293578156*m.x1 + 1.69609619231285*m.x2 + 2*m.x3 + 1.69609619231285*m.x4 + 0.876742293578154*m.x5 - 0.209056926535309*m.x6 - 1.23132295065132*m.x7 - 1.87938524157182*m.x8 - 1.95629520146761*m.x9 - 1.4386796006773*m.x10 - 0.483843791199336*m.x11 + 0.618033988749895*m.x12 + 1.53208888623796*m.x13 + 1.98053613748314*m.x14 + 1.8270909152852*m.x15 + 1.11838580694149*m.x16 + 0.0697989934050026*m.x17 - m.x18 - 1.76589518571785*m.x19 - 1.99512810051965*m.x20 - 1.61803398874989*m.x21 - 0.749213186831824*m.x22 + 0.347296355333861*m.x23 + 1.33826121271772*m.x24 + 1.92252339187664*m.x25 - m.x26 <= 0) m.c34 = Constraint(expr= 0.0523538966157441*m.x1 + 1.13281247384967*m.x2 + 1.84775906502257*m.x3 + 1.96650981512791*m.x4 + 1.45074874202458*m.x5 + 0.466890727711813*m.x6 - 0.667613718467543*m.x7 - 1.58670668058247*m.x8 - 1.99383466746626*m.x9 - 1.75763422532393*m.x10 - 0.954317520519218*m.x11 + 0.15691819145569*m.x12 + 1.21752285801744*m.x13 + 1.88528298218436*m.x14 + 1.94473984079535*m.x15 + 1.37670915138751*m.x16 + 0.364471050984295*m.x17 - 0.765366864730179*m.x18 - 1.64825237724403*m.x19 - 1.99931464995111*m.x20 - 1.70528032870818*m.x21 - 0.861022193616591*m.x22 + 0.261052384440103*m.x23 + 1.29889609666037*m.x24 + 1.91763946973639*m.x25 - m.x26 <= 0) m.c35 = Constraint(expr= - 0.78146225697855*m.x1 + 0.381617990753088*m.x2 + 1.41421356237309*m.x3 + 1.96325436689533*m.x4 + 1.84100970690488*m.x5 + 1.08927807003006*m.x6 - 0.0349048128745657*m.x7 - 1.14715287270209*m.x8 - 1.8671608529944*m.x9 - 1.94874012957047*m.x10 - 1.363996720125*m.x11 - 0.312868930080463*m.x12 + 0.845236523481399*m.x13 + 1.71433460140422*m.x14 + 1.99725906950915*m.x15 + 1.59727102009459*m.x16 + 0.651136308914314*m.x17 - 0.517638090205041*m.x18 - 1.50941916044554*m.x19 - 1.98509230328264*m.x20 - 1.78201304837674*m.x21 - 0.969619240492674*m.x22 + 0.174311485495316*m.x23 + 1.25864078209967*m.x24 + 1.91260951192607*m.x25 - m.x26 <= 0) m.c36 = Constraint(expr= - 1.47455467362025*m.x1 - 0.432879227876202*m.x2 + 0.765366864730181*m.x3 + 1.68678289162577*m.x4 + 1.99809644316372*m.x5 + 1.58670668058247*m.x6 + 0.601411599008543*m.x7 - 0.601411599008548*m.x8 - 1.58670668058247*m.x9 - 1.99809644316372*m.x10 - 1.68678289162577*m.x11 - 0.76536686473018*m.x12 + 0.432879227876208*m.x13 + 1.47455467362025*m.x14 + 1.98288972274762*m.x15 + 1.77402166635644*m.x16 + 0.923497226470066*m.x17 - 0.261052384440103*m.x18 - 1.35118041523132*m.x19 - 1.95259201423987*m.x20 - 1.84775906502257*m.x21 - 1.07459921669365*m.x22 + 0.087238774730672*m.x23 + 1.21752285801744*m.x24 + 1.90743390149645*m.x25 - m.x26 <= 0) m.c37 = Constraint(expr= - 1.90211303259031*m.x1 - 1.17557050458495*m.x2 + 1.10218211923262E-15*m.x3 + 1.17557050458495*m.x4 + 1.90211303259031*m.x5 + 1.90211303259031*m.x6 + 1.17557050458495*m.x7 - 8.57252759403147E-16*m.x8 - 1.17557050458495*m.x9 - 1.90211303259031*m.x10 - 1.90211303259031*m.x11 - 1.17557050458495*m.x12 + 6.12323399573677E-16*m.x13 + 1.17557050458495*m.x14 + 1.90211303259031*m.x15 + 1.90211303259031*m.x16 + 1.17557050458495*m.x17 - 3.67394039744206E-16*m.x18 - 1.17557050458495*m.x19 - 1.90211303259031*m.x20 - 1.90211303259031*m.x21 - 1.17557050458495*m.x22 + 1.22464679914735E-16*m.x23 + 1.17557050458495*m.x24 + 1.90211303259031*m.x25 - m.x26 <= 0) m.c38 = Constraint(expr= - 1.98714371135318*m.x1 - 1.72325832088305*m.x2 - 0.765366864730179*m.x3 + 0.500760008108884*m.x4 + 1.56521631370483*m.x5 + 1.99931464995111*m.x6 + 1.62823103671264*m.x7 + 0.601411599008546*m.x8 - 0.667613718467543*m.x9 - 1.66777164413434*m.x10 - 1.99626959684373*m.x11 - 1.52081193120006*m.x12 - 0.432879227876206*m.x13 + 0.829386485312479*m.x14 + 1.75763422532393*m.x15 + 1.97803172672383*m.x16 + 1.4018185285997*m.x17 + 0.261052384440103*m.x18 - 0.984847120206934*m.x19 - 1.83412014877025*m.x20 - 1.94473984079535*m.x21 - 1.27215644055553*m.x22 - 0.0872387747306718*m.x23 + 1.13281247384967*m.x24 + 1.8966473104124*m.x25 - m.x26 <= 0) m.c39 = Constraint(expr= - 1.71433460140422*m.x1 - 1.98509230328264*m.x2 - 1.4142135623731*m.x3 - 0.243738686810296*m.x4 + 1.03007614982011*m.x5 + 1.8671608529944*m.x6 + 1.91260951192607*m.x7 + 1.14715287270209*m.x8 - 0.104671912485886*m.x9 - 1.31211805798101*m.x10 - 1.96325436689533*m.x11 - 1.78201304837674*m.x12 - 0.845236523481401*m.x13 + 0.449902108687729*m.x14 + 1.55429192291394*m.x15 + 1.99969539031278*m.x16 + 1.59727102009459*m.x17 + 0.517638090205042*m.x18 - 0.781462256978548*m.x19 - 1.74923941427879*m.x20 - 1.97537668119028*m.x21 - 1.363996720125*m.x22 - 0.174311485495316*m.x23 + 1.08927807003005*m.x24 + 1.89103715119863*m.x25 - m.x26 <= 0) m.c40 = Constraint(expr= - 1.13281247384967*m.x1 - 1.91763946973639*m.x2 - 1.84775906502257*m.x3 - 0.954317520519214*m.x4 + 0.364471050984298*m.x5 + 1.52081193120006*m.x6 + 1.99931464995111*m.x7 + 1.58670668058247*m.x8 + 0.466890727711809*m.x9 - 0.861022193616592*m.x10 - 1.80517056869972*m.x11 - 1.94473984079535*m.x12 - 1.21752285801744*m.x13 + 0.0523538966157472*m.x14 + 1.29889609666037*m.x15 + 1.96650981512791*m.x16 + 1.75763422532393*m.x17 + 0.765366864730178*m.x18 - 0.568030689407845*m.x19 - 1.64825237724403*m.x20 - 1.99383466746626*m.x21 - 1.45074874202457*m.x22 - 0.261052384440103*m.x23 + 1.0449971294319*m.x24 + 1.88528298218436*m.x25 - m.x26 <= 0) m.c41 = Constraint(expr= - 0.347296355333865*m.x1 - 1.53208888623796*m.x2 - 2*m.x3 - 1.53208888623795*m.x4 - 0.347296355333859*m.x5 + m.x6 + 1.87938524157182*m.x7 + 1.87938524157182*m.x8 + 0.999999999999998*m.x9 - 0.347296355333861*m.x10 - 1.53208888623796*m.x11 - 2*m.x12 - 1.53208888623795*m.x13 - 0.34729635533386*m.x14 + m.x15 + 1.87938524157182*m.x16 + 1.87938524157182*m.x17 + m.x18 - 0.347296355333861*m.x19 - 1.53208888623796*m.x20 - 2*m.x21 - 1.53208888623796*m.x22 - 0.347296355333861*m.x23 + m.x24 + 1.87938524157182*m.x25 - m.x26 <= 0) m.c42 = Constraint(expr= 0.500760008108885*m.x1 - 0.892395626219618*m.x2 - 1.84775906502258*m.x3 - 1.8966473104124*m.x4 - 1.01507672592141*m.x5 + 0.364471050984295*m.x6 + 1.56521631370483*m.x7 + 1.99809644316372*m.x8 + 1.45074874202458*m.x9 + 0.191691505040446*m.x10 - 1.16140591142188*m.x11 - 1.94473984079535*m.x12 - 1.77402166635644*m.x13 - 0.733002453448593*m.x14 + 0.667613718467543*m.x15 + 1.7407113918798*m.x16 + 1.95984940924166*m.x17 + 1.21752285801744*m.x18 - 0.122097079069714*m.x19 - 1.4018185285997*m.x20 - 1.99383466746626*m.x21 - 1.60771372123443*m.x22 - 0.432879227876206*m.x23 + 0.954317520519217*m.x24 + 1.8733443784968*m.x25 - m.x26 <= 0) m.c43 = Constraint(expr= 1.25864078209968*m.x1 - 0.104671912485886*m.x2 - 1.41421356237309*m.x3 - 1.99725906950915*m.x4 - 1.55429192291394*m.x5 - 0.312868930080462*m.x6 + 1.08927807003005*m.x7 + 1.93185165257814*m.x8 + 1.78201304837674*m.x9 + 0.7167358990906*m.x10 - 0.716735899090602*m.x11 - 1.78201304837674*m.x12 - 1.93185165257814*m.x13 - 1.08927807003005*m.x14 + 0.312868930080462*m.x15 + 1.55429192291394*m.x16 + 1.99725906950915*m.x17 + 1.41421356237309*m.x18 + 0.104671912485888*m.x19 - 1.25864078209967*m.x20 - 1.97537668119028*m.x21 - 1.67734113589085*m.x22 - 0.517638090205042*m.x23 + 0.907980999479094*m.x24 + 1.8671608529944*m.x25 - m.x26 <= 0) m.c44 = Constraint(expr= 1.78986872320405*m.x1 + 0.700414762518939*m.x2 - 0.765366864730175*m.x3 - 1.81992254175309*m.x4 - 1.8966473104124*m.x5 - 0.954317520519218*m.x6 + 0.500760008108881*m.x7 + 1.68678289162577*m.x8 + 1.96650981512791*m.x9 + 1.18964557350268*m.x10 - 0.226406427535811*m.x11 - 1.52081193120006*m.x12 - 1.99809644316372*m.x13 - 1.4018185285997*m.x14 - 0.0523538966157478*m.x15 + 1.32524009643147*m.x16 + 1.99079239673436*m.x17 + 1.58670668058247*m.x18 + 0.330095211721356*m.x19 - 1.10387397062412*m.x20 - 1.94473984079535*m.x21 - 1.7407113918798*m.x22 - 0.601411599008546*m.x23 + 0.86102219361659*m.x24 + 1.86083513596405*m.x25 - m.x26 <= 0) m.c45 = Constraint(expr= 1.99878165403819*m.x1 + 1.38931674091799*m.x2 - 4.89982515786259E-15*m.x3 - 1.389316740918*m.x4 - 1.99878165403819*m.x5 - 1.48628965095479*m.x6 - 0.139512947488248*m.x7 + 1.28557521937308*m.x8 + 1.98904379073655*m.x9 + 1.57602150721344*m.x10 + 0.27834620192013*m.x11 - 1.17557050458495*m.x12 - 1.96961550602442*m.x13 - 1.65807514511008*m.x14 - 0.415823381635517*m.x15 + 1.05983852846641*m.x16 + 1.94059145255199*m.x17 + 1.73205080756888*m.x18 + 0.551274711633997*m.x19 - 0.938943125571782*m.x20 - 1.90211303259031*m.x21 - 1.79758809259833*m.x22 - 0.684040286651337*m.x23 + 0.813473286151601*m.x24 + 1.85436770913357*m.x25 - m.x26 <= 0) m.c46 = Constraint(expr= 1.84775906502258*m.x1 + 1.84775906502257*m.x2 + 0.765366864730179*m.x3 - 0.765366864730182*m.x4 - 1.84775906502258*m.x5 - 1.84775906502257*m.x6 - 0.765366864730179*m.x7 + 0.765366864730181*m.x8 + 1.84775906502257*m.x9 + 1.84775906502257*m.x10 + 0.76536686473018*m.x11 - 0.765366864730181*m.x12 - 1.84775906502257*m.x13 - 1.84775906502257*m.x14 - 0.76536686473018*m.x15 + 0.765366864730181*m.x16 + 1.84775906502257*m.x17 + 1.84775906502257*m.x18 + 0.76536686473018*m.x19 - 0.765366864730181*m.x20 - 1.84775906502257*m.x21 - 1.84775906502257*m.x22 - 0.765366864730179*m.x23 + 0.76536686473018*m.x24 + 1.84775906502257*m.x25 - m.x26 <= 0) m.c47 = Constraint(expr= 1.36399672012499*m.x1 + 1.99969539031278*m.x2 + 1.41421356237309*m.x3 - 0.0349048128745698*m.x4 - 1.46270740323834*m.x5 - 1.99725906950915*m.x6 - 1.31211805798101*m.x7 + 0.174311485495317*m.x8 + 1.55429192291394*m.x9 + 1.98509230328264*m.x10 + 1.2036300463041*m.x11 - 0.312868930080461*m.x12 - 1.63830408857798*m.x13 - 1.96325436689533*m.x14 - 1.08927807003005*m.x15 + 0.449902108687731*m.x16 + 1.71433460140422*m.x17 + 1.93185165257814*m.x18 + 0.969619240492675*m.x19 - 0.584743409445474*m.x20 - 1.78201304837674*m.x21 - 1.89103715119863*m.x22 - 0.845236523481399*m.x23 + 0.7167358990906*m.x24 + 1.84100970690488*m.x25 - m.x26 <= 0) m.c48 = Constraint(expr= 0.634609312810181*m.x1 + 1.81992254175309*m.x2 + 1.84775906502257*m.x3 + 0.700414762518939*m.x4 - 0.892395626219618*m.x5 - 1.91763946973639*m.x6 - 1.72325832088305*m.x7 - 0.432879227876206*m.x8 + 1.13281247384967*m.x9 + 1.97803172672383*m.x10 + 1.56521631370483*m.x11 + 0.15691819145569*m.x12 - 1.35118041523132*m.x13 - 1.99992384612834*m.x14 - 1.37670915138751*m.x15 + 0.122097079069714*m.x16 + 1.54324916677544*m.x17 + 1.98288972274762*m.x18 + 1.16140591142188*m.x19 - 0.398735868834395*m.x20 - 1.70528032870818*m.x21 - 1.92726090641725*m.x22 - 0.923497226470068*m.x23 + 0.667613718467542*m.x24 + 1.83412014877025*m.x25 - m.x26 <= 0) m.c49 = Constraint(expr= - 0.20905692653531*m.x1 + 1.33826121271772*m.x2 + 2*m.x3 + 1.33826121271772*m.x4 - 0.209056926535306*m.x5 - 1.6180339887499*m.x6 - 1.95629520146761*m.x7 - m.x8 + 0.618033988749892*m.x9 + 1.8270909152852*m.x10 + 1.8270909152852*m.x11 + 0.618033988749897*m.x12 - m.x13 - 1.95629520146761*m.x14 - 1.61803398874989*m.x15 - 0.209056926535307*m.x16 + 1.33826121271772*m.x17 + 2*m.x18 + 1.33826121271772*m.x19 - 0.209056926535307*m.x20 - 1.61803398874989*m.x21 - 1.95629520146761*m.x22 - m.x23 + 0.618033988749895*m.x24 + 1.8270909152852*m.x25 - m.x26 <= 0) m.c50 = Constraint(expr= - 1.0150767259214*m.x1 + 0.634609312810188*m.x2 + 1.84775906502258*m.x3 + 1.78986872320405*m.x4 + 0.500760008108879*m.x5 - 1.13281247384967*m.x6 - 1.98714371135318*m.x7 - 1.47455467362025*m.x8 + 0.0523538966157477*m.x9 + 1.54324916677544*m.x10 + 1.97257120307446*m.x11 + 1.0449971294319*m.x12 - 0.601411599008548*m.x13 - 1.83412014877025*m.x14 - 1.80517056869972*m.x15 - 0.534476752156511*m.x16 + 1.10387397062412*m.x17 + 1.98288972274762*m.x18 + 1.497911441578*m.x19 - 0.0174530709967489*m.x20 - 1.52081193120006*m.x21 - 1.97803172672383*m.x22 - 1.07459921669365*m.x23 + 0.568030689407846*m.x24 + 1.81992254175309*m.x25 - m.x26 <= 0) m.c51 = Constraint(expr= - 1.63830408857798*m.x1 - 0.174311485495315*m.x2 + 1.41421356237309*m.x3 + 1.99238939618349*m.x4 + 1.14715287270209*m.x5 - 0.517638090205042*m.x6 - 1.8126155740733*m.x7 - 1.8126155740733*m.x8 - 0.51763809020504*m.x9 + 1.14715287270209*m.x10 + 1.99238939618349*m.x11 + 1.4142135623731*m.x12 - 0.174311485495317*m.x13 - 1.63830408857798*m.x14 - 1.93185165257814*m.x15 - 0.845236523481397*m.x16 + 0.845236523481399*m.x17 + 1.93185165257814*m.x18 + 1.63830408857798*m.x19 + 0.174311485495316*m.x20 - 1.4142135623731*m.x21 - 1.99238939618349*m.x22 - 1.14715287270209*m.x23 + 0.517638090205041*m.x24 + 1.8126155740733*m.x25 - m.x26 <= 0) m.c52 = Constraint(expr= - 1.96650981512791*m.x1 - 0.954317520519217*m.x2 + 0.765366864730182*m.x3 + 1.91763946973639*m.x4 + 1.64825237724403*m.x5 + 0.156918191455693*m.x6 - 1.45074874202458*m.x7 - 1.98288972274762*m.x8 - 1.0449971294319*m.x9 + 0.667613718467543*m.x10 + 1.88528298218436*m.x11 + 1.70528032870818*m.x12 + 0.261052384440104*m.x13 - 1.37670915138751*m.x14 - 1.99383466746626*m.x15 - 1.13281247384966*m.x16 + 0.568030689407846*m.x17 + 1.84775906502257*m.x18 + 1.75763422532393*m.x19 + 0.364471050984295*m.x20 - 1.29889609666037*m.x21 - 1.99931464995111*m.x22 - 1.21752285801744*m.x23 + 0.466890727711811*m.x24 + 1.80517056869972*m.x25 - m.x26 <= 0) m.c53 = Constraint(expr= - 1.94059145255199*m.x1 - 1.57602150721345*m.x2 - 1.96067283990894E-15*m.x3 + 1.57602150721344*m.x4 + 1.94059145255199*m.x5 + 0.8134732861516*m.x6 - 0.938943125571782*m.x7 - 1.96961550602442*m.x8 - 1.48628965095479*m.x9 + 0.13951294748825*m.x10 + 1.65807514511008*m.x11 + 1.90211303259031*m.x12 + 0.684040286651339*m.x13 - 1.05983852846641*m.x14 - 1.98904379073655*m.x15 - 1.38931674091799*m.x16 + 0.27834620192013*m.x17 + 1.73205080756888*m.x18 + 1.85436770913358*m.x19 + 0.551274711633999*m.x20 - 1.17557050458495*m.x21 - 1.99878165403819*m.x22 - 1.28557521937308*m.x23 + 0.415823381635518*m.x24 + 1.79758809259833*m.x25 - m.x26 <= 0) m.c54 = Constraint(expr= - 1.56521631370483*m.x1 - 1.93629528075622*m.x2 - 0.765366864730179*m.x3 + 1.01507672592141*m.x4 + 1.98714371135318*m.x5 + 1.37670915138751*m.x6 - 0.330095211721357*m.x7 - 1.77402166635644*m.x8 - 1.80517056869972*m.x9 - 0.398735868834393*m.x10 + 1.32524009643148*m.x11 + 1.99383466746626*m.x12 + 1.07459921669365*m.x13 - 0.700414762518937*m.x14 - 1.91763946973639*m.x15 - 1.60771372123443*m.x16 - 0.0174530709967462*m.x17 + 1.58670668058247*m.x18 + 1.92726090641725*m.x19 + 0.733002453448594*m.x20 - 1.0449971294319*m.x21 - 1.99079239673436*m.x22 - 1.35118041523132*m.x23 + 0.364471050984295*m.x24 + 1.78986872320405*m.x25 - m.x26 <= 0) m.c55 = Constraint(expr= - 0.907980999479097*m.x1 - 1.97537668119028*m.x2 - 1.41421356237309*m.x3 + 0.312868930080462*m.x4 + 1.78201304837674*m.x5 + 1.78201304837674*m.x6 + 0.312868930080459*m.x7 - 1.41421356237309*m.x8 - 1.97537668119027*m.x9 - 0.907980999479094*m.x10 + 0.907980999479096*m.x11 + 1.97537668119028*m.x12 + 1.41421356237309*m.x13 - 0.312868930080461*m.x14 - 1.78201304837674*m.x15 - 1.78201304837674*m.x16 - 0.312868930080459*m.x17 + 1.4142135623731*m.x18 + 1.97537668119028*m.x19 + 0.907980999479093*m.x20 - 0.907980999479094*m.x21 - 1.97537668119028*m.x22 - 1.41421356237309*m.x23 + 0.312868930080462*m.x24 + 1.78201304837674*m.x25 - m.x26 <= 0) m.c56 = Constraint(expr= - 0.0872387747306755*m.x1 - 1.68678289162577*m.x2 - 1.84775906502257*m.x3 - 0.432879227876205*m.x4 + 1.35118041523132*m.x5 + 1.98288972274762*m.x6 + 0.92349722647007*m.x7 - 0.923497226470066*m.x8 - 1.98288972274762*m.x9 - 1.35118041523132*m.x10 + 0.432879227876205*m.x11 + 1.84775906502257*m.x12 + 1.68678289162577*m.x13 + 0.0872387747306728*m.x14 - 1.58670668058247*m.x15 - 1.90743390149645*m.x16 - 0.601411599008547*m.x17 + 1.21752285801744*m.x18 + 1.99809644316372*m.x19 + 1.07459921669365*m.x20 - 0.765366864730179*m.x21 - 1.95259201423987*m.x22 - 1.47455467362025*m.x23 + 0.261052384440103*m.x24 + 1.77402166635644*m.x25 - m.x26 <= 0) m.c57 = Constraint(expr= 0.749213186831827*m.x1 - 1.1183858069415*m.x2 - 2*m.x3 - 1.11838580694149*m.x4 + 0.749213186831824*m.x5 + 1.95629520146761*m.x6 + 1.4386796006773*m.x7 - 0.347296355333858*m.x8 - 1.8270909152852*m.x9 - 1.69609619231285*m.x10 - 0.0697989934050036*m.x11 + 1.6180339887499*m.x12 + 1.87938524157182*m.x13 + 0.483843791199336*m.x14 - 1.33826121271772*m.x15 - 1.98053613748314*m.x16 - 0.876742293578155*m.x17 + m.x18 + 1.99512810051965*m.x19 + 1.23132295065132*m.x20 - 0.618033988749895*m.x21 - 1.92252339187664*m.x22 - 1.53208888623796*m.x23 + 0.209056926535307*m.x24 + 1.76589518571785*m.x25 - m.x26 <= 0) m.c58 = Constraint(expr= 1.45074874202458*m.x1 - 0.364471050984295*m.x2 - 1.84775906502257*m.x3 - 1.64825237724403*m.x4 + 0.0523538966157446*m.x5 + 1.70528032870818*m.x6 + 1.80517056869972*m.x7 + 0.261052384440107*m.x8 - 1.52081193120006*m.x9 - 1.91763946973639*m.x10 - 0.568030689407847*m.x11 + 1.29889609666037*m.x12 + 1.98288972274762*m.x13 + 0.861022193616591*m.x14 - 1.0449971294319*m.x15 - 1.99931464995111*m.x16 - 1.13281247384966*m.x17 + 0.765366864730179*m.x18 + 1.96650981512791*m.x19 + 1.37670915138751*m.x20 - 0.46689072771181*m.x21 - 1.88528298218436*m.x22 - 1.58670668058247*m.x23 + 0.15691819145569*m.x24 + 1.75763422532393*m.x25 - m.x26 <= 0) m.c59 = Constraint(expr= 1.89103715119863*m.x1 + 0.449902108687732*m.x2 - 1.4142135623731*m.x3 - 1.94874012957047*m.x4 - 0.651136308914317*m.x5 + 1.25864078209967*m.x6 + 1.98509230328264*m.x7 + 0.845236523481403*m.x8 - 1.08927807003005*m.x9 - 1.99969539031278*m.x10 - 1.03007614982011*m.x11 + 0.907980999479093*m.x12 + 1.99238939618349*m.x13 + 1.2036300463041*m.x14 - 0.716735899090599*m.x15 - 1.96325436689533*m.x16 - 1.363996720125*m.x17 + 0.517638090205041*m.x18 + 1.91260951192607*m.x19 + 1.50941916044554*m.x20 - 0.31286893008046*m.x21 - 1.84100970690488*m.x22 - 1.63830408857798*m.x23 + 0.104671912485887*m.x24 + 1.74923941427879*m.x25 - m.x26 <= 0) m.c60 = Constraint(expr= 1.99079239673436*m.x1 + 1.18964557350269*m.x2 - 0.765366864730175*m.x3 - 1.97803172672383*m.x4 - 1.27215644055553*m.x5 + 0.667613718467537*m.x6 + 1.95984940924166*m.x7 + 1.35118041523132*m.x8 - 0.568030689407839*m.x9 - 1.93629528075621*m.x10 - 1.42650089830837*m.x11 + 0.466890727711808*m.x12 + 1.90743390149645*m.x13 + 1.497911441578*m.x14 - 0.364471050984294*m.x15 - 1.87334437849679*m.x16 - 1.56521631370483*m.x17 + 0.261052384440102*m.x18 + 1.83412014877025*m.x19 + 1.62823103671264*m.x20 - 0.156918191455689*m.x21 - 1.78986872320405*m.x22 - 1.68678289162577*m.x23 + 0.0523538966157458*m.x24 + 1.7407113918798*m.x25 - m.x26 <= 0) m.c61 = Constraint(expr= 1.73205080756888*m.x1 + 1.73205080756887*m.x2 - 5.38968387752153E-15*m.x3 - 1.73205080756888*m.x4 - 1.73205080756887*m.x5 + 5.14475451769206E-15*m.x6 + 1.73205080756888*m.x7 + 1.73205080756887*m.x8 - 4.89982515786259E-15*m.x9 - 1.73205080756888*m.x10 - 1.73205080756888*m.x11 + 4.65489579803312E-15*m.x12 + 1.73205080756888*m.x13 + 1.73205080756888*m.x14 - 8.57252759403147E-16*m.x15 - 1.73205080756888*m.x16 - 1.73205080756888*m.x17 + 2.38868023897393E-15*m.x18 + 1.73205080756888*m.x19 + 1.73205080756888*m.x20 - 3.67394039744206E-16*m.x21 - 1.73205080756888*m.x22 - 1.73205080756888*m.x23 + 1.22464679914735E-16*m.x24 + 1.73205080756888*m.x25 - m.x26 <= 0) m.c62 = Constraint(expr= 1.16140591142188*m.x1 + 1.98714371135317*m.x2 + 0.765366864730179*m.x3 - 1.24502927327524*m.x4 - 1.97257120307446*m.x5 - 0.667613718467541*m.x6 + 1.32524009643148*m.x7 + 1.95259201423987*m.x8 + 0.568030689407844*m.x9 - 1.4018185285997*m.x10 - 1.92726090641725*m.x11 - 0.466890727711809*m.x12 + 1.47455467362025*m.x13 + 1.8966473104124*m.x14 + 0.364471050984293*m.x15 - 1.54324916677544*m.x16 - 1.86083513596405*m.x17 - 0.261052384440102*m.x18 + 1.60771372123444*m.x19 + 1.81992254175309*m.x20 + 0.156918191455689*m.x21 - 1.66777164413434*m.x22 - 1.77402166635644*m.x23 - 0.052353896615746*m.x24 + 1.72325832088305*m.x25 - m.x26 <= 0) m.c63 = Constraint(expr= 0.381617990753093*m.x1 + 1.91260951192607*m.x2 + 1.41421356237309*m.x3 - 0.584743409445477*m.x4 - 1.96325436689533*m.x5 - 1.25864078209967*m.x6 + 0.781462256978552*m.x7 + 1.99238939618349*m.x8 + 1.08927807003005*m.x9 - 0.969619240492673*m.x10 - 1.99969539031278*m.x11 - 0.907980999479091*m.x12 + 1.14715287270209*m.x13 + 1.98509230328264*m.x14 + 0.7167358990906*m.x15 - 1.31211805798101*m.x16 - 1.94874012957047*m.x17 - 0.51763809020504*m.x18 + 1.46270740323834*m.x19 + 1.89103715119863*m.x20 + 0.312868930080461*m.x21 - 1.59727102009459*m.x22 - 1.8126155740733*m.x23 - 0.104671912485887*m.x24 + 1.71433460140422*m.x25 - m.x26 <= 0) m.c64 = Constraint(expr= - 0.466890727711808*m.x1 + 1.52081193120006*m.x2 + 1.84775906502257*m.x3 + 0.156918191455685*m.x4 - 1.70528032870819*m.x5 - 1.70528032870818*m.x6 + 0.156918191455689*m.x7 + 1.84775906502258*m.x8 + 1.52081193120006*m.x9 - 0.466890727711811*m.x10 - 1.94473984079535*m.x11 - 1.29889609666037*m.x12 + 0.765366864730181*m.x13 + 1.99383466746626*m.x14 + 1.0449971294319*m.x15 - 1.0449971294319*m.x16 - 1.99383466746626*m.x17 - 0.76536686473018*m.x18 + 1.29889609666037*m.x19 + 1.94473984079535*m.x20 + 0.46689072771181*m.x21 - 1.52081193120006*m.x22 - 1.84775906502257*m.x23 - 0.15691819145569*m.x24 + 1.70528032870818*m.x25 - m.x26 <= 0) m.c65 = Constraint(expr= - 1.23132295065131*m.x1 + 0.876742293578154*m.x2 + 2*m.x3 + 0.876742293578157*m.x4 - 1.23132295065132*m.x5 - 1.95629520146761*m.x6 - 0.483843791199335*m.x7 + 1.53208888623796*m.x8 + 1.8270909152852*m.x9 + 0.0697989934049998*m.x10 - 1.76589518571785*m.x11 - 1.61803398874989*m.x12 + 0.347296355333861*m.x13 + 1.92252339187664*m.x14 + 1.33826121271772*m.x15 - 0.749213186831823*m.x16 - 1.99512810051965*m.x17 - 0.999999999999998*m.x18 + 1.11838580694149*m.x19 + 1.98053613748314*m.x20 + 0.618033988749894*m.x21 - 1.4386796006773*m.x22 - 1.87938524157182*m.x23 - 0.209056926535307*m.x24 + 1.69609619231285*m.x25 - m.x26 <= 0) m.c66 = Constraint(expr= - 1.77402166635644*m.x1 + 0.0872387747306687*m.x2 + 1.84775906502257*m.x3 + 1.47455467362025*m.x4 - 0.601411599008546*m.x5 - 1.98288972274762*m.x6 - 1.07459921669365*m.x7 + 1.07459921669365*m.x8 + 1.98288972274762*m.x9 + 0.601411599008549*m.x10 - 1.47455467362025*m.x11 - 1.84775906502257*m.x12 - 0.0872387747306726*m.x13 + 1.77402166635644*m.x14 + 1.58670668058247*m.x15 - 0.432879227876204*m.x16 - 1.95259201423987*m.x17 - 1.21752285801744*m.x18 + 0.923497226470067*m.x19 + 1.99809644316372*m.x20 + 0.76536686473018*m.x21 - 1.35118041523132*m.x22 - 1.90743390149645*m.x23 - 0.261052384440103*m.x24 + 1.68678289162577*m.x25 - m.x26 <= 0) m.c67 = Constraint(expr= - 1.99725906950915*m.x1 - 0.716735899090599*m.x2 + 1.4142135623731*m.x3 + 1.8671608529944*m.x4 + 0.10467191248589*m.x5 - 1.78201304837673*m.x6 - 1.55429192291394*m.x7 + 0.517638090205042*m.x8 + 1.97537668119028*m.x9 + 1.08927807003006*m.x10 - 1.08927807003005*m.x11 - 1.97537668119028*m.x12 - 0.517638090205043*m.x13 + 1.55429192291394*m.x14 + 1.78201304837674*m.x15 - 0.104671912485886*m.x16 - 1.8671608529944*m.x17 - 1.4142135623731*m.x18 + 0.7167358990906*m.x19 + 1.99725906950915*m.x20 + 0.907980999479093*m.x21 - 1.25864078209967*m.x22 - 1.93185165257814*m.x23 - 0.312868930080462*m.x24 + 1.67734113589085*m.x25 - m.x26 <= 0) m.c68 = Constraint(expr= - 1.86083513596405*m.x1 - 1.4018185285997*m.x2 + 0.765366864730176*m.x3 + 1.99992384612834*m.x4 + 0.797498137850496*m.x5 - 1.37670915138751*m.x6 - 1.8733443784968*m.x7 - 0.0872387747306721*m.x8 + 1.80517056869972*m.x9 + 1.497911441578*m.x10 - 0.634609312810181*m.x11 - 1.99383466746626*m.x12 - 0.923497226470071*m.x13 + 1.27215644055553*m.x14 + 1.91763946973639*m.x15 + 0.226406427535813*m.x16 - 1.7407113918798*m.x17 - 1.58670668058247*m.x18 + 0.500760008108882*m.x19 + 1.97803172672383*m.x20 + 1.0449971294319*m.x21 - 1.16140591142188*m.x22 - 1.95259201423987*m.x23 - 0.364471050984295*m.x24 + 1.66777164413434*m.x25 - m.x26 <= 0) m.c69 = Constraint(expr= - 1.38931674091799*m.x1 - 1.85436770913358*m.x2 - 1.47081412025E-15*m.x3 + 1.85436770913357*m.x4 + 1.389316740918*m.x5 - 0.813473286151597*m.x6 - 1.99878165403819*m.x7 - 0.684040286651339*m.x8 + 1.48628965095479*m.x9 + 1.79758809259834*m.x10 - 0.139512947488247*m.x11 - 1.90211303259031*m.x12 - 1.28557521937308*m.x13 + 0.938943125571779*m.x14 + 1.98904379073655*m.x15 + 0.551274711633998*m.x16 - 1.57602150721344*m.x17 - 1.73205080756888*m.x18 + 0.27834620192013*m.x19 + 1.94059145255199*m.x20 + 1.17557050458495*m.x21 - 1.05983852846641*m.x22 - 1.96961550602442*m.x23 - 0.415823381635519*m.x24 + 1.65807514511008*m.x25 - m.x26 <= 0) m.c70 = Constraint(expr= - 0.667613718467544*m.x1 - 1.99931464995111*m.x2 - 0.765366864730172*m.x3 + 1.45074874202458*m.x4 + 1.80517056869972*m.x5 - 0.156918191455696*m.x6 - 1.91763946973639*m.x7 - 1.21752285801744*m.x8 + 1.0449971294319*m.x9 + 1.96650981512791*m.x10 + 0.364471050984292*m.x11 - 1.70528032870819*m.x12 - 1.58670668058247*m.x13 + 0.568030689407849*m.x14 + 1.99383466746626*m.x15 + 0.861022193616588*m.x16 - 1.37670915138751*m.x17 - 1.84775906502257*m.x18 + 0.0523538966157472*m.x19 + 1.88528298218436*m.x20 + 1.29889609666037*m.x21 - 0.954317520519217*m.x22 - 1.98288972274762*m.x23 - 0.466890727711811*m.x24 + 1.64825237724403*m.x25 - m.x26 <= 0) m.c71 = Constraint(expr= 0.174311485495314*m.x1 - 1.8126155740733*m.x2 - 1.41421356237309*m.x3 + 0.8452365234814*m.x4 + 1.99238939618349*m.x5 + 0.517638090205039*m.x6 - 1.63830408857799*m.x7 - 1.63830408857798*m.x8 + 0.517638090205042*m.x9 + 1.99238939618349*m.x10 + 0.845236523481397*m.x11 - 1.41421356237309*m.x12 - 1.8126155740733*m.x13 + 0.174311485495317*m.x14 + 1.93185165257814*m.x15 + 1.14715287270209*m.x16 - 1.14715287270209*m.x17 - 1.93185165257814*m.x18 - 0.174311485495316*m.x19 + 1.8126155740733*m.x20 + 1.41421356237309*m.x21 - 0.8452365234814*m.x22 - 1.99238939618349*m.x23 - 0.517638090205041*m.x24 + 1.63830408857798*m.x25 - m.x26 <= 0) m.c72 = Constraint(expr= 0.984847120206932*m.x1 - 1.32524009643148*m.x2 - 1.84775906502257*m.x3 + 0.122097079069715*m.x4 + 1.92726090641725*m.x5 + 1.13281247384966*m.x6 - 1.18964557350268*m.x7 - 1.90743390149645*m.x8 - 0.0523538966157415*m.x9 + 1.8733443784968*m.x10 + 1.27215644055553*m.x11 - 1.0449971294319*m.x12 - 1.95259201423987*m.x13 - 0.226406427535812*m.x14 + 1.80517056869972*m.x15 + 1.4018185285997*m.x16 - 0.892395626219618*m.x17 - 1.98288972274762*m.x18 - 0.398735868834394*m.x19 + 1.72325832088305*m.x20 + 1.52081193120006*m.x21 - 0.733002453448594*m.x22 - 1.99809644316372*m.x23 - 0.568030689407845*m.x24 + 1.62823103671264*m.x25 - m.x26 <= 0) m.c73 = Constraint(expr= 1.61803398874989*m.x1 - 0.618033988749897*m.x2 - 2*m.x3 - 0.618033988749893*m.x4 + 1.6180339887499*m.x5 + 1.61803398874989*m.x6 - 0.618033988749897*m.x7 - 2*m.x8 - 0.618033988749893*m.x9 + 1.6180339887499*m.x10 + 1.61803398874989*m.x11 - 0.618033988749896*m.x12 - 2*m.x13 - 0.618033988749894*m.x14 + 1.6180339887499*m.x15 + 1.61803398874989*m.x16 - 0.618033988749896*m.x17 - 2*m.x18 - 0.618033988749894*m.x19 + 1.6180339887499*m.x20 + 1.61803398874989*m.x21 - 0.618033988749895*m.x22 - 2*m.x23 - 0.618033988749895*m.x24 + 1.61803398874989*m.x25 - m.x26 <= 0) m.c74 = Constraint(expr= 1.95984940924166*m.x1 + 0.191691505040448*m.x2 - 1.84775906502257*m.x3 - 1.27215644055553*m.x4 + 1.10387397062412*m.x5 + 1.91763946973639*m.x6 + 0.0174530709967449*m.x7 - 1.90743390149645*m.x8 - 1.13281247384967*m.x9 + 1.24502927327524*m.x10 + 1.86083513596405*m.x11 - 0.156918191455689*m.x12 - 1.95259201423987*m.x13 - 0.984847120206933*m.x14 + 1.37670915138751*m.x15 + 1.78986872320405*m.x16 - 0.330095211721357*m.x17 - 1.98288972274762*m.x18 - 0.829386485312478*m.x19 + 1.497911441578*m.x20 + 1.70528032870818*m.x21 - 0.500760008108884*m.x22 - 1.99809644316372*m.x23 - 0.667613718467542*m.x24 + 1.60771372123443*m.x25 - m.x26 <= 0) m.c75 = Constraint(expr= 1.94874012957047*m.x1 + 0.969619240492676*m.x2 - 1.4142135623731*m.x3 - 1.74923941427879*m.x4 + 0.449902108687729*m.x5 + 1.99725906950915*m.x6 + 0.651136308914316*m.x7 - 1.63830408857798*m.x8 - 1.55429192291394*m.x9 + 0.781462256978546*m.x10 + 1.98509230328264*m.x11 + 0.312868930080459*m.x12 - 1.8126155740733*m.x13 - 1.31211805798101*m.x14 + 1.08927807003005*m.x15 + 1.91260951192607*m.x16 - 0.0349048128745657*m.x17 - 1.93185165257814*m.x18 - 1.03007614982011*m.x19 + 1.363996720125*m.x20 + 1.78201304837674*m.x21 - 0.381617990753089*m.x22 - 1.99238939618349*m.x23 - 0.716735899090601*m.x24 + 1.59727102009459*m.x25 - m.x26 <= 0) m.c76 = Constraint(expr= 1.58670668058247*m.x1 + 1.58670668058247*m.x2 - 0.765366864730176*m.x3 - 1.98288972274762*m.x4 - 0.261052384440106*m.x5 + 1.84775906502257*m.x6 + 1.21752285801744*m.x7 - 1.21752285801744*m.x8 - 1.84775906502257*m.x9 + 0.261052384440103*m.x10 + 1.98288972274762*m.x11 + 0.765366864730179*m.x12 - 1.58670668058247*m.x13 - 1.58670668058247*m.x14 + 0.765366864730178*m.x15 + 1.98288972274762*m.x16 + 0.261052384440104*m.x17 - 1.84775906502257*m.x18 - 1.21752285801744*m.x19 + 1.21752285801744*m.x20 + 1.84775906502257*m.x21 - 0.261052384440103*m.x22 - 1.98288972274762*m.x23 - 0.765366864730179*m.x24 + 1.58670668058247*m.x25 - m.x26 <= 0) m.c77 = Constraint(expr= 0.938943125571777*m.x1 + 1.94059145255199*m.x2 + 1.22588476042053E-15*m.x3 - 1.94059145255199*m.x4 - 0.938943125571786*m.x5 + 1.48628965095479*m.x6 + 1.65807514511008*m.x7 - 0.684040286651335*m.x8 - 1.98904379073655*m.x9 - 0.27834620192013*m.x10 + 1.85436770913357*m.x11 + 1.17557050458495*m.x12 - 1.28557521937308*m.x13 - 1.79758809259833*m.x14 + 0.415823381635519*m.x15 + 1.99878165403819*m.x16 + 0.551274711633998*m.x17 - 1.73205080756888*m.x18 - 1.38931674091799*m.x19 + 1.05983852846641*m.x20 + 1.90211303259031*m.x21 - 0.139512947488249*m.x22 - 1.96961550602442*m.x23 - 0.813473286151601*m.x24 + 1.57602150721344*m.x25 - m.x26 <= 0) m.c78 = Constraint(expr= 0.122097079069716*m.x1 + 1.97257120307446*m.x2 + 0.765366864730185*m.x3 - 1.62823103671264*m.x4 - 1.49791144157801*m.x5 + 0.954317520519214*m.x6 + 1.92726090641725*m.x7 - 0.0872387747306684*m.x8 - 1.96650981512791*m.x9 - 0.797498137850496*m.x10 + 1.60771372123443*m.x11 + 1.52081193120006*m.x12 - 0.923497226470066*m.x13 - 1.93629528075622*m.x14 + 0.0523538966157441*m.x15 + 1.95984940924166*m.x16 + 0.829386485312481*m.x17 - 1.58670668058247*m.x18 - 1.54324916677544*m.x19 + 0.892395626219618*m.x20 + 1.94473984079535*m.x21 - 0.0174530709967472*m.x22 - 1.95259201423987*m.x23 - 0.861022193616591*m.x24 + 1.56521631370483*m.x25 - m.x26 <= 0) m.c79 = Constraint(expr= - 0.716735899090592*m.x1 + 1.67734113589085*m.x2 + 1.41421356237309*m.x3 - 1.08927807003006*m.x4 - 1.8671608529944*m.x5 + 0.312868930080469*m.x6 + 1.99725906950915*m.x7 + 0.517638090205039*m.x8 - 1.78201304837674*m.x9 - 1.25864078209967*m.x10 + 1.25864078209968*m.x11 + 1.78201304837673*m.x12 - 0.517638090205042*m.x13 - 1.99725906950915*m.x14 - 0.312868930080459*m.x15 + 1.8671608529944*m.x16 + 1.08927807003005*m.x17 - 1.4142135623731*m.x18 - 1.67734113589085*m.x19 + 0.716735899090602*m.x20 + 1.97537668119028*m.x21 + 0.104671912485886*m.x22 - 1.93185165257814*m.x23 - 0.907980999479093*m.x24 + 1.55429192291394*m.x25 - m.x26 <= 0) m.c80 = Constraint(expr= - 1.42650089830836*m.x1 + 1.10387397062412*m.x2 + 1.84775906502257*m.x3 - 0.3987358688344*m.x4 - 1.99992384612834*m.x5 - 0.364471050984291*m.x6 + 1.86083513596405*m.x7 + 1.07459921669365*m.x8 - 1.45074874202458*m.x9 - 1.62823103671263*m.x10 + 0.829386485312483*m.x11 + 1.94473984079535*m.x12 - 0.087238774730675*m.x13 - 1.97803172672383*m.x14 - 0.667613718467541*m.x15 + 1.72325832088305*m.x16 + 1.32524009643147*m.x17 - 1.21752285801744*m.x18 - 1.78986872320405*m.x19 + 0.534476752156514*m.x20 + 1.99383466746626*m.x21 + 0.226406427535813*m.x22 - 1.90743390149645*m.x23 - 0.954317520519217*m.x24 + 1.54324916677544*m.x25 - m.x26 <= 0) m.c81 = Constraint(expr= - 1.87938524157181*m.x1 + 0.347296355333866*m.x2 + 2*m.x3 + 0.347296355333855*m.x4 - 1.87938524157182*m.x5 - m.x6 + 1.53208888623796*m.x7 + 1.53208888623796*m.x8 - m.x9 - 1.87938524157182*m.x10 + 0.347296355333865*m.x11 + 2*m.x12 + 0.347296355333855*m.x13 - 1.87938524157182*m.x14 - 0.999999999999998*m.x15 + 1.53208888623796*m.x16 + 1.53208888623795*m.x17 - m.x18 - 1.87938524157182*m.x19 + 0.347296355333861*m.x20 + 2*m.x21 + 0.34729635533386*m.x22 - 1.87938524157182*m.x23 - m.x24 + 1.53208888623796*m.x25 - m.x26 <= 0) m.c82 = Constraint(expr= - 1.99383466746626*m.x1 - 0.466890727711807*m.x2 + 1.84775906502258*m.x3 + 1.0449971294319*m.x4 - 1.52081193120006*m.x5 - 1.52081193120006*m.x6 + 1.0449971294319*m.x7 + 1.84775906502257*m.x8 - 0.466890727711812*m.x9 - 1.99383466746626*m.x10 - 0.156918191455686*m.x11 + 1.94473984079535*m.x12 + 0.765366864730179*m.x13 - 1.70528032870819*m.x14 - 1.29889609666037*m.x15 + 1.29889609666037*m.x16 + 1.70528032870818*m.x17 - 0.765366864730181*m.x18 - 1.94473984079535*m.x19 + 0.156918191455691*m.x20 + 1.99383466746626*m.x21 + 0.46689072771181*m.x22 - 1.84775906502257*m.x23 - 1.0449971294319*m.x24 + 1.52081193120006*m.x25 - m.x26 <= 0) m.c83 = Constraint(expr= - 1.74923941427879*m.x1 - 1.2036300463041*m.x2 + 1.4142135623731*m.x3 + 1.59727102009459*m.x4 - 0.969619240492674*m.x5 - 1.8671608529944*m.x6 + 0.449902108687729*m.x7 + 1.99238939618349*m.x8 + 0.10467191248589*m.x9 - 1.96325436689533*m.x10 - 0.65113630891431*m.x11 + 1.78201304837674*m.x12 + 1.14715287270209*m.x13 - 1.46270740323834*m.x14 - 1.55429192291394*m.x15 + 1.03007614982011*m.x16 + 1.84100970690488*m.x17 - 0.517638090205042*m.x18 - 1.98509230328264*m.x19 - 0.034904812874566*m.x20 + 1.97537668119028*m.x21 + 0.584743409445473*m.x22 - 1.8126155740733*m.x23 - 1.08927807003005*m.x24 + 1.50941916044554*m.x25 - m.x26 <= 0) m.c84 = Constraint(expr= - 1.18964557350268*m.x1 - 1.7407113918798*m.x2 + 0.765366864730176*m.x3 + 1.92726090641725*m.x4 - 0.295618822259219*m.x5 - 1.99931464995111*m.x6 - 0.191691505040448*m.x7 + 1.95259201423987*m.x8 + 0.66761371846754*m.x9 - 1.78986872320405*m.x10 - 1.10387397062411*m.x11 + 1.52081193120006*m.x12 + 1.47455467362025*m.x13 - 1.16140591142188*m.x14 - 1.75763422532393*m.x15 + 0.733002453448595*m.x16 + 1.93629528075622*m.x17 - 0.261052384440102*m.x18 - 1.99992384612834*m.x19 - 0.226406427535813*m.x20 + 1.94473984079535*m.x21 + 0.700414762518934*m.x22 - 1.77402166635644*m.x23 - 1.13281247384967*m.x24 + 1.497911441578*m.x25 - m.x26 <= 0) m.c85 = Constraint(expr= - 0.415823381635513*m.x1 - 1.98904379073655*m.x2 - 9.80955400591059E-16*m.x3 + 1.98904379073655*m.x4 + 0.415823381635522*m.x5 - 1.90211303259031*m.x6 - 0.8134732861516*m.x7 + 1.73205080756888*m.x8 + 1.17557050458495*m.x9 - 1.48628965095479*m.x10 - 1.48628965095479*m.x11 + 1.17557050458494*m.x12 + 1.73205080756888*m.x13 - 0.813473286151603*m.x14 - 1.90211303259031*m.x15 + 0.415823381635519*m.x16 + 1.98904379073655*m.x17 - 8.57252759403147E-16*m.x18 - 1.98904379073655*m.x19 - 0.41582338163552*m.x20 + 1.90211303259031*m.x21 + 0.813473286151601*m.x22 - 1.73205080756888*m.x23 - 1.17557050458495*m.x24 + 1.48628965095479*m.x25 - m.x26 <= 0) m.c86 = Constraint(expr= 0.432879227876204*m.x1 - 1.90743390149645*m.x2 - 0.765366864730178*m.x3 + 1.77402166635644*m.x4 + 1.07459921669365*m.x5 - 1.58670668058247*m.x6 - 1.35118041523132*m.x7 + 1.35118041523132*m.x8 + 1.58670668058247*m.x9 - 1.07459921669364*m.x10 - 1.77402166635644*m.x11 + 0.765366864730175*m.x12 + 1.90743390149645*m.x13 - 0.432879227876201*m.x14 - 1.98288972274762*m.x15 + 0.0872387747306712*m.x16 + 1.99809644316372*m.x17 + 0.261052384440104*m.x18 - 1.95259201423987*m.x19 - 0.601411599008547*m.x20 + 1.84775906502257*m.x21 + 0.923497226470068*m.x22 - 1.68678289162577*m.x23 - 1.21752285801744*m.x24 + 1.47455467362025*m.x25 - m.x26 <= 0) m.c87 = Constraint(expr= 1.2036300463041*m.x1 - 1.50941916044554*m.x2 - 1.4142135623731*m.x3 + 1.31211805798102*m.x4 + 1.59727102009459*m.x5 - 1.08927807003005*m.x6 - 1.74923941427879*m.x7 + 0.8452365234814*m.x8 + 1.8671608529944*m.x9 - 0.58474340944547*m.x10 - 1.94874012957047*m.x11 + 0.312868930080462*m.x12 + 1.99238939618349*m.x13 - 0.0349048128745626*m.x14 - 1.99725906950915*m.x15 - 0.243738686810296*m.x16 + 1.96325436689533*m.x17 + 0.517638090205044*m.x18 - 1.89103715119863*m.x19 - 0.781462256978547*m.x20 + 1.78201304837674*m.x21 + 1.03007614982011*m.x22 - 1.63830408857798*m.x23 - 1.25864078209968*m.x24 + 1.46270740323834*m.x25 - m.x26 <= 0) m.c88 = Constraint(expr= 1.75763422532393*m.x1 - 0.861022193616594*m.x2 - 1.84775906502257*m.x3 + 0.667613718467551*m.x4 + 1.91763946973638*m.x5 - 0.466890727711819*m.x6 - 1.96650981512791*m.x7 + 0.26105238444011*m.x8 + 1.99383466746626*m.x9 - 0.052353896615752*m.x10 - 1.99931464995111*m.x11 - 0.156918191455686*m.x12 + 1.98288972274762*m.x13 + 0.364471050984292*m.x14 - 1.94473984079535*m.x15 - 0.568030689407844*m.x16 + 1.88528298218436*m.x17 + 0.765366864730176*m.x18 - 1.80517056869972*m.x19 - 0.954317520519215*m.x20 + 1.70528032870819*m.x21 + 1.13281247384966*m.x22 - 1.58670668058247*m.x23 - 1.29889609666037*m.x24 + 1.45074874202458*m.x25 - m.x26 <= 0) m.c89 = Constraint(expr= 1.99512810051965*m.x1 - 0.069798993405004*m.x2 - 2*m.x3 - 0.0697989934049986*m.x4 + 1.99512810051965*m.x5 + 0.209056926535302*m.x6 - 1.98053613748314*m.x7 - 0.347296355333855*m.x8 + 1.95629520146761*m.x9 + 0.483843791199335*m.x10 - 1.92252339187664*m.x11 - 0.618033988749893*m.x12 + 1.87938524157182*m.x13 + 0.749213186831821*m.x14 - 1.8270909152852*m.x15 - 0.876742293578154*m.x16 + 1.76589518571785*m.x17 + 0.999999999999998*m.x18 - 1.69609619231285*m.x19 - 1.11838580694149*m.x20 + 1.6180339887499*m.x21 + 1.23132295065132*m.x22 - 1.53208888623796*m.x23 - 1.33826121271772*m.x24 + 1.4386796006773*m.x25 - m.x26 <= 0) m.c90 = Constraint(expr= 1.8733443784968*m.x1 + 0.733002453448595*m.x2 - 1.84775906502257*m.x3 - 0.797498137850495*m.x4 + 1.81992254175309*m.x5 + 0.861022193616589*m.x6 - 1.78986872320405*m.x7 - 0.923497226470063*m.x8 + 1.75763422532393*m.x9 + 0.984847120206933*m.x10 - 1.72325832088305*m.x11 - 1.0449971294319*m.x12 + 1.68678289162577*m.x13 + 1.10387397062411*m.x14 - 1.64825237724403*m.x15 - 1.16140591142188*m.x16 + 1.60771372123444*m.x17 + 1.21752285801744*m.x18 - 1.56521631370483*m.x19 - 1.27215644055553*m.x20 + 1.52081193120006*m.x21 + 1.32524009643148*m.x22 - 1.47455467362025*m.x23 - 1.37670915138751*m.x24 + 1.42650089830836*m.x25 - m.x26 <= 0) m.c91 = Constraint(expr= 1.4142135623731*m.x1 + 1.4142135623731*m.x2 - 1.4142135623731*m.x3 - 1.41421356237309*m.x4 + 1.4142135623731*m.x5 + 1.41421356237309*m.x6 - 1.4142135623731*m.x7 - 1.41421356237309*m.x8 + 1.4142135623731*m.x9 + 1.41421356237309*m.x10 - 1.4142135623731*m.x11 - 1.41421356237309*m.x12 + 1.41421356237309*m.x13 + 1.41421356237309*m.x14 - 1.41421356237309*m.x15 - 1.41421356237309*m.x16 + 1.41421356237309*m.x17 + 1.41421356237309*m.x18 - 1.41421356237309*m.x19 - 1.41421356237309*m.x20 + 1.4142135623731*m.x21 + 1.41421356237309*m.x22 - 1.4142135623731*m.x23 - 1.41421356237309*m.x24 + 1.4142135623731*m.x25 - m.x26 <= 0) m.c92 = Constraint(expr= - m.x26 + m.x28 - m.x29 == 0) m.c93 = Constraint(expr= m.x26 + m.x27 - m.x29 == 0) m.c94 = Constraint(expr=m.x28**2 - (m.x30**2 + m.x27**2) >= 0) m.c95 = Constraint(expr= - 2*m.x1 - 2*m.x2 - 2*m.x3 - 2*m.x4 - 2*m.x5 - 2*m.x6 - 2*m.x7 - 2*m.x8 - 2*m.x9 - 2*m.x10 - 2*m.x11 - 2*m.x12 - 2*m.x13 - 2*m.x14 - 2*m.x15 - 2*m.x16 - 2*m.x17 - 2*m.x18 - 2*m.x19 - 2*m.x20 - 2*m.x21 - 2*m.x22 - 2*m.x23 - 2*m.x24 - 2*m.x25 + m.x29 <= 0) m.c96 = Constraint(expr= - 1.81992254175309*m.x1 - 1.83412014877025*m.x2 - 1.84775906502257*m.x3 - 1.86083513596405*m.x4 - 1.8733443784968*m.x5 - 1.88528298218436*m.x6 - 1.8966473104124*m.x7 - 1.90743390149645*m.x8 - 1.91763946973639*m.x9 - 1.92726090641725*m.x10 - 1.93629528075622*m.x11 - 1.94473984079535*m.x12 - 1.95259201423987*m.x13 - 1.95984940924166*m.x14 - 1.96650981512791*m.x15 - 1.97257120307446*m.x16 - 1.97803172672383*m.x17 - 1.98288972274762*m.x18 - 1.98714371135317*m.x19 - 1.99079239673436*m.x20 - 1.99383466746626*m.x21 - 1.99626959684373*m.x22 - 1.99809644316372*m.x23 - 1.99931464995111*m.x24 - 1.99992384612834*m.x25 + m.x29 <= 0) m.c97 = Constraint(expr= - 1.31211805798101*m.x1 - 1.363996720125*m.x2 - 1.4142135623731*m.x3 - 1.46270740323834*m.x4 - 1.50941916044554*m.x5 - 1.55429192291394*m.x6 - 1.59727102009459*m.x7 - 1.63830408857798*m.x8 - 1.67734113589085*m.x9 - 1.71433460140422*m.x10 - 1.74923941427879*m.x11 - 1.78201304837674*m.x12 - 1.8126155740733*m.x13 - 1.84100970690488*m.x14 - 1.8671608529944*m.x15 - 1.89103715119863*m.x16 - 1.91260951192607*m.x17 - 1.93185165257814*m.x18 - 1.94874012957047*m.x19 - 1.96325436689533*m.x20 - 1.97537668119028*m.x21 - 1.98509230328264*m.x22 - 1.99238939618349*m.x23 - 1.99725906950915*m.x24 - 1.99969539031278*m.x25 + m.x29 <= 0) m.c98 = Constraint(expr= - 0.568030689407845*m.x1 - 0.667613718467542*m.x2 - 0.76536686473018*m.x3 - 0.86102219361659*m.x4 - 0.954317520519217*m.x5 - 1.0449971294319*m.x6 - 1.13281247384967*m.x7 - 1.21752285801744*m.x8 - 1.29889609666037*m.x9 - 1.37670915138751*m.x10 - 1.45074874202458*m.x11 - 1.52081193120006*m.x12 - 1.58670668058247*m.x13 - 1.64825237724403*m.x14 - 1.70528032870818*m.x15 - 1.75763422532393*m.x16 - 1.80517056869972*m.x17 - 1.84775906502257*m.x18 - 1.88528298218436*m.x19 - 1.91763946973639*m.x20 - 1.94473984079535*m.x21 - 1.96650981512791*m.x22 - 1.98288972274762*m.x23 - 1.99383466746626*m.x24 - 1.99931464995111*m.x25 + m.x29 <= 0) m.c99 = Constraint(expr= 0.278346201920131*m.x1 + 0.139512947488251*m.x2 - 1.22464679914735E-16*m.x3 - 0.13951294748825*m.x4 - 0.278346201920131*m.x5 - 0.415823381635519*m.x6 - 0.551274711633998*m.x7 - 0.684040286651338*m.x8 - 0.8134732861516*m.x9 - 0.938943125571782*m.x10 - 1.05983852846641*m.x11 - 1.17557050458495*m.x12 - 1.28557521937308*m.x13 - 1.38931674091799*m.x14 - 1.48628965095479*m.x15 - 1.57602150721344*m.x16 - 1.65807514511008*m.x17 - 1.73205080756888*m.x18 - 1.79758809259833*m.x19 - 1.85436770913357*m.x20 - 1.90211303259031*m.x21 - 1.94059145255199*m.x22 - 1.96961550602442*m.x23 - 1.98904379073655*m.x24 - 1.99878165403819*m.x25 + m.x29 <= 0) m.c100 = Constraint(expr= 1.07459921669365*m.x1 + 0.923497226470067*m.x2 + 0.765366864730179*m.x3 + 0.601411599008546*m.x4 + 0.432879227876206*m.x5 + 0.261052384440103*m.x6 + 0.0872387747306718*m.x7 - 0.087238774730672*m.x8 - 0.261052384440103*m.x9 - 0.432879227876206*m.x10 - 0.601411599008547*m.x11 - 0.76536686473018*m.x12 - 0.923497226470068*m.x13 - 1.07459921669365*m.x14 - 1.21752285801744*m.x15 - 1.35118041523132*m.x16 - 1.47455467362025*m.x17 - 1.58670668058247*m.x18 - 1.68678289162577*m.x19 - 1.77402166635644*m.x20 - 1.84775906502257*m.x21 - 1.90743390149645*m.x22 - 1.95259201423987*m.x23 - 1.98288972274762*m.x24 - 1.99809644316372*m.x25 + m.x29 <= 0) m.c101 = Constraint(expr= 1.67734113589085*m.x1 + 1.55429192291394*m.x2 + 1.41421356237309*m.x3 + 1.25864078209968*m.x4 + 1.08927807003005*m.x5 + 0.907980999479093*m.x6 + 0.716735899090601*m.x7 + 0.517638090205042*m.x8 + 0.312868930080462*m.x9 + 0.104671912485888*m.x10 - 0.104671912485887*m.x11 - 0.312868930080461*m.x12 - 0.517638090205041*m.x13 - 0.7167358990906*m.x14 - 0.907980999479094*m.x15 - 1.08927807003005*m.x16 - 1.25864078209968*m.x17 - 1.41421356237309*m.x18 - 1.55429192291394*m.x19 - 1.67734113589085*m.x20 - 1.78201304837674*m.x21 - 1.8671608529944*m.x22 - 1.93185165257814*m.x23 - 1.97537668119028*m.x24 - 1.99725906950915*m.x25 + m.x29 <= 0) m.c102 = Constraint(expr= 1.97803172672383*m.x1 + 1.92726090641725*m.x2 + 1.84775906502257*m.x3 + 1.7407113918798*m.x4 + 1.60771372123443*m.x5 + 1.45074874202458*m.x6 + 1.27215644055553*m.x7 + 1.07459921669365*m.x8 + 0.861022193616591*m.x9 + 0.634609312810184*m.x10 + 0.398735868834395*m.x11 + 0.15691819145569*m.x12 - 0.087238774730672*m.x13 - 0.330095211721355*m.x14 - 0.568030689407845*m.x15 - 0.797498137850493*m.x16 - 1.01507672592141*m.x17 - 1.21752285801744*m.x18 - 1.4018185285997*m.x19 - 1.56521631370483*m.x20 - 1.70528032870818*m.x21 - 1.81992254175309*m.x22 - 1.90743390149645*m.x23 - 1.96650981512791*m.x24 - 1.99626959684373*m.x25 + m.x29 <= 0) m.c103 = Constraint(expr= 1.92252339187664*m.x1 + 1.98053613748314*m.x2 + 2*m.x3 + 1.98053613748314*m.x4 + 1.92252339187664*m.x5 + 1.8270909152852*m.x6 + 1.69609619231285*m.x7 + 1.53208888623796*m.x8 + 1.33826121271772*m.x9 + 1.11838580694149*m.x10 + 0.876742293578155*m.x11 + 0.618033988749895*m.x12 + 0.347296355333861*m.x13 + 0.0697989934050019*m.x14 - 0.209056926535307*m.x15 - 0.483843791199335*m.x16 - 0.749213186831824*m.x17 - m.x18 - 1.23132295065132*m.x19 - 1.4386796006773*m.x20 - 1.61803398874989*m.x21 - 1.76589518571785*m.x22 - 1.87938524157182*m.x23 - 1.95629520146761*m.x24 - 1.99512810051965*m.x25 + m.x29 <= 0) m.c104 = Constraint(expr= 1.52081193120006*m.x1 + 1.70528032870818*m.x2 + 1.84775906502257*m.x3 + 1.94473984079535*m.x4 + 1.99383466746626*m.x5 + 1.99383466746626*m.x6 + 1.94473984079535*m.x7 + 1.84775906502257*m.x8 + 1.70528032870818*m.x9 + 1.52081193120006*m.x10 + 1.29889609666037*m.x11 + 1.0449971294319*m.x12 + 0.765366864730179*m.x13 + 0.466890727711811*m.x14 + 0.15691819145569*m.x15 - 0.15691819145569*m.x16 - 0.466890727711811*m.x17 - 0.76536686473018*m.x18 - 1.0449971294319*m.x19 - 1.29889609666037*m.x20 - 1.52081193120006*m.x21 - 1.70528032870818*m.x22 - 1.84775906502257*m.x23 - 1.94473984079535*m.x24 - 1.99383466746626*m.x25 + m.x29 <= 0) m.c105 = Constraint(expr= 0.8452365234814*m.x1 + 1.14715287270209*m.x2 + 1.4142135623731*m.x3 + 1.63830408857798*m.x4 + 1.8126155740733*m.x5 + 1.93185165257814*m.x6 + 1.99238939618349*m.x7 + 1.99238939618349*m.x8 + 1.93185165257814*m.x9 + 1.8126155740733*m.x10 + 1.63830408857798*m.x11 + 1.41421356237309*m.x12 + 1.14715287270209*m.x13 + 0.845236523481399*m.x14 + 0.517638090205041*m.x15 + 0.174311485495316*m.x16 - 0.174311485495317*m.x17 - 0.517638090205041*m.x18 - 0.845236523481399*m.x19 - 1.14715287270209*m.x20 - 1.4142135623731*m.x21 - 1.63830408857798*m.x22 - 1.8126155740733*m.x23 - 1.93185165257814*m.x24 - 1.99238939618349*m.x25 + m.x29 <= 0) m.c106 = Constraint(expr= 0.0174530709967489*m.x1 + 0.398735868834395*m.x2 + 0.765366864730181*m.x3 + 1.10387397062412*m.x4 + 1.4018185285997*m.x5 + 1.64825237724403*m.x6 + 1.83412014877025*m.x7 + 1.95259201423987*m.x8 + 1.99931464995111*m.x9 + 1.97257120307446*m.x10 + 1.8733443784968*m.x11 + 1.70528032870818*m.x12 + 1.47455467362025*m.x13 + 1.18964557350268*m.x14 + 0.86102219361659*m.x15 + 0.500760008108883*m.x16 + 0.122097079069714*m.x17 - 0.261052384440103*m.x18 - 0.634609312810185*m.x19 - 0.984847120206934*m.x20 - 1.29889609666037*m.x21 - 1.56521631370483*m.x22 - 1.77402166635644*m.x23 - 1.91763946973639*m.x24 - 1.99079239673436*m.x25 + m.x29 <= 0) m.c107 = Constraint(expr= - 0.813473286151601*m.x1 - 0.415823381635519*m.x2 + 3.67394039744206E-16*m.x3 + 0.415823381635518*m.x4 + 0.8134732861516*m.x5 + 1.17557050458495*m.x6 + 1.48628965095479*m.x7 + 1.73205080756888*m.x8 + 1.90211303259031*m.x9 + 1.98904379073655*m.x10 + 1.98904379073655*m.x11 + 1.90211303259031*m.x12 + 1.73205080756888*m.x13 + 1.48628965095479*m.x14 + 1.17557050458495*m.x15 + 0.813473286151601*m.x16 + 0.415823381635519*m.x17 + 3.21624529935327E-16*m.x18 - 0.415823381635518*m.x19 - 0.8134732861516*m.x20 - 1.17557050458495*m.x21 - 1.48628965095479*m.x22 - 1.73205080756888*m.x23 - 1.90211303259031*m.x24 - 1.98904379073655*m.x25 + m.x29 <= 0) m.c108 = Constraint(expr= - 1.497911441578*m.x1 - 1.16140591142188*m.x2 - 0.76536686473018*m.x3 - 0.330095211721356*m.x4 + 0.122097079069714*m.x5 + 0.568030689407845*m.x6 + 0.984847120206934*m.x7 + 1.35118041523132*m.x8 + 1.64825237724403*m.x9 + 1.86083513596405*m.x10 + 1.97803172672383*m.x11 + 1.99383466746626*m.x12 + 1.90743390149645*m.x13 + 1.72325832088305*m.x14 + 1.45074874202458*m.x15 + 1.10387397062412*m.x16 + 0.700414762518935*m.x17 + 0.261052384440103*m.x18 - 0.191691505040448*m.x19 - 0.634609312810184*m.x20 - 1.0449971294319*m.x21 - 1.4018185285997*m.x22 - 1.68678289162577*m.x23 - 1.88528298218436*m.x24 - 1.98714371135317*m.x25 + m.x29 <= 0) m.c109 = Constraint(expr= - 1.91260951192607*m.x1 - 1.71433460140422*m.x2 - 1.41421356237309*m.x3 - 1.03007614982011*m.x4 - 0.584743409445473*m.x5 - 0.104671912485888*m.x6 + 0.381617990753089*m.x7 + 0.845236523481398*m.x8 + 1.25864078209967*m.x9 + 1.59727102009459*m.x10 + 1.84100970690488*m.x11 + 1.97537668119028*m.x12 + 1.99238939618349*m.x13 + 1.89103715119863*m.x14 + 1.67734113589085*m.x15 + 1.363996720125*m.x16 + 0.969619240492674*m.x17 + 0.517638090205042*m.x18 + 0.034904812874567*m.x19 - 0.44990210868773*m.x20 - 0.907980999479094*m.x21 - 1.31211805798101*m.x22 - 1.63830408857798*m.x23 - 1.8671608529944*m.x24 - 1.98509230328264*m.x25 + m.x29 <= 0) m.c110 = Constraint(expr= - 1.98288972274762*m.x1 - 1.98288972274762*m.x2 - 1.84775906502257*m.x3 - 1.58670668058247*m.x4 - 1.21752285801744*m.x5 - 0.765366864730178*m.x6 - 0.261052384440103*m.x7 + 0.261052384440105*m.x8 + 0.765366864730181*m.x9 + 1.21752285801744*m.x10 + 1.58670668058247*m.x11 + 1.84775906502257*m.x12 + 1.98288972274762*m.x13 + 1.98288972274762*m.x14 + 1.84775906502257*m.x15 + 1.58670668058247*m.x16 + 1.21752285801744*m.x17 + 0.765366864730179*m.x18 + 0.261052384440103*m.x19 - 0.261052384440103*m.x20 - 0.76536686473018*m.x21 - 1.21752285801744*m.x22 - 1.58670668058247*m.x23 - 1.84775906502257*m.x24 - 1.98288972274762*m.x25 + m.x29 <= 0) m.c111 = Constraint(expr= - 1.69609619231285*m.x1 - 1.92252339187664*m.x2 - 2*m.x3 - 1.92252339187664*m.x4 - 1.69609619231285*m.x5 - 1.33826121271772*m.x6 - 0.876742293578155*m.x7 - 0.34729635533386*m.x8 + 0.209056926535307*m.x9 + 0.749213186831825*m.x10 + 1.23132295065132*m.x11 + 1.61803398874989*m.x12 + 1.87938524157182*m.x13 + 1.99512810051965*m.x14 + 1.95629520146761*m.x15 + 1.76589518571785*m.x16 + 1.4386796006773*m.x17 + m.x18 + 0.483843791199336*m.x19 - 0.0697989934050022*m.x20 - 0.618033988749895*m.x21 - 1.11838580694149*m.x22 - 1.53208888623796*m.x23 - 1.8270909152852*m.x24 - 1.98053613748314*m.x25 + m.x29 <= 0) m.c112 = Constraint(expr= - 1.10387397062412*m.x1 - 1.54324916677544*m.x2 - 1.84775906502257*m.x3 - 1.99079239673436*m.x4 - 1.95984940924166*m.x5 - 1.75763422532393*m.x6 - 1.4018185285997*m.x7 - 0.923497226470068*m.x8 - 0.364471050984295*m.x9 + 0.226406427535812*m.x10 + 0.797498137850492*m.x11 + 1.29889609666037*m.x12 + 1.68678289162577*m.x13 + 1.92726090641725*m.x14 + 1.99931464995111*m.x15 + 1.8966473104124*m.x16 + 1.62823103671264*m.x17 + 1.21752285801744*m.x18 + 0.700414762518935*m.x19 + 0.122097079069714*m.x20 - 0.466890727711811*m.x21 - 1.01507672592141*m.x22 - 1.47455467362025*m.x23 - 1.80517056869972*m.x24 - 1.97803172672383*m.x25 + m.x29 <= 0) m.c113 = Constraint(expr= - 0.312868930080462*m.x1 - 0.907980999479094*m.x2 - 1.4142135623731*m.x3 - 1.78201304837674*m.x4 - 1.97537668119028*m.x5 - 1.97537668119028*m.x6 - 1.78201304837674*m.x7 - 1.41421356237309*m.x8 - 0.907980999479093*m.x9 - 0.312868930080461*m.x10 + 0.312868930080462*m.x11 + 0.907980999479094*m.x12 + 1.4142135623731*m.x13 + 1.78201304837674*m.x14 + 1.97537668119028*m.x15 + 1.97537668119028*m.x16 + 1.78201304837674*m.x17 + 1.41421356237309*m.x18 + 0.907980999479093*m.x19 + 0.312868930080462*m.x20 - 0.312868930080462*m.x21 - 0.907980999479094*m.x22 - 1.4142135623731*m.x23 - 1.78201304837674*m.x24 - 1.97537668119028*m.x25 + m.x29 <= 0) m.c114 = Constraint(expr= 0.534476752156515*m.x1 - 0.122097079069714*m.x2 - 0.765366864730179*m.x3 - 1.32524009643147*m.x4 - 1.7407113918798*m.x5 - 1.96650981512791*m.x6 - 1.97803172672383*m.x7 - 1.77402166635644*m.x8 - 1.37670915138751*m.x9 - 0.829386485312478*m.x10 - 0.191691505040448*m.x11 + 0.46689072771181*m.x12 + 1.07459921669365*m.x13 + 1.56521631370483*m.x14 + 1.88528298218436*m.x15 + 1.99992384612834*m.x16 + 1.8966473104124*m.x17 + 1.58670668058247*m.x18 + 1.10387397062412*m.x19 + 0.500760008108883*m.x20 - 0.15691819145569*m.x21 - 0.797498137850492*m.x22 - 1.35118041523132*m.x23 - 1.75763422532393*m.x24 - 1.97257120307446*m.x25 + m.x29 <= 0) m.c115 = Constraint(expr= 1.28557521937308*m.x1 + 0.684040286651336*m.x2 - 6.12323399573677E-16*m.x3 - 0.684040286651339*m.x4 - 1.28557521937308*m.x5 - 1.73205080756888*m.x6 - 1.96961550602442*m.x7 - 1.96961550602442*m.x8 - 1.73205080756888*m.x9 - 1.28557521937308*m.x10 - 0.684040286651336*m.x11 + 3.67394039744206E-16*m.x12 + 0.684040286651339*m.x13 + 1.28557521937308*m.x14 + 1.73205080756888*m.x15 + 1.96961550602442*m.x16 + 1.96961550602442*m.x17 + 1.73205080756888*m.x18 + 1.28557521937308*m.x19 + 0.684040286651337*m.x20 - 1.22464679914735E-16*m.x21 - 0.684040286651338*m.x22 - 1.28557521937308*m.x23 - 1.73205080756888*m.x24 - 1.96961550602442*m.x25 + m.x29 <= 0) m.c116 = Constraint(expr= 1.80517056869972*m.x1 + 1.37670915138751*m.x2 + 0.76536686473018*m.x3 + 0.052353896615746*m.x4 - 0.667613718467541*m.x5 - 1.29889609666037*m.x6 - 1.75763422532393*m.x7 - 1.98288972274762*m.x8 - 1.94473984079535*m.x9 - 1.64825237724403*m.x10 - 1.13281247384966*m.x11 - 0.466890727711811*m.x12 + 0.261052384440103*m.x13 + 0.954317520519217*m.x14 + 1.52081193120006*m.x15 + 1.88528298218436*m.x16 + 1.99931464995111*m.x17 + 1.84775906502257*m.x18 + 1.45074874202458*m.x19 + 0.861022193616591*m.x20 + 0.15691819145569*m.x21 - 0.568030689407845*m.x22 - 1.21752285801744*m.x23 - 1.70528032870818*m.x24 - 1.96650981512791*m.x25 + m.x29 <= 0) m.c117 = Constraint(expr= 1.99969539031278*m.x1 + 1.84100970690488*m.x2 + 1.41421356237309*m.x3 + 0.781462256978547*m.x4 + 0.034904812874566*m.x5 - 0.716735899090602*m.x6 - 1.363996720125*m.x7 - 1.8126155740733*m.x8 - 1.99725906950915*m.x9 - 1.89103715119863*m.x10 - 1.50941916044554*m.x11 - 0.907980999479093*m.x12 - 0.174311485495316*m.x13 + 0.584743409445474*m.x14 + 1.25864078209968*m.x15 + 1.74923941427879*m.x16 + 1.98509230328264*m.x17 + 1.93185165257814*m.x18 + 1.59727102009459*m.x19 + 1.03007614982011*m.x20 + 0.312868930080462*m.x21 - 0.44990210868773*m.x22 - 1.14715287270209*m.x23 - 1.67734113589085*m.x24 - 1.96325436689533*m.x25 + m.x29 <= 0) m.c118 = Constraint(expr= 1.83412014877025*m.x1 + 1.99992384612834*m.x2 + 1.84775906502257*m.x3 + 1.4018185285997*m.x4 + 0.733002453448593*m.x5 - 0.0523538966157472*m.x6 - 0.829386485312479*m.x7 - 1.47455467362025*m.x8 - 1.88528298218436*m.x9 - 1.99626959684373*m.x10 - 1.78986872320405*m.x11 - 1.29889609666037*m.x12 - 0.601411599008547*m.x13 + 0.191691505040449*m.x14 + 0.954317520519217*m.x15 + 1.56521631370483*m.x16 + 1.92726090641725*m.x17 + 1.98288972274762*m.x18 + 1.72325832088305*m.x19 + 1.18964557350268*m.x20 + 0.466890727711811*m.x21 - 0.330095211721355*m.x22 - 1.07459921669365*m.x23 - 1.64825237724403*m.x24 - 1.95984940924166*m.x25 + m.x29 <= 0) m.c119 = Constraint(expr= 1.33826121271772*m.x1 + 1.8270909152852*m.x2 + 2*m.x3 + 1.8270909152852*m.x4 + 1.33826121271772*m.x5 + 0.618033988749894*m.x6 - 0.209056926535307*m.x7 - m.x8 - 1.61803398874989*m.x9 - 1.95629520146761*m.x10 - 1.95629520146761*m.x11 - 1.6180339887499*m.x12 - m.x13 - 0.209056926535308*m.x14 + 0.618033988749895*m.x15 + 1.33826121271772*m.x16 + 1.8270909152852*m.x17 + 2*m.x18 + 1.8270909152852*m.x19 + 1.33826121271772*m.x20 + 0.618033988749895*m.x21 - 0.209056926535307*m.x22 - m.x23 - 1.61803398874989*m.x24 - 1.95629520146761*m.x25 + m.x29 <= 0) m.c120 = Constraint(expr= 0.601411599008548*m.x1 + 1.35118041523132*m.x2 + 1.84775906502257*m.x3 + 1.99809644316372*m.x4 + 1.77402166635644*m.x5 + 1.21752285801744*m.x6 + 0.432879227876206*m.x7 - 0.432879227876206*m.x8 - 1.21752285801744*m.x9 - 1.77402166635644*m.x10 - 1.99809644316372*m.x11 - 1.84775906502257*m.x12 - 1.35118041523132*m.x13 - 0.601411599008545*m.x14 + 0.261052384440103*m.x15 + 1.07459921669365*m.x16 + 1.68678289162577*m.x17 + 1.98288972274762*m.x18 + 1.90743390149645*m.x19 + 1.47455467362025*m.x20 + 0.765366864730179*m.x21 - 0.087238774730672*m.x22 - 0.923497226470068*m.x23 - 1.58670668058247*m.x24 - 1.95259201423987*m.x25 + m.x29 <= 0) m.c121 = Constraint(expr= - 0.243738686810297*m.x1 + 0.651136308914312*m.x2 + 1.41421356237309*m.x3 + 1.89103715119863*m.x4 + 1.98509230328264*m.x5 + 1.67734113589085*m.x6 + 1.03007614982011*m.x7 + 0.174311485495317*m.x8 - 0.7167358990906*m.x9 - 1.46270740323834*m.x10 - 1.91260951192607*m.x11 - 1.97537668119028*m.x12 - 1.63830408857798*m.x13 - 0.969619240492675*m.x14 - 0.104671912485888*m.x15 + 0.781462256978548*m.x16 + 1.50941916044554*m.x17 + 1.93185165257814*m.x18 + 1.96325436689533*m.x19 + 1.59727102009459*m.x20 + 0.907980999479093*m.x21 + 0.034904812874567*m.x22 - 0.845236523481399*m.x23 - 1.55429192291394*m.x24 - 1.94874012957047*m.x25 + m.x29 <= 0) m.c122 = Constraint(expr= - 1.0449971294319*m.x1 - 0.15691819145569*m.x2 + 0.765366864730181*m.x3 + 1.52081193120006*m.x4 + 1.94473984079535*m.x5 + 1.94473984079535*m.x6 + 1.52081193120006*m.x7 + 0.76536686473018*m.x8 - 0.156918191455691*m.x9 - 1.0449971294319*m.x10 - 1.70528032870819*m.x11 - 1.99383466746626*m.x12 - 1.84775906502257*m.x13 - 1.29889609666037*m.x14 - 0.46689072771181*m.x15 + 0.46689072771181*m.x16 + 1.29889609666037*m.x17 + 1.84775906502257*m.x18 + 1.99383466746626*m.x19 + 1.70528032870818*m.x20 + 1.0449971294319*m.x21 + 0.15691819145569*m.x22 - 0.76536686473018*m.x23 - 1.52081193120006*m.x24 - 1.94473984079535*m.x25 + m.x29 <= 0) m.c123 = Constraint(expr= - 1.65807514511008*m.x1 - 0.93894312557178*m.x2 + 8.57252759403147E-16*m.x3 + 0.938943125571782*m.x4 + 1.65807514511008*m.x5 + 1.98904379073655*m.x6 + 1.85436770913358*m.x7 + 1.28557521937308*m.x8 + 0.41582338163552*m.x9 - 0.551274711633998*m.x10 - 1.38931674091799*m.x11 - 1.90211303259031*m.x12 - 1.96961550602442*m.x13 - 1.57602150721344*m.x14 - 0.813473286151601*m.x15 + 0.139512947488251*m.x16 + 1.05983852846641*m.x17 + 1.73205080756888*m.x18 + 1.99878165403819*m.x19 + 1.79758809259833*m.x20 + 1.17557050458495*m.x21 + 0.278346201920131*m.x22 - 0.684040286651338*m.x23 - 1.48628965095479*m.x24 - 1.94059145255199*m.x25 + m.x29 <= 0) m.c124 = Constraint(expr= - 1.97257120307446*m.x1 - 1.56521631370483*m.x2 - 0.76536686473018*m.x3 + 0.226406427535811*m.x4 + 1.16140591142188*m.x5 + 1.80517056869972*m.x6 + 1.99626959684373*m.x7 + 1.68678289162577*m.x8 + 0.954317520519218*m.x9 - 0.0174530709967474*m.x10 - 0.984847120206933*m.x11 - 1.70528032870818*m.x12 - 1.99809644316372*m.x13 - 1.78986872320405*m.x14 - 1.13281247384967*m.x15 - 0.191691505040448*m.x16 + 0.797498137850492*m.x17 + 1.58670668058247*m.x18 + 1.97803172672383*m.x19 + 1.8733443784968*m.x20 + 1.29889609666037*m.x21 + 0.398735868834395*m.x22 - 0.601411599008546*m.x23 - 1.45074874202458*m.x24 - 1.93629528075622*m.x25 + m.x29 <= 0) m.c125 = Constraint(expr= - 1.93185165257814*m.x1 - 1.93185165257814*m.x2 - 1.41421356237309*m.x3 - 0.51763809020504*m.x4 + 0.517638090205045*m.x5 + 1.4142135623731*m.x6 + 1.93185165257814*m.x7 + 1.93185165257814*m.x8 + 1.41421356237309*m.x9 + 0.51763809020504*m.x10 - 0.517638090205043*m.x11 - 1.4142135623731*m.x12 - 1.93185165257814*m.x13 - 1.93185165257814*m.x14 - 1.41421356237309*m.x15 - 0.517638090205041*m.x16 + 0.517638090205043*m.x17 + 1.4142135623731*m.x18 + 1.93185165257814*m.x19 + 1.93185165257814*m.x20 + 1.41421356237309*m.x21 + 0.517638090205041*m.x22 - 0.517638090205042*m.x23 - 1.4142135623731*m.x24 - 1.93185165257814*m.x25 + m.x29 <= 0) m.c126 = Constraint(expr= - 1.54324916677544*m.x1 - 1.97803172672383*m.x2 - 1.84775906502257*m.x3 - 1.18964557350268*m.x4 - 0.191691505040446*m.x5 + 0.861022193616592*m.x6 + 1.66777164413434*m.x7 + 1.99809644316372*m.x8 + 1.75763422532393*m.x9 + 1.01507672592141*m.x10 - 0.0174530709967492*m.x11 - 1.0449971294319*m.x12 - 1.77402166635644*m.x13 - 1.99626959684373*m.x14 - 1.64825237724403*m.x15 - 0.829386485312478*m.x16 + 0.226406427535814*m.x17 + 1.21752285801744*m.x18 + 1.86083513596405*m.x19 + 1.97257120307446*m.x20 + 1.52081193120006*m.x21 + 0.634609312810184*m.x22 - 0.432879227876206*m.x23 - 1.37670915138751*m.x24 - 1.92726090641725*m.x25 + m.x29 <= 0) m.c127 = Constraint(expr= - 0.876742293578156*m.x1 - 1.69609619231285*m.x2 - 2*m.x3 - 1.69609619231285*m.x4 - 0.876742293578154*m.x5 + 0.209056926535309*m.x6 + 1.23132295065132*m.x7 + 1.87938524157182*m.x8 + 1.95629520146761*m.x9 + 1.4386796006773*m.x10 + 0.483843791199336*m.x11 - 0.618033988749895*m.x12 - 1.53208888623796*m.x13 - 1.98053613748314*m.x14 - 1.8270909152852*m.x15 - 1.11838580694149*m.x16 - 0.0697989934050026*m.x17 + m.x18 + 1.76589518571785*m.x19 + 1.99512810051965*m.x20 + 1.61803398874989*m.x21 + 0.749213186831824*m.x22 - 0.347296355333861*m.x23 - 1.33826121271772*m.x24 - 1.92252339187664*m.x25 + m.x29 <= 0) m.c128 = Constraint(expr= - 0.0523538966157441*m.x1 - 1.13281247384967*m.x2 - 1.84775906502257*m.x3 - 1.96650981512791*m.x4 - 1.45074874202458*m.x5 - 0.466890727711813*m.x6 + 0.667613718467543*m.x7 + 1.58670668058247*m.x8 + 1.99383466746626*m.x9 + 1.75763422532393*m.x10 + 0.954317520519218*m.x11 - 0.15691819145569*m.x12 - 1.21752285801744*m.x13 - 1.88528298218436*m.x14 - 1.94473984079535*m.x15 - 1.37670915138751*m.x16 - 0.364471050984295*m.x17 + 0.765366864730179*m.x18 + 1.64825237724403*m.x19 + 1.99931464995111*m.x20 + 1.70528032870818*m.x21 + 0.861022193616591*m.x22 - 0.261052384440103*m.x23 - 1.29889609666037*m.x24 - 1.91763946973639*m.x25 + m.x29 <= 0) m.c129 = Constraint(expr= 0.78146225697855*m.x1 - 0.381617990753088*m.x2 - 1.41421356237309*m.x3 - 1.96325436689533*m.x4 - 1.84100970690488*m.x5 - 1.08927807003006*m.x6 + 0.0349048128745657*m.x7 + 1.14715287270209*m.x8 + 1.8671608529944*m.x9 + 1.94874012957047*m.x10 + 1.363996720125*m.x11 + 0.312868930080463*m.x12 - 0.845236523481399*m.x13 - 1.71433460140422*m.x14 - 1.99725906950915*m.x15 - 1.59727102009459*m.x16 - 0.651136308914314*m.x17 + 0.517638090205041*m.x18 + 1.50941916044554*m.x19 + 1.98509230328264*m.x20 + 1.78201304837674*m.x21 + 0.969619240492674*m.x22 - 0.174311485495316*m.x23 - 1.25864078209967*m.x24 - 1.91260951192607*m.x25 + m.x29 <= 0) m.c130 = Constraint(expr= 1.47455467362025*m.x1 + 0.432879227876202*m.x2 - 0.765366864730181*m.x3 - 1.68678289162577*m.x4 - 1.99809644316372*m.x5 - 1.58670668058247*m.x6 - 0.601411599008543*m.x7 + 0.601411599008548*m.x8 + 1.58670668058247*m.x9 + 1.99809644316372*m.x10 + 1.68678289162577*m.x11 + 0.76536686473018*m.x12 - 0.432879227876208*m.x13 - 1.47455467362025*m.x14 - 1.98288972274762*m.x15 - 1.77402166635644*m.x16 - 0.923497226470066*m.x17 + 0.261052384440103*m.x18 + 1.35118041523132*m.x19 + 1.95259201423987*m.x20 + 1.84775906502257*m.x21 + 1.07459921669365*m.x22 - 0.087238774730672*m.x23 - 1.21752285801744*m.x24 - 1.90743390149645*m.x25 + m.x29 <= 0) m.c131 = Constraint(expr= 1.90211303259031*m.x1 + 1.17557050458495*m.x2 - 1.10218211923262E-15*m.x3 - 1.17557050458495*m.x4 - 1.90211303259031*m.x5 - 1.90211303259031*m.x6 - 1.17557050458495*m.x7 + 8.57252759403147E-16*m.x8 + 1.17557050458495*m.x9 + 1.90211303259031*m.x10 + 1.90211303259031*m.x11 + 1.17557050458495*m.x12 - 6.12323399573677E-16*m.x13 - 1.17557050458495*m.x14 - 1.90211303259031*m.x15 - 1.90211303259031*m.x16 - 1.17557050458495*m.x17 + 3.67394039744206E-16*m.x18 + 1.17557050458495*m.x19 + 1.90211303259031*m.x20 + 1.90211303259031*m.x21 + 1.17557050458495*m.x22 - 1.22464679914735E-16*m.x23 - 1.17557050458495*m.x24 - 1.90211303259031*m.x25 + m.x29 <= 0) m.c132 = Constraint(expr= 1.98714371135318*m.x1 + 1.72325832088305*m.x2 + 0.765366864730179*m.x3 - 0.500760008108884*m.x4 - 1.56521631370483*m.x5 - 1.99931464995111*m.x6 - 1.62823103671264*m.x7 - 0.601411599008546*m.x8 + 0.667613718467543*m.x9 + 1.66777164413434*m.x10 + 1.99626959684373*m.x11 + 1.52081193120006*m.x12 + 0.432879227876206*m.x13 - 0.829386485312479*m.x14 - 1.75763422532393*m.x15 - 1.97803172672383*m.x16 - 1.4018185285997*m.x17 - 0.261052384440103*m.x18 + 0.984847120206934*m.x19 + 1.83412014877025*m.x20 + 1.94473984079535*m.x21 + 1.27215644055553*m.x22 + 0.0872387747306718*m.x23 - 1.13281247384967*m.x24 - 1.8966473104124*m.x25 + m.x29 <= 0) m.c133 = Constraint(expr= 1.71433460140422*m.x1 + 1.98509230328264*m.x2 + 1.4142135623731*m.x3 + 0.243738686810296*m.x4 - 1.03007614982011*m.x5 - 1.8671608529944*m.x6 - 1.91260951192607*m.x7 - 1.14715287270209*m.x8 + 0.104671912485886*m.x9 + 1.31211805798101*m.x10 + 1.96325436689533*m.x11 + 1.78201304837674*m.x12 + 0.845236523481401*m.x13 - 0.449902108687729*m.x14 - 1.55429192291394*m.x15 - 1.99969539031278*m.x16 - 1.59727102009459*m.x17 - 0.517638090205042*m.x18 + 0.781462256978548*m.x19 + 1.74923941427879*m.x20 + 1.97537668119028*m.x21 + 1.363996720125*m.x22 + 0.174311485495316*m.x23 - 1.08927807003005*m.x24 - 1.89103715119863*m.x25 + m.x29 <= 0) m.c134 = Constraint(expr= 1.13281247384967*m.x1 + 1.91763946973639*m.x2 + 1.84775906502257*m.x3 + 0.954317520519214*m.x4 - 0.364471050984298*m.x5 - 1.52081193120006*m.x6 - 1.99931464995111*m.x7 - 1.58670668058247*m.x8 - 0.466890727711809*m.x9 + 0.861022193616592*m.x10 + 1.80517056869972*m.x11 + 1.94473984079535*m.x12 + 1.21752285801744*m.x13 - 0.0523538966157472*m.x14 - 1.29889609666037*m.x15 - 1.96650981512791*m.x16 - 1.75763422532393*m.x17 - 0.765366864730178*m.x18 + 0.568030689407845*m.x19 + 1.64825237724403*m.x20 + 1.99383466746626*m.x21 + 1.45074874202457*m.x22 + 0.261052384440103*m.x23 - 1.0449971294319*m.x24 - 1.88528298218436*m.x25 + m.x29 <= 0) m.c135 = Constraint(expr= 0.347296355333865*m.x1 + 1.53208888623796*m.x2 + 2*m.x3 + 1.53208888623795*m.x4 + 0.347296355333859*m.x5 - m.x6 - 1.87938524157182*m.x7 - 1.87938524157182*m.x8 - 0.999999999999998*m.x9 + 0.347296355333861*m.x10 + 1.53208888623796*m.x11 + 2*m.x12 + 1.53208888623795*m.x13 + 0.34729635533386*m.x14 - m.x15 - 1.87938524157182*m.x16 - 1.87938524157182*m.x17 - m.x18 + 0.347296355333861*m.x19 + 1.53208888623796*m.x20 + 2*m.x21 + 1.53208888623796*m.x22 + 0.347296355333861*m.x23 - m.x24 - 1.87938524157182*m.x25 + m.x29 <= 0) m.c136 = Constraint(expr= - 0.500760008108885*m.x1 + 0.892395626219618*m.x2 + 1.84775906502258*m.x3 + 1.8966473104124*m.x4 + 1.01507672592141*m.x5 - 0.364471050984295*m.x6 - 1.56521631370483*m.x7 - 1.99809644316372*m.x8 - 1.45074874202458*m.x9 - 0.191691505040446*m.x10 + 1.16140591142188*m.x11 + 1.94473984079535*m.x12 + 1.77402166635644*m.x13 + 0.733002453448593*m.x14 - 0.667613718467543*m.x15 - 1.7407113918798*m.x16 - 1.95984940924166*m.x17 - 1.21752285801744*m.x18 + 0.122097079069714*m.x19 + 1.4018185285997*m.x20 + 1.99383466746626*m.x21 + 1.60771372123443*m.x22 + 0.432879227876206*m.x23 - 0.954317520519217*m.x24 - 1.8733443784968*m.x25 + m.x29 <= 0) m.c137 = Constraint(expr= - 1.25864078209968*m.x1 + 0.104671912485886*m.x2 + 1.41421356237309*m.x3 + 1.99725906950915*m.x4 + 1.55429192291394*m.x5 + 0.312868930080462*m.x6 - 1.08927807003005*m.x7 - 1.93185165257814*m.x8 - 1.78201304837674*m.x9 - 0.7167358990906*m.x10 + 0.716735899090602*m.x11 + 1.78201304837674*m.x12 + 1.93185165257814*m.x13 + 1.08927807003005*m.x14 - 0.312868930080462*m.x15 - 1.55429192291394*m.x16 - 1.99725906950915*m.x17 - 1.41421356237309*m.x18 - 0.104671912485888*m.x19 + 1.25864078209967*m.x20 + 1.97537668119028*m.x21 + 1.67734113589085*m.x22 + 0.517638090205042*m.x23 - 0.907980999479094*m.x24 - 1.8671608529944*m.x25 + m.x29 <= 0) m.c138 = Constraint(expr= - 1.78986872320405*m.x1 - 0.700414762518939*m.x2 + 0.765366864730175*m.x3 + 1.81992254175309*m.x4 + 1.8966473104124*m.x5 + 0.954317520519218*m.x6 - 0.500760008108881*m.x7 - 1.68678289162577*m.x8 - 1.96650981512791*m.x9 - 1.18964557350268*m.x10 + 0.226406427535811*m.x11 + 1.52081193120006*m.x12 + 1.99809644316372*m.x13 + 1.4018185285997*m.x14 + 0.0523538966157478*m.x15 - 1.32524009643147*m.x16 - 1.99079239673436*m.x17 - 1.58670668058247*m.x18 - 0.330095211721356*m.x19 + 1.10387397062412*m.x20 + 1.94473984079535*m.x21 + 1.7407113918798*m.x22 + 0.601411599008546*m.x23 - 0.86102219361659*m.x24 - 1.86083513596405*m.x25 + m.x29 <= 0) m.c139 = Constraint(expr= - 1.99878165403819*m.x1 - 1.38931674091799*m.x2 + 4.89982515786259E-15*m.x3 + 1.389316740918*m.x4 + 1.99878165403819*m.x5 + 1.48628965095479*m.x6 + 0.139512947488248*m.x7 - 1.28557521937308*m.x8 - 1.98904379073655*m.x9 - 1.57602150721344*m.x10 - 0.27834620192013*m.x11 + 1.17557050458495*m.x12 + 1.96961550602442*m.x13 + 1.65807514511008*m.x14 + 0.415823381635517*m.x15 - 1.05983852846641*m.x16 - 1.94059145255199*m.x17 - 1.73205080756888*m.x18 - 0.551274711633997*m.x19 + 0.938943125571782*m.x20 + 1.90211303259031*m.x21 + 1.79758809259833*m.x22 + 0.684040286651337*m.x23 - 0.813473286151601*m.x24 - 1.85436770913357*m.x25 + m.x29 <= 0) m.c140 = Constraint(expr= - 1.84775906502258*m.x1 - 1.84775906502257*m.x2 - 0.765366864730179*m.x3 + 0.765366864730182*m.x4 + 1.84775906502258*m.x5 + 1.84775906502257*m.x6 + 0.765366864730179*m.x7 - 0.765366864730181*m.x8 - 1.84775906502257*m.x9 - 1.84775906502257*m.x10 - 0.76536686473018*m.x11 + 0.765366864730181*m.x12 + 1.84775906502257*m.x13 + 1.84775906502257*m.x14 + 0.76536686473018*m.x15 - 0.765366864730181*m.x16 - 1.84775906502257*m.x17 - 1.84775906502257*m.x18 - 0.76536686473018*m.x19 + 0.765366864730181*m.x20 + 1.84775906502257*m.x21 + 1.84775906502257*m.x22 + 0.765366864730179*m.x23 - 0.76536686473018*m.x24 - 1.84775906502257*m.x25 + m.x29 <= 0) m.c141 = Constraint(expr= - 1.36399672012499*m.x1 - 1.99969539031278*m.x2 - 1.41421356237309*m.x3 + 0.0349048128745698*m.x4 + 1.46270740323834*m.x5 + 1.99725906950915*m.x6 + 1.31211805798101*m.x7 - 0.174311485495317*m.x8 - 1.55429192291394*m.x9 - 1.98509230328264*m.x10 - 1.2036300463041*m.x11 + 0.312868930080461*m.x12 + 1.63830408857798*m.x13 + 1.96325436689533*m.x14 + 1.08927807003005*m.x15 - 0.449902108687731*m.x16 - 1.71433460140422*m.x17 - 1.93185165257814*m.x18 - 0.969619240492675*m.x19 + 0.584743409445474*m.x20 + 1.78201304837674*m.x21 + 1.89103715119863*m.x22 + 0.845236523481399*m.x23 - 0.7167358990906*m.x24 - 1.84100970690488*m.x25 + m.x29 <= 0) m.c142 = Constraint(expr= - 0.634609312810181*m.x1 - 1.81992254175309*m.x2 - 1.84775906502257*m.x3 - 0.700414762518939*m.x4 + 0.892395626219618*m.x5 + 1.91763946973639*m.x6 + 1.72325832088305*m.x7 + 0.432879227876206*m.x8 - 1.13281247384967*m.x9 - 1.97803172672383*m.x10 - 1.56521631370483*m.x11 - 0.15691819145569*m.x12 + 1.35118041523132*m.x13 + 1.99992384612834*m.x14 + 1.37670915138751*m.x15 - 0.122097079069714*m.x16 - 1.54324916677544*m.x17 - 1.98288972274762*m.x18 - 1.16140591142188*m.x19 + 0.398735868834395*m.x20 + 1.70528032870818*m.x21 + 1.92726090641725*m.x22 + 0.923497226470068*m.x23 - 0.667613718467542*m.x24 - 1.83412014877025*m.x25 + m.x29 <= 0) m.c143 = Constraint(expr= 0.20905692653531*m.x1 - 1.33826121271772*m.x2 - 2*m.x3 - 1.33826121271772*m.x4 + 0.209056926535306*m.x5 + 1.6180339887499*m.x6 + 1.95629520146761*m.x7 + m.x8 - 0.618033988749892*m.x9 - 1.8270909152852*m.x10 - 1.8270909152852*m.x11 - 0.618033988749897*m.x12 + m.x13 + 1.95629520146761*m.x14 + 1.61803398874989*m.x15 + 0.209056926535307*m.x16 - 1.33826121271772*m.x17 - 2*m.x18 - 1.33826121271772*m.x19 + 0.209056926535307*m.x20 + 1.61803398874989*m.x21 + 1.95629520146761*m.x22 + m.x23 - 0.618033988749895*m.x24 - 1.8270909152852*m.x25 + m.x29 <= 0) m.c144 = Constraint(expr= 1.0150767259214*m.x1 - 0.634609312810188*m.x2 - 1.84775906502258*m.x3 - 1.78986872320405*m.x4 - 0.500760008108879*m.x5 + 1.13281247384967*m.x6 + 1.98714371135318*m.x7 + 1.47455467362025*m.x8 - 0.0523538966157477*m.x9 - 1.54324916677544*m.x10 - 1.97257120307446*m.x11 - 1.0449971294319*m.x12 + 0.601411599008548*m.x13 + 1.83412014877025*m.x14 + 1.80517056869972*m.x15 + 0.534476752156511*m.x16 - 1.10387397062412*m.x17 - 1.98288972274762*m.x18 - 1.497911441578*m.x19 + 0.0174530709967489*m.x20 + 1.52081193120006*m.x21 + 1.97803172672383*m.x22 + 1.07459921669365*m.x23 - 0.568030689407846*m.x24 - 1.81992254175309*m.x25 + m.x29 <= 0) m.c145 = Constraint(expr= 1.63830408857798*m.x1 + 0.174311485495315*m.x2 - 1.41421356237309*m.x3 - 1.99238939618349*m.x4 - 1.14715287270209*m.x5 + 0.517638090205042*m.x6 + 1.8126155740733*m.x7 + 1.8126155740733*m.x8 + 0.51763809020504*m.x9 - 1.14715287270209*m.x10 - 1.99238939618349*m.x11 - 1.4142135623731*m.x12 + 0.174311485495317*m.x13 + 1.63830408857798*m.x14 + 1.93185165257814*m.x15 + 0.845236523481397*m.x16 - 0.845236523481399*m.x17 - 1.93185165257814*m.x18 - 1.63830408857798*m.x19 - 0.174311485495316*m.x20 + 1.4142135623731*m.x21 + 1.99238939618349*m.x22 + 1.14715287270209*m.x23 - 0.517638090205041*m.x24 - 1.8126155740733*m.x25 + m.x29 <= 0) m.c146 = Constraint(expr= 1.96650981512791*m.x1 + 0.954317520519217*m.x2 - 0.765366864730182*m.x3 - 1.91763946973639*m.x4 - 1.64825237724403*m.x5 - 0.156918191455693*m.x6 + 1.45074874202458*m.x7 + 1.98288972274762*m.x8 + 1.0449971294319*m.x9 - 0.667613718467543*m.x10 - 1.88528298218436*m.x11 - 1.70528032870818*m.x12 - 0.261052384440104*m.x13 + 1.37670915138751*m.x14 + 1.99383466746626*m.x15 + 1.13281247384966*m.x16 - 0.568030689407846*m.x17 - 1.84775906502257*m.x18 - 1.75763422532393*m.x19 - 0.364471050984295*m.x20 + 1.29889609666037*m.x21 + 1.99931464995111*m.x22 + 1.21752285801744*m.x23 - 0.466890727711811*m.x24 - 1.80517056869972*m.x25 + m.x29 <= 0) m.c147 = Constraint(expr= 1.94059145255199*m.x1 + 1.57602150721345*m.x2 + 1.96067283990894E-15*m.x3 - 1.57602150721344*m.x4 - 1.94059145255199*m.x5 - 0.8134732861516*m.x6 + 0.938943125571782*m.x7 + 1.96961550602442*m.x8 + 1.48628965095479*m.x9 - 0.13951294748825*m.x10 - 1.65807514511008*m.x11 - 1.90211303259031*m.x12 - 0.684040286651339*m.x13 + 1.05983852846641*m.x14 + 1.98904379073655*m.x15 + 1.38931674091799*m.x16 - 0.27834620192013*m.x17 - 1.73205080756888*m.x18 - 1.85436770913358*m.x19 - 0.551274711633999*m.x20 + 1.17557050458495*m.x21 + 1.99878165403819*m.x22 + 1.28557521937308*m.x23 - 0.415823381635518*m.x24 - 1.79758809259833*m.x25 + m.x29 <= 0) m.c148 = Constraint(expr= 1.56521631370483*m.x1 + 1.93629528075622*m.x2 + 0.765366864730179*m.x3 - 1.01507672592141*m.x4 - 1.98714371135318*m.x5 - 1.37670915138751*m.x6 + 0.330095211721357*m.x7 + 1.77402166635644*m.x8 + 1.80517056869972*m.x9 + 0.398735868834393*m.x10 - 1.32524009643148*m.x11 - 1.99383466746626*m.x12 - 1.07459921669365*m.x13 + 0.700414762518937*m.x14 + 1.91763946973639*m.x15 + 1.60771372123443*m.x16 + 0.0174530709967462*m.x17 - 1.58670668058247*m.x18 - 1.92726090641725*m.x19 - 0.733002453448594*m.x20 + 1.0449971294319*m.x21 + 1.99079239673436*m.x22 + 1.35118041523132*m.x23 - 0.364471050984295*m.x24 - 1.78986872320405*m.x25 + m.x29 <= 0) m.c149 = Constraint(expr= 0.907980999479097*m.x1 + 1.97537668119028*m.x2 + 1.41421356237309*m.x3 - 0.312868930080462*m.x4 - 1.78201304837674*m.x5 - 1.78201304837674*m.x6 - 0.312868930080459*m.x7 + 1.41421356237309*m.x8 + 1.97537668119027*m.x9 + 0.907980999479094*m.x10 - 0.907980999479096*m.x11 - 1.97537668119028*m.x12 - 1.41421356237309*m.x13 + 0.312868930080461*m.x14 + 1.78201304837674*m.x15 + 1.78201304837674*m.x16 + 0.312868930080459*m.x17 - 1.4142135623731*m.x18 - 1.97537668119028*m.x19 - 0.907980999479093*m.x20 + 0.907980999479094*m.x21 + 1.97537668119028*m.x22 + 1.41421356237309*m.x23 - 0.312868930080462*m.x24 - 1.78201304837674*m.x25 + m.x29 <= 0) m.c150 = Constraint(expr= 0.0872387747306755*m.x1 + 1.68678289162577*m.x2 + 1.84775906502257*m.x3 + 0.432879227876205*m.x4 - 1.35118041523132*m.x5 - 1.98288972274762*m.x6 - 0.92349722647007*m.x7 + 0.923497226470066*m.x8 + 1.98288972274762*m.x9 + 1.35118041523132*m.x10 - 0.432879227876205*m.x11 - 1.84775906502257*m.x12 - 1.68678289162577*m.x13 - 0.0872387747306728*m.x14 + 1.58670668058247*m.x15 + 1.90743390149645*m.x16 + 0.601411599008547*m.x17 - 1.21752285801744*m.x18 - 1.99809644316372*m.x19 - 1.07459921669365*m.x20 + 0.765366864730179*m.x21 + 1.95259201423987*m.x22 + 1.47455467362025*m.x23 - 0.261052384440103*m.x24 - 1.77402166635644*m.x25 + m.x29 <= 0) m.c151 = Constraint(expr= - 0.749213186831827*m.x1 + 1.1183858069415*m.x2 + 2*m.x3 + 1.11838580694149*m.x4 - 0.749213186831824*m.x5 - 1.95629520146761*m.x6 - 1.4386796006773*m.x7 + 0.347296355333858*m.x8 + 1.8270909152852*m.x9 + 1.69609619231285*m.x10 + 0.0697989934050036*m.x11 - 1.6180339887499*m.x12 - 1.87938524157182*m.x13 - 0.483843791199336*m.x14 + 1.33826121271772*m.x15 + 1.98053613748314*m.x16 + 0.876742293578155*m.x17 - m.x18 - 1.99512810051965*m.x19 - 1.23132295065132*m.x20 + 0.618033988749895*m.x21 + 1.92252339187664*m.x22 + 1.53208888623796*m.x23 - 0.209056926535307*m.x24 - 1.76589518571785*m.x25 + m.x29 <= 0) m.c152 = Constraint(expr= - 1.45074874202458*m.x1 + 0.364471050984295*m.x2 + 1.84775906502257*m.x3 + 1.64825237724403*m.x4 - 0.0523538966157446*m.x5 - 1.70528032870818*m.x6 - 1.80517056869972*m.x7 - 0.261052384440107*m.x8 + 1.52081193120006*m.x9 + 1.91763946973639*m.x10 + 0.568030689407847*m.x11 - 1.29889609666037*m.x12 - 1.98288972274762*m.x13 - 0.861022193616591*m.x14 + 1.0449971294319*m.x15 + 1.99931464995111*m.x16 + 1.13281247384966*m.x17 - 0.765366864730179*m.x18 - 1.96650981512791*m.x19 - 1.37670915138751*m.x20 + 0.46689072771181*m.x21 + 1.88528298218436*m.x22 + 1.58670668058247*m.x23 - 0.15691819145569*m.x24 - 1.75763422532393*m.x25 + m.x29 <= 0) m.c153 = Constraint(expr= - 1.89103715119863*m.x1 - 0.449902108687732*m.x2 + 1.4142135623731*m.x3 + 1.94874012957047*m.x4 + 0.651136308914317*m.x5 - 1.25864078209967*m.x6 - 1.98509230328264*m.x7 - 0.845236523481403*m.x8 + 1.08927807003005*m.x9 + 1.99969539031278*m.x10 + 1.03007614982011*m.x11 - 0.907980999479093*m.x12 - 1.99238939618349*m.x13 - 1.2036300463041*m.x14 + 0.716735899090599*m.x15 + 1.96325436689533*m.x16 + 1.363996720125*m.x17 - 0.517638090205041*m.x18 - 1.91260951192607*m.x19 - 1.50941916044554*m.x20 + 0.31286893008046*m.x21 + 1.84100970690488*m.x22 + 1.63830408857798*m.x23 - 0.104671912485887*m.x24 - 1.74923941427879*m.x25 + m.x29 <= 0) m.c154 = Constraint(expr= - 1.99079239673436*m.x1 - 1.18964557350269*m.x2 + 0.765366864730175*m.x3 + 1.97803172672383*m.x4 + 1.27215644055553*m.x5 - 0.667613718467537*m.x6 - 1.95984940924166*m.x7 - 1.35118041523132*m.x8 + 0.568030689407839*m.x9 + 1.93629528075621*m.x10 + 1.42650089830837*m.x11 - 0.466890727711808*m.x12 - 1.90743390149645*m.x13 - 1.497911441578*m.x14 + 0.364471050984294*m.x15 + 1.87334437849679*m.x16 + 1.56521631370483*m.x17 - 0.261052384440102*m.x18 - 1.83412014877025*m.x19 - 1.62823103671264*m.x20 + 0.156918191455689*m.x21 + 1.78986872320405*m.x22 + 1.68678289162577*m.x23 - 0.0523538966157458*m.x24 - 1.7407113918798*m.x25 + m.x29 <= 0) m.c155 = Constraint(expr= - 1.73205080756888*m.x1 - 1.73205080756887*m.x2 + 5.38968387752153E-15*m.x3 + 1.73205080756888*m.x4 + 1.73205080756887*m.x5 - 5.14475451769206E-15*m.x6 - 1.73205080756888*m.x7 - 1.73205080756887*m.x8 + 4.89982515786259E-15*m.x9 + 1.73205080756888*m.x10 + 1.73205080756888*m.x11 - 4.65489579803312E-15*m.x12 - 1.73205080756888*m.x13 - 1.73205080756888*m.x14 + 8.57252759403147E-16*m.x15 + 1.73205080756888*m.x16 + 1.73205080756888*m.x17 - 2.38868023897393E-15*m.x18 - 1.73205080756888*m.x19 - 1.73205080756888*m.x20 + 3.67394039744206E-16*m.x21 + 1.73205080756888*m.x22 + 1.73205080756888*m.x23 - 1.22464679914735E-16*m.x24 - 1.73205080756888*m.x25 + m.x29 <= 0) m.c156 = Constraint(expr= - 1.16140591142188*m.x1 - 1.98714371135317*m.x2 - 0.765366864730179*m.x3 + 1.24502927327524*m.x4 + 1.97257120307446*m.x5 + 0.667613718467541*m.x6 - 1.32524009643148*m.x7 - 1.95259201423987*m.x8 - 0.568030689407844*m.x9 + 1.4018185285997*m.x10 + 1.92726090641725*m.x11 + 0.466890727711809*m.x12 - 1.47455467362025*m.x13 - 1.8966473104124*m.x14 - 0.364471050984293*m.x15 + 1.54324916677544*m.x16 + 1.86083513596405*m.x17 + 0.261052384440102*m.x18 - 1.60771372123444*m.x19 - 1.81992254175309*m.x20 - 0.156918191455689*m.x21 + 1.66777164413434*m.x22 + 1.77402166635644*m.x23 + 0.052353896615746*m.x24 - 1.72325832088305*m.x25 + m.x29 <= 0) m.c157 = Constraint(expr= - 0.381617990753093*m.x1 - 1.91260951192607*m.x2 - 1.41421356237309*m.x3 + 0.584743409445477*m.x4 + 1.96325436689533*m.x5 + 1.25864078209967*m.x6 - 0.781462256978552*m.x7 - 1.99238939618349*m.x8 - 1.08927807003005*m.x9 + 0.969619240492673*m.x10 + 1.99969539031278*m.x11 + 0.907980999479091*m.x12 - 1.14715287270209*m.x13 - 1.98509230328264*m.x14 - 0.7167358990906*m.x15 + 1.31211805798101*m.x16 + 1.94874012957047*m.x17 + 0.51763809020504*m.x18 - 1.46270740323834*m.x19 - 1.89103715119863*m.x20 - 0.312868930080461*m.x21 + 1.59727102009459*m.x22 + 1.8126155740733*m.x23 + 0.104671912485887*m.x24 - 1.71433460140422*m.x25 + m.x29 <= 0) m.c158 = Constraint(expr= 0.466890727711808*m.x1 - 1.52081193120006*m.x2 - 1.84775906502257*m.x3 - 0.156918191455685*m.x4 + 1.70528032870819*m.x5 + 1.70528032870818*m.x6 - 0.156918191455689*m.x7 - 1.84775906502258*m.x8 - 1.52081193120006*m.x9 + 0.466890727711811*m.x10 + 1.94473984079535*m.x11 + 1.29889609666037*m.x12 - 0.765366864730181*m.x13 - 1.99383466746626*m.x14 - 1.0449971294319*m.x15 + 1.0449971294319*m.x16 + 1.99383466746626*m.x17 + 0.76536686473018*m.x18 - 1.29889609666037*m.x19 - 1.94473984079535*m.x20 - 0.46689072771181*m.x21 + 1.52081193120006*m.x22 + 1.84775906502257*m.x23 + 0.15691819145569*m.x24 - 1.70528032870818*m.x25 + m.x29 <= 0) m.c159 = Constraint(expr= 1.23132295065131*m.x1 - 0.876742293578154*m.x2 - 2*m.x3 - 0.876742293578157*m.x4 + 1.23132295065132*m.x5 + 1.95629520146761*m.x6 + 0.483843791199335*m.x7 - 1.53208888623796*m.x8 - 1.8270909152852*m.x9 - 0.0697989934049998*m.x10 + 1.76589518571785*m.x11 + 1.61803398874989*m.x12 - 0.347296355333861*m.x13 - 1.92252339187664*m.x14 - 1.33826121271772*m.x15 + 0.749213186831823*m.x16 + 1.99512810051965*m.x17 + 0.999999999999998*m.x18 - 1.11838580694149*m.x19 - 1.98053613748314*m.x20 - 0.618033988749894*m.x21 + 1.4386796006773*m.x22 + 1.87938524157182*m.x23 + 0.209056926535307*m.x24 - 1.69609619231285*m.x25 + m.x29 <= 0) m.c160 = Constraint(expr= 1.77402166635644*m.x1 - 0.0872387747306687*m.x2 - 1.84775906502257*m.x3 - 1.47455467362025*m.x4 + 0.601411599008546*m.x5 + 1.98288972274762*m.x6 + 1.07459921669365*m.x7 - 1.07459921669365*m.x8 - 1.98288972274762*m.x9 - 0.601411599008549*m.x10 + 1.47455467362025*m.x11 + 1.84775906502257*m.x12 + 0.0872387747306726*m.x13 - 1.77402166635644*m.x14 - 1.58670668058247*m.x15 + 0.432879227876204*m.x16 + 1.95259201423987*m.x17 + 1.21752285801744*m.x18 - 0.923497226470067*m.x19 - 1.99809644316372*m.x20 - 0.76536686473018*m.x21 + 1.35118041523132*m.x22 + 1.90743390149645*m.x23 + 0.261052384440103*m.x24 - 1.68678289162577*m.x25 + m.x29 <= 0) m.c161 = Constraint(expr= 1.99725906950915*m.x1 + 0.716735899090599*m.x2 - 1.4142135623731*m.x3 - 1.8671608529944*m.x4 - 0.10467191248589*m.x5 + 1.78201304837673*m.x6 + 1.55429192291394*m.x7 - 0.517638090205042*m.x8 - 1.97537668119028*m.x9 - 1.08927807003006*m.x10 + 1.08927807003005*m.x11 + 1.97537668119028*m.x12 + 0.517638090205043*m.x13 - 1.55429192291394*m.x14 - 1.78201304837674*m.x15 + 0.104671912485886*m.x16 + 1.8671608529944*m.x17 + 1.4142135623731*m.x18 - 0.7167358990906*m.x19 - 1.99725906950915*m.x20 - 0.907980999479093*m.x21 + 1.25864078209967*m.x22 + 1.93185165257814*m.x23 + 0.312868930080462*m.x24 - 1.67734113589085*m.x25 + m.x29 <= 0) m.c162 = Constraint(expr= 1.86083513596405*m.x1 + 1.4018185285997*m.x2 - 0.765366864730176*m.x3 - 1.99992384612834*m.x4 - 0.797498137850496*m.x5 + 1.37670915138751*m.x6 + 1.8733443784968*m.x7 + 0.0872387747306721*m.x8 - 1.80517056869972*m.x9 - 1.497911441578*m.x10 + 0.634609312810181*m.x11 + 1.99383466746626*m.x12 + 0.923497226470071*m.x13 - 1.27215644055553*m.x14 - 1.91763946973639*m.x15 - 0.226406427535813*m.x16 + 1.7407113918798*m.x17 + 1.58670668058247*m.x18 - 0.500760008108882*m.x19 - 1.97803172672383*m.x20 - 1.0449971294319*m.x21 + 1.16140591142188*m.x22 + 1.95259201423987*m.x23 + 0.364471050984295*m.x24 - 1.66777164413434*m.x25 + m.x29 <= 0) m.c163 = Constraint(expr= 1.38931674091799*m.x1 + 1.85436770913358*m.x2 + 1.47081412025E-15*m.x3 - 1.85436770913357*m.x4 - 1.389316740918*m.x5 + 0.813473286151597*m.x6 + 1.99878165403819*m.x7 + 0.684040286651339*m.x8 - 1.48628965095479*m.x9 - 1.79758809259834*m.x10 + 0.139512947488247*m.x11 + 1.90211303259031*m.x12 + 1.28557521937308*m.x13 - 0.938943125571779*m.x14 - 1.98904379073655*m.x15 - 0.551274711633998*m.x16 + 1.57602150721344*m.x17 + 1.73205080756888*m.x18 - 0.27834620192013*m.x19 - 1.94059145255199*m.x20 - 1.17557050458495*m.x21 + 1.05983852846641*m.x22 + 1.96961550602442*m.x23 + 0.415823381635519*m.x24 - 1.65807514511008*m.x25 + m.x29 <= 0) m.c164 = Constraint(expr= 0.667613718467544*m.x1 + 1.99931464995111*m.x2 + 0.765366864730172*m.x3 - 1.45074874202458*m.x4 - 1.80517056869972*m.x5 + 0.156918191455696*m.x6 + 1.91763946973639*m.x7 + 1.21752285801744*m.x8 - 1.0449971294319*m.x9 - 1.96650981512791*m.x10 - 0.364471050984292*m.x11 + 1.70528032870819*m.x12 + 1.58670668058247*m.x13 - 0.568030689407849*m.x14 - 1.99383466746626*m.x15 - 0.861022193616588*m.x16 + 1.37670915138751*m.x17 + 1.84775906502257*m.x18 - 0.0523538966157472*m.x19 - 1.88528298218436*m.x20 - 1.29889609666037*m.x21 + 0.954317520519217*m.x22 + 1.98288972274762*m.x23 + 0.466890727711811*m.x24 - 1.64825237724403*m.x25 + m.x29 <= 0) m.c165 = Constraint(expr= - 0.174311485495314*m.x1 + 1.8126155740733*m.x2 + 1.41421356237309*m.x3 - 0.8452365234814*m.x4 - 1.99238939618349*m.x5 - 0.517638090205039*m.x6 + 1.63830408857799*m.x7 + 1.63830408857798*m.x8 - 0.517638090205042*m.x9 - 1.99238939618349*m.x10 - 0.845236523481397*m.x11 + 1.41421356237309*m.x12 + 1.8126155740733*m.x13 - 0.174311485495317*m.x14 - 1.93185165257814*m.x15 - 1.14715287270209*m.x16 + 1.14715287270209*m.x17 + 1.93185165257814*m.x18 + 0.174311485495316*m.x19 - 1.8126155740733*m.x20 - 1.41421356237309*m.x21 + 0.8452365234814*m.x22 + 1.99238939618349*m.x23 + 0.517638090205041*m.x24 - 1.63830408857798*m.x25 + m.x29 <= 0) m.c166 = Constraint(expr= - 0.984847120206932*m.x1 + 1.32524009643148*m.x2 + 1.84775906502257*m.x3 - 0.122097079069715*m.x4 - 1.92726090641725*m.x5 - 1.13281247384966*m.x6 + 1.18964557350268*m.x7 + 1.90743390149645*m.x8 + 0.0523538966157415*m.x9 - 1.8733443784968*m.x10 - 1.27215644055553*m.x11 + 1.0449971294319*m.x12 + 1.95259201423987*m.x13 + 0.226406427535812*m.x14 - 1.80517056869972*m.x15 - 1.4018185285997*m.x16 + 0.892395626219618*m.x17 + 1.98288972274762*m.x18 + 0.398735868834394*m.x19 - 1.72325832088305*m.x20 - 1.52081193120006*m.x21 + 0.733002453448594*m.x22 + 1.99809644316372*m.x23 + 0.568030689407845*m.x24 - 1.62823103671264*m.x25 + m.x29 <= 0) m.c167 = Constraint(expr= - 1.61803398874989*m.x1 + 0.618033988749897*m.x2 + 2*m.x3 + 0.618033988749893*m.x4 - 1.6180339887499*m.x5 - 1.61803398874989*m.x6 + 0.618033988749897*m.x7 + 2*m.x8 + 0.618033988749893*m.x9 - 1.6180339887499*m.x10 - 1.61803398874989*m.x11 + 0.618033988749896*m.x12 + 2*m.x13 + 0.618033988749894*m.x14 - 1.6180339887499*m.x15 - 1.61803398874989*m.x16 + 0.618033988749896*m.x17 + 2*m.x18 + 0.618033988749894*m.x19 - 1.6180339887499*m.x20 - 1.61803398874989*m.x21 + 0.618033988749895*m.x22 + 2*m.x23 + 0.618033988749895*m.x24 - 1.61803398874989*m.x25 + m.x29 <= 0) m.c168 = Constraint(expr= - 1.95984940924166*m.x1 - 0.191691505040448*m.x2 + 1.84775906502257*m.x3 + 1.27215644055553*m.x4 - 1.10387397062412*m.x5 - 1.91763946973639*m.x6 - 0.0174530709967449*m.x7 + 1.90743390149645*m.x8 + 1.13281247384967*m.x9 - 1.24502927327524*m.x10 - 1.86083513596405*m.x11 + 0.156918191455689*m.x12 + 1.95259201423987*m.x13 + 0.984847120206933*m.x14 - 1.37670915138751*m.x15 - 1.78986872320405*m.x16 + 0.330095211721357*m.x17 + 1.98288972274762*m.x18 + 0.829386485312478*m.x19 - 1.497911441578*m.x20 - 1.70528032870818*m.x21 + 0.500760008108884*m.x22 + 1.99809644316372*m.x23 + 0.667613718467542*m.x24 - 1.60771372123443*m.x25 + m.x29 <= 0) m.c169 = Constraint(expr= - 1.94874012957047*m.x1 - 0.969619240492676*m.x2 + 1.4142135623731*m.x3 + 1.74923941427879*m.x4 - 0.449902108687729*m.x5 - 1.99725906950915*m.x6 - 0.651136308914316*m.x7 + 1.63830408857798*m.x8 + 1.55429192291394*m.x9 - 0.781462256978546*m.x10 - 1.98509230328264*m.x11 - 0.312868930080459*m.x12 + 1.8126155740733*m.x13 + 1.31211805798101*m.x14 - 1.08927807003005*m.x15 - 1.91260951192607*m.x16 + 0.0349048128745657*m.x17 + 1.93185165257814*m.x18 + 1.03007614982011*m.x19 - 1.363996720125*m.x20 - 1.78201304837674*m.x21 + 0.381617990753089*m.x22 + 1.99238939618349*m.x23 + 0.716735899090601*m.x24 - 1.59727102009459*m.x25 + m.x29 <= 0) m.c170 = Constraint(expr= - 1.58670668058247*m.x1 - 1.58670668058247*m.x2 + 0.765366864730176*m.x3 + 1.98288972274762*m.x4 + 0.261052384440106*m.x5 - 1.84775906502257*m.x6 - 1.21752285801744*m.x7 + 1.21752285801744*m.x8 + 1.84775906502257*m.x9 - 0.261052384440103*m.x10 - 1.98288972274762*m.x11 - 0.765366864730179*m.x12 + 1.58670668058247*m.x13 + 1.58670668058247*m.x14 - 0.765366864730178*m.x15 - 1.98288972274762*m.x16 - 0.261052384440104*m.x17 + 1.84775906502257*m.x18 + 1.21752285801744*m.x19 - 1.21752285801744*m.x20 - 1.84775906502257*m.x21 + 0.261052384440103*m.x22 + 1.98288972274762*m.x23 + 0.765366864730179*m.x24 - 1.58670668058247*m.x25 + m.x29 <= 0) m.c171 = Constraint(expr= - 0.938943125571777*m.x1 - 1.94059145255199*m.x2 - 1.22588476042053E-15*m.x3 + 1.94059145255199*m.x4 + 0.938943125571786*m.x5 - 1.48628965095479*m.x6 - 1.65807514511008*m.x7 + 0.684040286651335*m.x8 + 1.98904379073655*m.x9 + 0.27834620192013*m.x10 - 1.85436770913357*m.x11 - 1.17557050458495*m.x12 + 1.28557521937308*m.x13 + 1.79758809259833*m.x14 - 0.415823381635519*m.x15 - 1.99878165403819*m.x16 - 0.551274711633998*m.x17 + 1.73205080756888*m.x18 + 1.38931674091799*m.x19 - 1.05983852846641*m.x20 - 1.90211303259031*m.x21 + 0.139512947488249*m.x22 + 1.96961550602442*m.x23 + 0.813473286151601*m.x24 - 1.57602150721344*m.x25 + m.x29 <= 0) m.c172 = Constraint(expr= - 0.122097079069716*m.x1 - 1.97257120307446*m.x2 - 0.765366864730185*m.x3 + 1.62823103671264*m.x4 + 1.49791144157801*m.x5 - 0.954317520519214*m.x6 - 1.92726090641725*m.x7 + 0.0872387747306684*m.x8 + 1.96650981512791*m.x9 + 0.797498137850496*m.x10 - 1.60771372123443*m.x11 - 1.52081193120006*m.x12 + 0.923497226470066*m.x13 + 1.93629528075622*m.x14 - 0.0523538966157441*m.x15 - 1.95984940924166*m.x16 - 0.829386485312481*m.x17 + 1.58670668058247*m.x18 + 1.54324916677544*m.x19 - 0.892395626219618*m.x20 - 1.94473984079535*m.x21 + 0.0174530709967472*m.x22 + 1.95259201423987*m.x23 + 0.861022193616591*m.x24 - 1.56521631370483*m.x25 + m.x29 <= 0) m.c173 = Constraint(expr= 0.716735899090592*m.x1 - 1.67734113589085*m.x2 - 1.41421356237309*m.x3 + 1.08927807003006*m.x4 + 1.8671608529944*m.x5 - 0.312868930080469*m.x6 - 1.99725906950915*m.x7 - 0.517638090205039*m.x8 + 1.78201304837674*m.x9 + 1.25864078209967*m.x10 - 1.25864078209968*m.x11 - 1.78201304837673*m.x12 + 0.517638090205042*m.x13 + 1.99725906950915*m.x14 + 0.312868930080459*m.x15 - 1.8671608529944*m.x16 - 1.08927807003005*m.x17 + 1.4142135623731*m.x18 + 1.67734113589085*m.x19 - 0.716735899090602*m.x20 - 1.97537668119028*m.x21 - 0.104671912485886*m.x22 + 1.93185165257814*m.x23 + 0.907980999479093*m.x24 - 1.55429192291394*m.x25 + m.x29 <= 0) m.c174 = Constraint(expr= 1.42650089830836*m.x1 - 1.10387397062412*m.x2 - 1.84775906502257*m.x3 + 0.3987358688344*m.x4 + 1.99992384612834*m.x5 + 0.364471050984291*m.x6 - 1.86083513596405*m.x7 - 1.07459921669365*m.x8 + 1.45074874202458*m.x9 + 1.62823103671263*m.x10 - 0.829386485312483*m.x11 - 1.94473984079535*m.x12 + 0.087238774730675*m.x13 + 1.97803172672383*m.x14 + 0.667613718467541*m.x15 - 1.72325832088305*m.x16 - 1.32524009643147*m.x17 + 1.21752285801744*m.x18 + 1.78986872320405*m.x19 - 0.534476752156514*m.x20 - 1.99383466746626*m.x21 - 0.226406427535813*m.x22 + 1.90743390149645*m.x23 + 0.954317520519217*m.x24 - 1.54324916677544*m.x25 + m.x29 <= 0) m.c175 = Constraint(expr= 1.87938524157181*m.x1 - 0.347296355333866*m.x2 - 2*m.x3 - 0.347296355333855*m.x4 + 1.87938524157182*m.x5 + m.x6 - 1.53208888623796*m.x7 - 1.53208888623796*m.x8 + m.x9 + 1.87938524157182*m.x10 - 0.347296355333865*m.x11 - 2*m.x12 - 0.347296355333855*m.x13 + 1.87938524157182*m.x14 + 0.999999999999998*m.x15 - 1.53208888623796*m.x16 - 1.53208888623795*m.x17 + m.x18 + 1.87938524157182*m.x19 - 0.347296355333861*m.x20 - 2*m.x21 - 0.34729635533386*m.x22 + 1.87938524157182*m.x23 + m.x24 - 1.53208888623796*m.x25 + m.x29 <= 0) m.c176 = Constraint(expr= 1.99383466746626*m.x1 + 0.466890727711807*m.x2 - 1.84775906502258*m.x3 - 1.0449971294319*m.x4 + 1.52081193120006*m.x5 + 1.52081193120006*m.x6 - 1.0449971294319*m.x7 - 1.84775906502257*m.x8 + 0.466890727711812*m.x9 + 1.99383466746626*m.x10 + 0.156918191455686*m.x11 - 1.94473984079535*m.x12 - 0.765366864730179*m.x13 + 1.70528032870819*m.x14 + 1.29889609666037*m.x15 - 1.29889609666037*m.x16 - 1.70528032870818*m.x17 + 0.765366864730181*m.x18 + 1.94473984079535*m.x19 - 0.156918191455691*m.x20 - 1.99383466746626*m.x21 - 0.46689072771181*m.x22 + 1.84775906502257*m.x23 + 1.0449971294319*m.x24 - 1.52081193120006*m.x25 + m.x29 <= 0) m.c177 = Constraint(expr= 1.74923941427879*m.x1 + 1.2036300463041*m.x2 - 1.4142135623731*m.x3 - 1.59727102009459*m.x4 + 0.969619240492674*m.x5 + 1.8671608529944*m.x6 - 0.449902108687729*m.x7 - 1.99238939618349*m.x8 - 0.10467191248589*m.x9 + 1.96325436689533*m.x10 + 0.65113630891431*m.x11 - 1.78201304837674*m.x12 - 1.14715287270209*m.x13 + 1.46270740323834*m.x14 + 1.55429192291394*m.x15 - 1.03007614982011*m.x16 - 1.84100970690488*m.x17 + 0.517638090205042*m.x18 + 1.98509230328264*m.x19 + 0.034904812874566*m.x20 - 1.97537668119028*m.x21 - 0.584743409445473*m.x22 + 1.8126155740733*m.x23 + 1.08927807003005*m.x24 - 1.50941916044554*m.x25 + m.x29 <= 0) m.c178 = Constraint(expr= 1.18964557350268*m.x1 + 1.7407113918798*m.x2 - 0.765366864730176*m.x3 - 1.92726090641725*m.x4 + 0.295618822259219*m.x5 + 1.99931464995111*m.x6 + 0.191691505040448*m.x7 - 1.95259201423987*m.x8 - 0.66761371846754*m.x9 + 1.78986872320405*m.x10 + 1.10387397062411*m.x11 - 1.52081193120006*m.x12 - 1.47455467362025*m.x13 + 1.16140591142188*m.x14 + 1.75763422532393*m.x15 - 0.733002453448595*m.x16 - 1.93629528075622*m.x17 + 0.261052384440102*m.x18 + 1.99992384612834*m.x19 + 0.226406427535813*m.x20 - 1.94473984079535*m.x21 - 0.700414762518934*m.x22 + 1.77402166635644*m.x23 + 1.13281247384967*m.x24 - 1.497911441578*m.x25 + m.x29 <= 0) m.c179 = Constraint(expr= 0.415823381635513*m.x1 + 1.98904379073655*m.x2 + 9.80955400591059E-16*m.x3 - 1.98904379073655*m.x4 - 0.415823381635522*m.x5 + 1.90211303259031*m.x6 + 0.8134732861516*m.x7 - 1.73205080756888*m.x8 - 1.17557050458495*m.x9 + 1.48628965095479*m.x10 + 1.48628965095479*m.x11 - 1.17557050458494*m.x12 - 1.73205080756888*m.x13 + 0.813473286151603*m.x14 + 1.90211303259031*m.x15 - 0.415823381635519*m.x16 - 1.98904379073655*m.x17 + 8.57252759403147E-16*m.x18 + 1.98904379073655*m.x19 + 0.41582338163552*m.x20 - 1.90211303259031*m.x21 - 0.813473286151601*m.x22 + 1.73205080756888*m.x23 + 1.17557050458495*m.x24 - 1.48628965095479*m.x25 + m.x29 <= 0) m.c180 = Constraint(expr= - 0.432879227876204*m.x1 + 1.90743390149645*m.x2 + 0.765366864730178*m.x3 - 1.77402166635644*m.x4 - 1.07459921669365*m.x5 + 1.58670668058247*m.x6 + 1.35118041523132*m.x7 - 1.35118041523132*m.x8 - 1.58670668058247*m.x9 + 1.07459921669364*m.x10 + 1.77402166635644*m.x11 - 0.765366864730175*m.x12 - 1.90743390149645*m.x13 + 0.432879227876201*m.x14 + 1.98288972274762*m.x15 - 0.0872387747306712*m.x16 - 1.99809644316372*m.x17 - 0.261052384440104*m.x18 + 1.95259201423987*m.x19 + 0.601411599008547*m.x20 - 1.84775906502257*m.x21 - 0.923497226470068*m.x22 + 1.68678289162577*m.x23 + 1.21752285801744*m.x24 - 1.47455467362025*m.x25 + m.x29 <= 0) m.c181 = Constraint(expr= - 1.2036300463041*m.x1 + 1.50941916044554*m.x2 + 1.4142135623731*m.x3 - 1.31211805798102*m.x4 - 1.59727102009459*m.x5 + 1.08927807003005*m.x6 + 1.74923941427879*m.x7 - 0.8452365234814*m.x8 - 1.8671608529944*m.x9 + 0.58474340944547*m.x10 + 1.94874012957047*m.x11 - 0.312868930080462*m.x12 - 1.99238939618349*m.x13 + 0.0349048128745626*m.x14 + 1.99725906950915*m.x15 + 0.243738686810296*m.x16 - 1.96325436689533*m.x17 - 0.517638090205044*m.x18 + 1.89103715119863*m.x19 + 0.781462256978547*m.x20 - 1.78201304837674*m.x21 - 1.03007614982011*m.x22 + 1.63830408857798*m.x23 + 1.25864078209968*m.x24 - 1.46270740323834*m.x25 + m.x29 <= 0) m.c182 = Constraint(expr= - 1.75763422532393*m.x1 + 0.861022193616594*m.x2 + 1.84775906502257*m.x3 - 0.667613718467551*m.x4 - 1.91763946973638*m.x5 + 0.466890727711819*m.x6 + 1.96650981512791*m.x7 - 0.26105238444011*m.x8 - 1.99383466746626*m.x9 + 0.052353896615752*m.x10 + 1.99931464995111*m.x11 + 0.156918191455686*m.x12 - 1.98288972274762*m.x13 - 0.364471050984292*m.x14 + 1.94473984079535*m.x15 + 0.568030689407844*m.x16 - 1.88528298218436*m.x17 - 0.765366864730176*m.x18 + 1.80517056869972*m.x19 + 0.954317520519215*m.x20 - 1.70528032870819*m.x21 - 1.13281247384966*m.x22 + 1.58670668058247*m.x23 + 1.29889609666037*m.x24 - 1.45074874202458*m.x25 + m.x29 <= 0) m.c183 = Constraint(expr= - 1.99512810051965*m.x1 + 0.069798993405004*m.x2 + 2*m.x3 + 0.0697989934049986*m.x4 - 1.99512810051965*m.x5 - 0.209056926535302*m.x6 + 1.98053613748314*m.x7 + 0.347296355333855*m.x8 - 1.95629520146761*m.x9 - 0.483843791199335*m.x10 + 1.92252339187664*m.x11 + 0.618033988749893*m.x12 - 1.87938524157182*m.x13 - 0.749213186831821*m.x14 + 1.8270909152852*m.x15 + 0.876742293578154*m.x16 - 1.76589518571785*m.x17 - 0.999999999999998*m.x18 + 1.69609619231285*m.x19 + 1.11838580694149*m.x20 - 1.6180339887499*m.x21 - 1.23132295065132*m.x22 + 1.53208888623796*m.x23 + 1.33826121271772*m.x24 - 1.4386796006773*m.x25 + m.x29 <= 0) m.c184 = Constraint(expr= - 1.8733443784968*m.x1 - 0.733002453448595*m.x2 + 1.84775906502257*m.x3 + 0.797498137850495*m.x4 - 1.81992254175309*m.x5 - 0.861022193616589*m.x6 + 1.78986872320405*m.x7 + 0.923497226470063*m.x8 - 1.75763422532393*m.x9 - 0.984847120206933*m.x10 + 1.72325832088305*m.x11 + 1.0449971294319*m.x12 - 1.68678289162577*m.x13 - 1.10387397062411*m.x14 + 1.64825237724403*m.x15 + 1.16140591142188*m.x16 - 1.60771372123444*m.x17 - 1.21752285801744*m.x18 + 1.56521631370483*m.x19 + 1.27215644055553*m.x20 - 1.52081193120006*m.x21 - 1.32524009643148*m.x22 + 1.47455467362025*m.x23 + 1.37670915138751*m.x24 - 1.42650089830836*m.x25 + m.x29 <= 0) m.c185 = Constraint(expr= - 1.4142135623731*m.x1 - 1.4142135623731*m.x2 + 1.4142135623731*m.x3 + 1.41421356237309*m.x4 - 1.4142135623731*m.x5 - 1.41421356237309*m.x6 + 1.4142135623731*m.x7 + 1.41421356237309*m.x8 - 1.4142135623731*m.x9 - 1.41421356237309*m.x10 + 1.4142135623731*m.x11 + 1.41421356237309*m.x12 - 1.41421356237309*m.x13 - 1.41421356237309*m.x14 + 1.41421356237309*m.x15 + 1.41421356237309*m.x16 - 1.41421356237309*m.x17 - 1.41421356237309*m.x18 + 1.41421356237309*m.x19 + 1.41421356237309*m.x20 - 1.4142135623731*m.x21 - 1.41421356237309*m.x22 + 1.4142135623731*m.x23 + 1.41421356237309*m.x24 - 1.4142135623731*m.x25 + m.x29 <= 0) m.c186 = Constraint(expr= - 1.00000000000001*m.x1 - 0.999999999999986*m.x2 + 2*m.x3 - 1.00000000000001*m.x4 - 0.999999999999987*m.x5 + 2*m.x6 - m.x7 - 0.999999999999987*m.x8 + 2*m.x9 - m.x10 - 0.999999999999994*m.x11 + 2*m.x12 - m.x13 - 0.999999999999994*m.x14 + 2*m.x15 - m.x16 - 0.999999999999995*m.x17 + 2*m.x18 - m.x19 - 0.999999999999998*m.x20 + 2*m.x21 - m.x22 - m.x23 + 2*m.x24 - m.x25 <= 0.01) m.c187 = Constraint(expr= - 0.191691505040447*m.x1 - 1.60771372123444*m.x2 + 1.84775906502257*m.x3 - 0.295618822259221*m.x4 - 1.54324916677544*m.x5 + 1.88528298218436*m.x6 - 0.398735868834394*m.x7 - 1.47455467362025*m.x8 + 1.91763946973639*m.x9 - 0.500760008108882*m.x10 - 1.4018185285997*m.x11 + 1.94473984079535*m.x12 - 0.601411599008546*m.x13 - 1.32524009643148*m.x14 + 1.96650981512791*m.x15 - 0.700414762518935*m.x16 - 1.24502927327524*m.x17 + 1.98288972274762*m.x18 - 0.797498137850492*m.x19 - 1.16140591142188*m.x20 + 1.99383466746626*m.x21 - 0.892395626219618*m.x22 - 1.07459921669365*m.x23 + 1.99931464995111*m.x24 - 0.984847120206934*m.x25 <= 0.01) m.c188 = Constraint(expr= 0.651136308914307*m.x1 - 1.94874012957047*m.x2 + 1.4142135623731*m.x3 + 0.449902108687723*m.x4 - 1.89103715119863*m.x5 + 1.55429192291394*m.x6 + 0.243738686810287*m.x7 - 1.81261557407329*m.x8 + 1.67734113589085*m.x9 + 0.0349048128745587*m.x10 - 1.71433460140422*m.x11 + 1.78201304837674*m.x12 - 0.174311485495318*m.x13 - 1.59727102009458*m.x14 + 1.86716085299441*m.x15 - 0.381617990753092*m.x16 - 1.46270740323834*m.x17 + 1.93185165257814*m.x18 - 0.584743409445477*m.x19 - 1.31211805798101*m.x20 + 1.97537668119028*m.x21 - 0.781462256978548*m.x22 - 1.14715287270209*m.x23 + 1.99725906950915*m.x24 - 0.969619240492674*m.x25 <= 0.01) m.c189 = Constraint(expr= 1.37670915138751*m.x1 - 1.96650981512791*m.x2 + 0.765366864730171*m.x3 + 1.13281247384967*m.x4 - 1.99931464995111*m.x5 + 1.04499712943189*m.x6 + 0.861022193616589*m.x7 - 1.98288972274762*m.x8 + 1.29889609666036*m.x9 + 0.568030689407843*m.x10 - 1.91763946973639*m.x11 + 1.52081193120006*m.x12 + 0.261052384440106*m.x13 - 1.80517056869972*m.x14 + 1.70528032870818*m.x15 - 0.0523538966157446*m.x16 - 1.64825237724403*m.x17 + 1.84775906502257*m.x18 - 0.364471050984295*m.x19 - 1.45074874202458*m.x20 + 1.94473984079535*m.x21 - 0.667613718467541*m.x22 - 1.21752285801744*m.x23 + 1.99383466746626*m.x24 - 0.954317520519217*m.x25 <= 0.01) m.c190 = Constraint(expr= 1.85436770913357*m.x1 - 1.65807514511009*m.x2 + 7.3491187561573E-15*m.x3 + 1.65807514511008*m.x4 - 1.85436770913358*m.x5 + 0.415823381635528*m.x6 + 1.38931674091799*m.x7 - 1.96961550602442*m.x8 + 0.813473286151611*m.x9 + 1.05983852846641*m.x10 - 1.99878165403819*m.x11 + 1.17557050458495*m.x12 + 0.684040286651331*m.x13 - 1.94059145255199*m.x14 + 1.48628965095479*m.x15 + 0.27834620192013*m.x16 - 1.79758809259833*m.x17 + 1.73205080756888*m.x18 - 0.139512947488254*m.x19 - 1.57602150721344*m.x20 + 1.90211303259031*m.x21 - 0.551274711634*m.x22 - 1.28557521937308*m.x23 + 1.98904379073655*m.x24 - 0.938943125571782*m.x25 <= 0.01) m.c191 = Constraint(expr= 1.99809644316372*m.x1 - 1.07459921669364*m.x2 - 0.765366864730183*m.x3 + 1.95259201423987*m.x4 - 1.47455467362024*m.x5 - 0.261052384440105*m.x6 + 1.77402166635645*m.x7 - 1.77402166635644*m.x8 + 0.261052384440104*m.x9 + 1.47455467362025*m.x10 - 1.95259201423987*m.x11 + 0.765366864730176*m.x12 + 1.07459921669365*m.x13 - 1.99809644316372*m.x14 + 1.21752285801744*m.x15 + 0.601411599008549*m.x16 - 1.90743390149646*m.x17 + 1.58670668058247*m.x18 + 0.0872387747306726*m.x19 - 1.68678289162577*m.x20 + 1.84775906502257*m.x21 - 0.432879227876204*m.x22 - 1.35118041523132*m.x23 + 1.98288972274762*m.x24 - 0.923497226470068*m.x25 <= 0.01) m.c192 = Constraint(expr= 1.78201304837674*m.x1 - 0.312868930080464*m.x2 - 1.4142135623731*m.x3 + 1.97537668119028*m.x4 - 0.907980999479098*m.x5 - 0.907980999479092*m.x6 + 1.97537668119028*m.x7 - 1.4142135623731*m.x8 - 0.312868930080457*m.x9 + 1.78201304837674*m.x10 - 1.78201304837674*m.x11 + 0.312868930080462*m.x12 + 1.41421356237309*m.x13 - 1.97537668119028*m.x14 + 0.907980999479097*m.x15 + 0.907980999479094*m.x16 - 1.97537668119027*m.x17 + 1.41421356237309*m.x18 + 0.312868930080459*m.x19 - 1.78201304837674*m.x20 + 1.78201304837674*m.x21 - 0.312868930080462*m.x22 - 1.41421356237309*m.x23 + 1.97537668119028*m.x24 - 0.907980999479094*m.x25 <= 0.01) m.c193 = Constraint(expr= 1.24502927327524*m.x1 + 0.500760008108897*m.x2 - 1.84775906502258*m.x3 + 1.72325832088305*m.x4 - 0.226406427535803*m.x5 - 1.45074874202458*m.x6 + 1.97257120307446*m.x7 - 0.923497226470062*m.x8 - 0.861022193616595*m.x9 + 1.95984940924166*m.x10 - 1.497911441578*m.x11 - 0.156918191455692*m.x12 + 1.68678289162577*m.x13 - 1.87334437849679*m.x14 + 0.56803068940784*m.x15 + 1.18964557350269*m.x16 - 1.99992384612834*m.x17 + 1.21752285801744*m.x18 + 0.534476752156514*m.x19 - 1.86083513596405*m.x20 + 1.70528032870818*m.x21 - 0.191691505040447*m.x22 - 1.47455467362025*m.x23 + 1.96650981512791*m.x24 - 0.892395626219617*m.x25 <= 0.01) m.c194 = Constraint(expr= 0.483843791199341*m.x1 + 1.23132295065132*m.x2 - 2*m.x3 + 1.23132295065131*m.x4 + 0.483843791199334*m.x5 - 1.8270909152852*m.x6 + 1.76589518571785*m.x7 - 0.347296355333867*m.x8 - 1.33826121271772*m.x9 + 1.99512810051965*m.x10 - 1.11838580694149*m.x11 - 0.618033988749893*m.x12 + 1.87938524157182*m.x13 - 1.69609619231285*m.x14 + 0.209056926535306*m.x15 + 1.4386796006773*m.x16 - 1.98053613748314*m.x17 + m.x18 + 0.749213186831825*m.x19 - 1.92252339187664*m.x20 + 1.6180339887499*m.x21 - 0.0697989934050018*m.x22 - 1.53208888623796*m.x23 + 1.95629520146761*m.x24 - 0.876742293578155*m.x25 <= 0.01) m.c195 = Constraint(expr= - 0.364471050984282*m.x1 + 1.75763422532393*m.x2 - 1.84775906502258*m.x3 + 0.568030689407849*m.x4 + 1.13281247384965*m.x5 - 1.99383466746626*m.x6 + 1.37670915138751*m.x7 + 0.261052384440098*m.x8 - 1.70528032870818*m.x9 + 1.88528298218436*m.x10 - 0.667613718467551*m.x11 - 1.04499712943189*m.x12 + 1.98288972274762*m.x13 - 1.45074874202458*m.x14 - 0.156918191455685*m.x15 + 1.64825237724403*m.x16 - 1.91763946973639*m.x17 + 0.765366864730182*m.x18 + 0.954317520519214*m.x19 - 1.96650981512791*m.x20 + 1.52081193120006*m.x21 + 0.0523538966157442*m.x22 - 1.58670668058247*m.x23 + 1.94473984079535*m.x24 - 0.86102219361659*m.x25 <= 0.01) m.c196 = Constraint(expr= - 1.14715287270209*m.x1 + 1.99238939618349*m.x2 - 1.41421356237309*m.x3 - 0.174311485495319*m.x4 + 1.63830408857798*m.x5 - 1.93185165257814*m.x6 + 0.845236523481401*m.x7 + 0.845236523481395*m.x8 - 1.93185165257814*m.x9 + 1.63830408857798*m.x10 - 0.174311485495312*m.x11 - 1.4142135623731*m.x12 + 1.99238939618349*m.x13 - 1.14715287270209*m.x14 - 0.517638090205039*m.x15 + 1.8126155740733*m.x16 - 1.8126155740733*m.x17 + 0.517638090205042*m.x18 + 1.14715287270209*m.x19 - 1.99238939618349*m.x20 + 1.41421356237309*m.x21 + 0.174311485495316*m.x22 - 1.63830408857798*m.x23 + 1.93185165257814*m.x24 - 0.845236523481399*m.x25 <= 0.01) m.c197 = Constraint(expr= - 1.72325832088304*m.x1 + 1.8966473104124*m.x2 - 0.765366864730191*m.x3 - 0.892395626219614*m.x4 + 1.93629528075621*m.x5 - 1.64825237724403*m.x6 + 0.226406427535824*m.x7 + 1.35118041523132*m.x8 - 1.99931464995111*m.x9 + 1.27215644055553*m.x10 + 0.330095211721346*m.x11 - 1.70528032870818*m.x12 + 1.90743390149646*m.x13 - 0.797498137850493*m.x14 - 0.861022193616583*m.x15 + 1.92726090641725*m.x16 - 1.66777164413434*m.x17 + 0.261052384440102*m.x18 + 1.32524009643147*m.x19 - 1.99992384612834*m.x20 + 1.29889609666037*m.x21 + 0.29561882225922*m.x22 - 1.68678289162577*m.x23 + 1.91763946973639*m.x24 - 0.829386485312478*m.x25 <= 0.01) m.c198 = Constraint(expr= - 1.98904379073655*m.x1 + 1.48628965095479*m.x2 - 4.88620758385765E-16*m.x3 - 1.48628965095479*m.x4 + 1.98904379073655*m.x5 - 1.17557050458494*m.x6 - 0.415823381635514*m.x7 + 1.73205080756888*m.x8 - 1.90211303259031*m.x9 + 0.813473286151598*m.x10 + 0.813473286151606*m.x11 - 1.90211303259031*m.x12 + 1.73205080756888*m.x13 - 0.41582338163552*m.x14 - 1.17557050458495*m.x15 + 1.98904379073655*m.x16 - 1.48628965095479*m.x17 - 2.20560219973841E-15*m.x18 + 1.48628965095479*m.x19 - 1.98904379073655*m.x20 + 1.17557050458495*m.x21 + 0.41582338163552*m.x22 - 1.73205080756888*m.x23 + 1.90211303259031*m.x24 - 0.8134732861516*m.x25 <= 0.01) m.c199 = Constraint(expr= - 1.8966473104124*m.x1 + 0.829386485312479*m.x2 + 0.765366864730177*m.x3 - 1.87334437849679*m.x4 + 1.78986872320405*m.x5 - 0.568030689407855*m.x6 - 1.01507672592141*m.x7 + 1.95259201423987*m.x8 - 1.64825237724403*m.x9 + 0.295618822259227*m.x10 + 1.24502927327523*m.x11 - 1.99383466746626*m.x12 + 1.47455467362025*m.x13 - 0.0174530709967489*m.x14 - 1.45074874202457*m.x15 + 1.99626959684373*m.x16 - 1.27215644055553*m.x17 - 0.2610523844401*m.x18 + 1.62823103671264*m.x19 - 1.95984940924166*m.x20 + 1.0449971294319*m.x21 + 0.534476752156511*m.x22 - 1.77402166635644*m.x23 + 1.88528298218436*m.x24 - 0.797498137850493*m.x25 <= 0.01) m.c200 = Constraint(expr= - 1.46270740323833*m.x1 + 0.0349048128745656*m.x2 + 1.4142135623731*m.x3 - 1.99969539031278*m.x4 + 1.36399672012499*m.x5 + 0.104671912485888*m.x6 - 1.50941916044555*m.x7 + 1.99238939618349*m.x8 - 1.25864078209967*m.x9 - 0.243738686810295*m.x10 + 1.59727102009459*m.x11 - 1.97537668119028*m.x12 + 1.14715287270209*m.x13 + 0.381617990753089*m.x14 - 1.67734113589085*m.x15 + 1.94874012957047*m.x16 - 1.0300761498201*m.x17 - 0.51763809020504*m.x18 + 1.74923941427879*m.x19 - 1.91260951192607*m.x20 + 0.907980999479093*m.x21 + 0.651136308914314*m.x22 - 1.8126155740733*m.x23 + 1.8671608529944*m.x24 - 0.781462256978547*m.x25 <= 0.01) m.c201 = Constraint(expr= - 0.765366864730178*m.x1 - 0.76536686473017*m.x2 + 1.84775906502257*m.x3 - 1.84775906502258*m.x4 + 0.765366864730184*m.x5 + 0.765366864730177*m.x6 - 1.84775906502257*m.x7 + 1.84775906502257*m.x8 - 0.765366864730177*m.x9 - 0.765366864730171*m.x10 + 1.84775906502257*m.x11 - 1.84775906502258*m.x12 + 0.765366864730182*m.x13 + 0.765366864730178*m.x14 - 1.84775906502257*m.x15 + 1.84775906502258*m.x16 - 0.765366864730182*m.x17 - 0.765366864730179*m.x18 + 1.84775906502257*m.x19 - 1.84775906502257*m.x20 + 0.765366864730181*m.x21 + 0.76536686473018*m.x22 - 1.84775906502257*m.x23 + 1.84775906502257*m.x24 - 0.76536686473018*m.x25 <= 0.01) m.c202 = Constraint(expr= 0.0697989934050108*m.x1 - 1.43867960067731*m.x2 + 2*m.x3 - 1.4386796006773*m.x4 + 0.0697989934049907*m.x5 + 1.33826121271772*m.x6 - 1.99512810051965*m.x7 + 1.53208888623795*m.x8 - 0.209056926535308*m.x9 - 1.23132295065132*m.x10 + 1.98053613748314*m.x11 - 1.61803398874989*m.x12 + 0.347296355333859*m.x13 + 1.1183858069415*m.x14 - 1.95629520146761*m.x15 + 1.69609619231285*m.x16 - 0.483843791199332*m.x17 - m.x18 + 1.92252339187664*m.x19 - 1.76589518571785*m.x20 + 0.618033988749892*m.x21 + 0.876742293578155*m.x22 - 1.87938524157182*m.x23 + 1.8270909152852*m.x24 - 0.749213186831824*m.x25 <= 0.01) m.c203 = Constraint(expr= 0.892395626219619*m.x1 - 1.87334437849679*m.x2 + 1.84775906502257*m.x3 - 0.829386485312485*m.x4 - 0.634609312810183*m.x5 + 1.75763422532393*m.x6 - 1.93629528075622*m.x7 + 1.07459921669364*m.x8 + 0.36447105098429*m.x9 - 1.60771372123444*m.x10 + 1.98714371135318*m.x11 - 1.29889609666037*m.x12 - 0.0872387747306713*m.x13 + 1.42650089830836*m.x14 - 1.99931464995111*m.x15 + 1.49791144157801*m.x16 - 0.191691505040452*m.x17 - 1.21752285801744*m.x18 + 1.97257120307446*m.x19 - 1.66777164413434*m.x20 + 0.466890727711811*m.x21 + 0.984847120206934*m.x22 - 1.90743390149645*m.x23 + 1.80517056869972*m.x24 - 0.733002453448595*m.x25 <= 0.01) m.c204 = Constraint(expr= 1.55429192291394*m.x1 - 1.99725906950915*m.x2 + 1.41421356237311*m.x3 - 0.104671912485903*m.x4 - 1.25864078209966*m.x5 + 1.97537668119027*m.x6 - 1.67734113589085*m.x7 + 0.517638090205051*m.x8 + 0.907980999479086*m.x9 - 1.8671608529944*m.x10 + 1.86716085299441*m.x11 - 0.907980999479097*m.x12 - 0.517638090205039*m.x13 + 1.67734113589084*m.x14 - 1.97537668119028*m.x15 + 1.25864078209968*m.x16 + 0.104671912485883*m.x17 - 1.41421356237309*m.x18 + 1.99725906950915*m.x19 - 1.55429192291394*m.x20 + 0.312868930080464*m.x21 + 1.08927807003005*m.x22 - 1.93185165257814*m.x23 + 1.78201304837674*m.x24 - 0.716735899090601*m.x25 <= 0.01) m.c205 = Constraint(expr= 1.93629528075622*m.x1 - 1.78986872320405*m.x2 + 0.765366864730184*m.x3 + 0.63460931281019*m.x4 - 1.72325832088305*m.x5 + 1.96650981512791*m.x6 - 1.24502927327524*m.x7 - 0.0872387747306775*m.x8 + 1.37670915138751*m.x9 - 1.99079239673436*m.x10 + 1.62823103671264*m.x11 - 0.466890727711806*m.x12 - 0.923497226470069*m.x13 + 1.86083513596405*m.x14 - 1.88528298218436*m.x15 + 0.984847120206936*m.x16 + 0.398735868834396*m.x17 - 1.58670668058247*m.x18 + 1.99626959684373*m.x19 - 1.42650089830836*m.x20 + 0.156918191455688*m.x21 + 1.18964557350268*m.x22 - 1.95259201423987*m.x23 + 1.75763422532393*m.x24 - 0.700414762518935*m.x25 <= 0.01) m.c206 = Constraint(expr= 1.96961550602442*m.x1 - 1.28557521937309*m.x2 + 7.83897747581624E-15*m.x3 + 1.28557521937308*m.x4 - 1.96961550602441*m.x5 + 1.73205080756888*m.x6 - 0.68404028665135*m.x7 - 0.68404028665133*m.x8 + 1.73205080756888*m.x9 - 1.96961550602442*m.x10 + 1.28557521937308*m.x11 + 9.80955400591059E-16*m.x12 - 1.28557521937307*m.x13 + 1.96961550602442*m.x14 - 1.73205080756888*m.x15 + 0.684040286651342*m.x16 + 0.684040286651332*m.x17 - 1.73205080756888*m.x18 + 1.96961550602442*m.x19 - 1.28557521937308*m.x20 + 8.57252759403147E-16*m.x21 + 1.28557521937308*m.x22 - 1.96961550602442*m.x23 + 1.73205080756888*m.x24 - 0.684040286651338*m.x25 <= 0.01) m.c207 = Constraint(expr= 1.64825237724403*m.x1 - 0.568030689407843*m.x2 - 0.765366864730183*m.x3 + 1.75763422532393*m.x4 - 1.96650981512791*m.x5 + 1.29889609666036*m.x6 - 0.0523538966157395*m.x7 - 1.21752285801745*m.x8 + 1.94473984079536*m.x9 - 1.80517056869972*m.x10 + 0.861022193616594*m.x11 + 0.466890727711807*m.x12 - 1.58670668058247*m.x13 + 1.99931464995111*m.x14 - 1.52081193120006*m.x15 + 0.364471050984295*m.x16 + 0.954317520519217*m.x17 - 1.84775906502257*m.x18 + 1.91763946973639*m.x19 - 1.13281247384967*m.x20 - 0.15691819145569*m.x21 + 1.37670915138751*m.x22 - 1.98288972274762*m.x23 + 1.70528032870818*m.x24 - 0.667613718467542*m.x25 <= 0.01) m.c208 = Constraint(expr= 1.03007614982011*m.x1 + 0.243738686810286*m.x2 - 1.41421356237309*m.x3 + 1.98509230328264*m.x4 - 1.71433460140423*m.x5 + 0.716735899090611*m.x6 + 0.584743409445472*m.x7 - 1.63830408857798*m.x8 + 1.99725906950915*m.x9 - 1.50941916044554*m.x10 + 0.381617990753093*m.x11 + 0.907980999479087*m.x12 - 1.8126155740733*m.x13 + 1.94874012957047*m.x14 - 1.25864078209968*m.x15 + 0.0349048128745702*m.x16 + 1.2036300463041*m.x17 - 1.93185165257814*m.x18 + 1.84100970690488*m.x19 - 0.969619240492676*m.x20 - 0.312868930080459*m.x21 + 1.46270740323834*m.x22 - 1.99238939618349*m.x23 + 1.67734113589085*m.x24 - 0.651136308914314*m.x25 <= 0.01) m.c209 = Constraint(expr= 0.226406427535811*m.x1 + 1.01507672592141*m.x2 - 1.84775906502257*m.x3 + 1.93629528075621*m.x4 - 1.24502927327523*m.x5 + 0.0523538966157468*m.x6 + 1.16140591142188*m.x7 - 1.90743390149646*m.x8 + 1.88528298218436*m.x9 - 1.10387397062411*m.x10 - 0.12209707906971*m.x11 + 1.29889609666037*m.x12 - 1.95259201423987*m.x13 + 1.81992254175308*m.x14 - 0.954317520519214*m.x15 - 0.295618822259222*m.x16 + 1.42650089830836*m.x17 - 1.98288972274762*m.x18 + 1.7407113918798*m.x19 - 0.797498137850492*m.x20 - 0.466890727711813*m.x21 + 1.54324916677544*m.x22 - 1.99809644316372*m.x23 + 1.64825237724403*m.x24 - 0.634609312810184*m.x25 <= 0.01) m.c210 = Constraint(expr= - 0.61803398874989*m.x1 + 1.61803398874989*m.x2 - 2*m.x3 + 1.6180339887499*m.x4 - 0.618033988749899*m.x5 - 0.618033988749891*m.x6 + 1.61803398874989*m.x7 - 2*m.x8 + 1.6180339887499*m.x9 - 0.618033988749898*m.x10 - 0.618033988749892*m.x11 + 1.61803398874989*m.x12 - 2*m.x13 + 1.6180339887499*m.x14 - 0.618033988749897*m.x15 - 0.618033988749893*m.x16 + 1.61803398874989*m.x17 - 2*m.x18 + 1.6180339887499*m.x19 - 0.618033988749896*m.x20 - 0.618033988749894*m.x21 + 1.61803398874989*m.x22 - 2*m.x23 + 1.61803398874989*m.x24 - 0.618033988749895*m.x25 <= 0.01) m.c211 = Constraint(expr= - 1.35118041523132*m.x1 + 1.95259201423987*m.x2 - 1.84775906502257*m.x3 + 1.07459921669365*m.x4 + 0.0872387747306838*m.x5 - 1.21752285801745*m.x6 + 1.90743390149645*m.x7 - 1.90743390149645*m.x8 + 1.21752285801744*m.x9 - 0.0872387747306696*m.x10 - 1.07459921669365*m.x11 + 1.84775906502258*m.x12 - 1.95259201423987*m.x13 + 1.35118041523132*m.x14 - 0.261052384440103*m.x15 - 0.92349722647007*m.x16 + 1.77402166635645*m.x17 - 1.98288972274762*m.x18 + 1.47455467362025*m.x19 - 0.432879227876205*m.x20 - 0.76536686473018*m.x21 + 1.68678289162577*m.x22 - 1.99809644316372*m.x23 + 1.58670668058247*m.x24 - 0.601411599008546*m.x25 <= 0.01) m.c212 = Constraint(expr= - 1.84100970690488*m.x1 + 1.96325436689533*m.x2 - 1.41421356237309*m.x3 + 0.381617990753095*m.x4 + 0.781462256978547*m.x5 - 1.67734113589085*m.x6 + 1.99969539031278*m.x7 - 1.63830408857798*m.x8 + 0.716735899090598*m.x9 + 0.449902108687724*m.x10 - 1.46270740323834*m.x11 + 1.97537668119028*m.x12 - 1.8126155740733*m.x13 + 1.03007614982011*m.x14 + 0.10467191248589*m.x15 - 1.2036300463041*m.x16 + 1.89103715119863*m.x17 - 1.93185165257814*m.x18 + 1.31211805798102*m.x19 - 0.243738686810295*m.x20 - 0.907980999479094*m.x21 + 1.74923941427879*m.x22 - 1.99238939618349*m.x23 + 1.55429192291394*m.x24 - 0.584743409445474*m.x25 <= 0.01) m.c213 = Constraint(expr= - 1.99931464995111*m.x1 + 1.64825237724404*m.x2 - 0.765366864730191*m.x3 - 0.364471050984282*m.x4 + 1.3767091513875*m.x5 - 1.94473984079535*m.x6 + 1.88528298218436*m.x7 - 1.21752285801745*m.x8 + 0.156918191455705*m.x9 + 0.954317520519216*m.x10 - 1.75763422532393*m.x11 + 1.99383466746626*m.x12 - 1.58670668058247*m.x13 + 0.667613718467544*m.x14 + 0.466890727711808*m.x15 - 1.45074874202457*m.x16 + 1.96650981512791*m.x17 - 1.84775906502258*m.x18 + 1.13281247384967*m.x19 - 0.0523538966157477*m.x20 - 1.0449971294319*m.x21 + 1.80517056869972*m.x22 - 1.98288972274762*m.x23 + 1.52081193120006*m.x24 - 0.568030689407846*m.x25 <= 0.01) m.c214 = Constraint(expr= - 1.79758809259834*m.x1 + 1.05983852846641*m.x2 - 9.78479478044706E-16*m.x3 - 1.0598385284664*m.x4 + 1.79758809259834*m.x5 - 1.98904379073655*m.x6 + 1.57602150721344*m.x7 - 0.684040286651337*m.x8 - 0.415823381635514*m.x9 + 1.389316740918*m.x10 - 1.94059145255199*m.x11 + 1.90211303259031*m.x12 - 1.28557521937308*m.x13 + 0.278346201920134*m.x14 + 0.8134732861516*m.x15 - 1.65807514511008*m.x16 + 1.99878165403819*m.x17 - 1.73205080756888*m.x18 + 0.938943125571782*m.x19 + 0.139512947488251*m.x20 - 1.17557050458495*m.x21 + 1.85436770913358*m.x22 - 1.96961550602442*m.x23 + 1.48628965095479*m.x24 - 0.551274711633998*m.x25 <= 0.01) m.c215 = Constraint(expr= - 1.27215644055554*m.x1 + 0.295618822259229*m.x2 + 0.765366864730176*m.x3 - 1.60771372123443*m.x4 + 1.99079239673436*m.x5 - 1.80517056869972*m.x6 + 1.10387397062412*m.x7 - 0.0872387747306843*m.x8 - 0.954317520519209*m.x9 + 1.72325832088305*m.x10 - 1.99992384612834*m.x11 + 1.70528032870819*m.x12 - 0.923497226470074*m.x13 - 0.122097079069711*m.x14 + 1.13281247384966*m.x15 - 1.81992254175309*m.x16 + 1.98714371135318*m.x17 - 1.58670668058247*m.x18 + 0.733002453448599*m.x19 + 0.330095211721355*m.x20 - 1.29889609666036*m.x21 + 1.8966473104124*m.x22 - 1.95259201423987*m.x23 + 1.45074874202458*m.x24 - 0.534476752156514*m.x25 <= 0.01) m.c216 = Constraint(expr= - 0.517638090205046*m.x1 - 0.51763809020505*m.x2 + 1.4142135623731*m.x3 - 1.93185165257814*m.x4 + 1.93185165257814*m.x5 - 1.41421356237309*m.x6 + 0.517638090205038*m.x7 + 0.517638090205044*m.x8 - 1.4142135623731*m.x9 + 1.93185165257814*m.x10 - 1.93185165257814*m.x11 + 1.4142135623731*m.x12 - 0.517638090205043*m.x13 - 0.517638090205046*m.x14 + 1.4142135623731*m.x15 - 1.93185165257814*m.x16 + 1.93185165257814*m.x17 - 1.41421356237309*m.x18 + 0.517638090205042*m.x19 + 0.517638090205043*m.x20 - 1.4142135623731*m.x21 + 1.93185165257814*m.x22 - 1.93185165257814*m.x23 + 1.4142135623731*m.x24 - 0.517638090205041*m.x25 <= 0.01) m.c217 = Constraint(expr= 0.330095211721358*m.x1 - 1.24502927327524*m.x2 + 1.84775906502257*m.x3 - 1.98714371135318*m.x4 + 1.62823103671264*m.x5 - 0.861022193616602*m.x6 - 0.122097079069709*m.x7 + 1.07459921669364*m.x8 - 1.75763422532393*m.x9 + 1.99992384612834*m.x10 - 1.7407113918798*m.x11 + 1.0449971294319*m.x12 - 0.0872387747306691*m.x13 - 0.892395626219615*m.x14 + 1.64825237724403*m.x15 - 1.99079239673436*m.x16 + 1.83412014877025*m.x17 - 1.21752285801745*m.x18 + 0.295618822259225*m.x19 + 0.700414762518932*m.x20 - 1.52081193120006*m.x21 + 1.95984940924166*m.x22 - 1.90743390149645*m.x23 + 1.37670915138751*m.x24 - 0.500760008108883*m.x25 <= 0.01) m.c218 = Constraint(expr= 1.1183858069415*m.x1 - 1.76589518571785*m.x2 + 2*m.x3 - 1.76589518571785*m.x4 + 1.11838580694149*m.x5 - 0.209056926535309*m.x6 - 0.749213186831826*m.x7 + 1.53208888623796*m.x8 - 1.95629520146761*m.x9 + 1.92252339187664*m.x10 - 1.4386796006773*m.x11 + 0.618033988749891*m.x12 + 0.347296355333868*m.x13 - 1.23132295065132*m.x14 + 1.8270909152852*m.x15 - 1.99512810051965*m.x16 + 1.69609619231285*m.x17 - 0.999999999999997*m.x18 + 0.0697989934050025*m.x19 + 0.876742293578157*m.x20 - 1.61803398874989*m.x21 + 1.98053613748314*m.x22 - 1.87938524157182*m.x23 + 1.33826121271772*m.x24 - 0.483843791199335*m.x25 <= 0.01) m.c219 = Constraint(expr= 1.70528032870818*m.x1 - 1.99383466746626*m.x2 + 1.84775906502257*m.x3 - 1.29889609666037*m.x4 + 0.466890727711814*m.x5 + 0.466890727711806*m.x6 - 1.29889609666036*m.x7 + 1.84775906502257*m.x8 - 1.99383466746626*m.x9 + 1.70528032870818*m.x10 - 1.0449971294319*m.x11 + 0.15691819145569*m.x12 + 0.765366864730178*m.x13 - 1.52081193120006*m.x14 + 1.94473984079535*m.x15 - 1.94473984079535*m.x16 + 1.52081193120006*m.x17 - 0.765366864730182*m.x18 - 0.156918191455686*m.x19 + 1.0449971294319*m.x20 - 1.70528032870818*m.x21 + 1.99383466746626*m.x22 - 1.84775906502257*m.x23 + 1.29889609666037*m.x24 - 0.466890727711811*m.x25 <= 0.01) m.c220 = Constraint(expr= 1.98509230328264*m.x1 - 1.89103715119863*m.x2 + 1.41421356237309*m.x3 - 0.651136308914309*m.x4 - 0.243738686810307*m.x5 + 1.08927807003006*m.x6 - 1.71433460140422*m.x7 + 1.99238939618349*m.x8 - 1.8671608529944*m.x9 + 1.36399672012499*m.x10 - 0.584743409445472*m.x11 - 0.312868930080471*m.x12 + 1.14715287270209*m.x13 - 1.74923941427879*m.x14 + 1.99725906950915*m.x15 - 1.84100970690488*m.x16 + 1.31211805798101*m.x17 - 0.517638090205042*m.x18 - 0.381617990753089*m.x19 + 1.2036300463041*m.x20 - 1.78201304837674*m.x21 + 1.99969539031278*m.x22 - 1.8126155740733*m.x23 + 1.25864078209967*m.x24 - 0.44990210868773*m.x25 <= 0.01) m.c221 = Constraint(expr= 1.90743390149645*m.x1 - 1.47455467362025*m.x2 + 0.765366864730185*m.x3 + 0.0872387747306691*m.x4 - 0.923497226470068*m.x5 + 1.58670668058247*m.x6 - 1.95259201423986*m.x7 + 1.95259201423987*m.x8 - 1.58670668058247*m.x9 + 0.923497226470068*m.x10 - 0.0872387747306696*m.x11 - 0.765366864730184*m.x12 + 1.47455467362024*m.x13 - 1.90743390149645*m.x14 + 1.98288972274762*m.x15 - 1.68678289162577*m.x16 + 1.07459921669365*m.x17 - 0.261052384440103*m.x18 - 0.601411599008543*m.x19 + 1.35118041523132*m.x20 - 1.84775906502257*m.x21 + 1.99809644316372*m.x22 - 1.77402166635644*m.x23 + 1.21752285801744*m.x24 - 0.432879227876206*m.x25 <= 0.01) m.c222 = Constraint(expr= 1.4862896509548*m.x1 - 0.813473286151606*m.x2 + 8.32883619547518E-15*m.x3 + 0.813473286151591*m.x4 - 1.48628965095478*m.x5 + 1.9021130325903*m.x6 - 1.98904379073655*m.x7 + 1.73205080756888*m.x8 - 1.17557050458495*m.x9 + 0.415823381635528*m.x10 + 0.415823381635508*m.x11 - 1.17557050458494*m.x12 + 1.73205080756888*m.x13 - 1.98904379073655*m.x14 + 1.90211303259031*m.x15 - 1.48628965095479*m.x16 + 0.813473286151603*m.x17 - 5.14475451769206E-15*m.x18 - 0.8134732861516*m.x19 + 1.48628965095479*m.x20 - 1.90211303259031*m.x21 + 1.98904379073655*m.x22 - 1.73205080756888*m.x23 + 1.17557050458495*m.x24 - 0.415823381635519*m.x25 <= 0.01) m.c223 = Constraint(expr= 0.797498137850503*m.x1 - 0.0174530709967376*m.x2 - 0.765366864730182*m.x3 + 1.42650089830836*m.x4 - 1.86083513596405*m.x5 + 1.99931464995111*m.x6 - 1.81992254175309*m.x7 + 1.35118041523132*m.x8 - 0.667613718467539*m.x9 - 0.12209707906971*m.x10 + 0.892395626219621*m.x11 - 1.52081193120006*m.x12 + 1.90743390149645*m.x13 - 1.99079239673436*m.x14 + 1.75763422532393*m.x15 - 1.24502927327524*m.x16 + 0.53447675215651*m.x17 + 0.2610523844401*m.x18 - 1.01507672592141*m.x19 + 1.60771372123443*m.x20 - 1.94473984079535*m.x21 + 1.97257120307446*m.x22 - 1.68678289162577*m.x23 + 1.13281247384967*m.x24 - 0.398735868834394*m.x25 <= 0.01) m.c224 = Constraint(expr= - 0.0349048128745631*m.x1 + 0.781462256978533*m.x2 - 1.41421356237309*m.x3 + 1.84100970690488*m.x4 - 1.99969539031278*m.x5 + 1.86716085299441*m.x6 - 1.46270740323834*m.x7 + 0.845236523481401*m.x8 - 0.104671912485888*m.x9 - 0.651136308914301*m.x10 + 1.31211805798101*m.x11 - 1.78201304837673*m.x12 + 1.99238939618349*m.x13 - 1.91260951192607*m.x14 + 1.55429192291394*m.x15 - 0.96961924049268*m.x16 + 0.243738686810299*m.x17 + 0.517638090205039*m.x18 - 1.2036300463041*m.x19 + 1.71433460140422*m.x20 - 1.97537668119028*m.x21 + 1.94874012957047*m.x22 - 1.63830408857798*m.x23 + 1.08927807003005*m.x24 - 0.38161799075309*m.x25 <= 0.01) m.c225 = Constraint(expr= - 0.861022193616593*m.x1 + 1.45074874202459*m.x2 - 1.84775906502257*m.x3 + 1.99931464995111*m.x4 - 1.88528298218435*m.x5 + 1.52081193120006*m.x6 - 0.954317520519216*m.x7 + 0.261052384440105*m.x8 + 0.466890727711807*m.x9 - 1.13281247384967*m.x10 + 1.64825237724403*m.x11 - 1.94473984079535*m.x12 + 1.98288972274762*m.x13 - 1.75763422532393*m.x14 + 1.29889609666037*m.x15 - 0.667613718467544*m.x16 - 0.0523538966157483*m.x17 + 0.765366864730179*m.x18 - 1.37670915138751*m.x19 + 1.80517056869972*m.x20 - 1.99383466746626*m.x21 + 1.91763946973639*m.x22 - 1.58670668058247*m.x23 + 1.0449971294319*m.x24 - 0.364471050984295*m.x25 <= 0.01) m.c226 = Constraint(expr= - 1.53208888623794*m.x1 + 1.87938524157181*m.x2 - 2*m.x3 + 1.87938524157182*m.x4 - 1.53208888623796*m.x5 + m.x6 - 0.347296355333868*m.x7 - 0.34729635533386*m.x8 + 0.999999999999993*m.x9 - 1.53208888623795*m.x10 + 1.87938524157181*m.x11 - 2*m.x12 + 1.87938524157182*m.x13 - 1.53208888623796*m.x14 + m.x15 - 0.347296355333866*m.x16 - 0.347296355333855*m.x17 + m.x18 - 1.53208888623796*m.x19 + 1.87938524157182*m.x20 - 2*m.x21 + 1.87938524157182*m.x22 - 1.53208888623796*m.x23 + m.x24 - 0.347296355333861*m.x25 <= 0.01) m.c227 = Constraint(expr= - 1.92726090641725*m.x1 + 1.99626959684373*m.x2 - 1.84775906502257*m.x3 + 1.497911441578*m.x4 - 0.984847120206926*m.x5 + 0.364471050984298*m.x6 + 0.29561882225922*m.x7 - 0.923497226470068*m.x8 + 1.45074874202458*m.x9 - 1.81992254175309*m.x10 + 1.99079239673436*m.x11 - 1.94473984079535*m.x12 + 1.68678289162577*m.x13 - 1.24502927327524*m.x14 + 0.667613718467538*m.x15 - 0.0174530709967489*m.x16 - 0.634609312810185*m.x17 + 1.21752285801744*m.x18 - 1.66777164413434*m.x19 + 1.93629528075622*m.x20 - 1.99383466746626*m.x21 + 1.83412014877025*m.x22 - 1.47455467362025*m.x23 + 0.954317520519216*m.x24 - 0.330095211721355*m.x25 <= 0.01) m.c228 = Constraint(expr= - 1.97537668119028*m.x1 + 1.78201304837674*m.x2 - 1.4142135623731*m.x3 + 0.907980999479093*m.x4 - 0.312868930080464*m.x5 - 0.312868930080456*m.x6 + 0.907980999479085*m.x7 - 1.4142135623731*m.x8 + 1.78201304837673*m.x9 - 1.97537668119027*m.x10 + 1.97537668119028*m.x11 - 1.78201304837673*m.x12 + 1.4142135623731*m.x13 - 0.907980999479097*m.x14 + 0.312868930080462*m.x15 + 0.312868930080458*m.x16 - 0.907980999479093*m.x17 + 1.41421356237309*m.x18 - 1.78201304837674*m.x19 + 1.97537668119027*m.x20 - 1.97537668119028*m.x21 + 1.78201304837674*m.x22 - 1.4142135623731*m.x23 + 0.907980999479094*m.x24 - 0.312868930080462*m.x25 <= 0.01) m.c229 = Constraint(expr= - 1.66777164413433*m.x1 + 1.27215644055553*m.x2 - 0.765366864730165*m.x3 + 0.191691505040441*m.x4 + 0.398735868834393*m.x5 - 0.954317520519221*m.x6 + 1.42650089830837*m.x7 - 1.77402166635644*m.x8 + 1.96650981512791*m.x9 - 1.98714371135317*m.x10 + 1.83412014877025*m.x11 - 1.52081193120006*m.x12 + 1.07459921669364*m.x13 - 0.534476752156504*m.x14 - 0.0523538966157478*m.x15 + 0.634609312810185*m.x16 - 1.16140591142188*m.x17 + 1.58670668058247*m.x18 - 1.8733443784968*m.x19 + 1.99626959684373*m.x20 - 1.94473984079535*m.x21 + 1.72325832088305*m.x22 - 1.35118041523132*m.x23 + 0.86102219361659*m.x24 - 0.295618822259221*m.x25 <= 0.01) m.c230 = Constraint(expr= - 1.0598385284664*m.x1 + 0.551274711634001*m.x2 - 1.56791929129057E-14*m.x3 - 0.551274711633998*m.x4 + 1.05983852846641*m.x5 - 1.48628965095479*m.x6 + 1.79758809259834*m.x7 - 1.96961550602442*m.x8 + 1.98904379073655*m.x9 - 1.85436770913358*m.x10 + 1.57602150721345*m.x11 - 1.17557050458495*m.x12 + 0.684040286651343*m.x13 - 0.139512947488255*m.x14 - 0.415823381635515*m.x15 + 0.938943125571779*m.x16 - 1.38931674091799*m.x17 + 1.73205080756888*m.x18 - 1.94059145255199*m.x19 + 1.99878165403819*m.x20 - 1.90211303259031*m.x21 + 1.65807514511008*m.x22 - 1.28557521937308*m.x23 + 0.8134732861516*m.x24 - 0.278346201920131*m.x25 <= 0.01) m.c231 = Constraint(expr= - 0.261052384440114*m.x1 - 0.261052384440103*m.x2 + 0.765366864730163*m.x3 - 1.21752285801743*m.x4 + 1.58670668058246*m.x5 - 1.84775906502257*m.x6 + 1.98288972274762*m.x7 - 1.98288972274762*m.x8 + 1.84775906502258*m.x9 - 1.58670668058247*m.x10 + 1.21752285801745*m.x11 - 0.76536686473019*m.x12 + 0.261052384440104*m.x13 + 0.261052384440099*m.x14 - 0.765366864730172*m.x15 + 1.21752285801744*m.x16 - 1.58670668058247*m.x17 + 1.84775906502257*m.x18 - 1.98288972274762*m.x19 + 1.98288972274762*m.x20 - 1.84775906502257*m.x21 + 1.58670668058247*m.x22 - 1.21752285801744*m.x23 + 0.765366864730181*m.x24 - 0.261052384440103*m.x25 <= 0.01) m.c232 = Constraint(expr= 0.58474340944547*m.x1 - 1.03007614982011*m.x2 + 1.4142135623731*m.x3 - 1.71433460140422*m.x4 + 1.91260951192607*m.x5 - 1.99725906950915*m.x6 + 1.96325436689533*m.x7 - 1.8126155740733*m.x8 + 1.55429192291394*m.x9 - 1.20363004630409*m.x10 + 0.781462256978554*m.x11 - 0.312868930080463*m.x12 - 0.17431148549532*m.x13 + 0.651136308914309*m.x14 - 1.08927807003005*m.x15 + 1.46270740323834*m.x16 - 1.74923941427879*m.x17 + 1.93185165257814*m.x18 - 1.99969539031278*m.x19 + 1.94874012957047*m.x20 - 1.78201304837674*m.x21 + 1.50941916044554*m.x22 - 1.14715287270209*m.x23 + 0.716735899090601*m.x24 - 0.243738686810295*m.x25 <= 0.01) m.c233 = Constraint(expr= 1.32524009643146*m.x1 - 1.62823103671264*m.x2 + 1.84775906502256*m.x3 - 1.97257120307446*m.x4 + 1.99626959684373*m.x5 - 1.91763946973639*m.x6 + 1.7407113918798*m.x7 - 1.47455467362025*m.x8 + 1.13281247384967*m.x9 - 0.733002453448601*m.x10 + 0.295618822259227*m.x11 + 0.156918191455684*m.x12 - 0.601411599008541*m.x13 + 1.0150767259214*m.x14 - 1.3767091513875*m.x15 + 1.66777164413433*m.x16 - 1.87334437849679*m.x17 + 1.98288972274762*m.x18 - 1.99079239673436*m.x19 + 1.8966473104124*m.x20 - 1.70528032870819*m.x21 + 1.42650089830836*m.x22 - 1.07459921669365*m.x23 + 0.667613718467542*m.x24 - 0.226406427535814*m.x25 <= 0.01) m.c234 = Constraint(expr= 1.82709091528521*m.x1 - 1.95629520146761*m.x2 + 2*m.x3 - 1.95629520146761*m.x4 + 1.8270909152852*m.x5 - 1.61803398874989*m.x6 + 1.33826121271772*m.x7 - 0.999999999999993*m.x8 + 0.618033988749892*m.x9 - 0.209056926535308*m.x10 - 0.209056926535301*m.x11 + 0.618033988749899*m.x12 - m.x13 + 1.33826121271771*m.x14 - 1.61803398874989*m.x15 + 1.8270909152852*m.x16 - 1.95629520146761*m.x17 + 2*m.x18 - 1.95629520146761*m.x19 + 1.8270909152852*m.x20 - 1.6180339887499*m.x21 + 1.33826121271772*m.x22 - m.x23 + 0.618033988749895*m.x24 - 0.209056926535307*m.x25 <= 0.01) m.c235 = Constraint(expr= 1.99992384612834*m.x1 - 1.95984940924166*m.x2 + 1.84775906502257*m.x3 - 1.66777164413434*m.x4 + 1.42650089830837*m.x5 - 1.13281247384967*m.x6 + 0.797498137850502*m.x7 - 0.432879227876211*m.x8 + 0.0523538966157468*m.x9 + 0.330095211721345*m.x10 - 0.70041476251893*m.x11 + 1.0449971294319*m.x12 - 1.35118041523131*m.x13 + 1.60771372123443*m.x14 - 1.80517056869972*m.x15 + 1.93629528075621*m.x16 - 1.99626959684373*m.x17 + 1.98288972274762*m.x18 - 1.8966473104124*m.x19 + 1.7407113918798*m.x20 - 1.52081193120006*m.x21 + 1.24502927327524*m.x22 - 0.923497226470069*m.x23 + 0.568030689407845*m.x24 - 0.191691505040448*m.x25 <= 0.01) m.c236 = Constraint(expr= 1.8126155740733*m.x1 - 1.63830408857798*m.x2 + 1.4142135623731*m.x3 - 1.14715287270208*m.x4 + 0.845236523481402*m.x5 - 0.517638090205032*m.x6 + 0.17431148549532*m.x7 + 0.174311485495326*m.x8 - 0.517638090205037*m.x9 + 0.845236523481408*m.x10 - 1.14715287270209*m.x11 + 1.4142135623731*m.x12 - 1.63830408857798*m.x13 + 1.8126155740733*m.x14 - 1.93185165257814*m.x15 + 1.99238939618349*m.x16 - 1.99238939618349*m.x17 + 1.93185165257814*m.x18 - 1.8126155740733*m.x19 + 1.63830408857798*m.x20 - 1.41421356237309*m.x21 + 1.14715287270209*m.x22 - 0.845236523481399*m.x23 + 0.517638090205041*m.x24 - 0.174311485495316*m.x25 <= 0.01) m.c237 = Constraint(expr= 1.29889609666036*m.x1 - 1.04499712943191*m.x2 + 0.765366864730185*m.x3 - 0.466890727711808*m.x4 + 0.156918191455692*m.x5 + 0.156918191455683*m.x6 - 0.466890727711813*m.x7 + 0.765366864730177*m.x8 - 1.04499712943189*m.x9 + 1.29889609666037*m.x10 - 1.52081193120006*m.x11 + 1.70528032870818*m.x12 - 1.84775906502257*m.x13 + 1.94473984079535*m.x14 - 1.99383466746626*m.x15 + 1.99383466746626*m.x16 - 1.94473984079535*m.x17 + 1.84775906502258*m.x18 - 1.70528032870819*m.x19 + 1.52081193120006*m.x20 - 1.29889609666037*m.x21 + 1.0449971294319*m.x22 - 0.765366864730181*m.x23 + 0.46689072771181*m.x24 - 0.15691819145569*m.x25 <= 0.01) m.c238 = Constraint(expr= 0.551274711633988*m.x1 - 0.278346201920116*m.x2 - 1.96030145152699E-14*m.x3 + 0.278346201920126*m.x4 - 0.551274711633998*m.x5 + 0.813473286151604*m.x6 - 1.05983852846642*m.x7 + 1.28557521937308*m.x8 - 1.48628965095479*m.x9 + 1.65807514511009*m.x10 - 1.79758809259834*m.x11 + 1.90211303259031*m.x12 - 1.96961550602442*m.x13 + 1.99878165403819*m.x14 - 1.98904379073655*m.x15 + 1.94059145255199*m.x16 - 1.85436770913357*m.x17 + 1.73205080756888*m.x18 - 1.57602150721344*m.x19 + 1.389316740918*m.x20 - 1.17557050458494*m.x21 + 0.938943125571782*m.x22 - 0.684040286651337*m.x23 + 0.415823381635518*m.x24 - 0.13951294748825*m.x25 <= 0.01) m.c239 = Constraint(expr= - 0.295618822259211*m.x1 + 0.534476752156503*m.x2 - 0.765366864730169*m.x3 + 0.984847120206924*m.x4 - 1.18964557350268*m.x5 + 1.37670915138751*m.x6 - 1.54324916677544*m.x7 + 1.68678289162577*m.x8 - 1.80517056869972*m.x9 + 1.8966473104124*m.x10 - 1.95984940924166*m.x11 + 1.99383466746626*m.x12 - 1.99809644316372*m.x13 + 1.97257120307446*m.x14 - 1.91763946973639*m.x15 + 1.83412014877025*m.x16 - 1.72325832088305*m.x17 + 1.58670668058247*m.x18 - 1.42650089830836*m.x19 + 1.24502927327524*m.x20 - 1.0449971294319*m.x21 + 0.829386485312479*m.x22 - 0.601411599008546*m.x23 + 0.364471050984296*m.x24 - 0.122097079069714*m.x25 <= 0.01) m.c240 = Constraint(expr= - 1.08927807003005*m.x1 + 1.25864078209967*m.x2 - 1.41421356237308*m.x3 + 1.55429192291393*m.x4 - 1.67734113589084*m.x5 + 1.78201304837673*m.x6 - 1.8671608529944*m.x7 + 1.93185165257813*m.x8 - 1.97537668119027*m.x9 + 1.99725906950915*m.x10 - 1.99725906950915*m.x11 + 1.97537668119028*m.x12 - 1.93185165257814*m.x13 + 1.86716085299441*m.x14 - 1.78201304837674*m.x15 + 1.67734113589085*m.x16 - 1.55429192291394*m.x17 + 1.4142135623731*m.x18 - 1.25864078209968*m.x19 + 1.08927807003006*m.x20 - 0.907980999479096*m.x21 + 0.716735899090602*m.x22 - 0.517638090205043*m.x23 + 0.312868930080462*m.x24 - 0.104671912485888*m.x25 <= 0.01) m.c241 = Constraint(expr= - 1.68678289162577*m.x1 + 1.77402166635644*m.x2 - 1.84775906502258*m.x3 + 1.90743390149645*m.x4 - 1.95259201423987*m.x5 + 1.98288972274762*m.x6 - 1.99809644316372*m.x7 + 1.99809644316372*m.x8 - 1.98288972274762*m.x9 + 1.95259201423987*m.x10 - 1.90743390149645*m.x11 + 1.84775906502257*m.x12 - 1.77402166635644*m.x13 + 1.68678289162577*m.x14 - 1.58670668058247*m.x15 + 1.47455467362025*m.x16 - 1.35118041523132*m.x17 + 1.21752285801744*m.x18 - 1.07459921669365*m.x19 + 0.923497226470066*m.x20 - 0.765366864730181*m.x21 + 0.601411599008545*m.x22 - 0.432879227876206*m.x23 + 0.261052384440103*m.x24 - 0.087238774730672*m.x25 <= 0.01) m.c242 = Constraint(expr= - 1.98053613748314*m.x1 + 1.99512810051965*m.x2 - 2*m.x3 + 1.99512810051965*m.x4 - 1.98053613748314*m.x5 + 1.95629520146761*m.x6 - 1.92252339187664*m.x7 + 1.87938524157182*m.x8 - 1.82709091528521*m.x9 + 1.76589518571785*m.x10 - 1.69609619231285*m.x11 + 1.6180339887499*m.x12 - 1.53208888623796*m.x13 + 1.43867960067731*m.x14 - 1.33826121271772*m.x15 + 1.23132295065132*m.x16 - 1.1183858069415*m.x17 + m.x18 - 0.87674229357816*m.x19 + 0.749213186831824*m.x20 - 0.618033988749896*m.x21 + 0.483843791199338*m.x22 - 0.347296355333861*m.x23 + 0.209056926535308*m.x24 - 0.0697989934050022*m.x25 <= 0.01) m.c243 = Constraint(expr= - 1.91763946973639*m.x1 + 1.88528298218436*m.x2 - 1.84775906502257*m.x3 + 1.80517056869972*m.x4 - 1.75763422532393*m.x5 + 1.70528032870818*m.x6 - 1.64825237724403*m.x7 + 1.58670668058247*m.x8 - 1.52081193120006*m.x9 + 1.45074874202457*m.x10 - 1.37670915138751*m.x11 + 1.29889609666036*m.x12 - 1.21752285801744*m.x13 + 1.13281247384967*m.x14 - 1.0449971294319*m.x15 + 0.954317520519214*m.x16 - 0.861022193616587*m.x17 + 0.765366864730182*m.x18 - 0.667613718467544*m.x19 + 0.568030689407846*m.x20 - 0.466890727711811*m.x21 + 0.364471050984294*m.x22 - 0.261052384440103*m.x23 + 0.156918191455689*m.x24 - 0.0523538966157463*m.x25 <= 0.01) m.c244 = Constraint(expr= - 1.50941916044555*m.x1 + 1.46270740323834*m.x2 - 1.41421356237309*m.x3 + 1.36399672012499*m.x4 - 1.31211805798102*m.x5 + 1.25864078209968*m.x6 - 1.20363004630411*m.x7 + 1.1471528727021*m.x8 - 1.08927807003006*m.x9 + 1.03007614982011*m.x10 - 0.969619240492675*m.x11 + 0.907980999479092*m.x12 - 0.845236523481407*m.x13 + 0.781462256978553*m.x14 - 0.716735899090603*m.x15 + 0.651136308914314*m.x16 - 0.584743409445478*m.x17 + 0.517638090205043*m.x18 - 0.449902108687735*m.x19 + 0.381617990753092*m.x20 - 0.312868930080465*m.x21 + 0.243738686810295*m.x22 - 0.174311485495317*m.x23 + 0.104671912485889*m.x24 - 0.0349048128745672*m.x25 <= 0.01) m.c245 = Constraint(expr= - 0.829386485312474*m.x1 + 0.79749813785049*m.x2 - 0.765366864730179*m.x3 + 0.733002453448596*m.x4 - 0.700414762518938*m.x5 + 0.667613718467533*m.x6 - 0.634609312810177*m.x7 + 0.601411599008541*m.x8 - 0.568030689407842*m.x9 + 0.534476752156512*m.x10 - 0.500760008108883*m.x11 + 0.466890727711813*m.x12 - 0.43287922787621*m.x13 + 0.398735868834387*m.x14 - 0.364471050984289*m.x15 + 0.330095211721351*m.x16 - 0.295618822259219*m.x17 + 0.261052384440103*m.x18 - 0.226406427535815*m.x19 + 0.191691505040444*m.x20 - 0.156918191455688*m.x21 + 0.122097079069714*m.x22 - 0.0872387747306707*m.x23 + 0.052353896615747*m.x24 - 0.0174530709967478*m.x25 <= 0.01) m.c246 = Constraint(expr= - 1.66589103522235E-14*m.x1 - 4.90230108040894E-15*m.x2 - 1.95819691736259E-15*m.x3 + 8.81869491513412E-15*m.x4 - 1.56791929129057E-14*m.x5 + 8.32883619547518E-15*m.x6 - 9.78479478044706E-16*m.x7 + 7.83897747581624E-15*m.x8 - 4.88620758385765E-16*m.x9 + 7.3491187561573E-15*m.x10 + 1.23796127317672E-18*m.x11 + 6.85926003649835E-15*m.x12 + 4.91096680932118E-16*m.x13 + 6.36940131683941E-15*m.x14 + 9.80955400591059E-16*m.x15 + 5.87954259718047E-15*m.x16 + 1.47081412025E-15*m.x17 + 5.38968387752153E-15*m.x18 + 1.96067283990894E-15*m.x19 + 4.89982515786259E-15*m.x20 - 1.10218211923262E-15*m.x21 + 8.57252759403147E-16*m.x22 - 6.12323399573677E-16*m.x23 + 3.67394039744206E-16*m.x24 - 1.22464679914735E-16*m.x25 <= 0.01) m.c247 = Constraint(expr= 1.00000000000001*m.x1 + 0.999999999999986*m.x2 - 2*m.x3 + 1.00000000000001*m.x4 + 0.999999999999987*m.x5 - 2*m.x6 + m.x7 + 0.999999999999987*m.x8 - 2*m.x9 + m.x10 + 0.999999999999994*m.x11 - 2*m.x12 + m.x13 + 0.999999999999994*m.x14 - 2*m.x15 + m.x16 + 0.999999999999995*m.x17 - 2*m.x18 + m.x19 + 0.999999999999998*m.x20 - 2*m.x21 + m.x22 + m.x23 - 2*m.x24 + m.x25 <= 0.01) m.c248 = Constraint(expr= 0.191691505040447*m.x1 + 1.60771372123444*m.x2 - 1.84775906502257*m.x3 + 0.295618822259221*m.x4 + 1.54324916677544*m.x5 - 1.88528298218436*m.x6 + 0.398735868834394*m.x7 + 1.47455467362025*m.x8 - 1.91763946973639*m.x9 + 0.500760008108882*m.x10 + 1.4018185285997*m.x11 - 1.94473984079535*m.x12 + 0.601411599008546*m.x13 + 1.32524009643148*m.x14 - 1.96650981512791*m.x15 + 0.700414762518935*m.x16 + 1.24502927327524*m.x17 - 1.98288972274762*m.x18 + 0.797498137850492*m.x19 + 1.16140591142188*m.x20 - 1.99383466746626*m.x21 + 0.892395626219618*m.x22 + 1.07459921669365*m.x23 - 1.99931464995111*m.x24 + 0.984847120206934*m.x25 <= 0.01) m.c249 = Constraint(expr= - 0.651136308914307*m.x1 + 1.94874012957047*m.x2 - 1.4142135623731*m.x3 - 0.449902108687723*m.x4 + 1.89103715119863*m.x5 - 1.55429192291394*m.x6 - 0.243738686810287*m.x7 + 1.81261557407329*m.x8 - 1.67734113589085*m.x9 - 0.0349048128745587*m.x10 + 1.71433460140422*m.x11 - 1.78201304837674*m.x12 + 0.174311485495318*m.x13 + 1.59727102009458*m.x14 - 1.86716085299441*m.x15 + 0.381617990753092*m.x16 + 1.46270740323834*m.x17 - 1.93185165257814*m.x18 + 0.584743409445477*m.x19 + 1.31211805798101*m.x20 - 1.97537668119028*m.x21 + 0.781462256978548*m.x22 + 1.14715287270209*m.x23 - 1.99725906950915*m.x24 + 0.969619240492674*m.x25 <= 0.01) m.c250 = Constraint(expr= - 1.37670915138751*m.x1 + 1.96650981512791*m.x2 - 0.765366864730171*m.x3 - 1.13281247384967*m.x4 + 1.99931464995111*m.x5 - 1.04499712943189*m.x6 - 0.861022193616589*m.x7 + 1.98288972274762*m.x8 - 1.29889609666036*m.x9 - 0.568030689407843*m.x10 + 1.91763946973639*m.x11 - 1.52081193120006*m.x12 - 0.261052384440106*m.x13 + 1.80517056869972*m.x14 - 1.70528032870818*m.x15 + 0.0523538966157446*m.x16 + 1.64825237724403*m.x17 - 1.84775906502257*m.x18 + 0.364471050984295*m.x19 + 1.45074874202458*m.x20 - 1.94473984079535*m.x21 + 0.667613718467541*m.x22 + 1.21752285801744*m.x23 - 1.99383466746626*m.x24 + 0.954317520519217*m.x25 <= 0.01) m.c251 = Constraint(expr= - 1.85436770913357*m.x1 + 1.65807514511009*m.x2 - 7.3491187561573E-15*m.x3 - 1.65807514511008*m.x4 + 1.85436770913358*m.x5 - 0.415823381635528*m.x6 - 1.38931674091799*m.x7 + 1.96961550602442*m.x8 - 0.813473286151611*m.x9 - 1.05983852846641*m.x10 + 1.99878165403819*m.x11 - 1.17557050458495*m.x12 - 0.684040286651331*m.x13 + 1.94059145255199*m.x14 - 1.48628965095479*m.x15 - 0.27834620192013*m.x16 + 1.79758809259833*m.x17 - 1.73205080756888*m.x18 + 0.139512947488254*m.x19 + 1.57602150721344*m.x20 - 1.90211303259031*m.x21 + 0.551274711634*m.x22 + 1.28557521937308*m.x23 - 1.98904379073655*m.x24 + 0.938943125571782*m.x25 <= 0.01) m.c252 = Constraint(expr= - 1.99809644316372*m.x1 + 1.07459921669364*m.x2 + 0.765366864730183*m.x3 - 1.95259201423987*m.x4 + 1.47455467362024*m.x5 + 0.261052384440105*m.x6 - 1.77402166635645*m.x7 + 1.77402166635644*m.x8 - 0.261052384440104*m.x9 - 1.47455467362025*m.x10 + 1.95259201423987*m.x11 - 0.765366864730176*m.x12 - 1.07459921669365*m.x13 + 1.99809644316372*m.x14 - 1.21752285801744*m.x15 - 0.601411599008549*m.x16 + 1.90743390149646*m.x17 - 1.58670668058247*m.x18 - 0.0872387747306726*m.x19 + 1.68678289162577*m.x20 - 1.84775906502257*m.x21 + 0.432879227876204*m.x22 + 1.35118041523132*m.x23 - 1.98288972274762*m.x24 + 0.923497226470068*m.x25 <= 0.01) m.c253 = Constraint(expr= - 1.78201304837674*m.x1 + 0.312868930080464*m.x2 + 1.4142135623731*m.x3 - 1.97537668119028*m.x4 + 0.907980999479098*m.x5 + 0.907980999479092*m.x6 - 1.97537668119028*m.x7 + 1.4142135623731*m.x8 + 0.312868930080457*m.x9 - 1.78201304837674*m.x10 + 1.78201304837674*m.x11 - 0.312868930080462*m.x12 - 1.41421356237309*m.x13 + 1.97537668119028*m.x14 - 0.907980999479097*m.x15 - 0.907980999479094*m.x16 + 1.97537668119027*m.x17 - 1.41421356237309*m.x18 - 0.312868930080459*m.x19 + 1.78201304837674*m.x20 - 1.78201304837674*m.x21 + 0.312868930080462*m.x22 + 1.41421356237309*m.x23 - 1.97537668119028*m.x24 + 0.907980999479094*m.x25 <= 0.01) m.c254 = Constraint(expr= - 1.24502927327524*m.x1 - 0.500760008108897*m.x2 + 1.84775906502258*m.x3 - 1.72325832088305*m.x4 + 0.226406427535803*m.x5 + 1.45074874202458*m.x6 - 1.97257120307446*m.x7 + 0.923497226470062*m.x8 + 0.861022193616595*m.x9 - 1.95984940924166*m.x10 + 1.497911441578*m.x11 + 0.156918191455692*m.x12 - 1.68678289162577*m.x13 + 1.87334437849679*m.x14 - 0.56803068940784*m.x15 - 1.18964557350269*m.x16 + 1.99992384612834*m.x17 - 1.21752285801744*m.x18 - 0.534476752156514*m.x19 + 1.86083513596405*m.x20 - 1.70528032870818*m.x21 + 0.191691505040447*m.x22 + 1.47455467362025*m.x23 - 1.96650981512791*m.x24 + 0.892395626219617*m.x25 <= 0.01) m.c255 = Constraint(expr= - 0.483843791199341*m.x1 - 1.23132295065132*m.x2 + 2*m.x3 - 1.23132295065131*m.x4 - 0.483843791199334*m.x5 + 1.8270909152852*m.x6 - 1.76589518571785*m.x7 + 0.347296355333867*m.x8 + 1.33826121271772*m.x9 - 1.99512810051965*m.x10 + 1.11838580694149*m.x11 + 0.618033988749893*m.x12 - 1.87938524157182*m.x13 + 1.69609619231285*m.x14 - 0.209056926535306*m.x15 - 1.4386796006773*m.x16 + 1.98053613748314*m.x17 - m.x18 - 0.749213186831825*m.x19 + 1.92252339187664*m.x20 - 1.6180339887499*m.x21 + 0.0697989934050018*m.x22 + 1.53208888623796*m.x23 - 1.95629520146761*m.x24 + 0.876742293578155*m.x25 <= 0.01) m.c256 = Constraint(expr= 0.364471050984282*m.x1 - 1.75763422532393*m.x2 + 1.84775906502258*m.x3 - 0.568030689407849*m.x4 - 1.13281247384965*m.x5 + 1.99383466746626*m.x6 - 1.37670915138751*m.x7 - 0.261052384440098*m.x8 + 1.70528032870818*m.x9 - 1.88528298218436*m.x10 + 0.667613718467551*m.x11 + 1.04499712943189*m.x12 - 1.98288972274762*m.x13 + 1.45074874202458*m.x14 + 0.156918191455685*m.x15 - 1.64825237724403*m.x16 + 1.91763946973639*m.x17 - 0.765366864730182*m.x18 - 0.954317520519214*m.x19 + 1.96650981512791*m.x20 - 1.52081193120006*m.x21 - 0.0523538966157442*m.x22 + 1.58670668058247*m.x23 - 1.94473984079535*m.x24 + 0.86102219361659*m.x25 <= 0.01) m.c257 = Constraint(expr= 1.14715287270209*m.x1 - 1.99238939618349*m.x2 + 1.41421356237309*m.x3 + 0.174311485495319*m.x4 - 1.63830408857798*m.x5 + 1.93185165257814*m.x6 - 0.845236523481401*m.x7 - 0.845236523481395*m.x8 + 1.93185165257814*m.x9 - 1.63830408857798*m.x10 + 0.174311485495312*m.x11 + 1.4142135623731*m.x12 - 1.99238939618349*m.x13 + 1.14715287270209*m.x14 + 0.517638090205039*m.x15 - 1.8126155740733*m.x16 + 1.8126155740733*m.x17 - 0.517638090205042*m.x18 - 1.14715287270209*m.x19 + 1.99238939618349*m.x20 - 1.41421356237309*m.x21 - 0.174311485495316*m.x22 + 1.63830408857798*m.x23 - 1.93185165257814*m.x24 + 0.845236523481399*m.x25 <= 0.01) m.c258 = Constraint(expr= 1.72325832088304*m.x1 - 1.8966473104124*m.x2 + 0.765366864730191*m.x3 + 0.892395626219614*m.x4 - 1.93629528075621*m.x5 + 1.64825237724403*m.x6 - 0.226406427535824*m.x7 - 1.35118041523132*m.x8 + 1.99931464995111*m.x9 - 1.27215644055553*m.x10 - 0.330095211721346*m.x11 + 1.70528032870818*m.x12 - 1.90743390149646*m.x13 + 0.797498137850493*m.x14 + 0.861022193616583*m.x15 - 1.92726090641725*m.x16 + 1.66777164413434*m.x17 - 0.261052384440102*m.x18 - 1.32524009643147*m.x19 + 1.99992384612834*m.x20 - 1.29889609666037*m.x21 - 0.29561882225922*m.x22 + 1.68678289162577*m.x23 - 1.91763946973639*m.x24 + 0.829386485312478*m.x25 <= 0.01) m.c259 = Constraint(expr= 1.98904379073655*m.x1 - 1.48628965095479*m.x2 + 4.88620758385765E-16*m.x3 + 1.48628965095479*m.x4 - 1.98904379073655*m.x5 + 1.17557050458494*m.x6 + 0.415823381635514*m.x7 - 1.73205080756888*m.x8 + 1.90211303259031*m.x9 - 0.813473286151598*m.x10 - 0.813473286151606*m.x11 + 1.90211303259031*m.x12 - 1.73205080756888*m.x13 + 0.41582338163552*m.x14 + 1.17557050458495*m.x15 - 1.98904379073655*m.x16 + 1.48628965095479*m.x17 + 2.20560219973841E-15*m.x18 - 1.48628965095479*m.x19 + 1.98904379073655*m.x20 - 1.17557050458495*m.x21 - 0.41582338163552*m.x22 + 1.73205080756888*m.x23 - 1.90211303259031*m.x24 + 0.8134732861516*m.x25 <= 0.01) m.c260 = Constraint(expr= 1.8966473104124*m.x1 - 0.829386485312479*m.x2 - 0.765366864730177*m.x3 + 1.87334437849679*m.x4 - 1.78986872320405*m.x5 + 0.568030689407855*m.x6 + 1.01507672592141*m.x7 - 1.95259201423987*m.x8 + 1.64825237724403*m.x9 - 0.295618822259227*m.x10 - 1.24502927327523*m.x11 + 1.99383466746626*m.x12 - 1.47455467362025*m.x13 + 0.0174530709967489*m.x14 + 1.45074874202457*m.x15 - 1.99626959684373*m.x16 + 1.27215644055553*m.x17 + 0.2610523844401*m.x18 - 1.62823103671264*m.x19 + 1.95984940924166*m.x20 - 1.0449971294319*m.x21 - 0.534476752156511*m.x22 + 1.77402166635644*m.x23 - 1.88528298218436*m.x24 + 0.797498137850493*m.x25 <= 0.01) m.c261 = Constraint(expr= 1.46270740323833*m.x1 - 0.0349048128745656*m.x2 - 1.4142135623731*m.x3 + 1.99969539031278*m.x4 - 1.36399672012499*m.x5 - 0.104671912485888*m.x6 + 1.50941916044555*m.x7 - 1.99238939618349*m.x8 + 1.25864078209967*m.x9 + 0.243738686810295*m.x10 - 1.59727102009459*m.x11 + 1.97537668119028*m.x12 - 1.14715287270209*m.x13 - 0.381617990753089*m.x14 + 1.67734113589085*m.x15 - 1.94874012957047*m.x16 + 1.0300761498201*m.x17 + 0.51763809020504*m.x18 - 1.74923941427879*m.x19 + 1.91260951192607*m.x20 - 0.907980999479093*m.x21 - 0.651136308914314*m.x22 + 1.8126155740733*m.x23 - 1.8671608529944*m.x24 + 0.781462256978547*m.x25 <= 0.01) m.c262 = Constraint(expr= 0.765366864730178*m.x1 + 0.76536686473017*m.x2 - 1.84775906502257*m.x3 + 1.84775906502258*m.x4 - 0.765366864730184*m.x5 - 0.765366864730177*m.x6 + 1.84775906502257*m.x7 - 1.84775906502257*m.x8 + 0.765366864730177*m.x9 + 0.765366864730171*m.x10 - 1.84775906502257*m.x11 + 1.84775906502258*m.x12 - 0.765366864730182*m.x13 - 0.765366864730178*m.x14 + 1.84775906502257*m.x15 - 1.84775906502258*m.x16 + 0.765366864730182*m.x17 + 0.765366864730179*m.x18 - 1.84775906502257*m.x19 + 1.84775906502257*m.x20 - 0.765366864730181*m.x21 - 0.76536686473018*m.x22 + 1.84775906502257*m.x23 - 1.84775906502257*m.x24 + 0.76536686473018*m.x25 <= 0.01) m.c263 = Constraint(expr= - 0.0697989934050108*m.x1 + 1.43867960067731*m.x2 - 2*m.x3 + 1.4386796006773*m.x4 - 0.0697989934049907*m.x5 - 1.33826121271772*m.x6 + 1.99512810051965*m.x7 - 1.53208888623795*m.x8 + 0.209056926535308*m.x9 + 1.23132295065132*m.x10 - 1.98053613748314*m.x11 + 1.61803398874989*m.x12 - 0.347296355333859*m.x13 - 1.1183858069415*m.x14 + 1.95629520146761*m.x15 - 1.69609619231285*m.x16 + 0.483843791199332*m.x17 + m.x18 - 1.92252339187664*m.x19 + 1.76589518571785*m.x20 - 0.618033988749892*m.x21 - 0.876742293578155*m.x22 + 1.87938524157182*m.x23 - 1.8270909152852*m.x24 + 0.749213186831824*m.x25 <= 0.01) m.c264 = Constraint(expr= - 0.892395626219619*m.x1 + 1.87334437849679*m.x2 - 1.84775906502257*m.x3 + 0.829386485312485*m.x4 + 0.634609312810183*m.x5 - 1.75763422532393*m.x6 + 1.93629528075622*m.x7 - 1.07459921669364*m.x8 - 0.36447105098429*m.x9 + 1.60771372123444*m.x10 - 1.98714371135318*m.x11 + 1.29889609666037*m.x12 + 0.0872387747306713*m.x13 - 1.42650089830836*m.x14 + 1.99931464995111*m.x15 - 1.49791144157801*m.x16 + 0.191691505040452*m.x17 + 1.21752285801744*m.x18 - 1.97257120307446*m.x19 + 1.66777164413434*m.x20 - 0.466890727711811*m.x21 - 0.984847120206934*m.x22 + 1.90743390149645*m.x23 - 1.80517056869972*m.x24 + 0.733002453448595*m.x25 <= 0.01) m.c265 = Constraint(expr= - 1.55429192291394*m.x1 + 1.99725906950915*m.x2 - 1.41421356237311*m.x3 + 0.104671912485903*m.x4 + 1.25864078209966*m.x5 - 1.97537668119027*m.x6 + 1.67734113589085*m.x7 - 0.517638090205051*m.x8 - 0.907980999479086*m.x9 + 1.8671608529944*m.x10 - 1.86716085299441*m.x11 + 0.907980999479097*m.x12 + 0.517638090205039*m.x13 - 1.67734113589084*m.x14 + 1.97537668119028*m.x15 - 1.25864078209968*m.x16 - 0.104671912485883*m.x17 + 1.41421356237309*m.x18 - 1.99725906950915*m.x19 + 1.55429192291394*m.x20 - 0.312868930080464*m.x21 - 1.08927807003005*m.x22 + 1.93185165257814*m.x23 - 1.78201304837674*m.x24 + 0.716735899090601*m.x25 <= 0.01) m.c266 = Constraint(expr= - 1.93629528075622*m.x1 + 1.78986872320405*m.x2 - 0.765366864730184*m.x3 - 0.63460931281019*m.x4 + 1.72325832088305*m.x5 - 1.96650981512791*m.x6 + 1.24502927327524*m.x7 + 0.0872387747306775*m.x8 - 1.37670915138751*m.x9 + 1.99079239673436*m.x10 - 1.62823103671264*m.x11 + 0.466890727711806*m.x12 + 0.923497226470069*m.x13 - 1.86083513596405*m.x14 + 1.88528298218436*m.x15 - 0.984847120206936*m.x16 - 0.398735868834396*m.x17 + 1.58670668058247*m.x18 - 1.99626959684373*m.x19 + 1.42650089830836*m.x20 - 0.156918191455688*m.x21 - 1.18964557350268*m.x22 + 1.95259201423987*m.x23 - 1.75763422532393*m.x24 + 0.700414762518935*m.x25 <= 0.01) m.c267 = Constraint(expr= - 1.96961550602442*m.x1 + 1.28557521937309*m.x2 - 7.83897747581624E-15*m.x3 - 1.28557521937308*m.x4 + 1.96961550602441*m.x5 - 1.73205080756888*m.x6 + 0.68404028665135*m.x7 + 0.68404028665133*m.x8 - 1.73205080756888*m.x9 + 1.96961550602442*m.x10 - 1.28557521937308*m.x11 - 9.80955400591059E-16*m.x12 + 1.28557521937307*m.x13 - 1.96961550602442*m.x14 + 1.73205080756888*m.x15 - 0.684040286651342*m.x16 - 0.684040286651332*m.x17 + 1.73205080756888*m.x18 - 1.96961550602442*m.x19 + 1.28557521937308*m.x20 - 8.57252759403147E-16*m.x21 - 1.28557521937308*m.x22 + 1.96961550602442*m.x23 - 1.73205080756888*m.x24 + 0.684040286651338*m.x25 <= 0.01) m.c268 = Constraint(expr= - 1.64825237724403*m.x1 + 0.568030689407843*m.x2 + 0.765366864730183*m.x3 - 1.75763422532393*m.x4 + 1.96650981512791*m.x5 - 1.29889609666036*m.x6 + 0.0523538966157395*m.x7 + 1.21752285801745*m.x8 - 1.94473984079536*m.x9 + 1.80517056869972*m.x10 - 0.861022193616594*m.x11 - 0.466890727711807*m.x12 + 1.58670668058247*m.x13 - 1.99931464995111*m.x14 + 1.52081193120006*m.x15 - 0.364471050984295*m.x16 - 0.954317520519217*m.x17 + 1.84775906502257*m.x18 - 1.91763946973639*m.x19 + 1.13281247384967*m.x20 + 0.15691819145569*m.x21 - 1.37670915138751*m.x22 + 1.98288972274762*m.x23 - 1.70528032870818*m.x24 + 0.667613718467542*m.x25 <= 0.01) m.c269 = Constraint(expr= - 1.03007614982011*m.x1 - 0.243738686810286*m.x2 + 1.41421356237309*m.x3 - 1.98509230328264*m.x4 + 1.71433460140423*m.x5 - 0.716735899090611*m.x6 - 0.584743409445472*m.x7 + 1.63830408857798*m.x8 - 1.99725906950915*m.x9 + 1.50941916044554*m.x10 - 0.381617990753093*m.x11 - 0.907980999479087*m.x12 + 1.8126155740733*m.x13 - 1.94874012957047*m.x14 + 1.25864078209968*m.x15 - 0.0349048128745702*m.x16 - 1.2036300463041*m.x17 + 1.93185165257814*m.x18 - 1.84100970690488*m.x19 + 0.969619240492676*m.x20 + 0.312868930080459*m.x21 - 1.46270740323834*m.x22 + 1.99238939618349*m.x23 - 1.67734113589085*m.x24 + 0.651136308914314*m.x25 <= 0.01) m.c270 = Constraint(expr= - 0.226406427535811*m.x1 - 1.01507672592141*m.x2 + 1.84775906502257*m.x3 - 1.93629528075621*m.x4 + 1.24502927327523*m.x5 - 0.0523538966157468*m.x6 - 1.16140591142188*m.x7 + 1.90743390149646*m.x8 - 1.88528298218436*m.x9 + 1.10387397062411*m.x10 + 0.12209707906971*m.x11 - 1.29889609666037*m.x12 + 1.95259201423987*m.x13 - 1.81992254175308*m.x14 + 0.954317520519214*m.x15 + 0.295618822259222*m.x16 - 1.42650089830836*m.x17 + 1.98288972274762*m.x18 - 1.7407113918798*m.x19 + 0.797498137850492*m.x20 + 0.466890727711813*m.x21 - 1.54324916677544*m.x22 + 1.99809644316372*m.x23 - 1.64825237724403*m.x24 + 0.634609312810184*m.x25 <= 0.01) m.c271 = Constraint(expr= 0.61803398874989*m.x1 - 1.61803398874989*m.x2 + 2*m.x3 - 1.6180339887499*m.x4 + 0.618033988749899*m.x5 + 0.618033988749891*m.x6 - 1.61803398874989*m.x7 + 2*m.x8 - 1.6180339887499*m.x9 + 0.618033988749898*m.x10 + 0.618033988749892*m.x11 - 1.61803398874989*m.x12 + 2*m.x13 - 1.6180339887499*m.x14 + 0.618033988749897*m.x15 + 0.618033988749893*m.x16 - 1.61803398874989*m.x17 + 2*m.x18 - 1.6180339887499*m.x19 + 0.618033988749896*m.x20 + 0.618033988749894*m.x21 - 1.61803398874989*m.x22 + 2*m.x23 - 1.61803398874989*m.x24 + 0.618033988749895*m.x25 <= 0.01) m.c272 = Constraint(expr= 1.35118041523132*m.x1 - 1.95259201423987*m.x2 + 1.84775906502257*m.x3 - 1.07459921669365*m.x4 - 0.0872387747306838*m.x5 + 1.21752285801745*m.x6 - 1.90743390149645*m.x7 + 1.90743390149645*m.x8 - 1.21752285801744*m.x9 + 0.0872387747306696*m.x10 + 1.07459921669365*m.x11 - 1.84775906502258*m.x12 + 1.95259201423987*m.x13 - 1.35118041523132*m.x14 + 0.261052384440103*m.x15 + 0.92349722647007*m.x16 - 1.77402166635645*m.x17 + 1.98288972274762*m.x18 - 1.47455467362025*m.x19 + 0.432879227876205*m.x20 + 0.76536686473018*m.x21 - 1.68678289162577*m.x22 + 1.99809644316372*m.x23 - 1.58670668058247*m.x24 + 0.601411599008546*m.x25 <= 0.01) m.c273 = Constraint(expr= 1.84100970690488*m.x1 - 1.96325436689533*m.x2 + 1.41421356237309*m.x3 - 0.381617990753095*m.x4 - 0.781462256978547*m.x5 + 1.67734113589085*m.x6 - 1.99969539031278*m.x7 + 1.63830408857798*m.x8 - 0.716735899090598*m.x9 - 0.449902108687724*m.x10 + 1.46270740323834*m.x11 - 1.97537668119028*m.x12 + 1.8126155740733*m.x13 - 1.03007614982011*m.x14 - 0.10467191248589*m.x15 + 1.2036300463041*m.x16 - 1.89103715119863*m.x17 + 1.93185165257814*m.x18 - 1.31211805798102*m.x19 + 0.243738686810295*m.x20 + 0.907980999479094*m.x21 - 1.74923941427879*m.x22 + 1.99238939618349*m.x23 - 1.55429192291394*m.x24 + 0.584743409445474*m.x25 <= 0.01) m.c274 = Constraint(expr= 1.99931464995111*m.x1 - 1.64825237724404*m.x2 + 0.765366864730191*m.x3 + 0.364471050984282*m.x4 - 1.3767091513875*m.x5 + 1.94473984079535*m.x6 - 1.88528298218436*m.x7 + 1.21752285801745*m.x8 - 0.156918191455705*m.x9 - 0.954317520519216*m.x10 + 1.75763422532393*m.x11 - 1.99383466746626*m.x12 + 1.58670668058247*m.x13 - 0.667613718467544*m.x14 - 0.466890727711808*m.x15 + 1.45074874202457*m.x16 - 1.96650981512791*m.x17 + 1.84775906502258*m.x18 - 1.13281247384967*m.x19 + 0.0523538966157477*m.x20 + 1.0449971294319*m.x21 - 1.80517056869972*m.x22 + 1.98288972274762*m.x23 - 1.52081193120006*m.x24 + 0.568030689407846*m.x25 <= 0.01) m.c275 = Constraint(expr= 1.79758809259834*m.x1 - 1.05983852846641*m.x2 + 9.78479478044706E-16*m.x3 + 1.0598385284664*m.x4 - 1.79758809259834*m.x5 + 1.98904379073655*m.x6 - 1.57602150721344*m.x7 + 0.684040286651337*m.x8 + 0.415823381635514*m.x9 - 1.389316740918*m.x10 + 1.94059145255199*m.x11 - 1.90211303259031*m.x12 + 1.28557521937308*m.x13 - 0.278346201920134*m.x14 - 0.8134732861516*m.x15 + 1.65807514511008*m.x16 - 1.99878165403819*m.x17 + 1.73205080756888*m.x18 - 0.938943125571782*m.x19 - 0.139512947488251*m.x20 + 1.17557050458495*m.x21 - 1.85436770913358*m.x22 + 1.96961550602442*m.x23 - 1.48628965095479*m.x24 + 0.551274711633998*m.x25 <= 0.01) m.c276 = Constraint(expr= 1.27215644055554*m.x1 - 0.295618822259229*m.x2 - 0.765366864730176*m.x3 + 1.60771372123443*m.x4 - 1.99079239673436*m.x5 + 1.80517056869972*m.x6 - 1.10387397062412*m.x7 + 0.0872387747306843*m.x8 + 0.954317520519209*m.x9 - 1.72325832088305*m.x10 + 1.99992384612834*m.x11 - 1.70528032870819*m.x12 + 0.923497226470074*m.x13 + 0.122097079069711*m.x14 - 1.13281247384966*m.x15 + 1.81992254175309*m.x16 - 1.98714371135318*m.x17 + 1.58670668058247*m.x18 - 0.733002453448599*m.x19 - 0.330095211721355*m.x20 + 1.29889609666036*m.x21 - 1.8966473104124*m.x22 + 1.95259201423987*m.x23 - 1.45074874202458*m.x24 + 0.534476752156514*m.x25 <= 0.01) m.c277 = Constraint(expr= 0.517638090205046*m.x1 + 0.51763809020505*m.x2 - 1.4142135623731*m.x3 + 1.93185165257814*m.x4 - 1.93185165257814*m.x5 + 1.41421356237309*m.x6 - 0.517638090205038*m.x7 - 0.517638090205044*m.x8 + 1.4142135623731*m.x9 - 1.93185165257814*m.x10 + 1.93185165257814*m.x11 - 1.4142135623731*m.x12 + 0.517638090205043*m.x13 + 0.517638090205046*m.x14 - 1.4142135623731*m.x15 + 1.93185165257814*m.x16 - 1.93185165257814*m.x17 + 1.41421356237309*m.x18 - 0.517638090205042*m.x19 - 0.517638090205043*m.x20 + 1.4142135623731*m.x21 - 1.93185165257814*m.x22 + 1.93185165257814*m.x23 - 1.4142135623731*m.x24 + 0.517638090205041*m.x25 <= 0.01) m.c278 = Constraint(expr= - 0.330095211721358*m.x1 + 1.24502927327524*m.x2 - 1.84775906502257*m.x3 + 1.98714371135318*m.x4 - 1.62823103671264*m.x5 + 0.861022193616602*m.x6 + 0.122097079069709*m.x7 - 1.07459921669364*m.x8 + 1.75763422532393*m.x9 - 1.99992384612834*m.x10 + 1.7407113918798*m.x11 - 1.0449971294319*m.x12 + 0.0872387747306691*m.x13 + 0.892395626219615*m.x14 - 1.64825237724403*m.x15 + 1.99079239673436*m.x16 - 1.83412014877025*m.x17 + 1.21752285801745*m.x18 - 0.295618822259225*m.x19 - 0.700414762518932*m.x20 + 1.52081193120006*m.x21 - 1.95984940924166*m.x22 + 1.90743390149645*m.x23 - 1.37670915138751*m.x24 + 0.500760008108883*m.x25 <= 0.01) m.c279 = Constraint(expr= - 1.1183858069415*m.x1 + 1.76589518571785*m.x2 - 2*m.x3 + 1.76589518571785*m.x4 - 1.11838580694149*m.x5 + 0.209056926535309*m.x6 + 0.749213186831826*m.x7 - 1.53208888623796*m.x8 + 1.95629520146761*m.x9 - 1.92252339187664*m.x10 + 1.4386796006773*m.x11 - 0.618033988749891*m.x12 - 0.347296355333868*m.x13 + 1.23132295065132*m.x14 - 1.8270909152852*m.x15 + 1.99512810051965*m.x16 - 1.69609619231285*m.x17 + 0.999999999999997*m.x18 - 0.0697989934050025*m.x19 - 0.876742293578157*m.x20 + 1.61803398874989*m.x21 - 1.98053613748314*m.x22 + 1.87938524157182*m.x23 - 1.33826121271772*m.x24 + 0.483843791199335*m.x25 <= 0.01) m.c280 = Constraint(expr= - 1.70528032870818*m.x1 + 1.99383466746626*m.x2 - 1.84775906502257*m.x3 + 1.29889609666037*m.x4 - 0.466890727711814*m.x5 - 0.466890727711806*m.x6 + 1.29889609666036*m.x7 - 1.84775906502257*m.x8 + 1.99383466746626*m.x9 - 1.70528032870818*m.x10 + 1.0449971294319*m.x11 - 0.15691819145569*m.x12 - 0.765366864730178*m.x13 + 1.52081193120006*m.x14 - 1.94473984079535*m.x15 + 1.94473984079535*m.x16 - 1.52081193120006*m.x17 + 0.765366864730182*m.x18 + 0.156918191455686*m.x19 - 1.0449971294319*m.x20 + 1.70528032870818*m.x21 - 1.99383466746626*m.x22 + 1.84775906502257*m.x23 - 1.29889609666037*m.x24 + 0.466890727711811*m.x25 <= 0.01) m.c281 = Constraint(expr= - 1.98509230328264*m.x1 + 1.89103715119863*m.x2 - 1.41421356237309*m.x3 + 0.651136308914309*m.x4 + 0.243738686810307*m.x5 - 1.08927807003006*m.x6 + 1.71433460140422*m.x7 - 1.99238939618349*m.x8 + 1.8671608529944*m.x9 - 1.36399672012499*m.x10 + 0.584743409445472*m.x11 + 0.312868930080471*m.x12 - 1.14715287270209*m.x13 + 1.74923941427879*m.x14 - 1.99725906950915*m.x15 + 1.84100970690488*m.x16 - 1.31211805798101*m.x17 + 0.517638090205042*m.x18 + 0.381617990753089*m.x19 - 1.2036300463041*m.x20 + 1.78201304837674*m.x21 - 1.99969539031278*m.x22 + 1.8126155740733*m.x23 - 1.25864078209967*m.x24 + 0.44990210868773*m.x25 <= 0.01) m.c282 = Constraint(expr= - 1.90743390149645*m.x1 + 1.47455467362025*m.x2 - 0.765366864730185*m.x3 - 0.0872387747306691*m.x4 + 0.923497226470068*m.x5 - 1.58670668058247*m.x6 + 1.95259201423986*m.x7 - 1.95259201423987*m.x8 + 1.58670668058247*m.x9 - 0.923497226470068*m.x10 + 0.0872387747306696*m.x11 + 0.765366864730184*m.x12 - 1.47455467362024*m.x13 + 1.90743390149645*m.x14 - 1.98288972274762*m.x15 + 1.68678289162577*m.x16 - 1.07459921669365*m.x17 + 0.261052384440103*m.x18 + 0.601411599008543*m.x19 - 1.35118041523132*m.x20 + 1.84775906502257*m.x21 - 1.99809644316372*m.x22 + 1.77402166635644*m.x23 - 1.21752285801744*m.x24 + 0.432879227876206*m.x25 <= 0.01) m.c283 = Constraint(expr= - 1.4862896509548*m.x1 + 0.813473286151606*m.x2 - 8.32883619547518E-15*m.x3 - 0.813473286151591*m.x4 + 1.48628965095478*m.x5 - 1.9021130325903*m.x6 + 1.98904379073655*m.x7 - 1.73205080756888*m.x8 + 1.17557050458495*m.x9 - 0.415823381635528*m.x10 - 0.415823381635508*m.x11 + 1.17557050458494*m.x12 - 1.73205080756888*m.x13 + 1.98904379073655*m.x14 - 1.90211303259031*m.x15 + 1.48628965095479*m.x16 - 0.813473286151603*m.x17 + 5.14475451769206E-15*m.x18 + 0.8134732861516*m.x19 - 1.48628965095479*m.x20 + 1.90211303259031*m.x21 - 1.98904379073655*m.x22 + 1.73205080756888*m.x23 - 1.17557050458495*m.x24 + 0.415823381635519*m.x25 <= 0.01) m.c284 = Constraint(expr= - 0.797498137850503*m.x1 + 0.0174530709967376*m.x2 + 0.765366864730182*m.x3 - 1.42650089830836*m.x4 + 1.86083513596405*m.x5 - 1.99931464995111*m.x6 + 1.81992254175309*m.x7 - 1.35118041523132*m.x8 + 0.667613718467539*m.x9 + 0.12209707906971*m.x10 - 0.892395626219621*m.x11 + 1.52081193120006*m.x12 - 1.90743390149645*m.x13 + 1.99079239673436*m.x14 - 1.75763422532393*m.x15 + 1.24502927327524*m.x16 - 0.53447675215651*m.x17 - 0.2610523844401*m.x18 + 1.01507672592141*m.x19 - 1.60771372123443*m.x20 + 1.94473984079535*m.x21 - 1.97257120307446*m.x22 + 1.68678289162577*m.x23 - 1.13281247384967*m.x24 + 0.398735868834394*m.x25 <= 0.01) m.c285 = Constraint(expr= 0.0349048128745631*m.x1 - 0.781462256978533*m.x2 + 1.41421356237309*m.x3 - 1.84100970690488*m.x4 + 1.99969539031278*m.x5 - 1.86716085299441*m.x6 + 1.46270740323834*m.x7 - 0.845236523481401*m.x8 + 0.104671912485888*m.x9 + 0.651136308914301*m.x10 - 1.31211805798101*m.x11 + 1.78201304837673*m.x12 - 1.99238939618349*m.x13 + 1.91260951192607*m.x14 - 1.55429192291394*m.x15 + 0.96961924049268*m.x16 - 0.243738686810299*m.x17 - 0.517638090205039*m.x18 + 1.2036300463041*m.x19 - 1.71433460140422*m.x20 + 1.97537668119028*m.x21 - 1.94874012957047*m.x22 + 1.63830408857798*m.x23 - 1.08927807003005*m.x24 + 0.38161799075309*m.x25 <= 0.01) m.c286 = Constraint(expr= 0.861022193616593*m.x1 - 1.45074874202459*m.x2 + 1.84775906502257*m.x3 - 1.99931464995111*m.x4 + 1.88528298218435*m.x5 - 1.52081193120006*m.x6 + 0.954317520519216*m.x7 - 0.261052384440105*m.x8 - 0.466890727711807*m.x9 + 1.13281247384967*m.x10 - 1.64825237724403*m.x11 + 1.94473984079535*m.x12 - 1.98288972274762*m.x13 + 1.75763422532393*m.x14 - 1.29889609666037*m.x15 + 0.667613718467544*m.x16 + 0.0523538966157483*m.x17 - 0.765366864730179*m.x18 + 1.37670915138751*m.x19 - 1.80517056869972*m.x20 + 1.99383466746626*m.x21 - 1.91763946973639*m.x22 + 1.58670668058247*m.x23 - 1.0449971294319*m.x24 + 0.364471050984295*m.x25 <= 0.01) m.c287 = Constraint(expr= 1.53208888623794*m.x1 - 1.87938524157181*m.x2 + 2*m.x3 - 1.87938524157182*m.x4 + 1.53208888623796*m.x5 - m.x6 + 0.347296355333868*m.x7 + 0.34729635533386*m.x8 - 0.999999999999993*m.x9 + 1.53208888623795*m.x10 - 1.87938524157181*m.x11 + 2*m.x12 - 1.87938524157182*m.x13 + 1.53208888623796*m.x14 - m.x15 + 0.347296355333866*m.x16 + 0.347296355333855*m.x17 - m.x18 + 1.53208888623796*m.x19 - 1.87938524157182*m.x20 + 2*m.x21 - 1.87938524157182*m.x22 + 1.53208888623796*m.x23 - m.x24 + 0.347296355333861*m.x25 <= 0.01) m.c288 = Constraint(expr= 1.92726090641725*m.x1 - 1.99626959684373*m.x2 + 1.84775906502257*m.x3 - 1.497911441578*m.x4 + 0.984847120206926*m.x5 - 0.364471050984298*m.x6 - 0.29561882225922*m.x7 + 0.923497226470068*m.x8 - 1.45074874202458*m.x9 + 1.81992254175309*m.x10 - 1.99079239673436*m.x11 + 1.94473984079535*m.x12 - 1.68678289162577*m.x13 + 1.24502927327524*m.x14 - 0.667613718467538*m.x15 + 0.0174530709967489*m.x16 + 0.634609312810185*m.x17 - 1.21752285801744*m.x18 + 1.66777164413434*m.x19 - 1.93629528075622*m.x20 + 1.99383466746626*m.x21 - 1.83412014877025*m.x22 + 1.47455467362025*m.x23 - 0.954317520519216*m.x24 + 0.330095211721355*m.x25 <= 0.01) m.c289 = Constraint(expr= 1.97537668119028*m.x1 - 1.78201304837674*m.x2 + 1.4142135623731*m.x3 - 0.907980999479093*m.x4 + 0.312868930080464*m.x5 + 0.312868930080456*m.x6 - 0.907980999479085*m.x7 + 1.4142135623731*m.x8 - 1.78201304837673*m.x9 + 1.97537668119027*m.x10 - 1.97537668119028*m.x11 + 1.78201304837673*m.x12 - 1.4142135623731*m.x13 + 0.907980999479097*m.x14 - 0.312868930080462*m.x15 - 0.312868930080458*m.x16 + 0.907980999479093*m.x17 - 1.41421356237309*m.x18 + 1.78201304837674*m.x19 - 1.97537668119027*m.x20 + 1.97537668119028*m.x21 - 1.78201304837674*m.x22 + 1.4142135623731*m.x23 - 0.907980999479094*m.x24 + 0.312868930080462*m.x25 <= 0.01) m.c290 = Constraint(expr= 1.66777164413433*m.x1 - 1.27215644055553*m.x2 + 0.765366864730165*m.x3 - 0.191691505040441*m.x4 - 0.398735868834393*m.x5 + 0.954317520519221*m.x6 - 1.42650089830837*m.x7 + 1.77402166635644*m.x8 - 1.96650981512791*m.x9 + 1.98714371135317*m.x10 - 1.83412014877025*m.x11 + 1.52081193120006*m.x12 - 1.07459921669364*m.x13 + 0.534476752156504*m.x14 + 0.0523538966157478*m.x15 - 0.634609312810185*m.x16 + 1.16140591142188*m.x17 - 1.58670668058247*m.x18 + 1.8733443784968*m.x19 - 1.99626959684373*m.x20 + 1.94473984079535*m.x21 - 1.72325832088305*m.x22 + 1.35118041523132*m.x23 - 0.86102219361659*m.x24 + 0.295618822259221*m.x25 <= 0.01) m.c291 = Constraint(expr= 1.0598385284664*m.x1 - 0.551274711634001*m.x2 + 1.56791929129057E-14*m.x3 + 0.551274711633998*m.x4 - 1.05983852846641*m.x5 + 1.48628965095479*m.x6 - 1.79758809259834*m.x7 + 1.96961550602442*m.x8 - 1.98904379073655*m.x9 + 1.85436770913358*m.x10 - 1.57602150721345*m.x11 + 1.17557050458495*m.x12 - 0.684040286651343*m.x13 + 0.139512947488255*m.x14 + 0.415823381635515*m.x15 - 0.938943125571779*m.x16 + 1.38931674091799*m.x17 - 1.73205080756888*m.x18 + 1.94059145255199*m.x19 - 1.99878165403819*m.x20 + 1.90211303259031*m.x21 - 1.65807514511008*m.x22 + 1.28557521937308*m.x23 - 0.8134732861516*m.x24 + 0.278346201920131*m.x25 <= 0.01) m.c292 = Constraint(expr= 0.261052384440114*m.x1 + 0.261052384440103*m.x2 - 0.765366864730163*m.x3 + 1.21752285801743*m.x4 - 1.58670668058246*m.x5 + 1.84775906502257*m.x6 - 1.98288972274762*m.x7 + 1.98288972274762*m.x8 - 1.84775906502258*m.x9 + 1.58670668058247*m.x10 - 1.21752285801745*m.x11 + 0.76536686473019*m.x12 - 0.261052384440104*m.x13 - 0.261052384440099*m.x14 + 0.765366864730172*m.x15 - 1.21752285801744*m.x16 + 1.58670668058247*m.x17 - 1.84775906502257*m.x18 + 1.98288972274762*m.x19 - 1.98288972274762*m.x20 + 1.84775906502257*m.x21 - 1.58670668058247*m.x22 + 1.21752285801744*m.x23 - 0.765366864730181*m.x24 + 0.261052384440103*m.x25 <= 0.01) m.c293 = Constraint(expr= - 0.58474340944547*m.x1 + 1.03007614982011*m.x2 - 1.4142135623731*m.x3 + 1.71433460140422*m.x4 - 1.91260951192607*m.x5 + 1.99725906950915*m.x6 - 1.96325436689533*m.x7 + 1.8126155740733*m.x8 - 1.55429192291394*m.x9 + 1.20363004630409*m.x10 - 0.781462256978554*m.x11 + 0.312868930080463*m.x12 + 0.17431148549532*m.x13 - 0.651136308914309*m.x14 + 1.08927807003005*m.x15 - 1.46270740323834*m.x16 + 1.74923941427879*m.x17 - 1.93185165257814*m.x18 + 1.99969539031278*m.x19 - 1.94874012957047*m.x20 + 1.78201304837674*m.x21 - 1.50941916044554*m.x22 + 1.14715287270209*m.x23 - 0.716735899090601*m.x24 + 0.243738686810295*m.x25 <= 0.01) m.c294 = Constraint(expr= - 1.32524009643146*m.x1 + 1.62823103671264*m.x2 - 1.84775906502256*m.x3 + 1.97257120307446*m.x4 - 1.99626959684373*m.x5 + 1.91763946973639*m.x6 - 1.7407113918798*m.x7 + 1.47455467362025*m.x8 - 1.13281247384967*m.x9 + 0.733002453448601*m.x10 - 0.295618822259227*m.x11 - 0.156918191455684*m.x12 + 0.601411599008541*m.x13 - 1.0150767259214*m.x14 + 1.3767091513875*m.x15 - 1.66777164413433*m.x16 + 1.87334437849679*m.x17 - 1.98288972274762*m.x18 + 1.99079239673436*m.x19 - 1.8966473104124*m.x20 + 1.70528032870819*m.x21 - 1.42650089830836*m.x22 + 1.07459921669365*m.x23 - 0.667613718467542*m.x24 + 0.226406427535814*m.x25 <= 0.01) m.c295 = Constraint(expr= - 1.82709091528521*m.x1 + 1.95629520146761*m.x2 - 2*m.x3 + 1.95629520146761*m.x4 - 1.8270909152852*m.x5 + 1.61803398874989*m.x6 - 1.33826121271772*m.x7 + 0.999999999999993*m.x8 - 0.618033988749892*m.x9 + 0.209056926535308*m.x10 + 0.209056926535301*m.x11 - 0.618033988749899*m.x12 + m.x13 - 1.33826121271771*m.x14 + 1.61803398874989*m.x15 - 1.8270909152852*m.x16 + 1.95629520146761*m.x17 - 2*m.x18 + 1.95629520146761*m.x19 - 1.8270909152852*m.x20 + 1.6180339887499*m.x21 - 1.33826121271772*m.x22 + m.x23 - 0.618033988749895*m.x24 + 0.209056926535307*m.x25 <= 0.01) m.c296 = Constraint(expr= - 1.99992384612834*m.x1 + 1.95984940924166*m.x2 - 1.84775906502257*m.x3 + 1.66777164413434*m.x4 - 1.42650089830837*m.x5 + 1.13281247384967*m.x6 - 0.797498137850502*m.x7 + 0.432879227876211*m.x8 - 0.0523538966157468*m.x9 - 0.330095211721345*m.x10 + 0.70041476251893*m.x11 - 1.0449971294319*m.x12 + 1.35118041523131*m.x13 - 1.60771372123443*m.x14 + 1.80517056869972*m.x15 - 1.93629528075621*m.x16 + 1.99626959684373*m.x17 - 1.98288972274762*m.x18 + 1.8966473104124*m.x19 - 1.7407113918798*m.x20 + 1.52081193120006*m.x21 - 1.24502927327524*m.x22 + 0.923497226470069*m.x23 - 0.568030689407845*m.x24 + 0.191691505040448*m.x25 <= 0.01) m.c297 = Constraint(expr= - 1.8126155740733*m.x1 + 1.63830408857798*m.x2 - 1.4142135623731*m.x3 + 1.14715287270208*m.x4 - 0.845236523481402*m.x5 + 0.517638090205032*m.x6 - 0.17431148549532*m.x7 - 0.174311485495326*m.x8 + 0.517638090205037*m.x9 - 0.845236523481408*m.x10 + 1.14715287270209*m.x11 - 1.4142135623731*m.x12 + 1.63830408857798*m.x13 - 1.8126155740733*m.x14 + 1.93185165257814*m.x15 - 1.99238939618349*m.x16 + 1.99238939618349*m.x17 - 1.93185165257814*m.x18 + 1.8126155740733*m.x19 - 1.63830408857798*m.x20 + 1.41421356237309*m.x21 - 1.14715287270209*m.x22 + 0.845236523481399*m.x23 - 0.517638090205041*m.x24 + 0.174311485495316*m.x25 <= 0.01) m.c298 = Constraint(expr= - 1.29889609666036*m.x1 + 1.04499712943191*m.x2 - 0.765366864730185*m.x3 + 0.466890727711808*m.x4 - 0.156918191455692*m.x5 - 0.156918191455683*m.x6 + 0.466890727711813*m.x7 - 0.765366864730177*m.x8 + 1.04499712943189*m.x9 - 1.29889609666037*m.x10 + 1.52081193120006*m.x11 - 1.70528032870818*m.x12 + 1.84775906502257*m.x13 - 1.94473984079535*m.x14 + 1.99383466746626*m.x15 - 1.99383466746626*m.x16 + 1.94473984079535*m.x17 - 1.84775906502258*m.x18 + 1.70528032870819*m.x19 - 1.52081193120006*m.x20 + 1.29889609666037*m.x21 - 1.0449971294319*m.x22 + 0.765366864730181*m.x23 - 0.46689072771181*m.x24 + 0.15691819145569*m.x25 <= 0.01) m.c299 = Constraint(expr= - 0.551274711633988*m.x1 + 0.278346201920116*m.x2 + 1.96030145152699E-14*m.x3 - 0.278346201920126*m.x4 + 0.551274711633998*m.x5 - 0.813473286151604*m.x6 + 1.05983852846642*m.x7 - 1.28557521937308*m.x8 + 1.48628965095479*m.x9 - 1.65807514511009*m.x10 + 1.79758809259834*m.x11 - 1.90211303259031*m.x12 + 1.96961550602442*m.x13 - 1.99878165403819*m.x14 + 1.98904379073655*m.x15 - 1.94059145255199*m.x16 + 1.85436770913357*m.x17 - 1.73205080756888*m.x18 + 1.57602150721344*m.x19 - 1.389316740918*m.x20 + 1.17557050458494*m.x21 - 0.938943125571782*m.x22 + 0.684040286651337*m.x23 - 0.415823381635518*m.x24 + 0.13951294748825*m.x25 <= 0.01) m.c300 = Constraint(expr= 0.295618822259211*m.x1 - 0.534476752156503*m.x2 + 0.765366864730169*m.x3 - 0.984847120206924*m.x4 + 1.18964557350268*m.x5 - 1.37670915138751*m.x6 + 1.54324916677544*m.x7 - 1.68678289162577*m.x8 + 1.80517056869972*m.x9 - 1.8966473104124*m.x10 + 1.95984940924166*m.x11 - 1.99383466746626*m.x12 + 1.99809644316372*m.x13 - 1.97257120307446*m.x14 + 1.91763946973639*m.x15 - 1.83412014877025*m.x16 + 1.72325832088305*m.x17 - 1.58670668058247*m.x18 + 1.42650089830836*m.x19 - 1.24502927327524*m.x20 + 1.0449971294319*m.x21 - 0.829386485312479*m.x22 + 0.601411599008546*m.x23 - 0.364471050984296*m.x24 + 0.122097079069714*m.x25 <= 0.01) m.c301 = Constraint(expr= 1.08927807003005*m.x1 - 1.25864078209967*m.x2 + 1.41421356237308*m.x3 - 1.55429192291393*m.x4 + 1.67734113589084*m.x5 - 1.78201304837673*m.x6 + 1.8671608529944*m.x7 - 1.93185165257813*m.x8 + 1.97537668119027*m.x9 - 1.99725906950915*m.x10 + 1.99725906950915*m.x11 - 1.97537668119028*m.x12 + 1.93185165257814*m.x13 - 1.86716085299441*m.x14 + 1.78201304837674*m.x15 - 1.67734113589085*m.x16 + 1.55429192291394*m.x17 - 1.4142135623731*m.x18 + 1.25864078209968*m.x19 - 1.08927807003006*m.x20 + 0.907980999479096*m.x21 - 0.716735899090602*m.x22 + 0.517638090205043*m.x23 - 0.312868930080462*m.x24 + 0.104671912485888*m.x25 <= 0.01) m.c302 = Constraint(expr= 1.68678289162577*m.x1 - 1.77402166635644*m.x2 + 1.84775906502258*m.x3 - 1.90743390149645*m.x4 + 1.95259201423987*m.x5 - 1.98288972274762*m.x6 + 1.99809644316372*m.x7 - 1.99809644316372*m.x8 + 1.98288972274762*m.x9 - 1.95259201423987*m.x10 + 1.90743390149645*m.x11 - 1.84775906502257*m.x12 + 1.77402166635644*m.x13 - 1.68678289162577*m.x14 + 1.58670668058247*m.x15 - 1.47455467362025*m.x16 + 1.35118041523132*m.x17 - 1.21752285801744*m.x18 + 1.07459921669365*m.x19 - 0.923497226470066*m.x20 + 0.765366864730181*m.x21 - 0.601411599008545*m.x22 + 0.432879227876206*m.x23 - 0.261052384440103*m.x24 + 0.087238774730672*m.x25 <= 0.01) m.c303 = Constraint(expr= 1.98053613748314*m.x1 - 1.99512810051965*m.x2 + 2*m.x3 - 1.99512810051965*m.x4 + 1.98053613748314*m.x5 - 1.95629520146761*m.x6 + 1.92252339187664*m.x7 - 1.87938524157182*m.x8 + 1.82709091528521*m.x9 - 1.76589518571785*m.x10 + 1.69609619231285*m.x11 - 1.6180339887499*m.x12 + 1.53208888623796*m.x13 - 1.43867960067731*m.x14 + 1.33826121271772*m.x15 - 1.23132295065132*m.x16 + 1.1183858069415*m.x17 - m.x18 + 0.87674229357816*m.x19 - 0.749213186831824*m.x20 + 0.618033988749896*m.x21 - 0.483843791199338*m.x22 + 0.347296355333861*m.x23 - 0.209056926535308*m.x24 + 0.0697989934050022*m.x25 <= 0.01) m.c304 = Constraint(expr= 1.91763946973639*m.x1 - 1.88528298218436*m.x2 + 1.84775906502257*m.x3 - 1.80517056869972*m.x4 + 1.75763422532393*m.x5 - 1.70528032870818*m.x6 + 1.64825237724403*m.x7 - 1.58670668058247*m.x8 + 1.52081193120006*m.x9 - 1.45074874202457*m.x10 + 1.37670915138751*m.x11 - 1.29889609666036*m.x12 + 1.21752285801744*m.x13 - 1.13281247384967*m.x14 + 1.0449971294319*m.x15 - 0.954317520519214*m.x16 + 0.861022193616587*m.x17 - 0.765366864730182*m.x18 + 0.667613718467544*m.x19 - 0.568030689407846*m.x20 + 0.466890727711811*m.x21 - 0.364471050984294*m.x22 + 0.261052384440103*m.x23 - 0.156918191455689*m.x24 + 0.0523538966157463*m.x25 <= 0.01) m.c305 = Constraint(expr= 1.50941916044555*m.x1 - 1.46270740323834*m.x2 + 1.41421356237309*m.x3 - 1.36399672012499*m.x4 + 1.31211805798102*m.x5 - 1.25864078209968*m.x6 + 1.20363004630411*m.x7 - 1.1471528727021*m.x8 + 1.08927807003006*m.x9 - 1.03007614982011*m.x10 + 0.969619240492675*m.x11 - 0.907980999479092*m.x12 + 0.845236523481407*m.x13 - 0.781462256978553*m.x14 + 0.716735899090603*m.x15 - 0.651136308914314*m.x16 + 0.584743409445478*m.x17 - 0.517638090205043*m.x18 + 0.449902108687735*m.x19 - 0.381617990753092*m.x20 + 0.312868930080465*m.x21 - 0.243738686810295*m.x22 + 0.174311485495317*m.x23 - 0.104671912485889*m.x24 + 0.0349048128745672*m.x25 <= 0.01) m.c306 = Constraint(expr= 0.829386485312474*m.x1 - 0.79749813785049*m.x2 + 0.765366864730179*m.x3 - 0.733002453448596*m.x4 + 0.700414762518938*m.x5 - 0.667613718467533*m.x6 + 0.634609312810177*m.x7 - 0.601411599008541*m.x8 + 0.568030689407842*m.x9 - 0.534476752156512*m.x10 + 0.500760008108883*m.x11 - 0.466890727711813*m.x12 + 0.43287922787621*m.x13 - 0.398735868834387*m.x14 + 0.364471050984289*m.x15 - 0.330095211721351*m.x16 + 0.295618822259219*m.x17 - 0.261052384440103*m.x18 + 0.226406427535815*m.x19 - 0.191691505040444*m.x20 + 0.156918191455688*m.x21 - 0.122097079069714*m.x22 + 0.0872387747306707*m.x23 - 0.052353896615747*m.x24 + 0.0174530709967478*m.x25 <= 0.01) m.c307 = Constraint(expr= 1.66589103522235E-14*m.x1 + 4.90230108040894E-15*m.x2 + 1.95819691736259E-15*m.x3 - 8.81869491513412E-15*m.x4 + 1.56791929129057E-14*m.x5 - 8.32883619547518E-15*m.x6 + 9.78479478044706E-16*m.x7 - 7.83897747581624E-15*m.x8 + 4.88620758385765E-16*m.x9 - 7.3491187561573E-15*m.x10 - 1.23796127317672E-18*m.x11 - 6.85926003649835E-15*m.x12 - 4.91096680932118E-16*m.x13 - 6.36940131683941E-15*m.x14 - 9.80955400591059E-16*m.x15 - 5.87954259718047E-15*m.x16 - 1.47081412025E-15*m.x17 - 5.38968387752153E-15*m.x18 - 1.96067283990894E-15*m.x19 - 4.89982515786259E-15*m.x20 + 1.10218211923262E-15*m.x21 - 8.57252759403147E-16*m.x22 + 6.12323399573677E-16*m.x23 - 3.67394039744206E-16*m.x24 + 1.22464679914735E-16*m.x25 <= 0.01)
87.878942
120
0.576323
32,679
259,155
4.570427
0.035497
0.028777
0.007432
0.005718
0.989395
0.989133
0.98296
0.98296
0.98296
0.975502
0
0.697751
0.295769
259,155
2,948
121
87.908752
0.120621
0.002408
0
0.001527
0
0
0
0
0
0
0
0
0
1
0
false
0
0.000382
0
0.000382
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
d2408744531b5d6e022ce9ec84ea61040f1b4c17
13,840
py
Python
test/geometry/transform/test_affine.py
connorlee77/kornia
af5b1f76bedf2a7fc0e0da2386b1be3032b6534f
[ "ECL-2.0", "Apache-2.0" ]
1
2021-10-21T05:13:51.000Z
2021-10-21T05:13:51.000Z
test/geometry/transform/test_affine.py
connorlee77/kornia
af5b1f76bedf2a7fc0e0da2386b1be3032b6534f
[ "ECL-2.0", "Apache-2.0" ]
1
2022-03-12T01:08:10.000Z
2022-03-12T01:08:10.000Z
test/geometry/transform/test_affine.py
connorlee77/kornia
af5b1f76bedf2a7fc0e0da2386b1be3032b6534f
[ "ECL-2.0", "Apache-2.0" ]
1
2021-02-09T02:19:32.000Z
2021-02-09T02:19:32.000Z
import pytest import kornia as kornia import kornia.testing as utils # test utils from test.common import device import torch from torch.autograd import gradcheck from torch.testing import assert_allclose class TestResize: def test_smoke(self, device): inp = torch.rand(1, 3, 3, 4).to(device) out = kornia.resize(inp, (3, 4)) assert_allclose(inp, out) def test_upsize(self, device): inp = torch.rand(1, 3, 3, 4).to(device) out = kornia.resize(inp, (6, 8)) assert out.shape == (1, 3, 6, 8) def test_upsize(self, device): inp = torch.rand(1, 3, 5, 2).to(device) out = kornia.resize(inp, (3, 1)) assert out.shape == (1, 3, 3, 1) def test_one_param(self, device): inp = torch.rand(1, 3, 5, 2).to(device) out = kornia.resize(inp, 10) assert out.shape == (1, 3, 25, 10) def test_gradcheck(self, device): # test parameters new_size = 4 input = torch.rand(1, 2, 3, 4).to(device) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.Resize(new_size), (input, ), raise_exception=True) class TestRotate: def test_angle90(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).to(device) expected = torch.tensor([[ [0., 0.], [4., 6.], [3., 5.], [0., 0.], ]]).to(device) # prepare transformation angle = torch.tensor([90.]).to(device) transform = kornia.Rotate(angle) assert_allclose(transform(inp), expected) def test_angle90_batch2(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [0., 0.], [4., 6.], [3., 5.], [0., 0.], ]], [[ [0., 0.], [5., 3.], [6., 4.], [0., 0.], ]]]).to(device) # prepare transformation angle = torch.tensor([90., -90.]).to(device) transform = kornia.Rotate(angle) assert_allclose(transform(inp), expected) def test_angle90_batch2_broadcast(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [0., 0.], [4., 6.], [3., 5.], [0., 0.], ]], [[ [0., 0.], [4., 6.], [3., 5.], [0., 0.], ]]]).to(device) # prepare transformation angle = torch.tensor([90.]).to(device) transform = kornia.Rotate(angle) assert_allclose(transform(inp), expected) def test_gradcheck(self, device): # test parameters angle = torch.tensor([90.]).to(device) angle = utils.tensor_to_gradcheck_var( angle, requires_grad=False) # to var # evaluate function gradient input = torch.rand(1, 2, 3, 4).to(device) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.rotate, (input, angle,), raise_exception=True) @pytest.mark.skip('Need deep look into it since crashes everywhere.') @pytest.mark.skip(reason="turn off all jit for a while") def test_jit(self, device): angle = torch.tensor([90.]).to(device) batch_size, channels, height, width = 2, 3, 64, 64 img = torch.ones(batch_size, channels, height, width).to(device) rot = kornia.Rotate(angle) rot_traced = torch.jit.trace(kornia.Rotate(angle), img) assert_allclose(rot(img), rot_traced(img)) class TestTranslate: def test_dxdy(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).to(device) expected = torch.tensor([[ [0., 1.], [0., 3.], [0., 5.], [0., 7.], ]]).to(device) # prepare transformation translation = torch.tensor([[1., 0.]]).to(device) transform = kornia.Translate(translation) assert_allclose(transform(inp), expected) def test_dxdy_batch(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [0., 1.], [0., 3.], [0., 5.], [0., 7.], ]], [[ [0., 0.], [0., 1.], [0., 3.], [0., 5.], ]]]).to(device) # prepare transformation translation = torch.tensor([[1., 0.], [1., 1.]]).to(device) transform = kornia.Translate(translation) assert_allclose(transform(inp), expected) def test_dxdy_batch_broadcast(self, device): # prepare input data inp = torch.tensor([[ [1., 2.], [3., 4.], [5., 6.], [7., 8.], ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [0., 1.], [0., 3.], [0., 5.], [0., 7.], ]], [[ [0., 1.], [0., 3.], [0., 5.], [0., 7.], ]]]).to(device) # prepare transformation translation = torch.tensor([[1., 0.]]).to(device) transform = kornia.Translate(translation) assert_allclose(transform(inp), expected) def test_gradcheck(self, device): # test parameters translation = torch.tensor([[1., 0.]]).to(device) translation = utils.tensor_to_gradcheck_var( translation, requires_grad=False) # to var # evaluate function gradient input = torch.rand(1, 2, 3, 4).to(device) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.translate, (input, translation,), raise_exception=True) @pytest.mark.skip('Need deep look into it since crashes everywhere.') @pytest.mark.skip(reason="turn off all jit for a while") def test_jit(self, device): translation = torch.tensor([[1., 0.]]).to(device) batch_size, channels, height, width = 2, 3, 64, 64 img = torch.ones(batch_size, channels, height, width).to(device) trans = kornia.Translate(translation) trans_traced = torch.jit.trace(kornia.Translate(translation), img) assert_allclose(trans(img), trans_traced(img)) class TestScale: def test_scale_factor_2(self, device): # prepare input data inp = torch.tensor([[ [0., 0., 0., 0.], [0., 1., 1., 0.], [0., 1., 1., 0.], [0., 0., 0., 0.] ]]).to(device) # prepare transformation scale_factor = torch.tensor([2.]).to(device) transform = kornia.Scale(scale_factor) assert_allclose(transform(inp).sum().item(), 12.25) def test_scale_factor_05(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).to(device) expected = torch.tensor([[ [0., 0., 0., 0.], [0., 1., 1., 0.], [0., 1., 1., 0.], [0., 0., 0., 0.] ]]).to(device) # prepare transformation scale_factor = torch.tensor([0.5]).to(device) transform = kornia.Scale(scale_factor) assert_allclose(transform(inp), expected) def test_scale_factor_05_batch2(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[ [0., 0., 0., 0.], [0., 1., 1., 0.], [0., 1., 1., 0.], [0., 0., 0., 0.] ]]).to(device) # prepare transformation scale_factor = torch.tensor([0.5, 0.5]).to(device) transform = kornia.Scale(scale_factor) assert_allclose(transform(inp), expected) def test_scale_factor_05_batch2_broadcast(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[ [0., 0., 0., 0.], [0., 1., 1., 0.], [0., 1., 1., 0.], [0., 0., 0., 0.] ]]).to(device) # prepare transformation scale_factor = torch.tensor([0.5]).to(device) transform = kornia.Scale(scale_factor) assert_allclose(transform(inp), expected) def test_gradcheck(self, device): # test parameters scale_factor = torch.tensor([0.5]).to(device) scale_factor = utils.tensor_to_gradcheck_var( scale_factor, requires_grad=False) # to var # evaluate function gradient input = torch.rand(1, 2, 3, 4).to(device) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.scale, (input, scale_factor,), raise_exception=True) @pytest.mark.skip('Need deep look into it since crashes everywhere.') @pytest.mark.skip(reason="turn off all jit for a while") def test_jit(self, device): scale_factor = torch.tensor([0.5]).to(device) batch_size, channels, height, width = 2, 3, 64, 64 img = torch.ones(batch_size, channels, height, width).to(device) trans = kornia.Scale(scale_factor) trans_traced = torch.jit.trace(kornia.Scale(scale_factor), img) assert_allclose(trans(img), trans_traced(img)) class TestShear: def test_shear_x(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).to(device) expected = torch.tensor([[ [1., 1., 1., 1.], [.5, 1., 1., 1.], [0., 1., 1., 1.], [0., .5, 1., 1.] ]]).to(device) # prepare transformation shear = torch.tensor([[0.5, 0.0]]).to(device) transform = kornia.Shear(shear) assert_allclose(transform(inp), expected) def test_shear_y(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).to(device) expected = torch.tensor([[ [1., .5, 0., 0.], [1., 1., 1., .5], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).to(device) # prepare transformation shear = torch.tensor([[0.0, 0.5]]).to(device) transform = kornia.Shear(shear) assert_allclose(transform(inp), expected) def test_shear_batch2(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [1., 1., 1., 1.], [.5, 1., 1., 1.], [0., 1., 1., 1.], [0., .5, 1., 1.] ]], [[ [1., .5, 0., 0.], [1., 1., 1., .5], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]]).to(device) # prepare transformation shear = torch.tensor([[0.5, 0.0], [0.0, 0.5]]).to(device) transform = kornia.Shear(shear) assert_allclose(transform(inp), expected) def test_shear_batch2_broadcast(self, device): # prepare input data inp = torch.tensor([[ [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.] ]]).repeat(2, 1, 1, 1).to(device) expected = torch.tensor([[[ [1., 1., 1., 1.], [.5, 1., 1., 1.], [0., 1., 1., 1.], [0., .5, 1., 1.] ]]]).to(device) # prepare transformation shear = torch.tensor([[0.5, 0.0]]).to(device) transform = kornia.Shear(shear) assert_allclose(transform(inp), expected) def test_gradcheck(self, device): # test parameters shear = torch.tensor([[0.5, 0.0]]).to(device) shear = utils.tensor_to_gradcheck_var( shear, requires_grad=False) # to var # evaluate function gradient input = torch.rand(1, 2, 3, 4).to(device) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.shear, (input, shear,), raise_exception=True) @pytest.mark.skip('Need deep look into it since crashes everywhere.') @pytest.mark.skip(reason="turn off all jit for a while") def test_jit(self, device): shear = torch.tensor([[0.5, 0.0]]).to(device) batch_size, channels, height, width = 2, 3, 64, 64 img = torch.ones(batch_size, channels, height, width).to(device) trans = kornia.Shear(shear) trans_traced = torch.jit.trace(kornia.Shear(shear), img) assert_allclose(trans(img), trans_traced(img))
32.641509
82
0.48685
1,678
13,840
3.932658
0.066746
0.052432
0.060464
0.06304
0.890741
0.861343
0.840127
0.825428
0.806637
0.778148
0
0.064083
0.33815
13,840
423
83
32.718676
0.656332
0.061344
0
0.80117
0
0
0.023488
0
0
0
0
0
0.081871
1
0.078947
false
0
0.020468
0
0.114035
0
0
0
0
null
0
0
0
1
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
7
d2550633518e9185fbe163e3cc99e5b5c172d0f9
1,873
py
Python
core/migrations/0022_alter_default_date_and_time.py
Alberdi/babybuddy
b2c228fac9d8a7d3abfaf284b37174594493a185
[ "BSD-2-Clause" ]
922
2017-10-26T13:15:40.000Z
2020-02-05T19:06:13.000Z
core/migrations/0022_alter_default_date_and_time.py
Alberdi/babybuddy
b2c228fac9d8a7d3abfaf284b37174594493a185
[ "BSD-2-Clause" ]
109
2017-10-26T14:00:30.000Z
2020-02-05T23:37:11.000Z
core/migrations/0022_alter_default_date_and_time.py
Alberdi/babybuddy
b2c228fac9d8a7d3abfaf284b37174594493a185
[ "BSD-2-Clause" ]
87
2017-10-26T13:15:54.000Z
2020-01-25T12:49:46.000Z
# Generated by Django 4.0.4 on 2022-04-12 02:07 import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0021_pumping"), ] operations = [ migrations.AlterField( model_name="bmi", name="date", field=models.DateField( default=django.utils.timezone.localdate, verbose_name="Date" ), ), migrations.AlterField( model_name="diaperchange", name="time", field=models.DateTimeField( default=django.utils.timezone.localtime, verbose_name="Time" ), ), migrations.AlterField( model_name="headcircumference", name="date", field=models.DateField( default=django.utils.timezone.localdate, verbose_name="Date" ), ), migrations.AlterField( model_name="height", name="date", field=models.DateField( default=django.utils.timezone.localdate, verbose_name="Date" ), ), migrations.AlterField( model_name="note", name="time", field=models.DateTimeField( default=django.utils.timezone.localtime, verbose_name="Time" ), ), migrations.AlterField( model_name="temperature", name="time", field=models.DateTimeField( default=django.utils.timezone.localtime, verbose_name="Time" ), ), migrations.AlterField( model_name="weight", name="date", field=models.DateField( default=django.utils.timezone.localdate, verbose_name="Date" ), ), ]
29.265625
76
0.532835
157
1,873
6.261147
0.280255
0.089522
0.154629
0.206511
0.744659
0.744659
0.744659
0.744659
0.744659
0.744659
0
0.01582
0.358783
1,873
63
77
29.730159
0.802664
0.024026
0
0.736842
1
0
0.071742
0
0
0
0
0
0
1
0
false
0
0.035088
0
0.087719
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
9676c6b03ef872d2971f85f8a310f037dcd15567
3,269
py
Python
GitHub User Info using tkinter/code.py
Ranjul-Arumadi/Mini-Projects
cecc8aade59f858ebac64bd7e30832bc80ef2a97
[ "MIT" ]
1
2021-06-23T18:49:30.000Z
2021-06-23T18:49:30.000Z
GitHub User Info using tkinter/code.py
Ranjul-Arumadi/Mini-Projects
cecc8aade59f858ebac64bd7e30832bc80ef2a97
[ "MIT" ]
null
null
null
GitHub User Info using tkinter/code.py
Ranjul-Arumadi/Mini-Projects
cecc8aade59f858ebac64bd7e30832bc80ef2a97
[ "MIT" ]
null
null
null
import tkinter as tk import requests HEIGHT = 500 WIDTH = 600 def format_response(user_data): try: name = user_data['name'] usrid = user_data['id'] company = user_data['company'] login = user_data['login'] followers = user_data['followers'] following = user_data['following'] final_str = 'Name: %s \n id: %s \n Company: %s \n Login: %s \n Followers: %s \n Following: %s' % (name, usrid, company, login, followers, following) except: final_str = 'There was a problem retrieving that information' return final_str def get_user_data(userName): url = f"https://api.github.com/users/{userName}" user_data = requests.get(url).json() label['text'] = format_response(user_data) root = tk.Tk() root.title('Dimport tkinter as tk import tkinter as tk import requests HEIGHT = 500 WIDTH = 600 def format_response(user_data): try: name = user_data['name'] usrid = user_data['id'] company = user_data['company'] login = user_data['login'] followers = user_data['followers'] following = user_data['following'] final_str = 'Name: %s \n id: %s \n Company: %s \n Login: %s \n Followers: %s \n Following: %s' % (name, usrid, company, login, followers, following) except: final_str = 'There was a problem retrieving that information' return final_str def get_user_data(userName): url = f"https://api.github.com/users/{userName}" user_data = requests.get(url).json() label['text'] = format_response(user_data) root = tk.Tk() root.title('Github User Info') canvas = tk.Canvas(root, height=HEIGHT, width=WIDTH) canvas.pack() background_image = tk.PhotoImage(file='wallpaper.png') background_label = tk.Label(root, image=background_image) background_label.place(relwidth=1, relheight=1) frame = tk.Frame(root, bg='#00050a', bd=5) frame.place(relx=0.5, rely=0.1, relwidth=0.75, relheight=0.1, anchor='n') entry = tk.Entry(frame, font=40) entry.place(relwidth=0.65, relheight=1) button = tk.Button(frame, text="Get details", font=40, command=lambda: get_user_data(entry.get())) button.place(relx=0.7, relheight=1, relwidth=0.3) lower_frame = tk.Frame(root, bg='#00050a', bd=10) lower_frame.place(relx=0.5, rely=0.25, relwidth=0.75, relheight=0.6, anchor='n') label = tk.Label(lower_frame) label.place(relwidth=1, relheight=1) root.mainloop()') canvas = tk.Canvas(root, height=HEIGHT, width=WIDTH) canvas.pack() background_image = tk.PhotoImage(file='wallpaper.png') background_label = tk.Label(root, image=background_image) background_label.place(relwidth=1, relheight=1) frame = tk.Frame(root, bg='#00050a', bd=5) frame.place(relx=0.5, rely=0.1, relwidth=0.75, relheight=0.1, anchor='n') entry = tk.Entry(frame, font=40) entry.place(relwidth=0.65, relheight=1) button = tk.Button(frame, text="Get details", font=40, command=lambda: get_user_data(entry.get())) button.place(relx=0.7, relheight=1, relwidth=0.3) lower_frame = tk.Frame(root, bg='#00050a', bd=10) lower_frame.place(relx=0.5, rely=0.25, relwidth=0.75, relheight=0.6, anchor='n') label = tk.Label(lower_frame) label.place(relwidth=1, relheight=1) root.mainloop()
27.470588
156
0.675436
491
3,269
4.395112
0.179226
0.081557
0.027804
0.040779
0.985171
0.985171
0.985171
0.985171
0.985171
0.985171
0
0.04065
0.172224
3,269
118
157
27.70339
0.756837
0
0
0.947368
0
0.052632
0.155399
0
0
0
0
0
0
0
null
null
0
0.065789
null
null
0
0
0
0
null
0
0
0
1
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
1
0
0
0
0
0
0
0
0
8
96aa7211ee9e78b2d432b7450375c76eff010956
173
py
Python
tests/unit/cli/commands/command_init_test.py
nichelia/ekrhizoc
1d14ec10dc3e4fd34b45cff7640a56ad0d9f5e6c
[ "MIT" ]
null
null
null
tests/unit/cli/commands/command_init_test.py
nichelia/ekrhizoc
1d14ec10dc3e4fd34b45cff7640a56ad0d9f5e6c
[ "MIT" ]
88
2020-02-16T02:16:56.000Z
2021-08-03T06:39:11.000Z
tests/unit/cli/commands/command_init_test.py
nichelia/ekrhizoc
1d14ec10dc3e4fd34b45cff7640a56ad0d9f5e6c
[ "MIT" ]
null
null
null
"""command_init_test """ from ekrhizoc.cli.commands import COMMANDS def test_commands(): """test_commands """ assert [C().name for C in COMMANDS] == ["crawl"]
17.3
52
0.653179
22
173
4.954545
0.681818
0.220183
0
0
0
0
0
0
0
0
0
0
0.184971
173
9
53
19.222222
0.77305
0.208092
0
0
0
0
0.04
0
0
0
0
0
0.333333
1
0.333333
true
0
0.333333
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
7
fbcbc9133f43874c74aa1491006f01894de94488
14,204
py
Python
HIL/utils/rules.py
fkie-cad/ipal_datasets
1ac7037150288937de954918733c06389e581f09
[ "MIT" ]
5
2021-11-08T16:57:54.000Z
2022-03-28T01:51:09.000Z
HIL/utils/rules.py
fkie-cad/ipal_datasets
1ac7037150288937de954918733c06389e581f09
[ "MIT" ]
null
null
null
HIL/utils/rules.py
fkie-cad/ipal_datasets
1ac7037150288937de954918733c06389e581f09
[ "MIT" ]
null
null
null
JS = { "protocols": ["modbus"], "rename": { "84.3.251.18:502:[0-9]+": "PLC1", "84.3.251.101:502:[0-2]": "PLC2", "84.3.251.102:502:[0-5]": "PLC3", "84.3.251.103:502:[0-5]": "PLC4", }, "rules": [ # Tank 1-8 { "src": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_1", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_1", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Tank_2", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Tank_2", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.3"], "method": lambda x: x[0], "name": "Tank_3", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.3"], "method": lambda x: x[0], "name": "Tank_3", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.4"], "method": lambda x: x[0], "name": "Tank_4", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.4"], "method": lambda x: x[0], "name": "Tank_4", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.5"], "method": lambda x: x[0], "name": "Tank_5", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "3", "var": ["holding.register.5"], "method": lambda x: x[0], "name": "Tank_5", "remove": True, }, { "src": "84.3.251.101:502:[0-2]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_6", "remove": True, }, { "dest": "84.3.251.101:502:[0-2]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_6", "remove": True, }, { "src": "84.3.251.102:502:[0-5]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_7", "remove": True, }, { "dest": "84.3.251.102:502:[0-5]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_7", "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_8", "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.1"], "method": lambda x: x[0], "name": "Tank_8", "remove": True, }, # Pump 1-6 { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.20"], "method": lambda x: x[0] == 1, "name": "Pump_1", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.20"], "method": lambda x: x[0] == 1, "name": "Pump_1", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.21"], "method": lambda x: x[0] == 1, "name": "Pump_2", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.21"], "method": lambda x: x[0] == 1, "name": "Pump_2", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.22"], "method": lambda x: x[0] == 1, "name": "Pump_3", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.22"], "method": lambda x: x[0] == 1, "name": "Pump_3", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.23"], "method": lambda x: x[0] == 1, "name": "Pump_4", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.23"], "method": lambda x: x[0] == 1, "name": "Pump_4", "remove": True, }, { "src": "84.3.251.102:502:[0-5]", "type": "1", "var": ["coil.1"], "method": lambda x: x[0] == 1, "name": "Pump_5", "remove": True, }, { "dest": "84.3.251.102:502:[0-5]", "type": "1", "var": ["coil.1"], "method": lambda x: x[0] == 1, "name": "Pump_5", "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "type": "1", "var": ["coil.1"], "method": lambda x: x[0] == 1, "name": "Pump_6", "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "type": "1", "var": ["coil.1"], "method": lambda x: x[0] == 1, "name": "Pump_6", "remove": True, }, # Flow sensor 1,2,4 { "src": "84.3.251.102:502:[0-5]", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Flow_sensor_1", "remove": True, }, { "dest": "84.3.251.102:502:[0-5]", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Flow_sensor_1", "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Flow_sensor_2", "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.2"], "method": lambda x: x[0], "name": "Flow_sensor_2", "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.3"], "method": lambda x: x[0], "name": "Flow_sensor_4", "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "type": "3", "var": ["holding.register.3"], "method": lambda x: x[0], "name": "Flow_sensor_4", "remove": True, }, # Valve 10-15,17,18,20,22 { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.39"], "method": lambda x: x[0] == 1, "name": "Valv_10", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.39"], "method": lambda x: x[0] == 1, "name": "Valv_10", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.40"], "method": lambda x: x[0] == 1, "name": "Valv_11", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.40"], "method": lambda x: x[0] == 1, "name": "Valv_11", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.41"], "method": lambda x: x[0] == 1, "name": "Valv_12", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.41"], "method": lambda x: x[0] == 1, "name": "Valv_12", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.42"], "method": lambda x: x[0] == 1, "name": "Valv_13", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.42"], "method": lambda x: x[0] == 1, "name": "Valv_13", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.43"], "method": lambda x: x[0] == 1, "name": "Valv_14", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.43"], "method": lambda x: x[0] == 1, "name": "Valv_14", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.44"], "method": lambda x: x[0] == 1, "name": "Valv_15", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.44"], "method": lambda x: x[0] == 1, "name": "Valv_15", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.46"], "method": lambda x: x[0] == 1, "name": "Valv_17", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.46"], "method": lambda x: x[0] == 1, "name": "Valv_17", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.47"], "method": lambda x: x[0] == 1, "name": "Valv_18", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.47"], "method": lambda x: x[0] == 1, "name": "Valv_18", "remove": True, }, { "src": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.49"], "method": lambda x: x[0] == 1, "name": "Valv_20", "remove": True, }, { "dest": "84.3.251.18:502:[0-9]+", "type": "1", "var": ["coil.49"], "method": lambda x: x[0] == 1, "name": "Valv_20", "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "type": "1", "var": ["coil.2"], "method": lambda x: x[0] == 1, "name": "Valv_22", "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "type": "1", "var": ["coil.2"], "method": lambda x: x[0] == 1, "name": "Valv_22", "remove": True, }, # Remove empty registers { "src": "84.3.251.18:502:[0-9]+", "var": [ "holding.register.5", "coil.0", "coil.1", "coil.2", "coil.3", "coil.4", "coil.5", "coil.6", "coil.7", "coil.30", "coil.31", "coil.32", "coil.33", "coil.34", "coil.35", "coil.36", "coil.37", "coil.38", "coil.45", "coil.48", "coil.49", ], "remove": True, }, {"dest": "84.3.251.18:502:[0-9]+", "var": ["coil.50"], "remove": True}, { "src": "84.3.251.101:502:[0-2]", "var": ["holding.register.1", "coil.1"], "remove": True, }, { "src": "84.3.251.102:502:[0-5]", "var": ["holding.register.1", "holding.register.3", "coil.2"], "remove": True, }, { "dest": "84.3.251.102:502:[0-5]", "var": ["holding.register.3"], "remove": True, }, { "src": "84.3.251.103:502:[0-5]", "var": ["holding.register.3"], "remove": True, }, { "dest": "84.3.251.103:502:[0-5]", "var": ["holding.register.3"], "remove": True, }, ], }
28.294821
79
0.315052
1,504
14,204
2.935505
0.052527
0.044168
0.088335
0.171234
0.935674
0.935674
0.935674
0.921857
0.916874
0.916648
0
0.160957
0.46156
14,204
501
80
28.351297
0.416318
0.005773
0
0.685484
0
0
0.306107
0.101303
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
83b71a9422adfb9ae87a6b4be6fea84626caeef4
28,672
py
Python
EvaluationFunctions/LoadFrameworkDesignsFilenames.py
Lucciola111/stream_autoencoder_windowing
5456b07bd20220c987598db2cdb832d8195e1575
[ "MIT" ]
4
2021-09-16T05:50:25.000Z
2021-12-31T07:04:55.000Z
EvaluationFunctions/LoadFrameworkDesignsFilenames.py
Lucciola111/stream_autoencoder_windowing
5456b07bd20220c987598db2cdb832d8195e1575
[ "MIT" ]
null
null
null
EvaluationFunctions/LoadFrameworkDesignsFilenames.py
Lucciola111/stream_autoencoder_windowing
5456b07bd20220c987598db2cdb832d8195e1575
[ "MIT" ]
1
2021-12-16T06:53:08.000Z
2021-12-16T06:53:08.000Z
import sys def load_framework_designs_filenames(experiment): """ Parameters ---------- experiment: Identifier of experiment for evaluation Returns the path and name of the dataset and a list with the file names of the results ------- """ result_file_names = {} # Experiments normal distribution if experiment == 'onlyMeanDrift_VerySmallVariance_50DR_RandomNormal_Min1DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_00.57_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_01.20_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_10.40_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_11.07_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_11.27_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.01_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-10_10.32.pickle_2021-08-12_11.48_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == 'onlyMeanDrift_SmallVariance_50DR_RandomNormal_Min1DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_01.57_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_02.22_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_02.59_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_03.48_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_04.17_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.05_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.42.pickle_2021-08-13_04.54_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == 'onlyMeanDrift_HigherVariance_50DR_RandomNormal_Min1DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_06.13_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_06.46_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_08.41_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_10.57_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_11.48_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyMeanDrift_var0.25_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.45.pickle_2021-08-13_15.53_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == 'onlyVarianceDrift_50DR_RandomNormal_Min1DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-08_19.34_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-08_20.07_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-08_21.38_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-08_23.52_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-09_00.40_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_onlyVarianceDrift_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_11.15.pickle_2021-08-09_02.41_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '50DR_RandomNormal_Min100DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_04.49_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_05.24_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_06.26_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_08.23_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_09.01_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_100MinDimBroken_300MinL_2000MaxL_2021-08-06_10.54.pickle_2021-08-09_10.28_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '50DR_RandomNormal_Min1DimsBroken': path = "Generated_Streams/Drift_Labels/" dataset = "RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle""RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-09_12.16_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-09_12.50_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-09_14.03_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-09_16.18_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-09_17.06_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_300MinL_2000MaxL_2021-08-06_10.53.pickle_2021-08-12_11.48_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' # Experiments other datasets elif experiment == '100DR_Merged_Min1Broken': path = "Generated_Streams/Drift_Labels/" dataset = "Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_50DR_100Dims_1MinDimBroken_DATASET_B_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_01.34_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_10.52_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_11.59_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_13.43_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_14.21_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Mixed_300MinDistance_DATASET_A_RandomNumpyRandomNormalUniform_DATASET_B_RandomRandomRBF.pickle_2021-08-12_15.59_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '50DR_RandomRandomRBF_Min1DriftCentroid_0to1CS': path = "Generated_Streams/Drift_And_Classifier_Labels/" dataset = "RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_01.15_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_01.48_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_03.04_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_05.01_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_05.44_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomRandomRBF_50DR_100Dims_50Centroids_1MinDriftCentroids_300MinL_2000MaxL_2021-08-06_10.57.pickle_2021-08-09_07.42_10ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '50DR_RandomMNIST_(Fashion)MNIST_SortAllNumbers': path = "Generated_Streams/Image_Data_Drift_And_Classifier_Labels/" dataset = "RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-09_11.34_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-09_12.38_10ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-11_04.16_1ITERATIONS__fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-11_05.35_1ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-11_06.05_1ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_RandomMNIST_and_FashionMNIST_SortAllNumbers19DR_2021-08-06_11.07.pickle_2021-08-11_09.40_1ITERATIONS__fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' # Experiments Time Complexity Analysis elif experiment == '10Dim': path = "Generated_Streams/Drift_Labels/" dataset = "Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_17.32_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_17.37_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_17.53_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_18.03_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_18.10_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_10Dims_1MinDimBroken_300MinL_2000MaxL_2021-09-06_22.24.pickle_2021-09-07_18.25_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '50Dim': path = "Generated_Streams/Drift_Labels/" dataset = "Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_18.51_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_19.02_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_19.30_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_19.53_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_20.03_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_50Dims_5MinDimBroken_300MinL_2000MaxL_2021-09-06_22.25.pickle_2021-09-07_20.29_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '100Dim': path = "Generated_Streams/Drift_Labels/" dataset = "Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_20.56_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_21.13_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_21.42_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_22.19_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_22.37_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_100Dims_10MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_23.00_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '500Dim': path = "Generated_Streams/Drift_Labels/" dataset = "Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-07_23.46_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-08_00.06_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-08_00.59_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-08_01.32_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-08_01.52_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_500Dims_50MinDimBroken_300MinL_2000MaxL_2021-09-06_22.26.pickle_2021-09-08_02.20_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' elif experiment == '1000Dim': path = "Generated_Streams/Drift_Labels/" dataset = "Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle" result_file_names["FILE_TrainNewAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_03.21_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_04.06_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_TrainNewAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_05.24_10ITERATIONS_0.5ENCODER_fitNewAETrue_fitFalse_initNewADWINTrue_feedNewADWINTrue' result_file_names["FILE_RetrainAE_KeepADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_06.37_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINFalse_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_07.07_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINFalse' result_file_names["FILE_RetrainAE_InitializeAndFeedADWIN"] = 'SAW_Autoencoder_ADWIN_Training_Time_RandomNumpyRandomNormalUniform_10DR_1000Dims_100MinDimBroken_300MinL_2000MaxL_2021-09-06_22.27.pickle_2021-09-08_08.11_10ITERATIONS_0.5ENCODER_fitNewAEFalse_fitTrue_initNewADWINTrue_feedNewADWINTrue' else: print("Error: Experiment identifier does not exist!") sys.exit() return path, dataset, result_file_names
160.178771
310
0.895194
3,242
28,672
7.239358
0.053362
0.028377
0.054964
0.098935
0.960588
0.949084
0.946954
0.94052
0.928504
0.896634
0
0.134259
0.052595
28,672
178
311
161.078652
0.729753
0.009277
0
0.090226
0
0
0.855657
0.853084
0
0
0
0
0
1
0.007519
false
0
0.007519
0
0.022556
0.007519
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
83e742b807790794be8efb6bbc6f56f99fb639c3
38,683
py
Python
electrumsv/tests/test_transaction.py
electrumsv/electrumsv
a2d9027ccec338cadfca778888e6ef7f077b1651
[ "MIT" ]
136
2019-01-10T15:49:09.000Z
2022-02-20T04:46:39.000Z
electrumsv/tests/test_transaction.py
electrumsv/electrumsv
a2d9027ccec338cadfca778888e6ef7f077b1651
[ "MIT" ]
790
2019-01-07T01:53:35.000Z
2022-03-30T23:04:28.000Z
electrumsv/tests/test_transaction.py
electrumsv/electrumsv
a2d9027ccec338cadfca778888e6ef7f077b1651
[ "MIT" ]
65
2019-01-10T23:55:30.000Z
2021-12-19T06:47:13.000Z
import json from typing import cast from bitcoinx import bip32_key_from_string, BIP32PublicKey, P2PKH_Address, PrivateKey, \ PublicKey, Tx import pytest from electrumsv.bitcoin import address_from_string from electrumsv.constants import KeystoreTextType from electrumsv.keystore import BIP32_KeyStore, Old_KeyStore, instantiate_keystore_from_text from electrumsv.transaction import XPublicKey, Transaction, TransactionContext, NO_SIGNATURE unsigned_blob = '010000000149f35e43fefd22d8bb9e4b3ff294c6286154c25712baf6ab77b646e5074d6aed010000005701ff4c53ff0488b21e0000000000000000004f130d773e678a58366711837ec2e33ea601858262f8eaef246a7ebd19909c9a03c3b30e38ca7d797fee1223df1c9827b2a9f3379768f520910260220e0560014600002300feffffffd8e43201000000000118e43201000000001976a914e158fb15c888037fdc40fb9133b4c1c3c688706488ac5fbd0700' signed_blob = '010000000149f35e43fefd22d8bb9e4b3ff294c6286154c25712baf6ab77b646e5074d6aed010000006a473044022025bdc804c6fe30966f6822dc25086bc6bb0366016e68e880cf6efd2468921f3202200e665db0404f6d6d9f86f73838306ac55bb0d0f6040ac6047d4e820f24f46885412103b5bbebceeb33c1b61f649596b9c3611c6b2853a1f6b48bce05dd54f667fa2166feffffff0118e43201000000001976a914e158fb15c888037fdc40fb9133b4c1c3c688706488ac5fbd0700' v2_blob = "0200000001191601a44a81e061502b7bfbc6eaa1cef6d1e6af5308ef96c9342f71dbf4b9b5000000006b483045022100a6d44d0a651790a477e75334adfb8aae94d6612d01187b2c02526e340a7fd6c8022028bdf7a64a54906b13b145cd5dab21a26bd4b85d6044e9b97bceab5be44c2a9201210253e8e0254b0c95776786e40984c1aa32a7d03efa6bdacdea5f421b774917d346feffffff026b20fa04000000001976a914024db2e87dd7cfd0e5f266c5f212e21a31d805a588aca0860100000000001976a91421919b94ae5cefcdf0271191459157cdb41c4cbf88aca6240700" class TestTransaction: def test_tx_unsigned(self): tx = Transaction.from_extended_bytes(bytes.fromhex(unsigned_blob)) assert tx.version == 1 assert len(tx.inputs) == 1 txin = tx.inputs[0] assert txin.prev_hash.hex() == '49f35e43fefd22d8bb9e4b3ff294c6286154c25712baf6ab77b646e5074d6aed' assert txin.prev_idx == 1 assert txin.script_sig.to_hex() == '01ff4c53ff0488b21e0000000000000000004f130d773e678a58366711837ec2e33ea601858262f8eaef246a7ebd19909c9a03c3b30e38ca7d797fee1223df1c9827b2a9f3379768f520910260220e0560014600002300' assert txin.script_length == 87 assert txin.script_offset == 42 assert txin.sequence == 4294967294 assert txin.value == 20112600 assert txin.signatures == [NO_SIGNATURE] assert txin.x_pubkeys == [XPublicKey.from_hex('ff0488b21e0000000000000000004f130d773e678a58366711837ec2e33ea601858262f8eaef246a7ebd19909c9a03c3b30e38ca7d797fee1223df1c9827b2a9f3379768f520910260220e0560014600002300')] assert txin.threshold == 1 txout = tx.outputs[0] assert txout.value == 20112408 and txout.script_pubkey == cast(P2PKH_Address, address_from_string('1MYXdf4moacvaEKZ57ozerpJ3t9xSeN6LK')).to_script() assert txout.script_length == 25 assert txout.script_offset == 151 assert tx.locktime == 507231 assert json.dumps(tx.to_dict(TransactionContext())) == '{"version": 1, "hex": "010000000149f35e43fefd22d8bb9e4b3ff294c6286154c25712baf6ab77b646e5074d6aed010000002401ff2103b5bbebceeb33c1b61f649596b9c3611c6b2853a1f6b48bce05dd54f667fa2166feffffff0118e43201000000001976a914e158fb15c888037fdc40fb9133b4c1c3c688706488ac5fbd0700", "complete": false, "inputs": [{"script_type": 2, "threshold": 1, "value": 20112600, "signatures": ["ff"], "x_pubkeys": [{"bip32_xpub": "xpub661MyMwAqRbcFL6WFqND2XM2w1EfpBwFfhsSUcw9xDR3nH8eYLv4z4HAhxv5zkqjHojWsPYK1ZSK7yCr8fZ9iWU6D361G2ryv5UgsKjbeDq", "derivation_path": [0, 35]}]}]}' def test_tx_signed(self): # This is testing the extended parsing for a signed transaction. tx_bytes = bytes.fromhex(signed_blob) tx = Transaction.from_extended_bytes(tx_bytes) assert tx.version == 1 assert len(tx.inputs) == 1 txin = tx.inputs[0] assert txin.prev_hash.hex() == '49f35e43fefd22d8bb9e4b3ff294c6286154c25712baf6ab77b646e5074d6aed' assert txin.prev_idx == 1 assert txin.script_sig.to_hex() == '473044022025bdc804c6fe30966f6822dc25086bc6bb0366016e68e880cf6efd2468921f3202200e665db0404f6d6d9f86f73838306ac55bb0d0f6040ac6047d4e820f24f46885412103b5bbebceeb33c1b61f649596b9c3611c6b2853a1f6b48bce05dd54f667fa2166' assert txin.script_length == 106 assert txin.script_offset == 42 assert txin.sequence == 4294967294 assert txin.signatures == [bytes.fromhex('3044022025bdc804c6fe30966f6822dc25086bc6bb0366016e68e880cf6efd2468921f3202200e665db0404f6d6d9f86f73838306ac55bb0d0f6040ac6047d4e820f24f4688541')] assert txin.x_pubkeys == [XPublicKey.from_hex('03b5bbebceeb33c1b61f649596b9c3611c6b2853a1f6b48bce05dd54f667fa2166')] assert txin.threshold == 1 txout = tx.outputs[0] assert txout.value == 20112408 and txout.script_pubkey == cast(P2PKH_Address, address_from_string('1MYXdf4moacvaEKZ57ozerpJ3t9xSeN6LK')).to_script() assert txout.script_length == 25 assert txout.script_offset == 162 assert tx.locktime == 507231 assert tx.to_dict(TransactionContext()) == {'hex': signed_blob, 'complete': True, 'version': 1} assert tx.serialize() == signed_blob tx.update_signatures(signed_blob) assert sum(tx.estimated_size()) == len(tx_bytes) def test_parse_xpub(self): res = XPublicKey.from_hex('fe4e13b0f311a55b8a5db9a32e959da9f011b131019d4cebe6141b9e2c93edcbfc0954c358b062a9f94111548e50bde5847a3096b8b7872dcffadb0e9579b9017b01000200').to_address() assert res == address_from_string('19h943e4diLc68GXW7G75QNe2KWuMu7BaJ') def test_version_field(self): tx = Transaction.from_hex(v2_blob) assert tx.txid() == "b97f9180173ab141b61b9f944d841e60feec691d6daab4d4d932b24dd36606fe" def test_txid_coinbase_to_p2pk(self): tx = Transaction.from_hex('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4103400d0302ef02062f503253482f522cfabe6d6dd90d39663d10f8fd25ec88338295d4c6ce1c90d4aeb368d8bdbadcc1da3b635801000000000000000474073e03ffffffff013c25cf2d01000000434104b0bd634234abbb1ba1e986e884185c61cf43e001f9137f23c2c409273eb16e6537a576782eba668a7ef8bd3b3cfb1edb7117ab65129b8a2e681f3c1e0908ef7bac00000000') assert 'dbaf14e1c476e76ea05a8b71921a46d6b06f0a950f17c5f9f1a03b8fae467f10' == tx.txid() def test_txid_coinbase_to_p2pkh(self): tx = Transaction.from_hex('01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff25033ca0030400001256124d696e656420627920425443204775696c640800000d41000007daffffffff01c00d1298000000001976a91427a1f12771de5cc3b73941664b2537c15316be4388ac00000000') assert '4328f9311c6defd9ae1bd7f4516b62acf64b361eb39dfcf09d9925c5fd5c61e8' == tx.txid() def test_txid_p2pk_to_p2pkh(self): tx = Transaction.from_hex('010000000118231a31d2df84f884ced6af11dc24306319577d4d7c340124a7e2dd9c314077000000004847304402200b6c45891aed48937241907bc3e3868ee4c792819821fcde33311e5a3da4789a02205021b59692b652a01f5f009bd481acac2f647a7d9c076d71d85869763337882e01fdffffff016c95052a010000001976a9149c4891e7791da9e622532c97f43863768264faaf88ac00000000') assert '90ba90a5b115106d26663fce6c6215b8699c5d4b2672dd30756115f3337dddf9' == tx.txid() def test_txid_p2pk_to_p2sh(self): tx = Transaction.from_hex('0100000001e4643183d6497823576d17ac2439fb97eba24be8137f312e10fcc16483bb2d070000000048473044022032bbf0394dfe3b004075e3cbb3ea7071b9184547e27f8f73f967c4b3f6a21fa4022073edd5ae8b7b638f25872a7a308bb53a848baa9b9cc70af45fcf3c683d36a55301fdffffff011821814a0000000017a9143c640bc28a346749c09615b50211cb051faff00f8700000000') assert '172bdf5a690b874385b98d7ab6f6af807356f03a26033c6a65ab79b4ac2085b5' == tx.txid() def test_txid_p2pkh_to_p2pkh(self): tx = Transaction.from_hex('0100000001f9dd7d33f315617530dd72264b5d9c69b815626cce3f66266d1015b1a590ba90000000006a4730440220699bfee3d280a499daf4af5593e8750b54fef0557f3c9f717bfa909493a84f60022057718eec7985b7796bb8630bf6ea2e9bf2892ac21bd6ab8f741a008537139ffe012103b4289890b40590447b57f773b5843bf0400e9cead08be225fac587b3c2a8e973fdffffff01ec24052a010000001976a914ce9ff3d15ed5f3a3d94b583b12796d063879b11588ac00000000') assert '24737c68f53d4b519939119ed83b2a8d44d716d7f3ca98bcecc0fbb92c2085ce' == tx.txid() def test_txid_p2pkh_to_p2sh(self): tx = Transaction.from_hex('010000000195232c30f6611b9f2f82ec63f5b443b132219c425e1824584411f3d16a7a54bc000000006b4830450221009f39ac457dc8ff316e5cc03161c9eff6212d8694ccb88d801dbb32e85d8ed100022074230bb05e99b85a6a50d2b71e7bf04d80be3f1d014ea038f93943abd79421d101210317be0f7e5478e087453b9b5111bdad586038720f16ac9658fd16217ffd7e5785fdffffff0200e40b540200000017a914d81df3751b9e7dca920678cc19cac8d7ec9010b08718dfd63c2c0000001976a914303c42b63569ff5b390a2016ff44651cd84c7c8988acc7010000') assert '155e4740fa59f374abb4e133b87247dccc3afc233cb97c2bf2b46bba3094aedc' == tx.txid() def test_txid_p2sh_to_p2pkh(self): tx = Transaction.from_hex('0100000001b98d550fa331da21038952d6931ffd3607c440ab2985b75477181b577de118b10b000000fdfd0000483045022100a26ea637a6d39aa27ea7a0065e9691d477e23ad5970b5937a9b06754140cf27102201b00ed050b5c468ee66f9ef1ff41dfb3bd64451469efaab1d4b56fbf92f9df48014730440220080421482a37cc9a98a8dc3bf9d6b828092ad1a1357e3be34d9c5bbdca59bb5f02206fa88a389c4bf31fa062977606801f3ea87e86636da2625776c8c228bcd59f8a014c69522102420e820f71d17989ed73c0ff2ec1c1926cf989ad6909610614ee90cf7db3ef8721036eae8acbae031fdcaf74a824f3894bf54881b42911bd3ad056ea59a33ffb3d312103752669b75eb4dc0cca209af77a59d2c761cbb47acc4cf4b316ded35080d92e8253aeffffffff0101ac3a00000000001976a914a6b6bcc85975bf6a01a0eabb2ac97d5a418223ad88ac00000000') assert '0ea982e8e601863e604ef6d9acf9317ae59d3eac9cafee6dd946abadafd35af8' == tx.txid() def test_txid_p2sh_to_p2sh(self): # Note the public keys in this transaction are not sorted. This also tests we do # not sort them. tx = Transaction.from_hex('01000000018695eef2250b3a3b6ef45fe065e601610e69dd7a56de742092d40e6276e6c9ec00000000fdfd000047304402203199bf8e49f7203e8bcbfd754aa356c6ba61643a3490f8aef3888e0aaa7c048c02201e7180bfd670f4404e513359b4020fbc85d6625e3e265e0c357e8611f11b83e401483045022100e60f897db114679f9a310a032a22e9a7c2b8080affe2036c480ff87bf6f45ada02202dbd27af38dd97d418e24d89c3bb7a97e359dd927c1094d8c9e5cac57df704fb014c69522103adc563b9f5e506f485978f4e913c10da208eac6d96d49df4beae469e81a4dd982102c52bc9643a021464a31a3bfa99cfa46afaa4b3acda31e025da204b4ee44cc07a2103a1c8edcc3310b3d7937e9e4179e7bd9cdf31c276f985f4eb356f21b874225eb153aeffffffff02b8ce05000000000017a9145c9c158430b7b79c3ad7ef9bdf981601eda2412d87b82400000000000017a9146bf3ff89019ecc5971a39cdd4f1cabd3b647ad5d8700000000') assert '2caab5a11fa1ec0f5bb014b8858d00fecf2c001e15d22ad04379ad7b36fef305' == tx.txid() # 2 inputs, one for each priv_key below unsigned_tx = "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000002401ff2102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff146000000000000f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000002401ff21030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff415901000000000001de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800" priv_keys = [PrivateKey.from_WIF(WIF) for WIF in ( "KzjWgFAozj8EfMFpeCBshWA69QXG7Kj7nMYHjSkkcTM8DM8GF1Hd", "KyY5VaoqPwjSgGpKHT3JJKDcxXMeqYo6umK7u1h3iBt9n9aihiPs", )] # First priv key only signed signed_tx_1 = "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000002401ff2102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff146000000000000f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000006b483045022100fa8ebdc7cefc407fd1b560fb2e2e5e96e900e94634d96df4fd284126048746a2022028d91ca132a1a386a67df69a2c5ba216218870c256c163d729f1575f7a8824f54121030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff01de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800" # Second priv key only signed signed_tx_2 = "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000006b4830450221008dc02fa531a9a704f5c01abdeb58930514651565b42abf94f6ad1565d0ad6785022027b1396f772c696629a4a09b01aed2416861aeaee05d0ff4a2e6fdfde73ec84d412102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000002401ff21030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff415901000000000001de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800" # Both priv keys signed signed_tx_3 = "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000006b4830450221008dc02fa531a9a704f5c01abdeb58930514651565b42abf94f6ad1565d0ad6785022027b1396f772c696629a4a09b01aed2416861aeaee05d0ff4a2e6fdfde73ec84d412102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000006b483045022100fa8ebdc7cefc407fd1b560fb2e2e5e96e900e94634d96df4fd284126048746a2022028d91ca132a1a386a67df69a2c5ba216218870c256c163d729f1575f7a8824f54121030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff01de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800" class TestTransaction2: def sign_tx(self, unsigned_tx_hex, priv_keys): keypairs = {XPublicKey.from_hex(priv_key.public_key.to_hex()): (priv_key.to_bytes(), priv_key.is_compressed()) for priv_key in priv_keys} tx = Transaction.from_extended_bytes(bytes.fromhex(unsigned_tx_hex)) tx.sign(keypairs) return tx def test_sign_tx_1(self): # Test signing the first input only tx = self.sign_tx(unsigned_tx, [priv_keys[0]]) assert json.dumps(tx.to_dict(TransactionContext())) == '{"version": 1, "hex": "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000002401ff2102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000006b483045022100fa8ebdc7cefc407fd1b560fb2e2e5e96e900e94634d96df4fd284126048746a2022028d91ca132a1a386a67df69a2c5ba216218870c256c163d729f1575f7a8824f54121030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff01de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800", "complete": false, "inputs": [{"script_type": 2, "threshold": 1, "value": 18161, "signatures": ["ff"], "x_pubkeys": [{"pubkey_bytes": "02faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85"}]}, {"script_type": 2, "threshold": 1, "value": 88385, "signatures": ["3045022100fa8ebdc7cefc407fd1b560fb2e2e5e96e900e94634d96df4fd284126048746a2022028d91ca132a1a386a67df69a2c5ba216218870c256c163d729f1575f7a8824f541"], "x_pubkeys": [{"pubkey_bytes": "030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477ea"}]}]}' assert not tx.is_complete() def test_sign_tx_2(self): # Test signing the second input only tx = self.sign_tx(unsigned_tx, [priv_keys[1]]) assert json.dumps(tx.to_dict(TransactionContext())) == '{"version": 1, "hex": "0100000002f25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084000000006b4830450221008dc02fa531a9a704f5c01abdeb58930514651565b42abf94f6ad1565d0ad6785022027b1396f772c696629a4a09b01aed2416861aeaee05d0ff4a2e6fdfde73ec84d412102faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85fefffffff25568d10d46181bc65b01b735f8cccdb91e4e7d172c5efb984b839d1c912084010000002401ff21030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477eafeffffff01de9e0100000000001976a914428f0dbcc74fc3a999bbaf8bf4600531e155e66b88ac75c50800", "complete": false, "inputs": [{"script_type": 2, "threshold": 1, "value": 18161, "signatures": ["30450221008dc02fa531a9a704f5c01abdeb58930514651565b42abf94f6ad1565d0ad6785022027b1396f772c696629a4a09b01aed2416861aeaee05d0ff4a2e6fdfde73ec84d41"], "x_pubkeys": [{"pubkey_bytes": "02faf7f10ccad1bc40e697e6b90b1d7c9daf92fdf47a4cf726f1c0422e4730fe85"}]}, {"script_type": 2, "threshold": 1, "value": 88385, "signatures": ["ff"], "x_pubkeys": [{"pubkey_bytes": "030c4ee92cd3c174e9aabcdec56ddc6b6d09a7767b563055a10e5406ec48f477ea"}]}]}' assert not tx.is_complete() def test_sign_tx_3(self): # Test signing both tx = self.sign_tx(unsigned_tx, priv_keys) assert tx.to_hex() == signed_tx_3 assert tx.is_complete() assert tx.txid() == "b83acf939a92c420d0cb8d45d5d4dfad4e90369ebce0f49a45808dc1b41259b0" def test_update_signatures(self): signed_tx = Tx.from_hex(signed_tx_3) sigs = [next(input.script_sig.ops())[:-1] for input in signed_tx.inputs] tx = Transaction.from_extended_bytes(bytes.fromhex(unsigned_tx)) tx.update_signatures(sigs) assert tx.is_complete() assert tx.txid() == "b83acf939a92c420d0cb8d45d5d4dfad4e90369ebce0f49a45808dc1b41259b0" def multisig_keystores(self): seed = 'ee6ea9eceaf649640051a4c305ac5c59' keystore1 = cast(Old_KeyStore, instantiate_keystore_from_text( KeystoreTextType.ELECTRUM_OLD_SEED_WORDS, seed, password="OLD")) xprv = ('xprv9s21ZrQH143K4XLpSd2berkCzJTXDv68rusDQFiQGSqa1ZmVXnYzYpTQ9' 'qYiSB7mHvg6kEsrd2ZtnHRJ61sZhSN4jZ2T8wxA4T75BE4QQZ1') xpub = ('xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8w' 'GvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA') keystore2 = cast(BIP32_KeyStore, instantiate_keystore_from_text( KeystoreTextType.EXTENDED_PRIVATE_KEY, xprv, password="BIP32")) assert keystore2.xpub == xpub return [keystore1, keystore2] unsigned_json_1 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b0000006e0001ff01ff4c675221020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e8410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e52aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["ff", "ff"], "x_pubkeys": [{"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}, {"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}]}]}' signed1_json_1 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000b400473044022100a9b906ec7fd40b8063326675d5f229d36227241dc84f262b203b3eaadfd91789021f267473437145d77c69273ffef2426055c6c89457832c3d38fcb3c07eb8c3914101ff4c675221020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e8410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e52aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["ff", "3044022100a9b906ec7fd40b8063326675d5f229d36227241dc84f262b203b3eaadfd91789021f267473437145d77c69273ffef2426055c6c89457832c3d38fcb3c07eb8c39141"], "x_pubkeys": [{"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}, {"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}]}]}' signed2_json_1 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000b500483045022100bc32a5f10b755dcd8dc9a498d76286f059993d1d72fbc5340d0da9dc99dcad0a022064e37760d9ad3e3b9f0b48263becca8dee5aac43bdcecfdfdc63553057083a8c4101ff4c675221020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e8410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e52aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["3045022100bc32a5f10b755dcd8dc9a498d76286f059993d1d72fbc5340d0da9dc99dcad0a022064e37760d9ad3e3b9f0b48263becca8dee5aac43bdcecfdfdc63553057083a8c41", "ff"], "x_pubkeys": [{"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}, {"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}]}]}' fully_signed_json_1 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000fb00483045022100bc32a5f10b755dcd8dc9a498d76286f059993d1d72fbc5340d0da9dc99dcad0a022064e37760d9ad3e3b9f0b48263becca8dee5aac43bdcecfdfdc63553057083a8c41473044022100a9b906ec7fd40b8063326675d5f229d36227241dc84f262b203b3eaadfd91789021f267473437145d77c69273ffef2426055c6c89457832c3d38fcb3c07eb8c391414c675221020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e8410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e52aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": true}' unsigned_json_2 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b0000006e0001ff01ff4c6752410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e21020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e852aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["ff", "ff"], "x_pubkeys": [{"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}, {"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}]}]}' signed1_json_2 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000b40047304402207a923d1b0ca9930cfb2162f1e85dc5feb6e9322efcceeaba7a91ad37f72b815702207ed90ebab7c8bbf728d29c2d93931bb44ff1a7147b37982c1d27c822c139079e4101ff4c6752410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e21020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e852aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["304402207a923d1b0ca9930cfb2162f1e85dc5feb6e9322efcceeaba7a91ad37f72b815702207ed90ebab7c8bbf728d29c2d93931bb44ff1a7147b37982c1d27c822c139079e41", "ff"], "x_pubkeys": [{"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}, {"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}]}]}' signed2_json_2 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000b500483045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345be781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a4101ff4c6752410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e21020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e852aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": false, "inputs": [{"script_type": 4, "threshold": 2, "value": 5300, "signatures": ["ff", "3045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345be781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a41"], "x_pubkeys": [{"old_mpk": "84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9", "derivation_path": [0, 0]}, {"bip32_xpub": "xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8wGvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA", "derivation_path": [0, 0]}]}]}' fully_signed_json_2 = '{"version": 1, "hex": "010000000111111111111111111111111111111111111111111111111111111111111111111b000000fb0047304402207a923d1b0ca9930cfb2162f1e85dc5feb6e9322efcceeaba7a91ad37f72b815702207ed90ebab7c8bbf728d29c2d93931bb44ff1a7147b37982c1d27c822c139079e41483045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345be781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a414c6752410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e21020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e852aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000", "complete": true}' @pytest.mark.parametrize("json_text", (unsigned_json_1, signed1_json_1, signed2_json_1, fully_signed_json_1, unsigned_json_2, signed1_json_2, signed2_json_2, fully_signed_json_2)) def test_dict_io(self, json_text: str) -> None: tx, context = Transaction.from_dict(json.loads(json_text)) assert json.dumps(tx.to_dict(context)) == json_text @pytest.mark.parametrize("unsigned_pair, signed1_pair, fully_signed_pair, signed2_pair", ( ( # Here the x_pubkeys are naturally sorted ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000a50001ff01ff4c9e524c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000045fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a90000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', unsigned_json_1), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000eb0001ff473044022100a9b906ec7fd40b8063326675d5f229d36227241dc84f262b203b3eaadfd91789021f267473437145d77c69273ffef2426055c6c89457832c3d38fcb3c07eb8c391414c9e524c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000045fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a90000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', signed1_json_1), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000fb00483045022100bc32a5f10b755dcd8dc9a498d76286f059993d1d72fbc5340d0da9dc99dcad0a022064e37760d9ad3e3b9f0b48263becca8dee5aac43bdcecfdfdc63553057083a8c41473044022100a9b906ec7fd40b8063326675d5f229d36227241dc84f262b203b3eaadfd91789021f267473437145d77c69273ffef2426055c6c89457832c3d38fcb3c07eb8c391414c675221020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e8410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e52aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000', fully_signed_json_1), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000ec00483045022100bc32a5f10b755dcd8dc9a498d76286f059993d1d72fbc5340d0da9dc99dcad0a022064e37760d9ad3e3b9f0b48263becca8dee5aac43bdcecfdfdc63553057083a8c4101ff4c9e524c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000045fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a90000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', signed2_json_1), ), ( # Here the x_pubkeys are reverse-sorted. They should not be switched when signing. ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000a50001ff01ff4c9e5245fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9000000004c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', unsigned_json_2), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000eb0047304402207a923d1b0ca9930cfb2162f1e85dc5feb6e9322efcceeaba7a91ad37f72b815702207ed90ebab7c8bbf728d29c2d93931bb44ff1a7147b37982c1d27c822c139079e4101ff4c9e5245fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9000000004c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', signed1_json_2), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000fb0047304402207a923d1b0ca9930cfb2162f1e85dc5feb6e9322efcceeaba7a91ad37f72b815702207ed90ebab7c8bbf728d29c2d93931bb44ff1a7147b37982c1d27c822c139079e41483045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345be781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a414c6752410472cd64a288e4a518059b388a9164522e05c3f3aef3f6791f31074af734510054bfde0bee54dbefa0eebe71a53d18298c628842b1865e2e0bc053bb4197af726e21020c8bd7a0cfa64714b8f01316cd46197b902565f2c812ed0d450fcd1425edc9e852aeffffffff0188130000000000001976a914000000000000000000000000000000000000000088ac00000000', fully_signed_json_2), ('010000000111111111111111111111111111111111111111111111111111111111111111111b000000ec0001ff483045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345be781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a414c9e5245fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9000000004c53ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000052aeffffffffb4140000000000000188130000000000001976a914000000000000000000000000000000000000000088ac00000000', signed2_json_2), ) )) def test_multisig(self, unsigned_pair, signed1_pair, fully_signed_pair, signed2_pair): unsigned_hex, unsigned_json = unsigned_pair signed1_hex, signed1_json = signed1_pair fully_signed_hex, fully_signed_json = fully_signed_pair signed2_hex, signed2_json = signed2_pair tx = Transaction.from_extended_bytes(bytes.fromhex(unsigned_hex)) keystore1, keystore2 = self.multisig_keystores() assert json.dumps(tx.to_dict(TransactionContext())) == unsigned_json # Sign with keystore 1, then 2 keystore1.sign_transaction(tx, "OLD", TransactionContext()) assert json.dumps(tx.to_dict(TransactionContext())) == signed1_json keystore2.sign_transaction(tx, "BIP32", TransactionContext()) assert tx.serialize() == fully_signed_hex # Sign with keystore 2, then 1 tx = Transaction.from_extended_bytes(bytes.fromhex(unsigned_hex)) keystore2.sign_transaction(tx, "BIP32", TransactionContext()) assert json.dumps(tx.to_dict(TransactionContext())) == signed2_json keystore1.sign_transaction(tx, "OLD", TransactionContext()) assert tx.serialize() == fully_signed_hex assert json.dumps(tx.to_dict(TransactionContext())) == fully_signed_json class TestXPublicKey: def test_bad_type(self): public_key = PublicKey.from_hex( '034339a901d8526c4d733c8ea7c861f1a6324f37f6b86f838725820e0c5fc19570') with pytest.raises(AssertionError): XPublicKey(pubkey_bytes=public_key) def test_bad_key(self): with pytest.raises(ValueError): XPublicKey.from_hex( '034339a901d8526c4d733c8ea7c861f1a6324f37f6b86f838725820e0c5fc1957000') with pytest.raises(AssertionError): XPublicKey.from_hex( 'ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdb' 'b213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa1201000a' ) @pytest.mark.parametrize("raw_hex", ( # An uncompressed 04 key '046d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e' '2487e6222a6664e079c8edf7518defd562dbeda1e7593dfd7f0be285880a24dab', # A compressed 03 key '034339a901d8526c4d733c8ea7c861f1a6324f37f6b86f838725820e0c5fc19570', # A compressed 02 key '026370246118a7c218fd557496ebb2b0862d59c6486e88f83e07fd12ce8a88fb00', )) def test_raw_public_keys(self, raw_hex, coin): public_key = PublicKey.from_hex(raw_hex) x_pubkey = XPublicKey.from_hex(raw_hex) # assert x_pubkey.to_bytes() == bytes.fromhex(raw_hex) # assert x_pubkey.to_hex() == raw_hex assert not x_pubkey.is_bip32_key() assert x_pubkey.to_public_key() == public_key assert x_pubkey.to_address() == public_key.to_address(coin=coin) assert x_pubkey.to_address().coin() is coin @pytest.mark.parametrize("raw_hex, path", ( ( 'ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdb' 'b213d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa1201000a00', (1, 10), ), ( 'ff0488b21e000000000000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb2' '13d0025602e9aa22cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa1200001900', (0, 25), ), )) def test_bip32_extended_keys(self, raw_hex, path, coin): # see test_keystore.py xpub = ('xpub661MyMwAqRbcH1RHYeZc1zgwYLJ1dNozE8npCe81pnNYtN6e5KsF6cmt17Fv8w' 'GvJrRiv6Kewm8ggBG6N3XajhoioH3stUmLRi53tk46CiA') root_key = bip32_key_from_string(xpub) True_10_public_key = cast(BIP32PublicKey, root_key.child(path[0]).child(path[1])) x_pubkey = XPublicKey.from_bytes(bytes.fromhex(raw_hex)) # assert x_pubkey.to_bytes() == bytes.fromhex(raw_hex) # assert x_pubkey.to_hex() == raw_hex assert x_pubkey.is_bip32_key() assert x_pubkey.bip32_extended_key_and_path() == (xpub, path) assert x_pubkey.to_public_key() == True_10_public_key assert x_pubkey.to_address() == True_10_public_key.to_address(coin=coin) assert x_pubkey.to_address().coin() is coin @pytest.mark.parametrize("raw_hex, public_key_hex", ( ('fee9d4b7866dd1e91c862aebf62a49548c7dbf7bcc6e4b7b8c9da820c7737968df9c09d' '5a3e271dc814a29981f81b3faaf2737b551ef5dcc6189cf0f8252c442b301000a00', '044794e135aa6d397222b4395091e53557f0e1ab9ffc0358303de6b9800642a9f544c3' 'f8d2ece93e25864f19f44279661c16aaa8e85eea9ea1c8c1fcf1c61fcae0' ), ('fee9d4b7866dd1e91c862aebf62a49548c7dbf7bcc6e4b7b8c9da820c7737968df9c09' 'd5a3e271dc814a29981f81b3faaf2737b551ef5dcc6189cf0f8252c442b300000500', '04935970bd7c9e51bfe8e1135bb89a8ce09f8876d60d81ba4432f5e6fa394e6d09c9b' 'a78f8d87aa7c519892a6adb5e7b39702379411dd7ba49f324f8c7e4e51f17' ), )) def test_old_keystore(self, raw_hex, public_key_hex, coin): public_key = PublicKey.from_hex(public_key_hex) assert public_key.is_compressed() is False x_pubkey = XPublicKey.from_hex(raw_hex) # assert x_pubkey.to_bytes() == bytes.fromhex(raw_hex) # assert x_pubkey.to_hex() == raw_hex assert not x_pubkey.is_bip32_key() assert x_pubkey.to_public_key() == public_key assert x_pubkey.to_public_key().is_compressed() is False assert x_pubkey.to_address() == public_key.to_address(coin=coin) assert x_pubkey.to_address().coin() is coin def test_fd_read_write(self): tx_hex = ('010000000111111111111111111111111111111111111111111111111111111111111111111b' '000000ec0001ff483045022100ae42f172f722ac2392ef3e5958d78bbca1ebedbce47eff27ba66345b' 'e781c46f02207c9ab6ff496791bf2e56300ff4621beaec6ccdd3639e460612569c6e0407e09a414c9e' '5245fe84717a26df3332b129e59faaab25c11752277bc55c07d8724e1660e63b862d00b41d3db01e29' 'ed54ca83300eb73d82b5381536298f40fdad8c1e307b66cf39a9000000004c53ff0488b21e00000000' '0000000000f79d7a4d3ea07099f09fbf35c3103908cbb4b1f30e8602a06ffbdbb213d0025602e9aa22' 'cc7106abab85e4c41f18f030c370213769c18d6754f3d0584e69a7fa120000000052aeffffffffb414' '0000000000000188130000000000001976a914000000000000000000000000000000000000000088ac' '00000000') tx = Transaction.from_extended_bytes(bytes.fromhex(tx_hex)) # We do not serialize the old extended byte format anymore. assert tx.serialize() != tx_hex
107.155125
1,177
0.856397
1,831
38,683
17.821955
0.162206
0.005148
0.007171
0.007355
0.214391
0.199314
0.189048
0.162693
0.155706
0.138422
0
0.476882
0.090324
38,683
360
1,178
107.452778
0.450453
0.024507
0
0.248175
0
0.032847
0.715055
0.653796
0
1
0
0
0.291971
1
0.094891
false
0.007299
0.029197
0
0.171533
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
8
f7acb0e8a9b10e471010f8ad80079a610e6841b6
6,637
py
Python
densecap/utils/data_loader.py
adymaharana/VLCStoryGan
74112404689e8144c2ed2d375e1e5a1cde09debb
[ "MIT" ]
10
2021-11-02T17:53:13.000Z
2022-03-28T06:38:20.000Z
densecap/utils/data_loader.py
adymaharana/VLCStoryGan
74112404689e8144c2ed2d375e1e5a1cde09debb
[ "MIT" ]
10
2021-11-01T21:28:11.000Z
2022-03-06T18:08:22.000Z
densecap/utils/data_loader.py
adymaharana/VLCStoryGan
74112404689e8144c2ed2d375e1e5a1cde09debb
[ "MIT" ]
3
2022-02-02T16:03:24.000Z
2022-03-28T06:38:23.000Z
import os import pickle import h5py import torch from torch.utils.data import Dataset import torchvision.transforms as transforms from PIL import Image from torch.utils.data import DataLoader from prefetch_generator import BackgroundGenerator __all__ = [ "DataLoaderPFG", "DenseCapDataset", 'DenseCapDatasetV2' ] class DataLoaderPFG(DataLoader): """ Prefetch version of DataLoader: https://github.com/IgorSusmelj/pytorch-styleguide/issues/5 """ def __iter__(self): return BackgroundGenerator(super().__iter__()) class DenseCapDataset(Dataset): """Images are loaded from by open specific file """ @staticmethod def collate_fn(batch): """Use in torch.utils.data.DataLoader """ return tuple(zip(*batch)) # as tuples instead of stacked tensors @staticmethod def get_transform(): """More complicated transform utils in torchvison/references/detection/transforms.py """ transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)), ]) return transform def __init__(self, img_dir_root, vg_data_path, look_up_tables_path, dataset_type=None, transform=None): assert dataset_type in {None, 'train', 'test', 'val'} super(DenseCapDataset, self).__init__() self.img_dir_root = img_dir_root self.vg_data_path = vg_data_path self.look_up_tables_path = look_up_tables_path self.dataset_type = dataset_type # if dataset_type is None, all data will be use self.transform = transform # === load data here ==== self.look_up_tables = pickle.load(open(look_up_tables_path, 'rb')) def set_dataset_type(self, dataset_type, verbose=True): assert dataset_type in {None, 'train', 'test', 'val'} if verbose: print('[DenseCapDataset]: {} switch to {}'.format(self.dataset_type, dataset_type)) self.dataset_type = dataset_type def __getitem__(self, idx): with h5py.File(self.vg_data_path, 'r') as vg_data: vg_idx = self.look_up_tables['split'][self.dataset_type][idx] if self.dataset_type else idx img_path = os.path.join(self.img_dir_root, self.look_up_tables['idx_to_directory'][vg_idx], self.look_up_tables['idx_to_filename'][vg_idx]) img = Image.open(img_path).convert("RGB") if self.transform is not None: img = self.transform(img) else: img = transforms.ToTensor()(img) first_box_idx = vg_data['img_to_first_box'][vg_idx] last_box_idx = vg_data['img_to_last_box'][vg_idx] boxes = torch.as_tensor(vg_data['boxes'][first_box_idx: last_box_idx+1], dtype=torch.float32) caps = torch.as_tensor(vg_data['captions'][first_box_idx: last_box_idx+1], dtype=torch.long) caps_len = torch.as_tensor(vg_data['lengths'][first_box_idx: last_box_idx+1], dtype=torch.long) targets = { 'boxes': boxes, 'caps': caps, 'caps_len': caps_len, } info = { 'idx': vg_idx, 'dir': self.look_up_tables['idx_to_directory'][vg_idx], 'file_name': self.look_up_tables['idx_to_filename'][vg_idx] } return img, targets, info def __len__(self): if self.dataset_type: return len(self.look_up_tables['split'][self.dataset_type]) else: return len(self.look_up_tables['filename_to_idx']) class DenseCapDatasetV2(Dataset): """Images are stored in VG-regions.h5 """ @staticmethod def collate_fn(batch): """Use in torch.utils.data.DataLoader """ return tuple(zip(*batch)) # as tuples instead of stacked tensors @staticmethod def get_transform(): """More complicated transform utils in torchvison/references/detection/transforms.py """ transform = transforms.Compose([ transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)), ]) return transform def __init__(self, vg_data_path, look_up_tables_path, dataset_type=None, transform=None): assert dataset_type in {None, 'train', 'test', 'val'} super(DenseCapDatasetV2, self).__init__() self.vg_data_path = vg_data_path self.look_up_tables_path = look_up_tables_path self.dataset_type = dataset_type # if dataset_type is None, all data will be use self.transform = transform # === load data here ==== self.look_up_tables = pickle.load(open(look_up_tables_path, 'rb')) def set_dataset_type(self, dataset_type, verbose=True): assert dataset_type in {None, 'train', 'test', 'val'} if verbose: print('[DenseCapDataset]: {} switch to {}'.format(self.dataset_type, dataset_type)) self.dataset_type = dataset_type def __getitem__(self, idx): with h5py.File(self.vg_data_path, 'r') as vg_data: vg_idx = self.look_up_tables['split'][self.dataset_type][idx] if self.dataset_type else idx img = vg_data['images'][vg_idx] h = vg_data['image_heights'][vg_idx] w = vg_data['image_widths'][vg_idx] img = torch.tensor(img[:, :h, :w] / 255., dtype=torch.float32) # get rid of zero padding if self.transform is not None: img = self.transform(img) first_box_idx = vg_data['img_to_first_box'][vg_idx] last_box_idx = vg_data['img_to_last_box'][vg_idx] boxes = torch.as_tensor(vg_data['boxes'][first_box_idx: last_box_idx+1], dtype=torch.float32) caps = torch.as_tensor(vg_data['captions'][first_box_idx: last_box_idx+1], dtype=torch.long) caps_len = torch.as_tensor(vg_data['lengths'][first_box_idx: last_box_idx+1], dtype=torch.long) targets = { 'boxes': boxes, 'caps': caps, 'caps_len': caps_len, } info = { 'idx': vg_idx, 'dir': self.look_up_tables['idx_to_directory'][vg_idx], 'file_name': self.look_up_tables['idx_to_filename'][vg_idx] } return img, targets, info def __len__(self): if self.dataset_type: return len(self.look_up_tables['split'][self.dataset_type]) else: return len(self.look_up_tables['filename_to_idx'])
32.37561
107
0.621064
857
6,637
4.495916
0.166861
0.091357
0.068518
0.066442
0.807682
0.786919
0.786919
0.786919
0.786919
0.769011
0
0.014549
0.264728
6,637
204
108
32.534314
0.775
0.103812
0
0.717742
0
0
0.086499
0
0
0
0
0
0.032258
1
0.104839
false
0
0.072581
0.008065
0.290323
0.016129
0
0
0
null
0
0
0
1
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
7
f7d6ecf8ff0fffca5074cbbc9c7e980eb1f61ea6
198,737
py
Python
ganimides_server/ganimides_database/_database_ganimides_api.py
leandrou-technology-forward/ganimides_api_server
8787927e2cf7568a070c1c65294ee76d89177908
[ "MIT" ]
null
null
null
ganimides_server/ganimides_database/_database_ganimides_api.py
leandrou-technology-forward/ganimides_api_server
8787927e2cf7568a070c1c65294ee76d89177908
[ "MIT" ]
1
2021-06-02T00:36:03.000Z
2021-06-02T00:36:03.000Z
ganimides_server/ganimides_database/_database_ganimides_api.py
leandrou-technology-forward/ganimides_api_server
8787927e2cf7568a070c1c65294ee76d89177908
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- #https://www.pythoncentral.io/series/python-sqlalchemy-database-tutorial/ import os import sys if not (os.path.dirname(os.path.dirname(__file__)) in sys.path): sys.path.append(os.path.dirname(os.path.dirname(__file__))) if not (os.path.dirname(__file__) in sys.path): sys.path.append(os.path.dirname(__file__)) import datetime import decimal # # from _serverApp import thisApp from _serverApp import get_debug_option_as_level, get_debug_files, log_message, retrieve_module_configuration, get_globals_from_configuration, save_module_configuration,get_module_debug_level from _serverApp import log_process_start, log_process_finish, log_process_message, log_process_result,log_process_data, log_process_input, log_process_output from _serverApp import set_process_identity_dict, set_process_caller_area, add_apis_to_configuration from _serverApp import build_process_signature, build_process_call_area, get_debug_level, get_debug_files import _database_ganimides_model as dbmodel #import ganimides_openBankingAPI as bankingapi #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #::: module ::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: module_Function = 'database adapter' module_ProgramName = 'database api' module_BaseTimeStamp = datetime.datetime.now() module_folder = os.getcwd() module_color = thisApp.Fore.LIGHTMAGENTA_EX module_folder = os.path.dirname(__file__) module_ProgramName = os.path.splitext(os.path.basename(__file__))[0] module_id = f'{module_ProgramName}' module_eyecatch = module_ProgramName module_version = 0.1 module_log_file_name = module_ProgramName+'.log' module_errors_file_name = os.path.splitext(os.path.basename(module_log_file_name))[0]+'_errors.log' module_versionString = f'{module_id} version {module_version}' module_file = __file__ log_file=thisApp.log_file_name print_enabled = thisApp.CONSOLE_ON and thisApp.DEBUG_ON consolelog_enabled = thisApp.CONSOLE_ON and thisApp.DEBUG_ON filelog_enabled = thisApp.FILELOG_ON module_is_externally_configurable = True module_identityDictionary = { 'module_file':__file__, 'module_Function':module_Function, 'module_ProgramName':module_ProgramName, 'module_BaseTimeStamp':module_BaseTimeStamp, 'module_folder':module_folder, 'module_color':module_color, 'module_id':module_id, 'module_eyecatch':module_eyecatch, 'module_version':module_version, 'module_versionString':module_versionString, 'module_log_file_name':module_log_file_name, 'module_errors_file_name': module_errors_file_name, 'consolelog_enabled': consolelog_enabled, 'filelog_enabled': filelog_enabled, 'module_is_externally_configurable':module_is_externally_configurable, } #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: module_configuration = { } #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # api services : database apis #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_device(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_device" _api_entity = 'DEVICE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper in ('REGISTER','UNREGISTER'): return dbapi_device_register_unregister(dbsession, action, input_dict, action_filter, caller_area=_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.DEVICE, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_device_register_unregister(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name="dbapi_device_register_unregister" _api_entity = 'DEVICE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) actions_supported=('REGISTER', 'UNREGISTER') now = datetime.datetime.utcnow() if action.upper() not in actions_supported: msg = f"action '{action}' not supported. {actions_supported}" api_result = {'api_status': 'error', 'api_message': msg, 'api_data': actions_supported, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result device = dbsession.get(dbmodel.DEVICE, input_dict, caller_area=_process_call_area) if not device: device_record = device.valid_fields_dictionary(input_dict) msg = f"invalid device" api_result = {'api_status': 'error', 'api_message': msg, 'api_data': device_record, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client = dbsession.get(dbmodel.CLIENT, input_dict, caller_area=_process_call_area) if not client: client_record = client.valid_fields_dictionary(input_dict) msg = f"invalid client" api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_record, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_id = client.client_id if action.upper() in ('REGISTER'): status = 'Registered' xx = 'for' else: status = 'UnRegistered' xx = 'from' registered_apps=[] if input_dict.get('applications', '').upper() in ('*', 'ALL') \ or input_dict.get('application', '').upper() in ('*', 'ALL') \ or input_dict.get('application_name', '').upper() in ('*', 'ALL'): CLIENT_DEVICE = dbmodel.CLIENT_DEVICE client_devices = dbsession.query(CLIENT_DEVICE).filter(CLIENT_DEVICE.device_uid == device.device_uid, CLIENT_DEVICE.client_id == client_id, CLIENT_DEVICE.status != status).all() if len(client_devices) <= 0: client_devices = dbsession.query(CLIENT_DEVICE).filter(CLIENT_DEVICE.device_uid == device.device_uid, CLIENT_DEVICE.client_id == client_id).all() client_device_records = dbsession.rows_to_dict(CLIENT_DEVICE, client_devices) msg = f"device already {status.upper()} {xx} usage by all applications" api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_device_records, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result for client_device in client_devices: client_device.status = status application = dbsession.get(dbmodel.APPLICATION, {'application_name': client_device.application_name}, caller_area=_process_call_area) registered_apps.append(application.application_name) dbsession.commit(**_process_call_area) client_device_records = dbsession.rows_to_dict(CLIENT_DEVICE, client_devices) else: application = dbsession.get(dbmodel.APPLICATION, input_dict, caller_area=_process_call_area) if not application: application_record = application.valid_fields_dictionary(input_dict) msg = f"invalid application" api_result = {'api_status': 'error', 'api_message': msg, 'api_data': application_record, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_device_record = {'device_uid': device.device_uid, 'client_id': client_id, 'application_name': application.application_name, 'last_usage_timestamp': now, 'status': status} client_device = dbsession.get(dbmodel.CLIENT_DEVICE, client_device_record, caller_area=_process_call_area) if client_device: if client_device.status == status: msg = f"device already {client_device.status.upper()} {xx} usage by application '{client_device.application_name}'" client_device_records = [client_device.to_dict()] api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_device_records, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_device = dbsession.refresh(dbmodel.CLIENT_DEVICE, client_device_record, auto_commit=True, caller_area=_process_call_area) registered_apps.append(application.application_name) client_device_records = [client_device.to_dict()] row_count = len(client_device_records) x='' if row_count > 1: x = 's' msg = f"device {status.upper()} {xx} usage by application{x} {registered_apps}" api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_device_records, 'api_data_rows': row_count, 'api_action': _api_action.upper(), 'api_name':_api_name } log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_device_usage(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_device_usage" _api_entity = 'DEVICE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.DEVICE_USAGE, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_client(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_cient" _api_entity = 'CLIENT' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area, **_process_call_area) if action.upper().replace('_', '-') in ('SEND-CONFIRMATION-EMAIL', 'SEND-CONFIRMATION-SMS'): client = dbsession.get(dbmodel.CLIENT, action_filter, caller_area=_process_call_area) if not client: msg = f'client not found' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_dict=client.to_dict() if client.confirmed and client.status=='Active': msg = f'client {client.email} already confirmed' api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if action.upper().replace('_', '-') in ('SEND-CONFIRMATION-EMAIL'): if not client.email: msg = f'email is missing' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #ok = send_confirmation_email(client.email) ok=True if ok: confirm_filter = {'email': client.email, 'mobile': ''} confirmation = dbsession.get(dbmodel.CLIENT_CONFIRMATION, confirm_filter, caller_area=_process_call_area) if not confirmation: confirm_dict = {'email': client.email, 'mobile': '', 'status': 'Sent'} xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) if not confirmation.status=='Confirmed': confirm_dict = {'email': client.email, 'mobile': '', 'status': 'Sent', 'send_timestamp': datetime.datetime.utcnow()} xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) msg = f'OK. a confirmation email sent to {client.email}' api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_dict} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: msg = f'FAILED to send confirmation email to {client.email}. retry' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_dict} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if action.upper().replace('_', '-') in ('SEND-CONFIRMATION-SMS'): if not client.mobile: msg = f'mobile has not been defined' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #ok = send_confirmation_sms(client.mobile) ok=True if ok: confirm_filter = {'mobile': client.mobile, 'email': ''} confirmation = dbsession.get(dbmodel.CLIENT_CONFIRMATION, confirm_filter, caller_area=_process_call_area) if not confirmation: confirm_dict = {'mobile': client.mobile, 'email': '', 'status': 'Sent'} xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) if not confirmation.status=='Confirmed': confirm_dict = {'mobile': client.mobile, 'email': '', 'status': 'Sent', 'send_timestamp': datetime.datetime.utcnow()} xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) msg = f'OK. a confirmation sms sent to {client.mobile}' api_result = {'api_status': 'success', 'api_message': msg, 'api_data': client_dict} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: msg = f'FAILED to send confirmation sms to {client.mobile}. retry' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_dict} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result api_result = dbsession.table_action(dbmodel.CLIENT, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) if not api_result.get('api_status') == 'success': log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if action.upper() in ('UPDATE', 'REFRESH', 'REGISTER', 'ACTIVATE', 'DEACTIVATE', 'CONFIRM'): client_dict = api_result.get('api_data', {}) client_id = client_dict.get('client_id') client_type = client_dict.get('client_type') update_dict = { #'client_id': client_dict.get('client_id'), 'status': client_dict.get('status'), 'email': client_dict.get('email'), 'confirmed': client_dict.get('confirmed'), 'client_status': client_dict.get('status'), 'client_email': client_dict.get('email'), 'client_mobile': client_dict.get('mobile'), 'client_name': client_dict.get('name'), 'client_confirmed': client_dict.get('confirmed'), 'confirmed_timestamp': client_dict.get('confirmed_timestamp'), } xaction = 'update_rows' action_filter = {'client_id': client_id} if client_id and client_type: if client_type == 'merchant': xapi_result = dbsession.table_action(dbmodel.MERCHANT, xaction , update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) elif client_type == 'subscriber': xapi_result = dbsession.table_action(dbmodel.SUBSCRIPTION, xaction , update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) elif client_type == 'customer_service_assistant': xapi_result = dbsession.table_action(dbmodel.CUSTOMER_SERVICE_ASSISTANT, xaction , update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) xapi_result = dbsession.table_action(dbmodel.APPLICATION_USER, xaction , update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) # if action.upper() in ('CONFIRM'): # if input_dict.get('mobile_confirmation_sms'): # # client_dict = api_result.get('api_data', {}) # mobile=client_dict.get('mobile') # confirm_filter = {'mobile': mobile, 'email': ''} # confirmation = dbsession.get(dbmodel.CLIENT_CONFIRMATION, confirm_filter, caller_area=_process_call_area) # if not confirmation: # confirm_dict = {'mobile': mobile, 'email': '', 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) # if not confirmation.status=='Confirmed': # confirm_dict = {'mobile': mobile, 'email': '', 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) # elif input_dict.get('email_confirmation_email'): # # client_dict = api_result.get('api_data', {}) # email=client_dict.get('email') # confirm_filter = {'mobile': '', 'email': email} # confirmation = dbsession.get(dbmodel.CLIENT_CONFIRMATION, confirm_filter, caller_area=_process_call_area) # if not confirmation: # confirm_dict = {'mobile': '', 'email': email, 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) # if not confirmation.status=='Confirmed': # confirm_dict = {'mobile': '', 'email': email, 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) # else: # # client_dict = api_result.get('api_data', {}) # email=client_dict.get('email') # confirm_filter = {'mobile': '', 'email': email} # confirmation = dbsession.get(dbmodel.CLIENT_CONFIRMATION, confirm_filter, caller_area=_process_call_area) # if not confirmation: # confirm_dict = {'mobile': '', 'email': email, 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) # if not confirmation.status=='Confirmed': # confirm_dict = {'mobile': '', 'email': email, 'status': 'Confirmed', 'confirmed_timestamp': datetime.datetime.utcnow(),'confirmed':1} # xapi_result = dbsession.table_action(dbmodel.CLIENT_CONFIRMATION, 'refresh' , confirm_dict, {}, auto_commit=True, caller_area=_process_call_area) api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_client_device(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_client_device" _api_entity = 'DEVICE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper in ('REGISTER','UNREGISTER'): return dbapi_device_register_unregister(dbsession, action, input_dict, action_filter, caller_area=_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.CLIENT_DEVICE, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_verification(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_verification" _api_entity = 'VERIFICATION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.VERIFICATION, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_email_confirmation(dbsession, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_email_confirmation" _api_entity = 'email' _api_action = 'confirm' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) verification = dbsession.get(dbmodel.VERIFICATION, input_dict, caller_area=_process_call_area) if not verification: msg = f'email verification failed' api_result = {'api_status': 'error', 'api_message': msg} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not verification.status=='Confirmed': action_filter = {'verification_id': verification.verification_id} update_dict = {'status': 'Confirmed', 'verified': 1, 'verification_timestamp': datetime.datetime.utcnow()} action_result = dbsession.table_action(dbmodel.VERIFICATION,'update', update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) client_id = verification.client_id client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) if not client: msg = f'mobile verification failed (client_id not found)' api_result = {'api_status': 'error', 'api_message': msg} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not client.email_confirmed or not client.confirmed: update_record = {'client_id': client_id, 'email_confirmed': 1, 'email_confirmed_timestamp': datetime.datetime.utcnow(), 'confirmed': 1} dbreply = dbsession.table_action(dbmodel.CLIENT, 'update', update_record, {'client_id': client_id}, auto_commit=True, caller_area=_process_call_area) client_rec=client.to_dict() if not dbreply.get('api_status')=='success': msg = f'email verification failed (client update failed)' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: msg = f'OK. client email confirmed' api_result = {'api_status': 'success', 'api_message': msg,'api_data':client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: client_rec=client.to_dict() msg = f'OK. client email already confirmed' api_result = {'api_status': 'success', 'api_message': msg,'api_data':client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_mobile_confirmation(dbsession, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_mobile_confirmation" _api_entity = 'mobile' _api_action = 'confirm' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) verification = dbsession.get(dbmodel.VERIFICATION, input_dict, caller_area=_process_call_area) if not verification: msg = f'mobile verification failed' api_result = {'api_status': 'error', 'api_message': msg} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not verification.status=='Confirmed': action_filter = {'verification_id': verification.verification_id} update_dict = {'status': 'Confirmed', 'verified': 1, 'verification_timestamp': datetime.datetime.utcnow()} action_result = dbsession.table_action(dbmodel.VERIFICATION,'update', update_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) client_id = verification.client_id client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) if not client: msg = f'mobile verification failed (client_id not found)' api_result = {'api_status': 'error', 'api_message': msg} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not client.mobile_confirmed or not client.confirmed: update_record = {'client_id': client_id, 'mobile_confirmed': 1, 'mobile_confirmed_timestamp': datetime.datetime.utcnow(), 'confirmed': 1} dbreply = dbsession.table_action(dbmodel.CLIENT, 'update', update_record, {'client_id': client_id}, auto_commit=True, caller_area=_process_call_area) client_rec=client.to_dict() if not dbreply.get('api_status')=='success': msg = f'mobile verification failed (client update failed)' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: msg = f'OK. client mobile confirmed' api_result = {'api_status': 'success', 'api_message': msg,'api_data':client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: client_rec=client.to_dict() msg = f'OK. client mobile already confirmed' api_result = {'api_status': 'success', 'api_message': msg,'api_data':client_rec} api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_api(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_api" _api_entity = 'API' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper() in ('REGISTER', 'UNREGISTER'): api_result = dbapi_api_register_unregister(dbsession, action, input_dict, action_filter, caller_area=_process_call_area) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.API, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_api_register_unregister(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_api_register_unregister" _api_entity = 'APPLICATION API' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper() not in ('REGISTER','UNREGISTER'): msg = f'invalid action [[{action}]] requested. use REGISTER or UNREGISTER' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if _api_action.upper() == 'REGISTER': api=dbsession.get(dbmodel.API, input_dict, caller_area=_process_call_area) if not api: msg = f'api not found' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not api.status=='Active': msg = f'api not Active' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result application=dbsession.get(dbmodel.APPLICATION, input_dict, caller_area=_process_call_area) if not application: msg = f'application not found' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not application.status=='Active': msg = f'application not Active' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'api_id':api.api_id}) input_dict.update({'api_name':api.api_name}) input_dict.update({'application_id': application.application_id}) input_dict.update({'application_name': application.application_name}) input_dict.update({'subscription_id': application.subscription_id}) action_filter={} api_registered = dbsession.get(dbmodel.APPLICATION_API, input_dict, caller_area=_process_call_area) if api_registered: input_dict.update({'application_api_id': api_registered.application_api_id}) action_filter = {'application_api_id': api_registered.application_api_id} input_dict.update({'status': 'Active'}) action='REFRESH' action_result = dbsession.table_action(dbmodel.APPLICATION_API, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result elif _api_action.upper() == 'UNREGISTER': api=dbsession.get(dbmodel.API, input_dict, caller_area=_process_call_area) if api: input_dict.update({'api_id':api.api_id}) input_dict.update({'api_name':api.api_name}) application=dbsession.get(dbmodel.APPLICATION, input_dict, caller_area=_process_call_area) if application: input_dict.update({'application_id': application.application_id}) input_dict.update({'application_name': application.application_name}) api_registered = dbsession.get(dbmodel.APPLICATION_API, input_dict, caller_area=_process_call_area) if not api_registered: msg = f'record not found' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'application_api_id': api_registered.application_api_id}) input_dict.update({'status':'Unregistered'}) action_filter={'application_api_id': api_registered.application_api_id} action='UPDATE' action_result = dbsession.table_action(dbmodel.APPLICATION_API, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result else: msg = f'invalid action [[{action}]] requested. use REGISTER or UNREGISTER' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_application(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_application" _api_entity = 'APPLICATION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper() in ('API_REGISTER', 'API_UNREGISTER'): xaction=action.upper().replace('API_','') return dbapi_api_register_unregister(dbsession, xaction, input_dict, action_filter, caller_area=_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() == 'VALIDATE' or action.upper() == 'VALIDATE_CREDENTIALS': application_name=input_dict.get('application_name') if not application_name: application_name=action_filter.get('application_name') client_id=input_dict.get('client_id') if not client_id: client_id=input_dict.get('application_client_id') if not client_id: client_id=action_filter.get('client_id') if not client_id: client_id=action_filter.get('application_client_id') client_secretKey = input_dict.get('client_secretKey') if not client_secretKey: client_secretKey=input_dict.get('application_client_secretKey') if not client_secretKey: client_secretKey=action_filter.get('client_secretKey') if not client_secretKey: client_secretKey=action_filter.get('application_client_secretKey') return dbapi_application_credentials_are_valid(dbsession, application_name, client_id, client_secretKey) if action.upper() in ('ADD','INSERT','REGISTER','REFRESH'): if not input_dict.get('application_name'): msg = f'application name not defined' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not input_dict.get('subscription_id') and not input_dict.get('client_id'): msg = f'subscription not defined' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result subscription = dbsession.get(dbmodel.SUBSCRIPTION, input_dict, caller_area=_process_call_area) if not subscription: client=dbsession.get(dbmodel.CLIENT, input_dict, caller_area=_process_call_area) if client: input_dict.update({'client_id': client.client_id}) subscription = dbsession.get(dbmodel.SUBSCRIPTION, input_dict, caller_area=_process_call_area) if not subscription: msg = f'subscription not found' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not subscription.status=='Active': msg = f'subscription not Active' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result app_rec={'application_name':input_dict.get('application_name')} application = dbsession.get(dbmodel.APPLICATION, app_rec, caller_area=_process_call_area) if application: if not application.subscription_id == subscription.subscription_id: msg = f'application {application.application_name} already in used. try another name' api_result = {'api_status': 'error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result subscription_record = subscription.to_dict() input_dict.update(subscription_record) client=dbsession.get(dbmodel.CLIENT, input_dict, caller_area=_process_call_area) if not client: msg = f'client not found' api_result = {'api_status': 'systemerror', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not client.status=='Active': msg = f'client not Active' api_result = {'api_status': 'system error', 'api_message': msg, 'api_data': input_dict} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result action_result = dbsession.table_action(dbmodel.APPLICATION, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) if api_result.get('api_status') == 'success': user_dict=api_result.get('api_data') user_dict.update({'user_role':'owner'}) dbapi_application_USER(dbsession, 'register', user_dict,caller_area=_process_call_area) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_application_credentials_are_valid(dbsession, application_name, client_id, client_secretKey ,caller_area={}): _api_name = "dbapi_application_credentials_are_valid" _api_entity = 'APPLICATION' _api_action = 'validation' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'application_name', application_name,**_process_call_area) log_process_input('', 'client_id', client_id,**_process_call_area) log_process_input('', 'client_secretKey', client_secretKey,**_process_call_area) application=dbsession.get(dbmodel.APPLICATION, {'application_name': application_name}, caller_area=_process_call_area) if not application: api_result=False else: if not application.client_id == client_id or not application.client_secretKey == client_secretKey: api_result=False else: api_result=True log_process_result(_api_msgID, api_result, data_name='application_credentials_are_valid', **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_application_api(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_application_api" _api_entity = 'APPLICATION_API' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.APPLICATION_API, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_application_USER(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_application_user" _api_entity = 'APPLICATION_USER' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() in ('REGISTER', 'UNREGISTER', 'ADD', 'REFRESH'): if not input_dict.get('user_role'): msg = f'user role not defined' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_id = input_dict.get('client_id') if client_id: client = dbsession.get(dbmodel.CLIENT, {'client_id': client_id}, caller_area=_process_call_area) else: client = dbsession.refresh(dbmodel.CLIENT, input_dict, auto_commit=True, caller_area=_process_call_area) if not client: msg = f'client not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not client.status == 'Active': msg = f"client not Active.(status:{client.status})" log_process_message('', 'warning', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) #return api_result application_name=input_dict.get('application_name') application = dbsession.get(dbmodel.APPLICATION, {'application_name': application_name}, caller_area=_process_call_area) if not application: application_id=input_dict.get('application_id') application = dbsession.get(dbmodel.APPLICATION, {'application_id': application_id}, caller_area=_process_call_area) if not application: msg = f'application not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not application.status == 'Active': msg = f"application not Active.(status:{application.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result app_rec = application.to_dict() client_rec = client.to_dict() input_dict.update(app_rec) input_dict.update(client_rec) # input_dict.update({'application_name': application.application_name}) # input_dict.update({'application_id': application.application_id}) # input_dict.update({'client_id': application.client_id}) # input_dict.update({'client_id': application.client_id}) # if not input_dict.get('status'): # input_dict.update({'status': 'Active'}) action_result = dbsession.table_action(dbmodel.APPLICATION_USER, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_application_template(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_template" _api_entity = 'TEMPLATE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.APPLICATION_TEMPLATE, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_token(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_token" _api_entity = 'TOKEN' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.TOKEN, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_subscription(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_subscription" _api_entity = 'SUBSCRIPTION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) input_dict.update({'client_type': 'subscriber'}) if action.upper() in ('REGISTER','ADD','REFRESH'): user = dbsession.get(dbmodel.USER, input_dict, caller_area=_process_call_area) if not user: user_id = '' else: user_id = user.user_id input_dict.update({'user_id': user_id}) if action.upper() in ('REGISTER','ADD','REFRESH'): xaction='REFRESH' action_result = dbsession.table_action(dbmodel.CLIENT, xaction, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result thismsg=action_result.get('api_message') api_result.update({'api_action': _api_action, 'api_name': _api_name}) if not api_result.get('api_status') == 'success': msg = f"subscription not registered. client record create failed" log_process_message(_api_msgID, 'error', msg, **_process_call_area) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client = api_result.get('api_data') client_id = client.get('client_id') client_secretKey = client.get('client_secretKey') input_dict.update({'client_id': client_id}) input_dict.update({'client_secretKey': client_secretKey}) elif action.upper() in ('CONFIRM', 'ACTIVATE', 'DEACTIVATE', 'DELETE'): subscription_dict = dbsession.get(dbmodel.SUBSCRIPTION, input_dict, 'DICT', caller_area=_process_call_area) if not subscription_dict: msg = f'subscription not found' action_status='error' api_result = {'api_status': action_status, 'api_message': msg, 'api_data': input_dict, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client=dbsession.get(dbmodel.CLIENT, subscription_dict,'', caller_area=_process_call_area) if not client: msg = f'client not found' action_status='error' api_result = {'api_status': action_status, 'api_message': msg, 'api_data': subscription_dict, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_id = client.client_id client_secretKey = client.client_secretKey input_dict.update({'client_id': client_id}) input_dict.update({'client_secretKey': client_secretKey}) api_result = dbsession.table_action(dbmodel.CLIENT, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result.update({'api_action': _api_action, 'api_name': _api_name}) thismsg=api_result.get('api_message') if not api_result.get('api_status') == 'success': msg = f'action {action.upper()} on client {client_id} failed' log_process_message(_api_msgID, 'error', msg, **_process_call_area) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_dict = api_result.get('api_data', {}) client_status = client_dict.get('status') subscription_dict = dbsession.get(dbmodel.SUBSCRIPTION, subscription_dict, 'DICT', caller_area=_process_call_area) client_id=subscription_dict.get('client_id') input_dict.update({'status': client_status}) input_dict.update({'client_id': client_id}) action_result = dbsession.table_action(dbmodel.SUBSCRIPTION, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result thismsg=thismsg.replace('CLIENT',_api_entity) api_result.update({'api_action': _api_action, 'api_name': _api_name,'api_message':thismsg}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_user(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_user" _api_entity = 'USER' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) api_result = dbsession.table_action(dbmodel.USER, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) if not api_result.get('api_status') == 'success': log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result # #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_merchant(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_merchant" _api_entity = 'MERCHANT' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if (action.upper().find('BANKACCOUNT') >= 0 and action.upper().find('GET') >= 0) or action.upper() in ('BANKACCOUNTS', 'BANKACCOUNT'): return dbapi_merchant_get_bankaccounts(dbsession, input_dict, action_filter, caller_area=_process_call_area) elif action.upper().find('BANKACCOUNT') >= 0 and action.upper().find('REGISTER') >= 0: return dbapi_merchant_bankaccount_register(dbsession, input_dict, action_filter, caller_area=_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) input_dict.update({'client_type': 'merchant'}) if action.upper() in ('REGISTER','ADD','REFRESH'): action='REFRESH' action_result = dbsession.table_action(dbmodel.CLIENT, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) thismsg=action_result.get('api_message') if not api_result.get('api_status') == 'success': log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client = api_result.get('api_data') client_id = client.get('client_id') input_dict.update({'client_id': client_id}) elif action.upper() in ('CONFIRM', 'ACTIVATE', 'DEACTIVATE', 'DELETE'): merchant_dict = dbsession.get(dbmodel.MERCHANT, input_dict, 'DICT', caller_area=_process_call_area) if not merchant_dict: msg = f'merchant not found' action_status='error' api_result = {'api_status': action_status, 'api_message': msg, 'api_data': input_dict, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_dict=dbsession.get(dbmodel.CLIENT, merchant_dict,'DICT', caller_area=_process_call_area) if not client_dict: msg = f'client not found' action_status='error' api_result = {'api_status': action_status, 'api_message': msg, 'api_data': merchant_dict, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #action='CONFIRM' action_result = dbsession.table_action(dbmodel.CLIENT, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) thismsg=action_result.get('api_message') # api_result = dbapi_client_confirm(client_dict) if not api_result.get('api_status') == 'success': # msg = f'client confirmation failed' # api_result.update({'api_message':msg}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result merchant_dict = dbsession.get(dbmodel.MERCHANT, merchant_dict, 'DICT', caller_area=_process_call_area) status=merchant_dict.get('status') client_id=merchant_dict.get('client_id') # if not merchant_dict.get('status') == 'Active': # msg = f"service provider not confirmed. status={status}" # action_status='error' # api_result = {'api_status': action_status, 'api_message': msg, 'api_data': merchant_dict, 'messages': messages, 'rows_added': rows_added, 'rows_updated': rows_updated, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result input_dict.update({'status': status}) input_dict.update({'client_id': client_id}) action_result = dbsession.table_action(dbmodel.MERCHANT, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result #thismsg=thismsg.replace('CLIENT',_api_entity) api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_retail_store(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_retail_store" _api_entity = 'RETAIL_STORE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() in ('REGISTER', 'ADD', 'REFRESH'): merchant_id = input_dict.get('merchant_id') merch_rec = {'merchant_id': merchant_id} merchant_name = input_dict.get('merchant_name') if merchant_name: merch_rec.update({'merchant_name':merchant_name}) merchant = dbsession.get(dbmodel.MERCHANT, merch_rec, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'merchant_id': merchant.merchant_id}) if not input_dict.get('status'): input_dict.update({'status': 'Active'}) action_result = dbsession.table_action(dbmodel.RETAIL_STORE, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_pointofsale(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_pointofsale" _api_entity = 'POINT_OF_SALE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper().find('BANKACCOUNT') >= 0 and (action.upper().find('ADD') >= 0 or action.upper().find('REGISTER') >= 0): return dbapi_pointofsale_bankaccount_remove(dbsession, input_dict, action_filter, caller_area=_process_call_area) elif action.upper().find('BANKACCOUNT') >= 0 and (action.upper().find('REMOVE') >= 0 or action.upper().find('DELETE') >= 0): return dbapi_pointofsale_bankaccount_add(dbsession, input_dict, action_filter, caller_area=_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() in ('REGISTER', 'ADD', 'REFRESH'): retail_store_id = input_dict.get('retail_store_id') store_rec={'retail_store_id':retail_store_id} retail_store = dbsession.get(dbmodel.RETAIL_STORE, store_rec, caller_area=_process_call_area) if not retail_store: msg = f'retail_store not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not retail_store.status == 'Active': msg = f"retail_store not Active.(status:{retail_store.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'retail_store_id': retail_store.retail_store_id}) merchant_id = retail_store.merchant_id merch_rec = {'merchant_id': merchant_id} merchant = dbsession.get(dbmodel.MERCHANT, merch_rec, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'merchant_id': merchant.merchant_id}) if not input_dict.get('status'): input_dict.update({'status': 'Active'}) action_result = dbsession.table_action(dbmodel.POINT_OF_SALE, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_service_point(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_service_point" _api_entity = 'SERVICE_POINT' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() in ('REGISTER', 'ADD', 'REFRESH'): retail_store_id = input_dict.get('retail_store_id') store_rec={'retail_store_id':retail_store_id} retail_store = dbsession.get(dbmodel.RETAIL_STORE, store_rec, caller_area=_process_call_area) if not retail_store: msg = f'retail_store not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not retail_store.status == 'Active': msg = f"retail_store not Active.(status:{retail_store.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'retail_store_id': retail_store.retail_store_id}) merchant_id = retail_store.merchant_id merch_rec = {'merchant_id': merchant_id} merchant = dbsession.get(dbmodel.MERCHANT, merch_rec, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'merchant_id': merchant.merchant_id}) if not input_dict.get('status'): input_dict.update({'status': 'Active'}) action_result = dbsession.table_action(dbmodel.SERVICE_POINT, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_customer_service_assistant(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_customer_service_assistant" _api_entity = 'CUSTOMER_SERVICE_ASSISTANT' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if action.upper() in ('REGISTER', 'ADD', 'REFRESH'): merchant_id=input_dict.get('merchant_id') merch_rec = {'merchant_id': merchant_id} merchant = dbsession.get(dbmodel.MERCHANT, merch_rec, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not input_dict.get('status'): input_dict.update({'status': 'Active'}) #client if input_dict.get('email'): action='REFRESH' input_dict.update({'client_type': 'customer_service_assistant'}) action_result = dbsession.table_action(dbmodel.CLIENT, action, input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) thismsg=action_result.get('api_message') if not api_result.get('api_status') == 'success': log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client = api_result.get('api_data') client_id = client.get('client_id') input_dict.update({'client_id': client_id}) action_result = dbsession.table_action(dbmodel.CUSTOMER_SERVICE_ASSISTANT, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_merchant_get_bankaccounts(dbsession, merchant_record, action_filter={}, caller_area={}): _api_name = "dbapi_merchant_get_bankaccounts" _api_entity = 'MERCHANT' _api_action = 'get_bank_accounts' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', merchant_record,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) merchant = dbsession.get(dbmodel.MERCHANT, merchant_record, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result client_id = merchant.client_id merchant_accounts=[] filterJson = {"client_id": client_id, "status": 'Active'} bank_accounts=dbsession.get_rows(dbmodel.BANK_ACCOUNT, filterJson, caller_area=_process_call_area) if bank_accounts: msg = f'[{len(bank_accounts)} bank accounts found] for merchant [{merchant.name}] client_id [{client_id}]' log_process_message('', 'success', msg, **_process_call_area) for bank_account in bank_accounts: bank_account_id = str(bank_account.bank_account_id) bank_accountID = str(bank_account.bank_accountID) merchant_accounts.append(bank_account_id) msg = f'OK. [{len(merchant_accounts)} bank accounts]' api_result = {'api_status': 'success', 'api_message': msg, 'data_records': len(merchant_accounts), 'api_data': merchant_accounts, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_merchant_bankaccount_register(dbsession, bankaccount_record, action_filter={}, caller_area={}): _api_name = "dbapi_merchant_bankaccount_register" _api_entity = 'MERCHANT' _api_action = 'register_bank_account' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', bankaccount_record,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) merchant = dbsession.get(dbmodel.MERCHANT, bankaccount_record, caller_area=_process_call_area) if not merchant: msg = f'merchant not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not merchant.status == 'Active': msg = f"merchant not Active.(status:{merchant.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result bank_account_id=None account_id = bankaccount_record.get('bank_account_id') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: account_id = bankaccount_record.get('bank_accountID') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: account_id = bankaccount_record.get('bank_account') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: msg = f"bank_account not found" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result bankaccount_record.update({'bank_account_id':bank_account_id}) bankaccount_record.update({'merchant_id':merchant.merchant_id}) bank_account = dbsession.get(dbmodel.BANK_ACCOUNT, {'bank_account_id':bank_account_id}, caller_area=_process_call_area) if not bank_account: msg = f"bank account not found" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not bank_account.status == 'Active': msg = f"bank account {bank_account_id} not Active (status:{bank_account.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result merchant_record = bank_account.to_dict() merchant_record.update({'merchant_id': merchant.merchant_id}) api_result = dbsession.table_action(dbmodel.MERCHANT, 'UPDATE', merchant_record, action_filter, auto_commit=True, caller_area=_process_call_area) api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_pointofsale_bankaccount_add(dbsession, bankaccount_record, action_filter={}, caller_area={}): _api_name = "dbapi_pointofsale_bankaccount_add" _api_entity = 'POINT_OF_SALE' _api_action = 'add_bank_account' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', bankaccount_record,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, bankaccount_record, caller_area=_process_call_area) if not pointofsale: msg = f'pointofsale not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not pointofsale.status == 'Active': msg = f"pointofsale not Active.(status:{pointofsale.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result bank_account_id=None account_id = bankaccount_record.get('bank_account_id') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: account_id = bankaccount_record.get('bank_accountID') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: account_id = bankaccount_record.get('bank_account') if account_id: bank_account_id = dbapi_get_bank_account_id(dbsession, account_id, caller_area={}) if not bank_account_id: msg = f"bank_account not found" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result bankaccount_record.update({'bank_account_id':bank_account_id}) bankaccount_record.update({'pointofsale_id':pointofsale.pointofsale_id}) bank_account = dbsession.get(dbmodel.BANK_ACCOUNT, {'bank_account_id':bank_account_id}, caller_area=_process_call_area) if not bank_account: msg = f"bank account not found" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not bank_account.status == 'Active': msg = f"bank account {bank_account_id} not Active (status:{bank_account.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result pointofsale_record = bank_account.to_dict() pointofsale_record.update({'pointofsale_id': pointofsale.pointofsale_id}) api_result = dbsession.table_action(dbmodel.POINT_OF_SALE, 'UPDATE', pointofsale_record, action_filter, auto_commit=True, caller_area=_process_call_area) api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_pointofsale_bankaccount_remove(dbsession, pointofsale_record, action_filter={}, caller_area={}): _api_name = "dbapi_pointofsale_bankaccount_remove" _api_entity = 'POINT_OF_SALE' _api_action = 'remove_bank_account' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', pointofsale_record,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, pointofsale_record, caller_area=_process_call_area) if not pointofsale: msg = f'pointofsale not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not pointofsale.status == 'Active': msg = f"pointofsale not Active.(status:{pointofsale.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result pointofsale_record = pointofsale.to_dict() pointofsale_record.update({ 'bank_account_id' : '', 'bank_subscription_id' : '', 'bank_code' : '', 'bank_subscriptionID' : '', 'bank_accountID' : '', 'payments_currency' : '', }) api_result = dbsession.table_action(dbmodel.POINT_OF_SALE, 'UPDATE', pointofsale_record, action_filter, auto_commit=True, caller_area=_process_call_area) api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_pointofsale_credit_info(dbsession, pointofsale_record, action_filter={}, caller_area={}): _api_name = "dbapi_pointofsale_credit_info" _api_entity = 'POINT_OF_SALE' _api_action = 'get_pointofsale_credit_info' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', pointofsale_record,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, pointofsale_record, caller_area=_process_call_area) if not pointofsale: msg = f'pointofsale not found' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not pointofsale.status == 'Active': msg = f"pointofsale not Active.(status:{pointofsale.status})" log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result pointofsale_id=pointofsale.pointofsale_id merchant_id=pointofsale.merchant_id pointofsale_name = pointofsale.name bank_account_id = pointofsale.bank_account_id bank_subscription_id = pointofsale.bank_subscription_id bank_code = pointofsale.bank_code bank_subscriptionID = pointofsale.bank_subscriptionID bank_accountID = pointofsale.bank_accountID payments_currency = pointofsale.payments_currency pointofsale_record = pointofsale.to_dict() if not bank_accountID: merchant = dbsession.get(dbmodel.MERCHANT, {'merchant_id':merchant_id}, caller_area=_process_call_area) bank_account_id = merchant.bank_account_id bank_subscription_id = merchant.bank_subscription_id bank_code = merchant.bank_code bank_subscriptionID = merchant.bank_subscriptionID bank_accountID = merchant.bank_accountID payments_currency = merchant.payments_currency x = ' from merchant' else: x = ' from point_of_sale' credit_info = { 'pointofsale_id': pointofsale_id, 'pointofsale_name':pointofsale_name, 'bank_account_id':bank_account_id, 'bank_subscription_id':bank_subscription_id, 'bank_code':bank_code, 'bank_subscriptionID':bank_subscriptionID, 'bank_accountID':bank_accountID, 'payments_currency': payments_currency, } msg = f"OK. pointofsale credit info retrieved [{x}]" log_process_message('', 'success', msg, **_process_call_area) api_result = {'api_status': 'success', 'api_message': msg, 'api_data':credit_info, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_interaction" _api_entity = 'INTERACTION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) if action.upper() in ('START','REQUEST'): return dbapi_interaction_start(dbsession, input_dict, caller_area=caller_area) elif action.upper() == 'ACCEPT': return dbapi_interaction_finish(dbsession, input_dict, caller_area=caller_area) elif action.upper() == 'FINISH': return dbapi_interaction_finish(dbsession, input_dict, caller_area=caller_area) elif action.upper() == 'MESSAGE': return dbapi_interaction_message_add(dbsession, input_dict, caller_area=caller_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area, **_process_call_area) action_result = dbsession.table_action(dbmodel.INTERACTION, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction_message(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_interaction_message" _api_entity = 'INTERACTION_MESSAGE' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.INTERACTION_MESSAGE, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_bank(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_bank" _api_entity = 'BANK' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.BANK, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_bank_authorization(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_bank_authorization" _api_entity = 'BANK_AUTHORIZATION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.BANK_AUTHORIZATION, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_bank_subscription(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_bank_subscription" _api_entity = 'BANK_SUBSCRIPTION' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.BANK_SUBSCRIPTION, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_bank_account(dbsession, action, input_dict, action_filter={}, caller_area={}): _api_name = "dbapi_bank_account" _api_entity = 'BANK_ACCOUNT' _api_action = action _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'action_filter', action_filter,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) action_result = dbsession.table_action(dbmodel.BANK_ACCOUNT, action , input_dict, action_filter, auto_commit=True, caller_area=_process_call_area) api_result = action_result api_result.update({'api_action': _api_action, 'api_name': _api_name}) log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_get_bank_account_id(dbsession, any_accountid, caller_area={}): if not any_accountid: return None _api_name = "dbapi_get_bank_account_id" _api_entity = 'BANK_ACCOUNT' _api_action = 'get' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) account = dbsession.get(dbmodel.BANK_ACCOUNT, {'bank_account_id': any_accountid}, caller_area=_process_call_area) if account: bank_account_id = account.bank_account_id else: account = dbsession.get(dbmodel.BANK_ACCOUNT, {'bank_accountID': any_accountid}, caller_area=_process_call_area) if account: bank_account_id = account.bank_account_id else: bank_account_id = None return bank_account_id #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_get_bank_code(dbsession, any_bank_id, return_field='bank_id', caller_area={}): if not any_bank_id: return None _api_name = "dbapi_get_bank_code" _api_entity = 'BANK' _api_action = 'get' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) bank = dbsession.get(dbmodel.BANK, {'bank_id': any_bank_id}, caller_area=_process_call_area) if not bank: bank = dbsession.get(dbmodel.BANK, {'bank_code': any_bank_id}, caller_area=_process_call_area) if not bank: bank = dbsession.get(dbmodel.BANK, {'bank_BIC': any_bank_id}, caller_area=_process_call_area) if not bank: return None if return_field.upper().find('CODE') >=0: return bank.bank_code elif return_field.upper().find('BIC') >=0: return bank.bank_BIC else: return bank.bank_id #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_device_log(dbsession, device_uid, application_name, geolocation_lat, geolocation_lon, client_id, caller_area={}): _api_name="dbapi_device_log" _api_entity = 'DEVICE' _api_action = 'log' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'device_uid', device_uid,**_process_call_area) log_process_input('', 'application_name', application_name,**_process_call_area) log_process_input('', 'geolocation_lat', geolocation_lat,**_process_call_area) log_process_input('', 'geolocation_lon', geolocation_lon,**_process_call_area) log_process_input('', 'client_id', client_id,**_process_call_area) # print(geolocation_lat,geolocation_lon) # glat=geoloc_to_integer(geolocation_lat) # glon = geoloc_to_integer(geolocation_lon) # print(glat,glon) # glat2=integer_to_geoloc(glat) # glon2 = integer_to_geoloc(glon) # print(glat2,glon2) # geolocation_lat=geoloc_to_integer(geolocation_lat) # geolocation_lon=geoloc_to_integer(geolocation_lon) # print(geolocation_lat,geolocation_lon) now = datetime.datetime.utcnow() application_id = None if not application_name: application_name='?' application = dbsession.get(dbmodel.APPLICATION, {'application_name': application_name}, caller_area=_process_call_area) if application: application_id = application.application_id device_record = {'device_uid': device_uid, 'last_usage_geolocation_lat': geolocation_lat, 'last_usage_geolocation_lon': geolocation_lon, 'last_usage_timestamp': now} usage_record = {'device_uid': device_uid, 'application_name': application_name, 'geolocation_lat': geolocation_lat, 'geolocation_lon': geolocation_lon, 'client_id': client_id} client_device_record = {'device_uid': device_uid, 'client_id': client_id, 'application_name': application_name, 'application_id': application_id, 'last_usage_timestamp': now} device = dbsession.refresh(dbmodel.DEVICE, device_record, auto_commit=False, caller_area=_process_call_area) device_usage = dbsession.refresh(dbmodel.DEVICE_USAGE,usage_record, auto_commit=False, caller_area=_process_call_area) client_device = dbsession.refresh(dbmodel.CLIENT_DEVICE,client_device_record, auto_commit=False, caller_area=_process_call_area) dbsession.commit(**_process_call_area) if client_device: logged_record = client_device.to_dict() if device.times_used <= 1: msg=f"OK. new device logged" else: msg = f"OK. device logged, times_used:{device_usage.times_used}/{client_device.times_used}" log_process_message('', 'success', msg, **_process_call_area) api_result = {'api_status': 'success', 'api_message': msg, 'api_data': logged_record, 'api_action': _api_action.upper(), 'api_name': _api_name} else: msg = f"device logged FAILED" api_result = {'api_status': 'error', 'api_message': msg, 'api_data': {}, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_token_is_valid(dbsession, token, caller_area={}): _api_name = "dbapi_token_is_valid" _api_entity = 'TOKEN' _api_action = 'validation' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'token', token,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) if type(token) == type(''): input_dict = {'token': token} elif type(token) == type({}): input_dict = token else: msg='invalid token provided' log_process_message('', 'error', msg, **_process_call_area) return False if not input_dict.get('token'): msg='no token provided' log_process_message('', 'error', msg, **_process_call_area) return False token_record = dbsession.get(dbmodel.TOKEN, input_dict, caller_area=_process_call_area) if not token_record: msg = f'access token is NOT valid.(not found)' log_process_message('', 'error', msg, **_process_call_area) return False expiryDT = token_record.expiryDT if not expiryDT: msg = f'access token is NOT valid.(no expiryDT)' log_process_message('', 'error', msg, **_process_call_area) return False #universal time #GMT=Greenwich Mean Time #UTC=Coordinated Universal Time #There is no time difference between Coordinated Universal Time and Greenwich Mean Time #nowString = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S') #now=datetime.datetime.utcnow() if expiryDT < datetime.datetime.utcnow(): msg = f'access token is NOT valid.(expired)' api_result = False api_result = True log_process_result(_api_msgID, api_result, data_name='access_token_is_valid', **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_token_get_access_token(dbsession, token_request, caller_area={}): _api_name = "dbapi_token_get_access_token" _api_entity = 'TOKEN' _api_action = 'GET_TOKEN' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'token_request', token_request,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) application_name=token_request.get('application_name') client_id=token_request.get('application_client_id') client_secretKey=token_request.get('application_client_secretKey') application = dbsession.get(dbmodel.APPLICATION, {'application_name': application_name, 'client_id': client_id}, caller_area=_process_call_area) if not application: msg='application not registered' api_result={'api_status': 'error', 'api_message': msg,'api_data':{}} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if not application.client_id == client_id or not application.client_secretKey == client_secretKey: msg='application credentials not valid' api_result={'api_status': 'error', 'api_message': msg,'api_data':{}} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result token_duration_secs = 3600 #1 hour if token_request.get('token_scope') == 'application_service': token_duration_secs = 3600 #1 hour token_request.update({'duration_seconds':token_duration_secs}) token_request.update({'status':'Active'}) expiryDT = datetime.datetime.utcnow() + datetime.timedelta(seconds=token_duration_secs) token_request.update({'expiryDT': expiryDT}) if 'token' in token_request.keys(): token_request.pop('token') token = dbsession.insert(dbmodel.TOKEN, token_request,auto_commit=True, caller_area=_process_call_area) if not token: msg='token generation failed' api_result={'api_status': 'system error', 'api_message': msg,'api_data':{}} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result token_record = { 'token_type': token.token_type, 'token_scope': token.token_scope, 'grant_type': token.grant_type, 'token': token.token, 'duration_seconds': token.duration_seconds, 'expiryDT': token.expiryDT, } msg='OK. token generated' api_result={'api_status': 'success', 'api_message': msg,'api_data':token_record} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_cleanup_tokens(dbsession, caller_area={}): _api_name = "debapi_cleanup_tokens" _api_entity = 'TOKEN' _api_action = 'CLEANUP' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) where_expression = {'status': 'Expired'} deleted_result = dbsession.delete_rows(dbmodel.TOKEN, where_expression, auto_commit=True) deleted_rows = deleted_result.get('rows_deleted', 0) #nowString = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S') #where_expression = f"expiryDT<'{datetime.datetime.utcnow()}'" where_expression = {'expiryDT': {datetime.datetime.utcnow()}} update_dict = {'status': 'Expired'} expired_result = dbsession.update_rows(dbmodel.TOKEN, update_dict,where_expression, auto_commit=True, caller_area=_process_call_area) expired_rows = expired_result.get('rows_updated', 0) msg = f'tokens cleaned with {expired_rows} tokens expired, {deleted_rows} removed.' api_result = {'api_status': 'success', 'api_message': msg, 'rows_expired': expired_rows, 'rows_removed': deleted_rows} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction_start(dbsession, input_dict, caller_area={}): _api_name = "dbapi_interaction_start" _api_entity = 'INTERACTION' _api_action = 'START' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) #//////////////////////////////////////// originator = None originator_id = None originator_name = None corresponder = None corresponder_id = None corresponder_name = None #//////////////////////////////////////// #step-1: originator (originator, originator_id, originator_name) = find_originator(dbsession, input_dict, _process_call_area) # originator_id = input_dict.get('originator_id') # if originator_id: # xid = dbsession.get(dbmodel.CLIENT, {'client_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='client' # originator_name = xid.email # else: # xid = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='pointofsale' # originator_name = xid.name # else: # msg = f'originator not valid' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # xoriginator = input_dict.get('originator') # if xoriginator and not xoriginator == originator: # msg = f'originator_id not valid for originator {xoriginator}' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # else: # client_id = input_dict.get('client_id') # if client_id: # client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) # if not client: # msg = f'client not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='client' # originator_id=client_id # originator_name = client.email # else: # pointofsale_id = input_dict.get('pointofsale_id') # if pointofsale_id: # pointofsale=dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':pointofsale_id}, caller_area=_process_call_area) # if not pointofsale: # msg = f'pointofsale not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='pointofsale' # originator_id=pointofsale_id # originator_name = pointofsale.name # else: # msg = f'no pointofsale or consumer or client defined' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result if not originator_id: msg = f'originator not defined (pointofsale or client or service_point)' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result xoriginator = input_dict.get('originator') if xoriginator and not xoriginator == originator: msg = f'originator_id not valid for originator {xoriginator}' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'originator': originator}) input_dict.update({'originator_id': originator_id}) input_dict.update({'originator_name': originator_name}) msg = f'originator set to [{originator_name}]' log_process_message('', 'success', msg, **_process_call_area) #step-2: corresponder (corresponder, corresponder_id, corresponder_name) = find_corresponder(dbsession, input_dict, _process_call_area) # corresponder_id = input_dict.get('corresponder_id') # if not corresponder_id: # msg = f'no corresponder specified' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':corresponder_id}, caller_area=_process_call_area) # if pointofsale: # corresponder='pointofsale' # corresponder_id = pointofsale.pointofsale_id # corresponder_name = pointofsale.name # else: # xid = dbsession.get(dbmodel.CLIENT, {'client_id':corresponder_id}, caller_area=_process_call_area) # if xid: # corresponder='client' # corresponder_id=xid.client_id # corresponder_name = xid.email # else: # msg = f'corresponder not valid' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result if not corresponder_id: msg = f'corresponder not valid' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result xcorresponder = input_dict.get('corresponder') if xcorresponder and not xcorresponder == corresponder: msg = f'corresponder_id not valid for corresponder {xcorresponder}' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'corresponder': corresponder}) input_dict.update({'corresponder_id': corresponder_id}) input_dict.update({'corresponder_name': corresponder_name}) msg = f'corresponder set to [{corresponder_name}]' log_process_message('', 'success', msg, **_process_call_area) #step-3: already active filterJson = {"originator": originator, "originator_id": originator_id, "status": 'Active'} active_interactions=dbsession.get_rows(dbmodel.INTERACTION, filterJson, caller_area=_process_call_area) if active_interactions: msg = f'[{len(active_interactions)} active interactions found] for originator [{originator_name}]' log_process_message('', 'warning', msg, **_process_call_area) for active_interaction in active_interactions: interaction_id = active_interaction.interaction_id time_start = active_interaction.row_timestamp time_end = datetime.datetime.utcnow() diff = time_end - time_start duration = diff.days * 24 * 60 * 60 + diff.seconds interaction_rec = active_interaction.to_dict() interaction_rec.update({'status':'canceled','completed_timestamp':time_end,'duration':duration}) active_interaction = dbsession.update(dbmodel.INTERACTION, interaction_rec, auto_commit=True, caller_area=_process_call_area) #step-4: corresponder is available (not active) filterJson = {"corresponder": corresponder, "corresponder_id": corresponder_id, "status": 'Active'} active_interactions=dbsession.get_rows(dbmodel.INTERACTION, filterJson, caller_area=_process_call_area) if active_interactions: msg = f'[{len(active_interactions)} active interaction(s) found] for corresponder [{corresponder_name}]' log_process_message('', 'warning', msg, **_process_call_area) for active_interaction in active_interactions: interaction_id = active_interaction.interaction_id time_start = active_interaction.row_timestamp time_end = datetime.datetime.utcnow() diff = time_end - time_start duration = diff.days * 24 * 60 * 60 + diff.seconds if duration>5*60: # 5 minutes interaction_rec = active_interaction.to_dict() interaction_rec.update({'status':'canceled-timeout','completed_timestamp':time_end,'duration':duration}) active_interaction = dbsession.update(dbmodel.INTERACTION, interaction_rec, auto_commit=True, caller_area=_process_call_area) msg = f'corresponder {corresponder_name} interaction {interaction_id} timed-out and canceled after {duration/60} minutes' log_process_message('', 'warning', msg, **_process_call_area) filterJson = {"corresponder": corresponder, "corresponder_id": corresponder_id, "status": 'Active'} active_interactions=dbsession.get_rows(dbmodel.INTERACTION, filterJson, caller_area=_process_call_area) if active_interactions: msg = f'corresponder {corresponder_name} is not available' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #step-5: insert input_dict.update({'status': 'Requested'}) interaction = dbsession.insert(dbmodel.INTERACTION, input_dict, auto_commit=True, caller_area=_process_call_area) if not interaction: msg = f'interaction start failed' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result interaction_id = interaction.interaction_id #step-6: message interaction_message = { 'interaction_id':interaction_id, 'originator_id':interaction.originator_id, 'originator': interaction.originator, 'originator_name': interaction.originator_name, 'message_type':'start', 'message_record':f"hi. i am {interaction.originator} {interaction.originator_name} and i want to interact with {interaction.corresponder} {interaction.corresponder_name}", 'content_type':'text', 'format':'', 'application_name': input_dict.get('application_name'), 'geolocation_lat': input_dict.get('geolocation_lat'), 'geolocation_lon': input_dict.get('geolocation_lon'), } start_message = dbsession.insert(dbmodel.INTERACTION_MESSAGE, interaction_message, auto_commit=True, caller_area=_process_call_area) if not start_message: msg = f'start message insert failed' log_process_message('', 'error', msg, **_process_call_area) msg = f'interaction start failed (message insert failed)' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #shalimar #step-6: result interaction_record = interaction.to_dict() msg=f'OK. interaction established between You and {corresponder.upper()} {corresponder_name}' api_result = {'api_status': 'success', 'api_message': msg, 'interaction_id': interaction_id, 'api_data': interaction_record, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction_accept(dbsession, input_dict, caller_area={}): _api_name = "dbapi_interaction_accept" _api_entity = 'INTERACTION' _api_action = 'ACCEPT' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) interaction_id = input_dict.get('interaction_id') if not interaction_id: msg = f'interaction not defined' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return interaction = dbsession.get(dbmodel.INTERACTION, {'interaction_id':interaction_id}, caller_area=_process_call_area) if not interaction: msg = f'interaction not found' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return if interaction.status == 'Active': msg = f'interaction is already Active' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return if not interaction.status=='Requested': msg = f'interaction is already [{interaction.status}]' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return #//////////////////////////////////////// originator = None originator_id = None originator_name = None #//////////////////////////////////////// # #step-1: originator # originator_id = input_dict.get('originator_id') # if originator_id: # xid = dbsession.get(dbmodel.CLIENT, {'client_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='client' # originator_name = xid.email # else: # xid = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='pointofsale' # originator_name = xid.name # else: # msg = f'originator not valid' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # xoriginator = input_dict.get('originator') # if xoriginator and not xoriginator == originator: # msg = f'originator_id not valid for originator {xoriginator}' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # else: # client_id = input_dict.get('client_id') # if client_id: # client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) # if not client: # msg = f'client not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='client' # originator_id=client_id # originator_name = client.email # else: # pointofsale_id = input_dict.get('pointofsale_id') # if pointofsale_id: # pointofsale=dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':pointofsale_id}, caller_area=_process_call_area) # if not pointofsale: # msg = f'pointofsale not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='pointofsale' # originator_id=pointofsale_id # originator_name = pointofsale.name # else: # msg = f'no pointofsale or client defined' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result (originator, originator_id, originator_name) = find_originator(dbsession, input_dict, _process_call_area) if not originator_id: msg = f'originator not defined (pointofsale or client or service_point)' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result xoriginator = input_dict.get('originator') if xoriginator and not xoriginator == originator: msg = f'originator_id not valid for originator {xoriginator}' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result # if not originator or not originator_id: # msg = f'originator(as corresponder) not defined (pointofsale or client)' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result if originator_id == interaction.originator_id: msg = f'accepter [{originator_name}] same as requestor' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result if interaction.corresponder_id: if not originator_id == interaction.corresponder_id: msg = f'interaction must be accepted by [{interaction.corresponder}] {interaction.corresponder_name} [not] by [{originator}] {originator_name} ' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return input_dict.update({'corresponder': originator}) input_dict.update({'corresponder_id': originator_id}) input_dict.update({'corresponder_name': originator_name}) msg=f'corresponder: [{originator}] [[{originator_name}]]' log_process_message('', 'success', msg, **_process_call_area) interaction_message = { 'interaction_id': interaction_id, 'originator_id': originator_id, 'originator': originator, 'originator_name': originator_name, 'message_type':'accept', 'message_record':f"hi. i am {originator} {originator_name}. how can i help you Mr. {interaction.originator} {interaction.originator_name}", 'content_type':input_dict.get('content_type','text'), 'format':input_dict.get('format',''), 'application_name': input_dict.get('application_name'), 'geolocation_lat': input_dict.get('geolocation_lat'), 'geolocation_lon': input_dict.get('geolocation_lon'), } message = dbsession.insert(dbmodel.INTERACTION_MESSAGE, interaction_message, auto_commit=True, caller_area=_process_call_area) if not message: msg = f'interaction message add failed' log_process_message('', 'error', msg, **_process_call_area) time_start = interaction.row_timestamp time_end = datetime.datetime.utcnow() diff = time_end - time_start duration = diff.days * 24 * 60 * 60 + diff.seconds interaction_rec = interaction.to_dict() interaction_rec.update({ 'corresponder': originator, 'corresponder_id': originator_id, 'corresponder_name': originator_name, 'status': 'Active', 'last_usage_timestamp': datetime.datetime.utcnow(), 'accept_geolocation_lat':input_dict.get('geolocation_lat'), 'accept_geolocation_lon':input_dict.get('geolocation_lon'), }) interaction = dbsession.update(dbmodel.INTERACTION, interaction_rec, auto_commit=True, caller_area=_process_call_area) if not interaction: msg = f'interaction accept failed' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_message('', 'error', msg, **_process_call_area) return api_result #step-6: result interaction_rec = interaction.to_dict() msg=f'OK. interaction accepted' api_result = {'api_status': 'success', 'api_message': msg, 'interaction_id': interaction.interaction_id, 'api_data': interaction_rec, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction_finish(dbsession, input_dict, caller_area={}): _api_name = "dbapi_interaction_finish" _api_entity = 'INTERACTION' _api_action = 'FINISH' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) interaction_id = input_dict.get('interaction_id') if not interaction_id: msg = f'interaction not defined' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return interaction = dbsession.get(dbmodel.INTERACTION, {'interaction_id':interaction_id}, caller_area=_process_call_area) if not interaction: msg = f'interaction not found' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return if not interaction.status=='Active': msg = f'interaction not Active' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return #//////////////////////////////////////// originator = None originator_id = None originator_name = None #//////////////////////////////////////// #step-1: originator # originator_id = input_dict.get('originator_id') # if originator_id: # xid = dbsession.get(dbmodel.CLIENT, {'client_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='client' # originator_name = xid.email # else: # xid = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='pointofsale' # originator_name = xid.name # else: # msg = f'originator not valid' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # xoriginator = input_dict.get('originator') # if xoriginator and not xoriginator == originator: # msg = f'originator_id not valid for originator {xoriginator}' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # else: # client_id = input_dict.get('client_id') # if client_id: # client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) # if not client: # msg = f'client not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='client' # originator_id=client_id # originator_name = client.email # else: # pointofsale_id = input_dict.get('pointofsale_id') # if pointofsale_id: # pointofsale=dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':pointofsale_id}, caller_area=_process_call_area) # if not pointofsale: # msg = f'pointofsale not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='pointofsale' # originator_id=pointofsale_id # originator_name = pointofsale.name # else: # msg = f'no pointofsale or client defined' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result (originator, originator_id, originator_name) = find_originator(dbsession, input_dict, _process_call_area) if not originator_id: msg = f'originator not defined (pointofsale or client or service_point)' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result xoriginator = input_dict.get('originator') if xoriginator and not xoriginator == originator: msg = f'originator_id not valid for originator {xoriginator}' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result # if not originator or not originator_id: # msg = f'originator not defined (pointofsale or client)' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result if not (originator_id == interaction.originator_id or originator_id == interaction.corresponder_id): msg = f'invalid originator [{originator_name}] for interaction [{interaction.interaction_id}]' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'originator': originator}) input_dict.update({'originator_id': originator_id}) input_dict.update({'originator_name': originator_name}) msg=f'originator: [{originator}] [[{originator_name}]]' log_process_message('', 'success', msg, **_process_call_area) interaction_message = { 'interaction_id': interaction_id, 'originator_id': input_dict.get('originator_id', ''), 'originator': input_dict.get('originator', ''), 'originator_name': input_dict.get('originator_name', ''), 'content_type': input_dict.get('content_type', 'text'), 'format': input_dict.get('format', ''), 'application_name': input_dict.get('application_name'), 'geolocation_lat': input_dict.get('geolocation_lat'), 'geolocation_lon': input_dict.get('geolocation_lon'), 'message_type': 'finish', 'message_record':f"goodbye. Thank you for interacting with us.{input_dict.get('originator')} {input_dict.get('originator_name')}", } message = dbsession.insert(dbmodel.INTERACTION_MESSAGE, interaction_message, auto_commit=True, caller_area=_process_call_area) if not message: msg = f'interaction message add failed' log_process_message('', 'error', msg, **_process_call_area) time_start = interaction.row_timestamp time_end = datetime.datetime.utcnow() diff = time_end - time_start duration = diff.days * 24 * 60 * 60 + diff.seconds interaction_rec = interaction.to_dict() interaction_rec.update({'status':'completed','completed_timestamp':time_end,'duration':duration}) interaction = dbsession.update(dbmodel.INTERACTION, interaction_rec, auto_commit=True, caller_area=_process_call_area) if not interaction: msg = f'interaction finish failed' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_message('', 'error', msg, **_process_call_area) return api_result #step-6: result interaction_rec = interaction.to_dict() msg=f'OK. interaction finish' api_result = {'api_status': 'success', 'api_message': msg, 'interaction_id': interaction.interaction_id, 'api_data': interaction_rec, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def dbapi_interaction_message_add(dbsession, input_dict, caller_area={}): _api_name = "dbapi_interaction_message_add" _api_entity = 'INTERACTION_MESSAGE' _api_action = 'ADD' _api_msgID = set_msgID(_api_name, _api_action, _api_entity) _process_identity_kwargs = {'type': 'api', 'module': module_id, 'name': _api_name, 'action': _api_action, 'entity': _api_entity, 'msgID': _api_msgID,} _process_adapters_kwargs = {'dbsession': dbsession} _process_log_kwargs = {'indent_method': 'AUTO', 'indent_level':None} _process_debug_level = get_debug_level(caller_area.get('debug_level'), **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_files = get_debug_files(_process_debug_level, **_process_identity_kwargs, **_process_adapters_kwargs) _process_debug_kwargs={'debug_level':_process_debug_level,'debug_files':_process_debug_files} _process_signature = build_process_signature(**_process_identity_kwargs, **_process_adapters_kwargs, **_process_debug_kwargs, **_process_log_kwargs) _process_call_area = build_process_call_area(_process_signature, caller_area) log_process_start(_api_msgID,**_process_call_area) log_process_input('', 'input_dict', input_dict,**_process_call_area) log_process_input('', 'caller_area', caller_area,**_process_call_area) interaction_id = input_dict.get('interaction_id') if not interaction_id: msg = f'interaction not defined' log_process_message('', 'error', msg, **_process_call_area) api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return interaction = dbsession.get(dbmodel.INTERACTION, {'interaction_id':interaction_id}, caller_area=_process_call_area) if not interaction: msg = f'interaction not found' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return if not interaction.status=='Active': msg = f'interaction not Active' api_result = {'api_status': 'error', 'api_message': msg} log_process_finish(_api_msgID, api_result, **_process_call_area) return #//////////////////////////////////////// originator = None originator_id = None originator_name = None #//////////////////////////////////////// #step-1: originator # originator_id = input_dict.get('originator_id') # if originator_id: # xid = dbsession.get(dbmodel.CLIENT, {'client_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='client' # originator_name = xid.email # else: # xid = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':originator_id}, caller_area=_process_call_area) # if xid: # originator='pointofsale' # originator_name = xid.name # else: # msg = f'originator not valid' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # xoriginator = input_dict.get('originator') # if xoriginator and not xoriginator == originator: # msg = f'originator_id not valid for originator {xoriginator}' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # else: # client_id = input_dict.get('client_id') # if client_id: # client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=_process_call_area) # if not client: # msg = f'client not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='client' # originator_id=client_id # originator_name = client.email # else: # pointofsale_id = input_dict.get('pointofsale_id') # if pointofsale_id: # pointofsale=dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':pointofsale_id}, caller_area=_process_call_area) # if not pointofsale: # msg = f'pointofsale not found' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # originator='pointofsale' # originator_id=pointofsale_id # originator_name = pointofsale.name # else: # msg = f'no pointofsale or client defined' # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result # if not originator or not originator_id: # msg = f'originator not defined (pointofsale or client)' # log_process_message('', 'error', msg, **_process_call_area) # api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} # log_process_finish(_api_msgID, api_result, **_process_call_area) # return api_result (originator, originator_id, originator_name) = find_originator(dbsession, input_dict, _process_call_area) if not originator_id: msg = f'originator not defined (pointofsale or client or service_point)' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result xoriginator = input_dict.get('originator') if xoriginator and not xoriginator == originator: msg = f'originator_id not valid for originator {xoriginator}' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result input_dict.update({'originator': originator}) input_dict.update({'originator_id': originator_id}) input_dict.update({'originator_name': originator_name}) if not (originator_id == interaction.originator_id or originator_id == interaction.corresponder_id): msg = f'invalid originator [{originator_name}] for interaction [{interaction.interaction_id}]' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result msg=f'originator: [{originator}] [[{originator_name}]]' log_process_message('', 'success', msg, **_process_call_area) interaction_message = { 'interaction_id': interaction_id, 'originator_id': originator_id, 'originator': originator, 'originator_name': originator_name, 'message_type': input_dict.get('message_type', 'message'), 'message_record': input_dict.get('message_record', ''), 'content_type': input_dict.get('content_type', 'text'), 'format': input_dict.get('format', ''), 'application_name': input_dict.get('application_name'), 'geolocation_lat': input_dict.get('geolocation_lat'), 'geolocation_lon': input_dict.get('geolocation_lon'), } message = dbsession.insert(dbmodel.INTERACTION_MESSAGE, interaction_message, auto_commit=True, caller_area=_process_call_area) if not message: msg = f'interaction message add failed' api_result = {'api_status': 'error', 'api_message': msg, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #step-6: result message_record = message.to_dict() msg=f'OK. interaction message added' api_result = {'api_status': 'success', 'api_message': msg, 'interaction_message_id': message.interaction_message_id, 'api_data': message_record, 'api_action': _api_action.upper(), 'api_name': _api_name} log_process_finish(_api_msgID, api_result, **_process_call_area) return api_result #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def find_originator(dbsession,input_dict={},caller_area={}): originator = None originator_id = None originator_name = None originator_id = input_dict.get('originator_id') if originator_id: client = dbsession.get(dbmodel.CLIENT, {'client_id':originator_id}, caller_area=caller_area) if client: originator='client' originator_name = client.email else: pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id': originator_id}, caller_area=caller_area) if pointofsale: originator='pointofsale' originator_name = pointofsale.name else: service_point=dbsession.get(dbmodel.SERVICE_POINT, {'servicepoint_id':originator_id}, caller_area=caller_area) if service_point: originator='service_point' originator_id=service_point.service_point_id originator_name = service_point.name else: client_id = input_dict.get('client_id') if client_id: client=dbsession.get(dbmodel.CLIENT, {'client_id':client_id}, caller_area=caller_area) if client: originator='client' originator_id=client_id originator_name = client.email else: pointofsale_id = input_dict.get('pointofsale_id') if pointofsale_id: pointofsale=dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id':pointofsale_id}, caller_area=caller_area) if pointofsale: originator='pointofsale' originator_id=pointofsale_id originator_name = pointofsale.name else: servicepoint_id = input_dict.get('servicepoint_id') if servicepoint_id: service_point=dbsession.get(dbmodel.SERVICE_POINT, {'servicepoint_id':pointofsale_id}, caller_area=caller_area) if service_point: originator='service_point' originator_id=service_point.service_point_id originator_name = service_point.name return (originator, originator_id, originator_name) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def find_corresponder(dbsession,input_dict={},caller_area={}): corresponder = None corresponder_id = None corresponder_name = None corresponder_id = input_dict.get('corresponder_id') if corresponder_id: client = dbsession.get(dbmodel.CLIENT, {'client_id':corresponder_id}, caller_area=caller_area) if client: corresponder='client' corresponder_name = client.email else: pointofsale = dbsession.get(dbmodel.POINT_OF_SALE, {'pointofsale_id': corresponder_id}, caller_area=caller_area) if pointofsale: corresponder='pointofsale' corresponder_name = pointofsale.name else: service_point=dbsession.get(dbmodel.SERVICE_POINT, {'servicepoint_id':corresponder_id}, caller_area=caller_area) if service_point: corresponder='service_point' corresponder_id=service_point.service_point_id corresponder_name = service_point.name return (corresponder, corresponder_id, corresponder_name) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def set_msgID(api_name,api_action,api_entity): msgid=f"#C0#api #C9#{api_name}#C0# [{api_entity}]#C0# action [[{api_action.upper()}]]#C0#" return msgid #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def geoloc_to_integer(geoloc): try: d = decimal.Decimal(str(geoloc).replace(",", ".").strip()) except: d = 0 i = int(d * 1000000000) return i #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def integer_to_geoloc(i): try: d = decimal.Decimal(str(i)) except: d = 0 geoloc = d / 1000000000 return geoloc #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # module initialization #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: module_configuration = retrieve_module_configuration(__file__, module_identityDictionary, module_configuration, print_enabled=consolelog_enabled, filelog_enabled=filelog_enabled, handle_as_init=False) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # (print_enabled, filelog_enabled, log_file, errors_file,consolelog_enabled)=get_globals_from_configuration(module_configuration) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: functions_ids=['dbapi_'] exclude_functions_ids = ['set_msgID', 'set_process_debug_level'] thisModuleObj = sys.modules[__name__] module_configuration.update({'database_apis':[]}) module_configuration = add_apis_to_configuration('database_apis', module_configuration, thisModuleObj, functions_ids, exclude_functions_ids) save_module_configuration(module_identityDictionary, module_configuration, print_enabled=consolelog_enabled, filelog_enabled=filelog_enabled) thisApp.pair_module_configuration('database_apis',module_configuration) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: save_module_configuration(module_identityDictionary, module_configuration, print_enabled=consolelog_enabled, filelog_enabled=filelog_enabled) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: if get_module_debug_level(module_id) > 0: apis = thisApp.application_configuration.get('database_apis', {}) for api_name in apis.keys(): api_entry = apis.get(api_name) msg=f'module [[{module_id}]] database api [{api_name} [[[{api_entry}]]]' log_message(msg) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #import commands # apis = thisApp.application_configuration.get('database_apis', {}) # for api_name in apis.keys(): # api_entry = apis.get(api_name) # msg=f'from {module_id} import {api_name}' # log_message(msg) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: msg = f'database [ganimides] [[[[module [{module_id}] loaded]]]] with [[version {module_version}]]' if thisApp.get_module_debug_level(module_id): log_message(msg) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # main #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: if __name__ == '__main__': #tests/research print(__file__) # caller_area={'aaaa': '11111'} # print('0caller_area=', caller_area) # test_api(caller_area, call_level=-1) # print('4caller_area=', caller_area) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
59.680781
239
0.673725
23,055
198,737
5.27044
0.016786
0.060291
0.082215
0.034565
0.905349
0.878578
0.859765
0.845116
0.831923
0.819743
0
0.000764
0.163915
198,737
3,329
240
59.698708
0.730514
0.15355
0
0.715116
0
0.002076
0.158287
0.01569
0
0
0
0
0
1
0.020349
false
0
0.004153
0
0.100914
0.002076
0
0
0
null
0
0
0
1
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
7
792ade8ff7275bc97897d754dadc60a7c2399247
4,149
py
Python
tests/execution_engine/split_and_sample/split_and_sample_test_cases.py
andyjessen/great_expectations
74f7f2aa7b51144f34156ed49490dae4edaa5cb7
[ "Apache-2.0" ]
null
null
null
tests/execution_engine/split_and_sample/split_and_sample_test_cases.py
andyjessen/great_expectations
74f7f2aa7b51144f34156ed49490dae4edaa5cb7
[ "Apache-2.0" ]
null
null
null
tests/execution_engine/split_and_sample/split_and_sample_test_cases.py
andyjessen/great_expectations
74f7f2aa7b51144f34156ed49490dae4edaa5cb7
[ "Apache-2.0" ]
null
null
null
import datetime from typing import List import pytest import great_expectations.exceptions as ge_exceptions from great_expectations.execution_engine.split_and_sample.data_splitter import DatePart SINGLE_DATE_PART_BATCH_IDENTIFIERS: List[pytest.param] = [ pytest.param({"month": 10}, id="month_dict"), pytest.param("10-31-2018", id="dateutil parseable date string"), pytest.param( datetime.datetime(2018, 10, 31, 0, 0, 0), id="datetime", ), pytest.param( {"month": 10, "unsupported": 5}, marks=pytest.mark.xfail(strict=True, raises=ge_exceptions.InvalidConfigError), id="month_dict, unsupported batch identifier", ), pytest.param( {"month": 11}, marks=pytest.mark.xfail(strict=True), id="incorrect month_dict should fail", ), pytest.param( "not a real date", marks=pytest.mark.xfail(strict=True), id="non dateutil parseable date string", ), pytest.param( datetime.datetime(2018, 11, 30, 0, 0, 0), marks=pytest.mark.xfail(strict=True), id="incorrect datetime should fail", ), ] SINGLE_DATE_PART_DATE_PARTS: List[pytest.param] = [ pytest.param( [DatePart.MONTH], id="month_with_DatePart", ), pytest.param( ["month"], id="month_with_string_DatePart", ), pytest.param( ["Month"], id="month_with_string_mixed_case_DatePart", ), pytest.param(None, marks=pytest.mark.xfail(strict=True), id="date_parts=None"), pytest.param([], marks=pytest.mark.xfail(strict=True), id="date_parts=[]"), pytest.param( ["invalid"], marks=pytest.mark.xfail(strict=True), id="invalid date_parts" ), pytest.param( "invalid", marks=pytest.mark.xfail(strict=True), id="invalid date_parts (not a list)", ), pytest.param( "month", marks=pytest.mark.xfail(strict=True), id="invalid date_parts (not a list but valid str)", ), pytest.param( DatePart.MONTH, marks=pytest.mark.xfail(strict=True), id="invalid date_parts (not a list but valid DatePart)", ), ] MULTIPLE_DATE_PART_BATCH_IDENTIFIERS: List[pytest.param] = [ pytest.param({"year": 2018, "month": 10}, id="year_and_month_dict"), pytest.param("10-31-2018", id="dateutil parseable date string"), pytest.param( datetime.datetime(2018, 10, 30, 0, 0, 0), id="datetime", ), pytest.param( {"year": 2018, "month": 10, "unsupported": 5}, marks=pytest.mark.xfail(strict=True, raises=ge_exceptions.InvalidConfigError), id="year_and_month_dict, unsupported batch identifier", ), pytest.param( {"year": 2021, "month": 10}, marks=pytest.mark.xfail(strict=True), id="incorrect year in year_and_month_dict should fail", ), pytest.param( {"year": 2018, "month": 11}, marks=pytest.mark.xfail(strict=True), id="incorrect month in year_and_month_dict should fail", ), pytest.param( "not a real date", marks=pytest.mark.xfail(strict=True), id="non dateutil parseable date string", ), pytest.param( datetime.datetime(2018, 11, 30, 0, 0, 0), marks=pytest.mark.xfail(strict=True), id="incorrect datetime should fail", ), ] MULTIPLE_DATE_PART_DATE_PARTS: List[pytest.param] = [ pytest.param( [DatePart.YEAR, DatePart.MONTH], id="year_month_with_DatePart", ), pytest.param( [DatePart.YEAR, "month"], id="year_month_with_mixed_DatePart", ), pytest.param( ["year", "month"], id="year_month_with_string_DatePart", ), pytest.param( ["YEAR", "Month"], id="year_month_with_string_mixed_case_DatePart", ), pytest.param(None, marks=pytest.mark.xfail(strict=True), id="date_parts=None"), pytest.param([], marks=pytest.mark.xfail(strict=True), id="date_parts=[]"), pytest.param( ["invalid", "date", "parts"], marks=pytest.mark.xfail(strict=True), id="invalid date_parts", ), ]
31.195489
87
0.620872
508
4,149
4.92126
0.13189
0.154
0.108
0.144
0.8756
0.8468
0.828
0.772
0.7288
0.6696
0
0.028858
0.231622
4,149
132
88
31.431818
0.755333
0
0
0.6
0
0
0.258134
0.045794
0
0
0
0
0
1
0
true
0
0.04
0
0.04
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
1
0
0
0
0
0
0
7
f70eab61632b9f861e510d3c8482608efe5ebe97
449,278
py
Python
rnn_cell_impl.py
narutowang/indrnn
434e1200b5e742a0eac92bed661c69e97b8b8711
[ "Apache-2.0" ]
null
null
null
rnn_cell_impl.py
narutowang/indrnn
434e1200b5e742a0eac92bed661c69e97b8b8711
[ "Apache-2.0" ]
null
null
null
rnn_cell_impl.py
narutowang/indrnn
434e1200b5e742a0eac92bed661c69e97b8b8711
[ "Apache-2.0" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://assets-cdn.github.com"> <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com"> <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://assets-cdn.github.com/assets/frameworks-0b6eee1f89d4460d83bdbee0a4cb0020.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://assets-cdn.github.com/assets/github-c4d5af25254cfc8bb30ae5cb6f074c97.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://assets-cdn.github.com/assets/site-83dc1f7ebc9c7461fe1eab799b56c4c4.css" /> <meta name="viewport" content="width=device-width"> <title>tensorflow/rnn_cell_impl.py at r1.6 · tensorflow/tensorflow · GitHub</title> <meta name="description" content="GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta property="og:image" content="https://avatars2.githubusercontent.com/u/15658638?s=400&amp;v=4" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="tensorflow/tensorflow" /><meta property="og:url" content="https://github.com/tensorflow/tensorflow" /><meta property="og:description" content="tensorflow - Computation using data flow graphs for scalable machine learning" /> <link rel="assets" href="https://assets-cdn.github.com/"> <meta name="pjax-timeout" content="1000"> <meta name="request-id" content="D9CE:22519:FDC93F:17A0312:5AB1D278" data-pjax-transient> <meta name="selected-link" value="repo_source" data-pjax-transient> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-analytics" content="UA-3769691-2"> <meta name="octolytics-host" content="collector.githubapp.com" /><meta name="octolytics-app-id" content="github" /><meta name="octolytics-event-url" content="https://collector.githubapp.com/github-external/browser_event" /><meta name="octolytics-dimension-request_id" content="D9CE:22519:FDC93F:17A0312:5AB1D278" /><meta name="octolytics-dimension-region_edge" content="sea" /><meta name="octolytics-dimension-region_render" content="iad" /> <meta name="hydro-events-url" content="https://github.com/hydro_browser_events" /> <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-pjax-transient="true" /> <meta class="js-ga-set" name="dimension1" content="Logged Out"> <meta name="hostname" content="github.com"> <meta name="user-login" content=""> <meta name="expected-hostname" content="github.com"> <meta name="js-proxy-site-detection-payload" content="YTI3MjdkNDE4ODBjNzIwYjgyNTVlMzFjZTEwODkzZDRmYTJkNTZhMTdhZGZmNGM0ODc3MTZmNTg3MzBjNmM2Nnx7InJlbW90ZV9hZGRyZXNzIjoiMTY3LjIyMC4yMzIuMTI0IiwicmVxdWVzdF9pZCI6IkQ5Q0U6MjI1MTk6RkRDOTNGOjE3QTAzMTI6NUFCMUQyNzgiLCJ0aW1lc3RhbXAiOjE1MjE2MDMxOTMsImhvc3QiOiJnaXRodWIuY29tIn0="> <meta name="enabled-features" content="UNIVERSE_BANNER,FREE_TRIALS,MARKETPLACE_INSIGHTS,MARKETPLACE_INSIGHTS_CONVERSION_PERCENTAGES"> <meta name="html-safe-nonce" content="54cbe43f921a89e1942c69748da62cb0fab66263"> <meta http-equiv="x-pjax-version" content="f5d037ad7a1b600b21fb2f3474bd0c48"> <link href="https://github.com/tensorflow/tensorflow/commits/r1.6.atom" rel="alternate" title="Recent Commits to tensorflow:r1.6" type="application/atom+xml"> <meta name="description" content="tensorflow - Computation using data flow graphs for scalable machine learning"> <meta name="go-import" content="github.com/tensorflow/tensorflow git https://github.com/tensorflow/tensorflow.git"> <meta name="octolytics-dimension-user_id" content="15658638" /><meta name="octolytics-dimension-user_login" content="tensorflow" /><meta name="octolytics-dimension-repository_id" content="45717250" /><meta name="octolytics-dimension-repository_nwo" content="tensorflow/tensorflow" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="45717250" /><meta name="octolytics-dimension-repository_network_root_nwo" content="tensorflow/tensorflow" /><meta name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" content="false" /> <link rel="canonical" href="https://github.com/tensorflow/tensorflow/blob/r1.6/tensorflow/python/ops/rnn_cell_impl.py" data-pjax-transient> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000"> <link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://assets-cdn.github.com/favicon.ico"> <meta name="theme-color" content="#1e2327"> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-blob"> <div class="position-relative js-header-wrapper "> <a href="#start-of-content" tabindex="1" class="px-2 py-4 show-on-focus js-skip-to-content">Skip to content</a> <div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div> <header class="Header header-logged-out position-relative f4 py-3" role="banner"> <div class="container-lg d-flex px-3"> <div class="d-flex flex-justify-between flex-items-center"> <a class="header-logo-invertocat my-0" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark"> <svg height="32" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> </a> </div> <div class="HeaderMenu HeaderMenu--bright d-flex flex-justify-between flex-auto"> <nav class="mt-0"> <ul class="d-flex list-style-none"> <li class="ml-2"> <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:features" data-selected-links="/features /features/project-management /features/code-review /features/project-management /features/integrations /features" href="/features"> Features </a> </li> <li class="ml-4"> <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:business" data-selected-links="/business /business/security /business/customers /business" href="/business"> Business </a> </li> <li class="ml-4"> <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:explore" data-selected-links="/explore /trending /trending/developers /integrations /integrations/feature/code /integrations/feature/collaborate /integrations/feature/ship showcases showcases_search showcases_landing /explore" href="/explore"> Explore </a> </li> <li class="ml-4"> <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:marketplace" data-selected-links=" /marketplace" href="/marketplace"> Marketplace </a> </li> <li class="ml-4"> <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:pricing" data-selected-links="/pricing /pricing/developer /pricing/team /pricing/business-hosted /pricing/business-enterprise /pricing" href="/pricing"> Pricing </a> </li> </ul> </nav> <div class="d-flex"> <div class="d-lg-flex flex-items-center mr-3"> <div class="header-search scoped-search site-scoped-search js-site-search" role="search"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" data-scoped-search-url="/tensorflow/tensorflow/search" data-unscoped-search-url="/search" action="/tensorflow/tensorflow/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" /> <label class="form-control header-search-wrapper js-chromeless-input-container"> <a class="header-search-scope no-underline" href="/tensorflow/tensorflow/blob/r1.6/tensorflow/python/ops/rnn_cell_impl.py">This repository</a> <input type="text" class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable" data-hotkey="s,/" name="q" value="" placeholder="Search" aria-label="Search this repository" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off"> <input type="hidden" class="js-site-search-type-field" name="type" > </label> </form></div> </div> <span class="d-inline-block"> <div class="HeaderNavlink px-0 py-2 m-0"> <a class="text-bold text-white no-underline" href="/login?return_to=%2Ftensorflow%2Ftensorflow%2Fblob%2Fr1.6%2Ftensorflow%2Fpython%2Fops%2Frnn_cell_impl.py" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a> <span class="text-gray">or</span> <a class="text-bold text-white no-underline" href="/join?source=header-repo" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a> </div> </span> </div> </div> </div> </header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container"> </div> <div role="main" class="application-main " > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <div id="js-repo-pjax-container" data-pjax-container > <div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav "> <div class="repohead-details-container clearfix container"> <ul class="pagehead-actions"> <li> <a href="/login?return_to=%2Ftensorflow%2Ftensorflow" class="btn btn-sm btn-with-count tooltipped tooltipped-n" aria-label="You must be signed in to watch a repository" rel="nofollow"> <svg class="octicon octicon-eye" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> Watch </a> <a class="social-count" href="/tensorflow/tensorflow/watchers" aria-label="7632 users are watching this repository"> 7,632 </a> </li> <li> <a href="/login?return_to=%2Ftensorflow%2Ftensorflow" class="btn btn-sm btn-with-count tooltipped tooltipped-n" aria-label="You must be signed in to star a repository" rel="nofollow"> <svg class="octicon octicon-star" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg> Star </a> <a class="social-count js-social-count" href="/tensorflow/tensorflow/stargazers" aria-label="93301 users starred this repository"> 93,301 </a> </li> <li> <a href="/login?return_to=%2Ftensorflow%2Ftensorflow" class="btn btn-sm btn-with-count tooltipped tooltipped-n" aria-label="You must be signed in to fork a repository" rel="nofollow"> <svg class="octicon octicon-repo-forked" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> Fork </a> <a href="/tensorflow/tensorflow/network" class="social-count" aria-label="59890 users forked this repository"> 59,890 </a> </li> </ul> <h1 class="public "> <svg class="octicon octicon-repo" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg> <span class="author" itemprop="author"><a class="url fn" rel="author" href="/tensorflow">tensorflow</a></span><!-- --><span class="path-divider">/</span><!-- --><strong itemprop="name"><a data-pjax="#js-repo-pjax-container" href="/tensorflow/tensorflow">tensorflow</a></strong> </h1> </div> <nav class="reponav js-repo-nav js-sidenav-container-pjax container" itemscope itemtype="http://schema.org/BreadcrumbList" role="navigation" data-pjax="#js-repo-pjax-container"> <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> <a class="js-selected-navigation-item selected reponav-item" itemprop="url" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages /tensorflow/tensorflow/tree/r1.6" href="/tensorflow/tensorflow/tree/r1.6"> <svg class="octicon octicon-code" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg> <span itemprop="name">Code</span> <meta itemprop="position" content="1"> </a> </span> <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> <a itemprop="url" data-hotkey="g i" class="js-selected-navigation-item reponav-item" data-selected-links="repo_issues repo_labels repo_milestones /tensorflow/tensorflow/issues" href="/tensorflow/tensorflow/issues"> <svg class="octicon octicon-issue-opened" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg> <span itemprop="name">Issues</span> <span class="Counter">1,287</span> <meta itemprop="position" content="2"> </a> </span> <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> <a data-hotkey="g p" itemprop="url" class="js-selected-navigation-item reponav-item" data-selected-links="repo_pulls checks /tensorflow/tensorflow/pulls" href="/tensorflow/tensorflow/pulls"> <svg class="octicon octicon-git-pull-request" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> <span itemprop="name">Pull requests</span> <span class="Counter">197</span> <meta itemprop="position" content="3"> </a> </span> <a data-hotkey="g b" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /tensorflow/tensorflow/projects" href="/tensorflow/tensorflow/projects"> <svg class="octicon octicon-project" viewBox="0 0 15 16" version="1.1" width="15" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg> Projects <span class="Counter" >0</span> </a> <a class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors dependency_graph pulse /tensorflow/tensorflow/pulse" href="/tensorflow/tensorflow/pulse"> <svg class="octicon octicon-graph" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg> Insights </a> </nav> </div> <div class="container new-discussion-timeline experiment-repo-nav "> <div class="repository-content "> <a class="d-none js-permalink-shortcut" data-hotkey="y" href="/tensorflow/tensorflow/blob/cbc658095ae228f2f557af47e4901d552573aa15/tensorflow/python/ops/rnn_cell_impl.py">Permalink</a> <!-- blob contrib key: blob_contributors:v21:5895d9f5b73fd7bcfb782c5d3257ea21 --> <div class="file-navigation"> <div class="select-menu branch-select-menu js-menu-container js-select-menu float-left"> <button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w" type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true"> <i>Branch:</i> <span class="js-select-button css-truncate-target">r1.6</span> </button> <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax> <div class="select-menu-modal"> <div class="select-menu-header"> <svg class="octicon octicon-x js-menu-close" role="img" aria-label="Close" viewBox="0 0 12 16" version="1.1" width="12" height="16"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> <span class="select-menu-title">Switch branches/tags</span> </div> <div class="select-menu-filters"> <div class="select-menu-text-filter"> <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Filter branches/tags"> </div> <div class="select-menu-tabs"> <ul> <li class="select-menu-tab"> <a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a> </li> <li class="select-menu-tab"> <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a> </li> </ul> </div> </div> <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu"> <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/0.6.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.6.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> 0.6.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/branch_189041421/tensorflow/python/ops/rnn_cell_impl.py" data-name="branch_189041421" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> branch_189041421 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/martinwicke-patch-1/tensorflow/python/ops/rnn_cell_impl.py" data-name="martinwicke-patch-1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> martinwicke-patch-1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/martinwicke-patch-2/tensorflow/python/ops/rnn_cell_impl.py" data-name="martinwicke-patch-2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> martinwicke-patch-2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell_impl.py" data-name="master" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> master </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/mrry-patch-1/tensorflow/python/ops/rnn_cell_impl.py" data-name="mrry-patch-1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> mrry-patch-1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.7/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.7" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.7 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.8/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.8" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.8 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.9/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.9" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.9 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.10/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.10" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.10 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.11/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.11" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.11 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r0.12/tensorflow/python/ops/rnn_cell_impl.py" data-name="r0.12" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r0.12 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.2/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.3/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.3" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.3 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.4/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.4" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.4 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.5/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.5" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.5 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open selected" href="/tensorflow/tensorflow/blob/r1.6/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.6" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.6 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/r1.7/tensorflow/python/ops/rnn_cell_impl.py" data-name="r1.7" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> r1.7 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/blob/yifeif-patch-1/tensorflow/python/ops/rnn_cell_impl.py" data-name="yifeif-patch-1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> yifeif-patch-1 </span> </a> </div> <div class="select-menu-no-results">Nothing to show</div> </div> <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags"> <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.7.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.7.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.7.0-rc0"> v1.7.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.6.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.6.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.6.0"> v1.6.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.6.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.6.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.6.0-rc1"> v1.6.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.6.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.6.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.6.0-rc0"> v1.6.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.5.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.5.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.5.1"> v1.5.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.5.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.5.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.5.0"> v1.5.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.5.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.5.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.5.0-rc1"> v1.5.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.5.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.5.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.5.0-rc0"> v1.5.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.4.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.4.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.4.1"> v1.4.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.4.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.4.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.4.0"> v1.4.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.4.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.4.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.4.0-rc1"> v1.4.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.4.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.4.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.4.0-rc0"> v1.4.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.3.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.3.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.3.1"> v1.3.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.3.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.3.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.3.0"> v1.3.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.3.0-rc2/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.3.0-rc2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.3.0-rc2"> v1.3.0-rc2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.3.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.3.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.3.0-rc1"> v1.3.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.3.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.3.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.3.0-rc0"> v1.3.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.2.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.2.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.2.1"> v1.2.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.2.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.2.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.2.0"> v1.2.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.2.0-rc2/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.2.0-rc2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.2.0-rc2"> v1.2.0-rc2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.2.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.2.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.2.0-rc1"> v1.2.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.2.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.2.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.2.0-rc0"> v1.2.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.1.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.1.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.1.0"> v1.1.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.1.0-rc2/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.1.0-rc2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.1.0-rc2"> v1.1.0-rc2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.1.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.1.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.1.0-rc1"> v1.1.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.1.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.1.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.1.0-rc0"> v1.1.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.1"> v1.0.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.0"> v1.0.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.0-rc2/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.0-rc2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.0-rc2"> v1.0.0-rc2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.0-rc1"> v1.0.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.0-rc0"> v1.0.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v1.0.0-alpha/tensorflow/python/ops/rnn_cell_impl.py" data-name="v1.0.0-alpha" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v1.0.0-alpha"> v1.0.0-alpha </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.12.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.12.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.12.0"> v0.12.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.11.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.11.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.11.0"> v0.11.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.11.0rc2/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.11.0rc2" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.11.0rc2"> v0.11.0rc2 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.11.0rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.11.0rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.11.0rc1"> v0.11.0rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.11.0rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.11.0rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.11.0rc0"> v0.11.0rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.10.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.10.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.10.0"> v0.10.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.10.0rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.10.0rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.10.0rc0"> v0.10.0rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.9.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.9.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.9.0"> v0.9.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.9.0rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.9.0rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.9.0rc0"> v0.9.0rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.8.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.8.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.8.0"> v0.8.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.8.0rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.8.0rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.8.0rc0"> v0.8.0rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.7.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.7.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.7.1"> v0.7.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.7.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.7.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.7.0"> v0.7.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/v0.6.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="v0.6.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="v0.6.0"> v0.6.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/0.12.1/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.12.1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="0.12.1"> 0.12.1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/0.12.0-rc1/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.12.0-rc1" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="0.12.0-rc1"> 0.12.0-rc1 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/0.12.0-rc0/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.12.0-rc0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="0.12.0-rc0"> 0.12.0-rc0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/0.6.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.6.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="0.6.0"> 0.6.0 </span> </a> <a class="select-menu-item js-navigation-item js-navigation-open " href="/tensorflow/tensorflow/tree/0.5.0/tensorflow/python/ops/rnn_cell_impl.py" data-name="0.5.0" data-skip-pjax="true" rel="nofollow"> <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> <span class="select-menu-item-text css-truncate-target" title="0.5.0"> 0.5.0 </span> </a> </div> <div class="select-menu-no-results">Nothing to show</div> </div> </div> </div> </div> <div class="BtnGroup float-right"> <a href="/tensorflow/tensorflow/find/r1.6" class="js-pjax-capture-input btn btn-sm BtnGroup-item" data-pjax data-hotkey="t"> Find file </a> <clipboard-copy for="blob-path" aria-label="Copy file path to clipboard" class="btn btn-sm BtnGroup-item tooltipped tooltipped-s" data-copied-hint="Copied!"> Copy path </clipboard-copy> </div> <div id="blob-path" class="breadcrumb"> <span class="repo-root js-repo-root"><span class="js-path-segment"><a data-pjax="true" href="/tensorflow/tensorflow/tree/r1.6"><span>tensorflow</span></a></span></span><span class="separator">/</span><span class="js-path-segment"><a data-pjax="true" href="/tensorflow/tensorflow/tree/r1.6/tensorflow"><span>tensorflow</span></a></span><span class="separator">/</span><span class="js-path-segment"><a data-pjax="true" href="/tensorflow/tensorflow/tree/r1.6/tensorflow/python"><span>python</span></a></span><span class="separator">/</span><span class="js-path-segment"><a data-pjax="true" href="/tensorflow/tensorflow/tree/r1.6/tensorflow/python/ops"><span>ops</span></a></span><span class="separator">/</span><strong class="final-path">rnn_cell_impl.py</strong> </div> </div> <div class="commit-tease"> <span class="float-right"> <a class="commit-tease-sha" href="/tensorflow/tensorflow/commit/dff64beac8570d910f83774087642bb6a3fda96a" data-pjax> dff64be </a> <relative-time datetime="2018-01-23T21:46:25Z">Jan 23, 2018</relative-time> </span> <div> <img alt="@michaelkhan3" class="avatar" height="20" src="https://avatars3.githubusercontent.com/u/4420471?s=40&amp;v=4" width="20" /> <a href="/michaelkhan3" class="user-mention" rel="contributor">michaelkhan3</a> <a href="/tensorflow/tensorflow/commit/dff64beac8570d910f83774087642bb6a3fda96a" class="message" data-pjax="true" title="Add property to get cell wrapped by DropoutWrapper (#16006) * add property to get cell wrapped by dropout * updating golden files">Add property to get cell wrapped by DropoutWrapper (</a><a href="https://github.com/tensorflow/tensorflow/pull/16006" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="287414630" data-permission-text="Issue title is private" data-url="https://github.com/tensorflow/tensorflow/issues/16006">#16006</a><a href="/tensorflow/tensorflow/commit/dff64beac8570d910f83774087642bb6a3fda96a" class="message" data-pjax="true" title="Add property to get cell wrapped by DropoutWrapper (#16006) * add property to get cell wrapped by dropout * updating golden files">)</a> </div> <div class="commit-tease-contributors"> <button type="button" class="btn-link muted-link contributors-toggle" data-facebox="#blob_contributors_box"> <strong>13</strong> contributors </button> <a class="avatar-link tooltipped tooltipped-s" aria-label="tensorflower-gardener" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=tensorflower-gardener"><img alt="@tensorflower-gardener" class="avatar" height="20" src="https://avatars1.githubusercontent.com/u/17151892?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="ebrevdo" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=ebrevdo"><img alt="@ebrevdo" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/1794715?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="jhseu" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=jhseu"><img alt="@jhseu" class="avatar" height="20" src="https://avatars1.githubusercontent.com/u/170179?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="protoget" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=protoget"><img alt="@protoget" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/5117188?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="xiejw" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=xiejw"><img alt="@xiejw" class="avatar" height="20" src="https://avatars0.githubusercontent.com/u/1184671?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="martinwicke" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=martinwicke"><img alt="@martinwicke" class="avatar" height="20" src="https://avatars1.githubusercontent.com/u/577277?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="michaelkhan3" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=michaelkhan3"><img alt="@michaelkhan3" class="avatar" height="20" src="https://avatars3.githubusercontent.com/u/4420471?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="fchollet" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=fchollet"><img alt="@fchollet" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/710255?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="drpngx" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=drpngx"><img alt="@drpngx" class="avatar" height="20" src="https://avatars3.githubusercontent.com/u/20959853?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="caisq" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=caisq"><img alt="@caisq" class="avatar" height="20" src="https://avatars0.githubusercontent.com/u/16824702?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="alextp" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=alextp"><img alt="@alextp" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/5061?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="annarev" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=annarev"><img alt="@annarev" class="avatar" height="20" src="https://avatars0.githubusercontent.com/u/22060313?s=40&amp;v=4" width="20" /> </a> <a class="avatar-link tooltipped tooltipped-s" aria-label="kosklain" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py?author=kosklain"><img alt="@kosklain" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/1104579?s=40&amp;v=4" width="20" /> </a> </div> <div id="blob_contributors_box" style="display:none"> <h2 class="facebox-header" data-facebox-id="facebox-header">Users who have contributed to this file</h2> <ul class="facebox-user-list" data-facebox-id="facebox-description"> <li class="facebox-user-list-item"> <img alt="@tensorflower-gardener" height="24" src="https://avatars0.githubusercontent.com/u/17151892?s=48&amp;v=4" width="24" /> <a href="/tensorflower-gardener">tensorflower-gardener</a> </li> <li class="facebox-user-list-item"> <img alt="@ebrevdo" height="24" src="https://avatars3.githubusercontent.com/u/1794715?s=48&amp;v=4" width="24" /> <a href="/ebrevdo">ebrevdo</a> </li> <li class="facebox-user-list-item"> <img alt="@jhseu" height="24" src="https://avatars0.githubusercontent.com/u/170179?s=48&amp;v=4" width="24" /> <a href="/jhseu">jhseu</a> </li> <li class="facebox-user-list-item"> <img alt="@protoget" height="24" src="https://avatars3.githubusercontent.com/u/5117188?s=48&amp;v=4" width="24" /> <a href="/protoget">protoget</a> </li> <li class="facebox-user-list-item"> <img alt="@xiejw" height="24" src="https://avatars1.githubusercontent.com/u/1184671?s=48&amp;v=4" width="24" /> <a href="/xiejw">xiejw</a> </li> <li class="facebox-user-list-item"> <img alt="@martinwicke" height="24" src="https://avatars0.githubusercontent.com/u/577277?s=48&amp;v=4" width="24" /> <a href="/martinwicke">martinwicke</a> </li> <li class="facebox-user-list-item"> <img alt="@michaelkhan3" height="24" src="https://avatars2.githubusercontent.com/u/4420471?s=48&amp;v=4" width="24" /> <a href="/michaelkhan3">michaelkhan3</a> </li> <li class="facebox-user-list-item"> <img alt="@fchollet" height="24" src="https://avatars3.githubusercontent.com/u/710255?s=48&amp;v=4" width="24" /> <a href="/fchollet">fchollet</a> </li> <li class="facebox-user-list-item"> <img alt="@drpngx" height="24" src="https://avatars2.githubusercontent.com/u/20959853?s=48&amp;v=4" width="24" /> <a href="/drpngx">drpngx</a> </li> <li class="facebox-user-list-item"> <img alt="@caisq" height="24" src="https://avatars1.githubusercontent.com/u/16824702?s=48&amp;v=4" width="24" /> <a href="/caisq">caisq</a> </li> <li class="facebox-user-list-item"> <img alt="@alextp" height="24" src="https://avatars3.githubusercontent.com/u/5061?s=48&amp;v=4" width="24" /> <a href="/alextp">alextp</a> </li> <li class="facebox-user-list-item"> <img alt="@annarev" height="24" src="https://avatars1.githubusercontent.com/u/22060313?s=48&amp;v=4" width="24" /> <a href="/annarev">annarev</a> </li> <li class="facebox-user-list-item"> <img alt="@kosklain" height="24" src="https://avatars3.githubusercontent.com/u/1104579?s=48&amp;v=4" width="24" /> <a href="/kosklain">kosklain</a> </li> </ul> </div> </div> <div class="file"> <div class="file-header"> <div class="file-actions"> <div class="BtnGroup"> <a id="raw-url" class="btn btn-sm BtnGroup-item" href="/tensorflow/tensorflow/raw/r1.6/tensorflow/python/ops/rnn_cell_impl.py">Raw</a> <a class="btn btn-sm js-update-url-with-hash BtnGroup-item" data-hotkey="b" href="/tensorflow/tensorflow/blame/r1.6/tensorflow/python/ops/rnn_cell_impl.py">Blame</a> <a rel="nofollow" class="btn btn-sm BtnGroup-item" href="/tensorflow/tensorflow/commits/r1.6/tensorflow/python/ops/rnn_cell_impl.py">History</a> </div> <button type="button" class="btn-octicon disabled tooltipped tooltipped-nw" aria-label="You must be signed in to make or propose changes"> <svg class="octicon octicon-pencil" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"/></svg> </button> <button type="button" class="btn-octicon btn-octicon-danger disabled tooltipped tooltipped-nw" aria-label="You must be signed in to make or propose changes"> <svg class="octicon octicon-trashcan" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg> </button> </div> <div class="file-info"> 1286 lines (1078 sloc) <span class="file-info-divider"></span> 49.7 KB </div> </div> <div itemprop="text" class="blob-wrapper data type-python"> <table class="highlight tab-size js-file-line-container" data-tab-size="8"> <tr> <td id="L1" class="blob-num js-line-number" data-line-number="1"></td> <td id="LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Copyright 2015 The TensorFlow Authors. All Rights Reserved.</span></td> </tr> <tr> <td id="L2" class="blob-num js-line-number" data-line-number="2"></td> <td id="LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td> </tr> <tr> <td id="L3" class="blob-num js-line-number" data-line-number="3"></td> <td id="LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></td> </tr> <tr> <td id="L4" class="blob-num js-line-number" data-line-number="4"></td> <td id="LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> you may not use this file except in compliance with the License.</span></td> </tr> <tr> <td id="L5" class="blob-num js-line-number" data-line-number="5"></td> <td id="LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> You may obtain a copy of the License at</span></td> </tr> <tr> <td id="L6" class="blob-num js-line-number" data-line-number="6"></td> <td id="LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td> </tr> <tr> <td id="L7" class="blob-num js-line-number" data-line-number="7"></td> <td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> http://www.apache.org/licenses/LICENSE-2.0</span></td> </tr> <tr> <td id="L8" class="blob-num js-line-number" data-line-number="8"></td> <td id="LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td> </tr> <tr> <td id="L9" class="blob-num js-line-number" data-line-number="9"></td> <td id="LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Unless required by applicable law or agreed to in writing, software</span></td> </tr> <tr> <td id="L10" class="blob-num js-line-number" data-line-number="10"></td> <td id="LC10" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></td> </tr> <tr> <td id="L11" class="blob-num js-line-number" data-line-number="11"></td> <td id="LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></td> </tr> <tr> <td id="L12" class="blob-num js-line-number" data-line-number="12"></td> <td id="LC12" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> See the License for the specific language governing permissions and</span></td> </tr> <tr> <td id="L13" class="blob-num js-line-number" data-line-number="13"></td> <td id="LC13" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> limitations under the License.</span></td> </tr> <tr> <td id="L14" class="blob-num js-line-number" data-line-number="14"></td> <td id="LC14" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> ==============================================================================</span></td> </tr> <tr> <td id="L15" class="blob-num js-line-number" data-line-number="15"></td> <td id="LC15" class="blob-code blob-code-inner js-file-line"><span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Module implementing RNN Cells.</span></td> </tr> <tr> <td id="L16" class="blob-num js-line-number" data-line-number="16"></td> <td id="LC16" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L17" class="blob-num js-line-number" data-line-number="17"></td> <td id="LC17" class="blob-code blob-code-inner js-file-line"><span class="pl-s">This module provides a number of basic commonly used RNN cells, such as LSTM</span></td> </tr> <tr> <td id="L18" class="blob-num js-line-number" data-line-number="18"></td> <td id="LC18" class="blob-code blob-code-inner js-file-line"><span class="pl-s">(Long Short Term Memory) or GRU (Gated Recurrent Unit), and a number of</span></td> </tr> <tr> <td id="L19" class="blob-num js-line-number" data-line-number="19"></td> <td id="LC19" class="blob-code blob-code-inner js-file-line"><span class="pl-s">operators that allow adding dropouts, projections, or embeddings for inputs.</span></td> </tr> <tr> <td id="L20" class="blob-num js-line-number" data-line-number="20"></td> <td id="LC20" class="blob-code blob-code-inner js-file-line"><span class="pl-s">Constructing multi-layer cells is supported by the class `MultiRNNCell`, or by</span></td> </tr> <tr> <td id="L21" class="blob-num js-line-number" data-line-number="21"></td> <td id="LC21" class="blob-code blob-code-inner js-file-line"><span class="pl-s">calling the `rnn` ops several times.</span></td> </tr> <tr> <td id="L22" class="blob-num js-line-number" data-line-number="22"></td> <td id="LC22" class="blob-code blob-code-inner js-file-line"><span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L23" class="blob-num js-line-number" data-line-number="23"></td> <td id="LC23" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> <span class="pl-c1">__future__</span> <span class="pl-k">import</span> absolute_import</td> </tr> <tr> <td id="L24" class="blob-num js-line-number" data-line-number="24"></td> <td id="LC24" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> <span class="pl-c1">__future__</span> <span class="pl-k">import</span> division</td> </tr> <tr> <td id="L25" class="blob-num js-line-number" data-line-number="25"></td> <td id="LC25" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> <span class="pl-c1">__future__</span> <span class="pl-k">import</span> print_function</td> </tr> <tr> <td id="L26" class="blob-num js-line-number" data-line-number="26"></td> <td id="LC26" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L27" class="blob-num js-line-number" data-line-number="27"></td> <td id="LC27" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> collections</td> </tr> <tr> <td id="L28" class="blob-num js-line-number" data-line-number="28"></td> <td id="LC28" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> hashlib</td> </tr> <tr> <td id="L29" class="blob-num js-line-number" data-line-number="29"></td> <td id="LC29" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> numbers</td> </tr> <tr> <td id="L30" class="blob-num js-line-number" data-line-number="30"></td> <td id="LC30" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L31" class="blob-num js-line-number" data-line-number="31"></td> <td id="LC31" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.eager <span class="pl-k">import</span> context</td> </tr> <tr> <td id="L32" class="blob-num js-line-number" data-line-number="32"></td> <td id="LC32" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.framework <span class="pl-k">import</span> constant_op</td> </tr> <tr> <td id="L33" class="blob-num js-line-number" data-line-number="33"></td> <td id="LC33" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.framework <span class="pl-k">import</span> dtypes</td> </tr> <tr> <td id="L34" class="blob-num js-line-number" data-line-number="34"></td> <td id="LC34" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.framework <span class="pl-k">import</span> ops</td> </tr> <tr> <td id="L35" class="blob-num js-line-number" data-line-number="35"></td> <td id="LC35" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.framework <span class="pl-k">import</span> tensor_shape</td> </tr> <tr> <td id="L36" class="blob-num js-line-number" data-line-number="36"></td> <td id="LC36" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.framework <span class="pl-k">import</span> tensor_util</td> </tr> <tr> <td id="L37" class="blob-num js-line-number" data-line-number="37"></td> <td id="LC37" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.layers <span class="pl-k">import</span> base <span class="pl-k">as</span> base_layer</td> </tr> <tr> <td id="L38" class="blob-num js-line-number" data-line-number="38"></td> <td id="LC38" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> array_ops</td> </tr> <tr> <td id="L39" class="blob-num js-line-number" data-line-number="39"></td> <td id="LC39" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> clip_ops</td> </tr> <tr> <td id="L40" class="blob-num js-line-number" data-line-number="40"></td> <td id="LC40" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> init_ops</td> </tr> <tr> <td id="L41" class="blob-num js-line-number" data-line-number="41"></td> <td id="LC41" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> math_ops</td> </tr> <tr> <td id="L42" class="blob-num js-line-number" data-line-number="42"></td> <td id="LC42" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> nn_ops</td> </tr> <tr> <td id="L43" class="blob-num js-line-number" data-line-number="43"></td> <td id="LC43" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> partitioned_variables</td> </tr> <tr> <td id="L44" class="blob-num js-line-number" data-line-number="44"></td> <td id="LC44" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> random_ops</td> </tr> <tr> <td id="L45" class="blob-num js-line-number" data-line-number="45"></td> <td id="LC45" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> tensor_array_ops</td> </tr> <tr> <td id="L46" class="blob-num js-line-number" data-line-number="46"></td> <td id="LC46" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> variable_scope <span class="pl-k">as</span> vs</td> </tr> <tr> <td id="L47" class="blob-num js-line-number" data-line-number="47"></td> <td id="LC47" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.ops <span class="pl-k">import</span> variables <span class="pl-k">as</span> tf_variables</td> </tr> <tr> <td id="L48" class="blob-num js-line-number" data-line-number="48"></td> <td id="LC48" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.platform <span class="pl-k">import</span> tf_logging <span class="pl-k">as</span> logging</td> </tr> <tr> <td id="L49" class="blob-num js-line-number" data-line-number="49"></td> <td id="LC49" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.util <span class="pl-k">import</span> nest</td> </tr> <tr> <td id="L50" class="blob-num js-line-number" data-line-number="50"></td> <td id="LC50" class="blob-code blob-code-inner js-file-line"><span class="pl-k">from</span> tensorflow.python.util.tf_export <span class="pl-k">import</span> tf_export</td> </tr> <tr> <td id="L51" class="blob-num js-line-number" data-line-number="51"></td> <td id="LC51" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L52" class="blob-num js-line-number" data-line-number="52"></td> <td id="LC52" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L53" class="blob-num js-line-number" data-line-number="53"></td> <td id="LC53" class="blob-code blob-code-inner js-file-line"><span class="pl-c1">_BIAS_VARIABLE_NAME</span> <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span>bias<span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L54" class="blob-num js-line-number" data-line-number="54"></td> <td id="LC54" class="blob-code blob-code-inner js-file-line"><span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span> <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span>kernel<span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L55" class="blob-num js-line-number" data-line-number="55"></td> <td id="LC55" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L56" class="blob-num js-line-number" data-line-number="56"></td> <td id="LC56" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L57" class="blob-num js-line-number" data-line-number="57"></td> <td id="LC57" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_like_rnncell</span>(<span class="pl-smi">cell</span>):</td> </tr> <tr> <td id="L58" class="blob-num js-line-number" data-line-number="58"></td> <td id="LC58" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Checks that a given object is an RNNCell by using duck typing.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L59" class="blob-num js-line-number" data-line-number="59"></td> <td id="LC59" class="blob-code blob-code-inner js-file-line"> conditions <span class="pl-k">=</span> [<span class="pl-c1">hasattr</span>(cell, <span class="pl-s"><span class="pl-pds">&quot;</span>output_size<span class="pl-pds">&quot;</span></span>), <span class="pl-c1">hasattr</span>(cell, <span class="pl-s"><span class="pl-pds">&quot;</span>state_size<span class="pl-pds">&quot;</span></span>),</td> </tr> <tr> <td id="L60" class="blob-num js-line-number" data-line-number="60"></td> <td id="LC60" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">hasattr</span>(cell, <span class="pl-s"><span class="pl-pds">&quot;</span>zero_state<span class="pl-pds">&quot;</span></span>), <span class="pl-c1">callable</span>(cell)]</td> </tr> <tr> <td id="L61" class="blob-num js-line-number" data-line-number="61"></td> <td id="LC61" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">all</span>(conditions)</td> </tr> <tr> <td id="L62" class="blob-num js-line-number" data-line-number="62"></td> <td id="LC62" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L63" class="blob-num js-line-number" data-line-number="63"></td> <td id="LC63" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L64" class="blob-num js-line-number" data-line-number="64"></td> <td id="LC64" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_concat</span>(<span class="pl-smi">prefix</span>, <span class="pl-smi">suffix</span>, <span class="pl-smi">static</span><span class="pl-k">=</span><span class="pl-c1">False</span>):</td> </tr> <tr> <td id="L65" class="blob-num js-line-number" data-line-number="65"></td> <td id="LC65" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Concat that enables int, Tensor, or TensorShape values.</span></td> </tr> <tr> <td id="L66" class="blob-num js-line-number" data-line-number="66"></td> <td id="LC66" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L67" class="blob-num js-line-number" data-line-number="67"></td> <td id="LC67" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> This function takes a size specification, which can be an integer, a</span></td> </tr> <tr> <td id="L68" class="blob-num js-line-number" data-line-number="68"></td> <td id="LC68" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> TensorShape, or a Tensor, and converts it into a concatenated Tensor</span></td> </tr> <tr> <td id="L69" class="blob-num js-line-number" data-line-number="69"></td> <td id="LC69" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> (if static = False) or a list of integers (if static = True).</span></td> </tr> <tr> <td id="L70" class="blob-num js-line-number" data-line-number="70"></td> <td id="LC70" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L71" class="blob-num js-line-number" data-line-number="71"></td> <td id="LC71" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L72" class="blob-num js-line-number" data-line-number="72"></td> <td id="LC72" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> prefix: The prefix; usually the batch size (and/or time step size).</span></td> </tr> <tr> <td id="L73" class="blob-num js-line-number" data-line-number="73"></td> <td id="LC73" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> (TensorShape, int, or Tensor.)</span></td> </tr> <tr> <td id="L74" class="blob-num js-line-number" data-line-number="74"></td> <td id="LC74" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> suffix: TensorShape, int, or Tensor.</span></td> </tr> <tr> <td id="L75" class="blob-num js-line-number" data-line-number="75"></td> <td id="LC75" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> static: If `True`, return a python list with possibly unknown dimensions.</span></td> </tr> <tr> <td id="L76" class="blob-num js-line-number" data-line-number="76"></td> <td id="LC76" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Otherwise return a `Tensor`.</span></td> </tr> <tr> <td id="L77" class="blob-num js-line-number" data-line-number="77"></td> <td id="LC77" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L78" class="blob-num js-line-number" data-line-number="78"></td> <td id="LC78" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L79" class="blob-num js-line-number" data-line-number="79"></td> <td id="LC79" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> shape: the concatenation of prefix and suffix.</span></td> </tr> <tr> <td id="L80" class="blob-num js-line-number" data-line-number="80"></td> <td id="LC80" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L81" class="blob-num js-line-number" data-line-number="81"></td> <td id="LC81" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L82" class="blob-num js-line-number" data-line-number="82"></td> <td id="LC82" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: if `suffix` is not a scalar or vector (or TensorShape).</span></td> </tr> <tr> <td id="L83" class="blob-num js-line-number" data-line-number="83"></td> <td id="LC83" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: if prefix or suffix was `None` and asked for dynamic</span></td> </tr> <tr> <td id="L84" class="blob-num js-line-number" data-line-number="84"></td> <td id="LC84" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Tensors out.</span></td> </tr> <tr> <td id="L85" class="blob-num js-line-number" data-line-number="85"></td> <td id="LC85" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L86" class="blob-num js-line-number" data-line-number="86"></td> <td id="LC86" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">isinstance</span>(prefix, ops.Tensor):</td> </tr> <tr> <td id="L87" class="blob-num js-line-number" data-line-number="87"></td> <td id="LC87" class="blob-code blob-code-inner js-file-line"> p <span class="pl-k">=</span> prefix</td> </tr> <tr> <td id="L88" class="blob-num js-line-number" data-line-number="88"></td> <td id="LC88" class="blob-code blob-code-inner js-file-line"> p_static <span class="pl-k">=</span> tensor_util.constant_value(prefix)</td> </tr> <tr> <td id="L89" class="blob-num js-line-number" data-line-number="89"></td> <td id="LC89" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> p.shape.ndims <span class="pl-k">==</span> <span class="pl-c1">0</span>:</td> </tr> <tr> <td id="L90" class="blob-num js-line-number" data-line-number="90"></td> <td id="LC90" class="blob-code blob-code-inner js-file-line"> p <span class="pl-k">=</span> array_ops.expand_dims(p, <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L91" class="blob-num js-line-number" data-line-number="91"></td> <td id="LC91" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">elif</span> p.shape.ndims <span class="pl-k">!=</span> <span class="pl-c1">1</span>:</td> </tr> <tr> <td id="L92" class="blob-num js-line-number" data-line-number="92"></td> <td id="LC92" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>prefix tensor must be either a scalar or vector, <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L93" class="blob-num js-line-number" data-line-number="93"></td> <td id="LC93" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>but saw tensor: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> p)</td> </tr> <tr> <td id="L94" class="blob-num js-line-number" data-line-number="94"></td> <td id="LC94" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L95" class="blob-num js-line-number" data-line-number="95"></td> <td id="LC95" class="blob-code blob-code-inner js-file-line"> p <span class="pl-k">=</span> tensor_shape.as_shape(prefix)</td> </tr> <tr> <td id="L96" class="blob-num js-line-number" data-line-number="96"></td> <td id="LC96" class="blob-code blob-code-inner js-file-line"> p_static <span class="pl-k">=</span> p.as_list() <span class="pl-k">if</span> p.ndims <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L97" class="blob-num js-line-number" data-line-number="97"></td> <td id="LC97" class="blob-code blob-code-inner js-file-line"> p <span class="pl-k">=</span> (constant_op.constant(p.as_list(), <span class="pl-v">dtype</span><span class="pl-k">=</span>dtypes.int32)</td> </tr> <tr> <td id="L98" class="blob-num js-line-number" data-line-number="98"></td> <td id="LC98" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> p.is_fully_defined() <span class="pl-k">else</span> <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L99" class="blob-num js-line-number" data-line-number="99"></td> <td id="LC99" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">isinstance</span>(suffix, ops.Tensor):</td> </tr> <tr> <td id="L100" class="blob-num js-line-number" data-line-number="100"></td> <td id="LC100" class="blob-code blob-code-inner js-file-line"> s <span class="pl-k">=</span> suffix</td> </tr> <tr> <td id="L101" class="blob-num js-line-number" data-line-number="101"></td> <td id="LC101" class="blob-code blob-code-inner js-file-line"> s_static <span class="pl-k">=</span> tensor_util.constant_value(suffix)</td> </tr> <tr> <td id="L102" class="blob-num js-line-number" data-line-number="102"></td> <td id="LC102" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> s.shape.ndims <span class="pl-k">==</span> <span class="pl-c1">0</span>:</td> </tr> <tr> <td id="L103" class="blob-num js-line-number" data-line-number="103"></td> <td id="LC103" class="blob-code blob-code-inner js-file-line"> s <span class="pl-k">=</span> array_ops.expand_dims(s, <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L104" class="blob-num js-line-number" data-line-number="104"></td> <td id="LC104" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">elif</span> s.shape.ndims <span class="pl-k">!=</span> <span class="pl-c1">1</span>:</td> </tr> <tr> <td id="L105" class="blob-num js-line-number" data-line-number="105"></td> <td id="LC105" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>suffix tensor must be either a scalar or vector, <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L106" class="blob-num js-line-number" data-line-number="106"></td> <td id="LC106" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>but saw tensor: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> s)</td> </tr> <tr> <td id="L107" class="blob-num js-line-number" data-line-number="107"></td> <td id="LC107" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L108" class="blob-num js-line-number" data-line-number="108"></td> <td id="LC108" class="blob-code blob-code-inner js-file-line"> s <span class="pl-k">=</span> tensor_shape.as_shape(suffix)</td> </tr> <tr> <td id="L109" class="blob-num js-line-number" data-line-number="109"></td> <td id="LC109" class="blob-code blob-code-inner js-file-line"> s_static <span class="pl-k">=</span> s.as_list() <span class="pl-k">if</span> s.ndims <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L110" class="blob-num js-line-number" data-line-number="110"></td> <td id="LC110" class="blob-code blob-code-inner js-file-line"> s <span class="pl-k">=</span> (constant_op.constant(s.as_list(), <span class="pl-v">dtype</span><span class="pl-k">=</span>dtypes.int32)</td> </tr> <tr> <td id="L111" class="blob-num js-line-number" data-line-number="111"></td> <td id="LC111" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> s.is_fully_defined() <span class="pl-k">else</span> <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L112" class="blob-num js-line-number" data-line-number="112"></td> <td id="LC112" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L113" class="blob-num js-line-number" data-line-number="113"></td> <td id="LC113" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> static:</td> </tr> <tr> <td id="L114" class="blob-num js-line-number" data-line-number="114"></td> <td id="LC114" class="blob-code blob-code-inner js-file-line"> shape <span class="pl-k">=</span> tensor_shape.as_shape(p_static).concatenate(s_static)</td> </tr> <tr> <td id="L115" class="blob-num js-line-number" data-line-number="115"></td> <td id="LC115" class="blob-code blob-code-inner js-file-line"> shape <span class="pl-k">=</span> shape.as_list() <span class="pl-k">if</span> shape.ndims <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L116" class="blob-num js-line-number" data-line-number="116"></td> <td id="LC116" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L117" class="blob-num js-line-number" data-line-number="117"></td> <td id="LC117" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> p <span class="pl-k">is</span> <span class="pl-c1">None</span> <span class="pl-k">or</span> s <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L118" class="blob-num js-line-number" data-line-number="118"></td> <td id="LC118" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Provided a prefix or suffix of None: <span class="pl-c1">%s</span> and <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L119" class="blob-num js-line-number" data-line-number="119"></td> <td id="LC119" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> (prefix, suffix))</td> </tr> <tr> <td id="L120" class="blob-num js-line-number" data-line-number="120"></td> <td id="LC120" class="blob-code blob-code-inner js-file-line"> shape <span class="pl-k">=</span> array_ops.concat((p, s), <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L121" class="blob-num js-line-number" data-line-number="121"></td> <td id="LC121" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> shape</td> </tr> <tr> <td id="L122" class="blob-num js-line-number" data-line-number="122"></td> <td id="LC122" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L123" class="blob-num js-line-number" data-line-number="123"></td> <td id="LC123" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L124" class="blob-num js-line-number" data-line-number="124"></td> <td id="LC124" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_zero_state_tensors</span>(<span class="pl-smi">state_size</span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L125" class="blob-num js-line-number" data-line-number="125"></td> <td id="LC125" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Create tensors of zeros based on state_size, batch_size, and dtype.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L126" class="blob-num js-line-number" data-line-number="126"></td> <td id="LC126" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">get_state_shape</span>(<span class="pl-smi">s</span>):</td> </tr> <tr> <td id="L127" class="blob-num js-line-number" data-line-number="127"></td> <td id="LC127" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Combine s with batch_size to get a proper tensor shape.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L128" class="blob-num js-line-number" data-line-number="128"></td> <td id="LC128" class="blob-code blob-code-inner js-file-line"> c <span class="pl-k">=</span> _concat(batch_size, s)</td> </tr> <tr> <td id="L129" class="blob-num js-line-number" data-line-number="129"></td> <td id="LC129" class="blob-code blob-code-inner js-file-line"> size <span class="pl-k">=</span> array_ops.zeros(c, <span class="pl-v">dtype</span><span class="pl-k">=</span>dtype)</td> </tr> <tr> <td id="L130" class="blob-num js-line-number" data-line-number="130"></td> <td id="LC130" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> context.in_graph_mode():</td> </tr> <tr> <td id="L131" class="blob-num js-line-number" data-line-number="131"></td> <td id="LC131" class="blob-code blob-code-inner js-file-line"> c_static <span class="pl-k">=</span> _concat(batch_size, s, <span class="pl-v">static</span><span class="pl-k">=</span><span class="pl-c1">True</span>)</td> </tr> <tr> <td id="L132" class="blob-num js-line-number" data-line-number="132"></td> <td id="LC132" class="blob-code blob-code-inner js-file-line"> size.set_shape(c_static)</td> </tr> <tr> <td id="L133" class="blob-num js-line-number" data-line-number="133"></td> <td id="LC133" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> size</td> </tr> <tr> <td id="L134" class="blob-num js-line-number" data-line-number="134"></td> <td id="LC134" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> nest.map_structure(get_state_shape, state_size)</td> </tr> <tr> <td id="L135" class="blob-num js-line-number" data-line-number="135"></td> <td id="LC135" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L136" class="blob-num js-line-number" data-line-number="136"></td> <td id="LC136" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L137" class="blob-num js-line-number" data-line-number="137"></td> <td id="LC137" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.RNNCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L138" class="blob-num js-line-number" data-line-number="138"></td> <td id="LC138" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">RNNCell</span>(<span class="pl-e">base_layer</span>.<span class="pl-e">Layer</span>):</td> </tr> <tr> <td id="L139" class="blob-num js-line-number" data-line-number="139"></td> <td id="LC139" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Abstract object representing an RNN cell.</span></td> </tr> <tr> <td id="L140" class="blob-num js-line-number" data-line-number="140"></td> <td id="LC140" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L141" class="blob-num js-line-number" data-line-number="141"></td> <td id="LC141" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Every `RNNCell` must have the properties below and implement `call` with</span></td> </tr> <tr> <td id="L142" class="blob-num js-line-number" data-line-number="142"></td> <td id="LC142" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the signature `(output, next_state) = call(input, state)`. The optional</span></td> </tr> <tr> <td id="L143" class="blob-num js-line-number" data-line-number="143"></td> <td id="LC143" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> third input argument, `scope`, is allowed for backwards compatibility</span></td> </tr> <tr> <td id="L144" class="blob-num js-line-number" data-line-number="144"></td> <td id="LC144" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> purposes; but should be left off for new subclasses.</span></td> </tr> <tr> <td id="L145" class="blob-num js-line-number" data-line-number="145"></td> <td id="LC145" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L146" class="blob-num js-line-number" data-line-number="146"></td> <td id="LC146" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> This definition of cell differs from the definition used in the literature.</span></td> </tr> <tr> <td id="L147" class="blob-num js-line-number" data-line-number="147"></td> <td id="LC147" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> In the literature, &#39;cell&#39; refers to an object with a single scalar output.</span></td> </tr> <tr> <td id="L148" class="blob-num js-line-number" data-line-number="148"></td> <td id="LC148" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> This definition refers to a horizontal array of such units.</span></td> </tr> <tr> <td id="L149" class="blob-num js-line-number" data-line-number="149"></td> <td id="LC149" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L150" class="blob-num js-line-number" data-line-number="150"></td> <td id="LC150" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> An RNN cell, in the most abstract setting, is anything that has</span></td> </tr> <tr> <td id="L151" class="blob-num js-line-number" data-line-number="151"></td> <td id="LC151" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> a state and performs some operation that takes a matrix of inputs.</span></td> </tr> <tr> <td id="L152" class="blob-num js-line-number" data-line-number="152"></td> <td id="LC152" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> This operation results in an output matrix with `self.output_size` columns.</span></td> </tr> <tr> <td id="L153" class="blob-num js-line-number" data-line-number="153"></td> <td id="LC153" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> If `self.state_size` is an integer, this operation also results in a new</span></td> </tr> <tr> <td id="L154" class="blob-num js-line-number" data-line-number="154"></td> <td id="LC154" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state matrix with `self.state_size` columns. If `self.state_size` is a</span></td> </tr> <tr> <td id="L155" class="blob-num js-line-number" data-line-number="155"></td> <td id="LC155" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> (possibly nested tuple of) TensorShape object(s), then it should return a</span></td> </tr> <tr> <td id="L156" class="blob-num js-line-number" data-line-number="156"></td> <td id="LC156" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> matching structure of Tensors having shape `[batch_size].concatenate(s)`</span></td> </tr> <tr> <td id="L157" class="blob-num js-line-number" data-line-number="157"></td> <td id="LC157" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> for each `s` in `self.batch_size`.</span></td> </tr> <tr> <td id="L158" class="blob-num js-line-number" data-line-number="158"></td> <td id="LC158" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L159" class="blob-num js-line-number" data-line-number="159"></td> <td id="LC159" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L160" class="blob-num js-line-number" data-line-number="160"></td> <td id="LC160" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L161" class="blob-num js-line-number" data-line-number="161"></td> <td id="LC161" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run this RNN cell on inputs, starting from the given state.</span></td> </tr> <tr> <td id="L162" class="blob-num js-line-number" data-line-number="162"></td> <td id="LC162" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L163" class="blob-num js-line-number" data-line-number="163"></td> <td id="LC163" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L164" class="blob-num js-line-number" data-line-number="164"></td> <td id="LC164" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> inputs: `2-D` tensor with shape `[batch_size, input_size]`.</span></td> </tr> <tr> <td id="L165" class="blob-num js-line-number" data-line-number="165"></td> <td id="LC165" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state: if `self.state_size` is an integer, this should be a `2-D Tensor`</span></td> </tr> <tr> <td id="L166" class="blob-num js-line-number" data-line-number="166"></td> <td id="LC166" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> with shape `[batch_size, self.state_size]`. Otherwise, if</span></td> </tr> <tr> <td id="L167" class="blob-num js-line-number" data-line-number="167"></td> <td id="LC167" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `self.state_size` is a tuple of integers, this should be a tuple</span></td> </tr> <tr> <td id="L168" class="blob-num js-line-number" data-line-number="168"></td> <td id="LC168" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> with shapes `[batch_size, s] for s in self.state_size`.</span></td> </tr> <tr> <td id="L169" class="blob-num js-line-number" data-line-number="169"></td> <td id="LC169" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> scope: VariableScope for the created subgraph; defaults to class name.</span></td> </tr> <tr> <td id="L170" class="blob-num js-line-number" data-line-number="170"></td> <td id="LC170" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L171" class="blob-num js-line-number" data-line-number="171"></td> <td id="LC171" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L172" class="blob-num js-line-number" data-line-number="172"></td> <td id="LC172" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> A pair containing:</span></td> </tr> <tr> <td id="L173" class="blob-num js-line-number" data-line-number="173"></td> <td id="LC173" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L174" class="blob-num js-line-number" data-line-number="174"></td> <td id="LC174" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - Output: A `2-D` tensor with shape `[batch_size, self.output_size]`.</span></td> </tr> <tr> <td id="L175" class="blob-num js-line-number" data-line-number="175"></td> <td id="LC175" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - New state: Either a single `2-D` tensor, or a tuple of tensors matching</span></td> </tr> <tr> <td id="L176" class="blob-num js-line-number" data-line-number="176"></td> <td id="LC176" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the arity and shapes of `state`.</span></td> </tr> <tr> <td id="L177" class="blob-num js-line-number" data-line-number="177"></td> <td id="LC177" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L178" class="blob-num js-line-number" data-line-number="178"></td> <td id="LC178" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> scope <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L179" class="blob-num js-line-number" data-line-number="179"></td> <td id="LC179" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> vs.variable_scope(scope,</td> </tr> <tr> <td id="L180" class="blob-num js-line-number" data-line-number="180"></td> <td id="LC180" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">custom_getter</span><span class="pl-k">=</span><span class="pl-c1">self</span>._rnn_get_variable) <span class="pl-k">as</span> scope:</td> </tr> <tr> <td id="L181" class="blob-num js-line-number" data-line-number="181"></td> <td id="LC181" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">super</span>(RNNCell, <span class="pl-c1">self</span>).<span class="pl-c1">__call__</span>(inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope)</td> </tr> <tr> <td id="L182" class="blob-num js-line-number" data-line-number="182"></td> <td id="LC182" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L183" class="blob-num js-line-number" data-line-number="183"></td> <td id="LC183" class="blob-code blob-code-inner js-file-line"> scope_attrname <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span>rnncell_scope<span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L184" class="blob-num js-line-number" data-line-number="184"></td> <td id="LC184" class="blob-code blob-code-inner js-file-line"> scope <span class="pl-k">=</span> <span class="pl-c1">getattr</span>(<span class="pl-c1">self</span>, scope_attrname, <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L185" class="blob-num js-line-number" data-line-number="185"></td> <td id="LC185" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> scope <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L186" class="blob-num js-line-number" data-line-number="186"></td> <td id="LC186" class="blob-code blob-code-inner js-file-line"> scope <span class="pl-k">=</span> vs.variable_scope(vs.get_variable_scope(),</td> </tr> <tr> <td id="L187" class="blob-num js-line-number" data-line-number="187"></td> <td id="LC187" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">custom_getter</span><span class="pl-k">=</span><span class="pl-c1">self</span>._rnn_get_variable)</td> </tr> <tr> <td id="L188" class="blob-num js-line-number" data-line-number="188"></td> <td id="LC188" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">setattr</span>(<span class="pl-c1">self</span>, scope_attrname, scope)</td> </tr> <tr> <td id="L189" class="blob-num js-line-number" data-line-number="189"></td> <td id="LC189" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> scope:</td> </tr> <tr> <td id="L190" class="blob-num js-line-number" data-line-number="190"></td> <td id="LC190" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">super</span>(RNNCell, <span class="pl-c1">self</span>).<span class="pl-c1">__call__</span>(inputs, state)</td> </tr> <tr> <td id="L191" class="blob-num js-line-number" data-line-number="191"></td> <td id="LC191" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L192" class="blob-num js-line-number" data-line-number="192"></td> <td id="LC192" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_rnn_get_variable</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">getter</span>, <span class="pl-k">*</span><span class="pl-smi">args</span>, <span class="pl-k">**</span><span class="pl-smi">kwargs</span>):</td> </tr> <tr> <td id="L193" class="blob-num js-line-number" data-line-number="193"></td> <td id="LC193" class="blob-code blob-code-inner js-file-line"> variable <span class="pl-k">=</span> getter(<span class="pl-k">*</span>args, <span class="pl-k">**</span>kwargs)</td> </tr> <tr> <td id="L194" class="blob-num js-line-number" data-line-number="194"></td> <td id="LC194" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> context.in_graph_mode():</td> </tr> <tr> <td id="L195" class="blob-num js-line-number" data-line-number="195"></td> <td id="LC195" class="blob-code blob-code-inner js-file-line"> trainable <span class="pl-k">=</span> (variable <span class="pl-k">in</span> tf_variables.trainable_variables() <span class="pl-k">or</span></td> </tr> <tr> <td id="L196" class="blob-num js-line-number" data-line-number="196"></td> <td id="LC196" class="blob-code blob-code-inner js-file-line"> (<span class="pl-c1">isinstance</span>(variable, tf_variables.PartitionedVariable) <span class="pl-k">and</span></td> </tr> <tr> <td id="L197" class="blob-num js-line-number" data-line-number="197"></td> <td id="LC197" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">list</span>(variable)[<span class="pl-c1">0</span>] <span class="pl-k">in</span> tf_variables.trainable_variables()))</td> </tr> <tr> <td id="L198" class="blob-num js-line-number" data-line-number="198"></td> <td id="LC198" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L199" class="blob-num js-line-number" data-line-number="199"></td> <td id="LC199" class="blob-code blob-code-inner js-file-line"> trainable <span class="pl-k">=</span> variable._trainable <span class="pl-c"><span class="pl-c">#</span> pylint: disable=protected-access</span></td> </tr> <tr> <td id="L200" class="blob-num js-line-number" data-line-number="200"></td> <td id="LC200" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> trainable <span class="pl-k">and</span> variable <span class="pl-k">not</span> <span class="pl-k">in</span> <span class="pl-c1">self</span>._trainable_weights:</td> </tr> <tr> <td id="L201" class="blob-num js-line-number" data-line-number="201"></td> <td id="LC201" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._trainable_weights.append(variable)</td> </tr> <tr> <td id="L202" class="blob-num js-line-number" data-line-number="202"></td> <td id="LC202" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">elif</span> <span class="pl-k">not</span> trainable <span class="pl-k">and</span> variable <span class="pl-k">not</span> <span class="pl-k">in</span> <span class="pl-c1">self</span>._non_trainable_weights:</td> </tr> <tr> <td id="L203" class="blob-num js-line-number" data-line-number="203"></td> <td id="LC203" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._non_trainable_weights.append(variable)</td> </tr> <tr> <td id="L204" class="blob-num js-line-number" data-line-number="204"></td> <td id="LC204" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> variable</td> </tr> <tr> <td id="L205" class="blob-num js-line-number" data-line-number="205"></td> <td id="LC205" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L206" class="blob-num js-line-number" data-line-number="206"></td> <td id="LC206" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L207" class="blob-num js-line-number" data-line-number="207"></td> <td id="LC207" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L208" class="blob-num js-line-number" data-line-number="208"></td> <td id="LC208" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>size(s) of state(s) used by this cell.</span></td> </tr> <tr> <td id="L209" class="blob-num js-line-number" data-line-number="209"></td> <td id="LC209" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L210" class="blob-num js-line-number" data-line-number="210"></td> <td id="LC210" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> It can be represented by an Integer, a TensorShape or a tuple of Integers</span></td> </tr> <tr> <td id="L211" class="blob-num js-line-number" data-line-number="211"></td> <td id="LC211" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> or TensorShapes.</span></td> </tr> <tr> <td id="L212" class="blob-num js-line-number" data-line-number="212"></td> <td id="LC212" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L213" class="blob-num js-line-number" data-line-number="213"></td> <td id="LC213" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">NotImplementedError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Abstract method<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L214" class="blob-num js-line-number" data-line-number="214"></td> <td id="LC214" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L215" class="blob-num js-line-number" data-line-number="215"></td> <td id="LC215" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L216" class="blob-num js-line-number" data-line-number="216"></td> <td id="LC216" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L217" class="blob-num js-line-number" data-line-number="217"></td> <td id="LC217" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Integer or TensorShape: size of outputs produced by this cell.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L218" class="blob-num js-line-number" data-line-number="218"></td> <td id="LC218" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">NotImplementedError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Abstract method<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L219" class="blob-num js-line-number" data-line-number="219"></td> <td id="LC219" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L220" class="blob-num js-line-number" data-line-number="220"></td> <td id="LC220" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">build</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">_</span>):</td> </tr> <tr> <td id="L221" class="blob-num js-line-number" data-line-number="221"></td> <td id="LC221" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> This tells the parent Layer object that it&#39;s OK to call</span></td> </tr> <tr> <td id="L222" class="blob-num js-line-number" data-line-number="222"></td> <td id="LC222" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> self.add_variable() inside the call() method.</span></td> </tr> <tr> <td id="L223" class="blob-num js-line-number" data-line-number="223"></td> <td id="LC223" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">pass</span></td> </tr> <tr> <td id="L224" class="blob-num js-line-number" data-line-number="224"></td> <td id="LC224" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L225" class="blob-num js-line-number" data-line-number="225"></td> <td id="LC225" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">zero_state</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L226" class="blob-num js-line-number" data-line-number="226"></td> <td id="LC226" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Return zero-filled state tensor(s).</span></td> </tr> <tr> <td id="L227" class="blob-num js-line-number" data-line-number="227"></td> <td id="LC227" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L228" class="blob-num js-line-number" data-line-number="228"></td> <td id="LC228" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L229" class="blob-num js-line-number" data-line-number="229"></td> <td id="LC229" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> batch_size: int, float, or unit Tensor representing the batch size.</span></td> </tr> <tr> <td id="L230" class="blob-num js-line-number" data-line-number="230"></td> <td id="LC230" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> dtype: the data type to use for the state.</span></td> </tr> <tr> <td id="L231" class="blob-num js-line-number" data-line-number="231"></td> <td id="LC231" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L232" class="blob-num js-line-number" data-line-number="232"></td> <td id="LC232" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L233" class="blob-num js-line-number" data-line-number="233"></td> <td id="LC233" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> If `state_size` is an int or TensorShape, then the return value is a</span></td> </tr> <tr> <td id="L234" class="blob-num js-line-number" data-line-number="234"></td> <td id="LC234" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `N-D` tensor of shape `[batch_size, state_size]` filled with zeros.</span></td> </tr> <tr> <td id="L235" class="blob-num js-line-number" data-line-number="235"></td> <td id="LC235" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L236" class="blob-num js-line-number" data-line-number="236"></td> <td id="LC236" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> If `state_size` is a nested list or tuple, then the return value is</span></td> </tr> <tr> <td id="L237" class="blob-num js-line-number" data-line-number="237"></td> <td id="LC237" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> a nested list or tuple (of the same structure) of `2-D` tensors with</span></td> </tr> <tr> <td id="L238" class="blob-num js-line-number" data-line-number="238"></td> <td id="LC238" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the shapes `[batch_size, s]` for each s in `state_size`.</span></td> </tr> <tr> <td id="L239" class="blob-num js-line-number" data-line-number="239"></td> <td id="LC239" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L240" class="blob-num js-line-number" data-line-number="240"></td> <td id="LC240" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Try to use the last cached zero_state. This is done to avoid recreating</span></td> </tr> <tr> <td id="L241" class="blob-num js-line-number" data-line-number="241"></td> <td id="LC241" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> zeros, especially when eager execution is enabled.</span></td> </tr> <tr> <td id="L242" class="blob-num js-line-number" data-line-number="242"></td> <td id="LC242" class="blob-code blob-code-inner js-file-line"> state_size <span class="pl-k">=</span> <span class="pl-c1">self</span>.state_size</td> </tr> <tr> <td id="L243" class="blob-num js-line-number" data-line-number="243"></td> <td id="LC243" class="blob-code blob-code-inner js-file-line"> is_eager <span class="pl-k">=</span> context.in_eager_mode()</td> </tr> <tr> <td id="L244" class="blob-num js-line-number" data-line-number="244"></td> <td id="LC244" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> is_eager <span class="pl-k">and</span> <span class="pl-c1">hasattr</span>(<span class="pl-c1">self</span>, <span class="pl-s"><span class="pl-pds">&quot;</span>_last_zero_state<span class="pl-pds">&quot;</span></span>):</td> </tr> <tr> <td id="L245" class="blob-num js-line-number" data-line-number="245"></td> <td id="LC245" class="blob-code blob-code-inner js-file-line"> (last_state_size, last_batch_size, last_dtype,</td> </tr> <tr> <td id="L246" class="blob-num js-line-number" data-line-number="246"></td> <td id="LC246" class="blob-code blob-code-inner js-file-line"> last_output) <span class="pl-k">=</span> <span class="pl-c1">getattr</span>(<span class="pl-c1">self</span>, <span class="pl-s"><span class="pl-pds">&quot;</span>_last_zero_state<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L247" class="blob-num js-line-number" data-line-number="247"></td> <td id="LC247" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (last_batch_size <span class="pl-k">==</span> batch_size <span class="pl-k">and</span></td> </tr> <tr> <td id="L248" class="blob-num js-line-number" data-line-number="248"></td> <td id="LC248" class="blob-code blob-code-inner js-file-line"> last_dtype <span class="pl-k">==</span> dtype <span class="pl-k">and</span></td> </tr> <tr> <td id="L249" class="blob-num js-line-number" data-line-number="249"></td> <td id="LC249" class="blob-code blob-code-inner js-file-line"> last_state_size <span class="pl-k">==</span> state_size):</td> </tr> <tr> <td id="L250" class="blob-num js-line-number" data-line-number="250"></td> <td id="LC250" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> last_output</td> </tr> <tr> <td id="L251" class="blob-num js-line-number" data-line-number="251"></td> <td id="LC251" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-c1">type</span>(<span class="pl-c1">self</span>).<span class="pl-c1">__name__</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ZeroState<span class="pl-pds">&quot;</span></span>, <span class="pl-v">values</span><span class="pl-k">=</span>[batch_size]):</td> </tr> <tr> <td id="L252" class="blob-num js-line-number" data-line-number="252"></td> <td id="LC252" class="blob-code blob-code-inner js-file-line"> output <span class="pl-k">=</span> _zero_state_tensors(state_size, batch_size, dtype)</td> </tr> <tr> <td id="L253" class="blob-num js-line-number" data-line-number="253"></td> <td id="LC253" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> is_eager:</td> </tr> <tr> <td id="L254" class="blob-num js-line-number" data-line-number="254"></td> <td id="LC254" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._last_zero_state <span class="pl-k">=</span> (state_size, batch_size, dtype, output)</td> </tr> <tr> <td id="L255" class="blob-num js-line-number" data-line-number="255"></td> <td id="LC255" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> output</td> </tr> <tr> <td id="L256" class="blob-num js-line-number" data-line-number="256"></td> <td id="LC256" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L257" class="blob-num js-line-number" data-line-number="257"></td> <td id="LC257" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L258" class="blob-num js-line-number" data-line-number="258"></td> <td id="LC258" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">_LayerRNNCell</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L259" class="blob-num js-line-number" data-line-number="259"></td> <td id="LC259" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Subclass of RNNCells that act like proper `tf.Layer` objects.</span></td> </tr> <tr> <td id="L260" class="blob-num js-line-number" data-line-number="260"></td> <td id="LC260" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L261" class="blob-num js-line-number" data-line-number="261"></td> <td id="LC261" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> For backwards compatibility purposes, most `RNNCell` instances allow their</span></td> </tr> <tr> <td id="L262" class="blob-num js-line-number" data-line-number="262"></td> <td id="LC262" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `call` methods to instantiate variables via `tf.get_variable`. The underlying</span></td> </tr> <tr> <td id="L263" class="blob-num js-line-number" data-line-number="263"></td> <td id="LC263" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> variable scope thus keeps track of any variables, and returning cached</span></td> </tr> <tr> <td id="L264" class="blob-num js-line-number" data-line-number="264"></td> <td id="LC264" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> versions. This is atypical of `tf.layer` objects, which separate this</span></td> </tr> <tr> <td id="L265" class="blob-num js-line-number" data-line-number="265"></td> <td id="LC265" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> part of layer building into a `build` method that is only called once.</span></td> </tr> <tr> <td id="L266" class="blob-num js-line-number" data-line-number="266"></td> <td id="LC266" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L267" class="blob-num js-line-number" data-line-number="267"></td> <td id="LC267" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Here we provide a subclass for `RNNCell` objects that act exactly as</span></td> </tr> <tr> <td id="L268" class="blob-num js-line-number" data-line-number="268"></td> <td id="LC268" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `Layer` objects do. They must provide a `build` method and their</span></td> </tr> <tr> <td id="L269" class="blob-num js-line-number" data-line-number="269"></td> <td id="LC269" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `call` methods do not access Variables `tf.get_variable`.</span></td> </tr> <tr> <td id="L270" class="blob-num js-line-number" data-line-number="270"></td> <td id="LC270" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L271" class="blob-num js-line-number" data-line-number="271"></td> <td id="LC271" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L272" class="blob-num js-line-number" data-line-number="272"></td> <td id="LC272" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-k">*</span><span class="pl-smi">args</span>, <span class="pl-k">**</span><span class="pl-smi">kwargs</span>):</td> </tr> <tr> <td id="L273" class="blob-num js-line-number" data-line-number="273"></td> <td id="LC273" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run this RNN cell on inputs, starting from the given state.</span></td> </tr> <tr> <td id="L274" class="blob-num js-line-number" data-line-number="274"></td> <td id="LC274" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L275" class="blob-num js-line-number" data-line-number="275"></td> <td id="LC275" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L276" class="blob-num js-line-number" data-line-number="276"></td> <td id="LC276" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> inputs: `2-D` tensor with shape `[batch_size, input_size]`.</span></td> </tr> <tr> <td id="L277" class="blob-num js-line-number" data-line-number="277"></td> <td id="LC277" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state: if `self.state_size` is an integer, this should be a `2-D Tensor`</span></td> </tr> <tr> <td id="L278" class="blob-num js-line-number" data-line-number="278"></td> <td id="LC278" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> with shape `[batch_size, self.state_size]`. Otherwise, if</span></td> </tr> <tr> <td id="L279" class="blob-num js-line-number" data-line-number="279"></td> <td id="LC279" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `self.state_size` is a tuple of integers, this should be a tuple</span></td> </tr> <tr> <td id="L280" class="blob-num js-line-number" data-line-number="280"></td> <td id="LC280" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> with shapes `[batch_size, s] for s in self.state_size`.</span></td> </tr> <tr> <td id="L281" class="blob-num js-line-number" data-line-number="281"></td> <td id="LC281" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> scope: optional cell scope.</span></td> </tr> <tr> <td id="L282" class="blob-num js-line-number" data-line-number="282"></td> <td id="LC282" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> *args: Additional positional arguments.</span></td> </tr> <tr> <td id="L283" class="blob-num js-line-number" data-line-number="283"></td> <td id="LC283" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> **kwargs: Additional keyword arguments.</span></td> </tr> <tr> <td id="L284" class="blob-num js-line-number" data-line-number="284"></td> <td id="LC284" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L285" class="blob-num js-line-number" data-line-number="285"></td> <td id="LC285" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L286" class="blob-num js-line-number" data-line-number="286"></td> <td id="LC286" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> A pair containing:</span></td> </tr> <tr> <td id="L287" class="blob-num js-line-number" data-line-number="287"></td> <td id="LC287" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L288" class="blob-num js-line-number" data-line-number="288"></td> <td id="LC288" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - Output: A `2-D` tensor with shape `[batch_size, self.output_size]`.</span></td> </tr> <tr> <td id="L289" class="blob-num js-line-number" data-line-number="289"></td> <td id="LC289" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - New state: Either a single `2-D` tensor, or a tuple of tensors matching</span></td> </tr> <tr> <td id="L290" class="blob-num js-line-number" data-line-number="290"></td> <td id="LC290" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the arity and shapes of `state`.</span></td> </tr> <tr> <td id="L291" class="blob-num js-line-number" data-line-number="291"></td> <td id="LC291" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L292" class="blob-num js-line-number" data-line-number="292"></td> <td id="LC292" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Bypass RNNCell&#39;s variable capturing semantics for LayerRNNCell.</span></td> </tr> <tr> <td id="L293" class="blob-num js-line-number" data-line-number="293"></td> <td id="LC293" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Instead, it is up to subclasses to provide a proper build</span></td> </tr> <tr> <td id="L294" class="blob-num js-line-number" data-line-number="294"></td> <td id="LC294" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> method. See the class docstring for more details.</span></td> </tr> <tr> <td id="L295" class="blob-num js-line-number" data-line-number="295"></td> <td id="LC295" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> base_layer.Layer.<span class="pl-c1">__call__</span>(<span class="pl-c1">self</span>, inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope,</td> </tr> <tr> <td id="L296" class="blob-num js-line-number" data-line-number="296"></td> <td id="LC296" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">*</span>args, <span class="pl-k">**</span>kwargs)</td> </tr> <tr> <td id="L297" class="blob-num js-line-number" data-line-number="297"></td> <td id="LC297" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L298" class="blob-num js-line-number" data-line-number="298"></td> <td id="LC298" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L299" class="blob-num js-line-number" data-line-number="299"></td> <td id="LC299" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.BasicRNNCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L300" class="blob-num js-line-number" data-line-number="300"></td> <td id="LC300" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">BasicRNNCell</span>(<span class="pl-e">_LayerRNNCell</span>):</td> </tr> <tr> <td id="L301" class="blob-num js-line-number" data-line-number="301"></td> <td id="LC301" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>The most basic RNN cell.</span></td> </tr> <tr> <td id="L302" class="blob-num js-line-number" data-line-number="302"></td> <td id="LC302" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L303" class="blob-num js-line-number" data-line-number="303"></td> <td id="LC303" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L304" class="blob-num js-line-number" data-line-number="304"></td> <td id="LC304" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_units: int, The number of units in the RNN cell.</span></td> </tr> <tr> <td id="L305" class="blob-num js-line-number" data-line-number="305"></td> <td id="LC305" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> activation: Nonlinearity to use. Default: `tanh`.</span></td> </tr> <tr> <td id="L306" class="blob-num js-line-number" data-line-number="306"></td> <td id="LC306" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> reuse: (optional) Python boolean describing whether to reuse variables</span></td> </tr> <tr> <td id="L307" class="blob-num js-line-number" data-line-number="307"></td> <td id="LC307" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> in an existing scope. If not `True`, and the existing scope already has</span></td> </tr> <tr> <td id="L308" class="blob-num js-line-number" data-line-number="308"></td> <td id="LC308" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the given variables, an error is raised.</span></td> </tr> <tr> <td id="L309" class="blob-num js-line-number" data-line-number="309"></td> <td id="LC309" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> name: String, the name of the layer. Layers with the same name will</span></td> </tr> <tr> <td id="L310" class="blob-num js-line-number" data-line-number="310"></td> <td id="LC310" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> share weights, but to avoid mistakes we require reuse=True in such</span></td> </tr> <tr> <td id="L311" class="blob-num js-line-number" data-line-number="311"></td> <td id="LC311" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cases.</span></td> </tr> <tr> <td id="L312" class="blob-num js-line-number" data-line-number="312"></td> <td id="LC312" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L313" class="blob-num js-line-number" data-line-number="313"></td> <td id="LC313" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L314" class="blob-num js-line-number" data-line-number="314"></td> <td id="LC314" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">num_units</span>, <span class="pl-smi">activation</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">reuse</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">name</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L315" class="blob-num js-line-number" data-line-number="315"></td> <td id="LC315" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">super</span>(BasicRNNCell, <span class="pl-c1">self</span>).<span class="pl-c1">__init__</span>(<span class="pl-v">_reuse</span><span class="pl-k">=</span>reuse, <span class="pl-v">name</span><span class="pl-k">=</span>name)</td> </tr> <tr> <td id="L316" class="blob-num js-line-number" data-line-number="316"></td> <td id="LC316" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L317" class="blob-num js-line-number" data-line-number="317"></td> <td id="LC317" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Inputs must be 2-dimensional.</span></td> </tr> <tr> <td id="L318" class="blob-num js-line-number" data-line-number="318"></td> <td id="LC318" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.input_spec <span class="pl-k">=</span> base_layer.InputSpec(<span class="pl-v">ndim</span><span class="pl-k">=</span><span class="pl-c1">2</span>)</td> </tr> <tr> <td id="L319" class="blob-num js-line-number" data-line-number="319"></td> <td id="LC319" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L320" class="blob-num js-line-number" data-line-number="320"></td> <td id="LC320" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_units <span class="pl-k">=</span> num_units</td> </tr> <tr> <td id="L321" class="blob-num js-line-number" data-line-number="321"></td> <td id="LC321" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._activation <span class="pl-k">=</span> activation <span class="pl-k">or</span> math_ops.tanh</td> </tr> <tr> <td id="L322" class="blob-num js-line-number" data-line-number="322"></td> <td id="LC322" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L323" class="blob-num js-line-number" data-line-number="323"></td> <td id="LC323" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L324" class="blob-num js-line-number" data-line-number="324"></td> <td id="LC324" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L325" class="blob-num js-line-number" data-line-number="325"></td> <td id="LC325" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L326" class="blob-num js-line-number" data-line-number="326"></td> <td id="LC326" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L327" class="blob-num js-line-number" data-line-number="327"></td> <td id="LC327" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L328" class="blob-num js-line-number" data-line-number="328"></td> <td id="LC328" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L329" class="blob-num js-line-number" data-line-number="329"></td> <td id="LC329" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L330" class="blob-num js-line-number" data-line-number="330"></td> <td id="LC330" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L331" class="blob-num js-line-number" data-line-number="331"></td> <td id="LC331" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">build</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs_shape</span>):</td> </tr> <tr> <td id="L332" class="blob-num js-line-number" data-line-number="332"></td> <td id="LC332" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> inputs_shape[<span class="pl-c1">1</span>].value <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L333" class="blob-num js-line-number" data-line-number="333"></td> <td id="LC333" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Expected inputs.shape[-1] to be known, saw shape: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L334" class="blob-num js-line-number" data-line-number="334"></td> <td id="LC334" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> inputs_shape)</td> </tr> <tr> <td id="L335" class="blob-num js-line-number" data-line-number="335"></td> <td id="LC335" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L336" class="blob-num js-line-number" data-line-number="336"></td> <td id="LC336" class="blob-code blob-code-inner js-file-line"> input_depth <span class="pl-k">=</span> inputs_shape[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L337" class="blob-num js-line-number" data-line-number="337"></td> <td id="LC337" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L338" class="blob-num js-line-number" data-line-number="338"></td> <td id="LC338" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L339" class="blob-num js-line-number" data-line-number="339"></td> <td id="LC339" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[input_depth <span class="pl-k">+</span> <span class="pl-c1">self</span>._num_units, <span class="pl-c1">self</span>._num_units])</td> </tr> <tr> <td id="L340" class="blob-num js-line-number" data-line-number="340"></td> <td id="LC340" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L341" class="blob-num js-line-number" data-line-number="341"></td> <td id="LC341" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_BIAS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L342" class="blob-num js-line-number" data-line-number="342"></td> <td id="LC342" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L343" class="blob-num js-line-number" data-line-number="343"></td> <td id="LC343" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span>init_ops.zeros_initializer(<span class="pl-v">dtype</span><span class="pl-k">=</span><span class="pl-c1">self</span>.dtype))</td> </tr> <tr> <td id="L344" class="blob-num js-line-number" data-line-number="344"></td> <td id="LC344" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L345" class="blob-num js-line-number" data-line-number="345"></td> <td id="LC345" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.built <span class="pl-k">=</span> <span class="pl-c1">True</span></td> </tr> <tr> <td id="L346" class="blob-num js-line-number" data-line-number="346"></td> <td id="LC346" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L347" class="blob-num js-line-number" data-line-number="347"></td> <td id="LC347" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">call</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>):</td> </tr> <tr> <td id="L348" class="blob-num js-line-number" data-line-number="348"></td> <td id="LC348" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Most basic RNN: output = new_state = act(W * input + U * state + B).<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L349" class="blob-num js-line-number" data-line-number="349"></td> <td id="LC349" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L350" class="blob-num js-line-number" data-line-number="350"></td> <td id="LC350" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> math_ops.matmul(</td> </tr> <tr> <td id="L351" class="blob-num js-line-number" data-line-number="351"></td> <td id="LC351" class="blob-code blob-code-inner js-file-line"> array_ops.concat([inputs, state], <span class="pl-c1">1</span>), <span class="pl-c1">self</span>._kernel)</td> </tr> <tr> <td id="L352" class="blob-num js-line-number" data-line-number="352"></td> <td id="LC352" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> nn_ops.bias_add(gate_inputs, <span class="pl-c1">self</span>._bias)</td> </tr> <tr> <td id="L353" class="blob-num js-line-number" data-line-number="353"></td> <td id="LC353" class="blob-code blob-code-inner js-file-line"> output <span class="pl-k">=</span> <span class="pl-c1">self</span>._activation(gate_inputs)</td> </tr> <tr> <td id="L354" class="blob-num js-line-number" data-line-number="354"></td> <td id="LC354" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> output, output</td> </tr> <tr> <td id="L355" class="blob-num js-line-number" data-line-number="355"></td> <td id="LC355" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L356" class="blob-num js-line-number" data-line-number="356"></td> <td id="LC356" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L357" class="blob-num js-line-number" data-line-number="357"></td> <td id="LC357" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.GRUCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L358" class="blob-num js-line-number" data-line-number="358"></td> <td id="LC358" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">GRUCell</span>(<span class="pl-e">_LayerRNNCell</span>):</td> </tr> <tr> <td id="L359" class="blob-num js-line-number" data-line-number="359"></td> <td id="LC359" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Gated Recurrent Unit cell (cf. http://arxiv.org/abs/1406.1078).</span></td> </tr> <tr> <td id="L360" class="blob-num js-line-number" data-line-number="360"></td> <td id="LC360" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L361" class="blob-num js-line-number" data-line-number="361"></td> <td id="LC361" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L362" class="blob-num js-line-number" data-line-number="362"></td> <td id="LC362" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_units: int, The number of units in the GRU cell.</span></td> </tr> <tr> <td id="L363" class="blob-num js-line-number" data-line-number="363"></td> <td id="LC363" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> activation: Nonlinearity to use. Default: `tanh`.</span></td> </tr> <tr> <td id="L364" class="blob-num js-line-number" data-line-number="364"></td> <td id="LC364" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> reuse: (optional) Python boolean describing whether to reuse variables</span></td> </tr> <tr> <td id="L365" class="blob-num js-line-number" data-line-number="365"></td> <td id="LC365" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> in an existing scope. If not `True`, and the existing scope already has</span></td> </tr> <tr> <td id="L366" class="blob-num js-line-number" data-line-number="366"></td> <td id="LC366" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the given variables, an error is raised.</span></td> </tr> <tr> <td id="L367" class="blob-num js-line-number" data-line-number="367"></td> <td id="LC367" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> kernel_initializer: (optional) The initializer to use for the weight and</span></td> </tr> <tr> <td id="L368" class="blob-num js-line-number" data-line-number="368"></td> <td id="LC368" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> projection matrices.</span></td> </tr> <tr> <td id="L369" class="blob-num js-line-number" data-line-number="369"></td> <td id="LC369" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> bias_initializer: (optional) The initializer to use for the bias.</span></td> </tr> <tr> <td id="L370" class="blob-num js-line-number" data-line-number="370"></td> <td id="LC370" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> name: String, the name of the layer. Layers with the same name will</span></td> </tr> <tr> <td id="L371" class="blob-num js-line-number" data-line-number="371"></td> <td id="LC371" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> share weights, but to avoid mistakes we require reuse=True in such</span></td> </tr> <tr> <td id="L372" class="blob-num js-line-number" data-line-number="372"></td> <td id="LC372" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cases.</span></td> </tr> <tr> <td id="L373" class="blob-num js-line-number" data-line-number="373"></td> <td id="LC373" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L374" class="blob-num js-line-number" data-line-number="374"></td> <td id="LC374" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L375" class="blob-num js-line-number" data-line-number="375"></td> <td id="LC375" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>,</td> </tr> <tr> <td id="L376" class="blob-num js-line-number" data-line-number="376"></td> <td id="LC376" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">num_units</span>,</td> </tr> <tr> <td id="L377" class="blob-num js-line-number" data-line-number="377"></td> <td id="LC377" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">activation</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L378" class="blob-num js-line-number" data-line-number="378"></td> <td id="LC378" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">reuse</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L379" class="blob-num js-line-number" data-line-number="379"></td> <td id="LC379" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">kernel_initializer</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L380" class="blob-num js-line-number" data-line-number="380"></td> <td id="LC380" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">bias_initializer</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L381" class="blob-num js-line-number" data-line-number="381"></td> <td id="LC381" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">name</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L382" class="blob-num js-line-number" data-line-number="382"></td> <td id="LC382" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">super</span>(GRUCell, <span class="pl-c1">self</span>).<span class="pl-c1">__init__</span>(<span class="pl-v">_reuse</span><span class="pl-k">=</span>reuse, <span class="pl-v">name</span><span class="pl-k">=</span>name)</td> </tr> <tr> <td id="L383" class="blob-num js-line-number" data-line-number="383"></td> <td id="LC383" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L384" class="blob-num js-line-number" data-line-number="384"></td> <td id="LC384" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Inputs must be 2-dimensional.</span></td> </tr> <tr> <td id="L385" class="blob-num js-line-number" data-line-number="385"></td> <td id="LC385" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.input_spec <span class="pl-k">=</span> base_layer.InputSpec(<span class="pl-v">ndim</span><span class="pl-k">=</span><span class="pl-c1">2</span>)</td> </tr> <tr> <td id="L386" class="blob-num js-line-number" data-line-number="386"></td> <td id="LC386" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L387" class="blob-num js-line-number" data-line-number="387"></td> <td id="LC387" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_units <span class="pl-k">=</span> num_units</td> </tr> <tr> <td id="L388" class="blob-num js-line-number" data-line-number="388"></td> <td id="LC388" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._activation <span class="pl-k">=</span> activation <span class="pl-k">or</span> math_ops.tanh</td> </tr> <tr> <td id="L389" class="blob-num js-line-number" data-line-number="389"></td> <td id="LC389" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._kernel_initializer <span class="pl-k">=</span> kernel_initializer</td> </tr> <tr> <td id="L390" class="blob-num js-line-number" data-line-number="390"></td> <td id="LC390" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias_initializer <span class="pl-k">=</span> bias_initializer</td> </tr> <tr> <td id="L391" class="blob-num js-line-number" data-line-number="391"></td> <td id="LC391" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L392" class="blob-num js-line-number" data-line-number="392"></td> <td id="LC392" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L393" class="blob-num js-line-number" data-line-number="393"></td> <td id="LC393" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L394" class="blob-num js-line-number" data-line-number="394"></td> <td id="LC394" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L395" class="blob-num js-line-number" data-line-number="395"></td> <td id="LC395" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L396" class="blob-num js-line-number" data-line-number="396"></td> <td id="LC396" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L397" class="blob-num js-line-number" data-line-number="397"></td> <td id="LC397" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L398" class="blob-num js-line-number" data-line-number="398"></td> <td id="LC398" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L399" class="blob-num js-line-number" data-line-number="399"></td> <td id="LC399" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L400" class="blob-num js-line-number" data-line-number="400"></td> <td id="LC400" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">build</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs_shape</span>):</td> </tr> <tr> <td id="L401" class="blob-num js-line-number" data-line-number="401"></td> <td id="LC401" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> inputs_shape[<span class="pl-c1">1</span>].value <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L402" class="blob-num js-line-number" data-line-number="402"></td> <td id="LC402" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Expected inputs.shape[-1] to be known, saw shape: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L403" class="blob-num js-line-number" data-line-number="403"></td> <td id="LC403" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> inputs_shape)</td> </tr> <tr> <td id="L404" class="blob-num js-line-number" data-line-number="404"></td> <td id="LC404" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L405" class="blob-num js-line-number" data-line-number="405"></td> <td id="LC405" class="blob-code blob-code-inner js-file-line"> input_depth <span class="pl-k">=</span> inputs_shape[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L406" class="blob-num js-line-number" data-line-number="406"></td> <td id="LC406" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._gate_kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L407" class="blob-num js-line-number" data-line-number="407"></td> <td id="LC407" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>gates/<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L408" class="blob-num js-line-number" data-line-number="408"></td> <td id="LC408" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[input_depth <span class="pl-k">+</span> <span class="pl-c1">self</span>._num_units, <span class="pl-c1">2</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L409" class="blob-num js-line-number" data-line-number="409"></td> <td id="LC409" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._kernel_initializer)</td> </tr> <tr> <td id="L410" class="blob-num js-line-number" data-line-number="410"></td> <td id="LC410" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._gate_bias <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L411" class="blob-num js-line-number" data-line-number="411"></td> <td id="LC411" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>gates/<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">_BIAS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L412" class="blob-num js-line-number" data-line-number="412"></td> <td id="LC412" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">2</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L413" class="blob-num js-line-number" data-line-number="413"></td> <td id="LC413" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span>(</td> </tr> <tr> <td id="L414" class="blob-num js-line-number" data-line-number="414"></td> <td id="LC414" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias_initializer</td> </tr> <tr> <td id="L415" class="blob-num js-line-number" data-line-number="415"></td> <td id="LC415" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._bias_initializer <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L416" class="blob-num js-line-number" data-line-number="416"></td> <td id="LC416" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> init_ops.constant_initializer(<span class="pl-c1">1.0</span>, <span class="pl-v">dtype</span><span class="pl-k">=</span><span class="pl-c1">self</span>.dtype)))</td> </tr> <tr> <td id="L417" class="blob-num js-line-number" data-line-number="417"></td> <td id="LC417" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._candidate_kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L418" class="blob-num js-line-number" data-line-number="418"></td> <td id="LC418" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>candidate/<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L419" class="blob-num js-line-number" data-line-number="419"></td> <td id="LC419" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[input_depth <span class="pl-k">+</span> <span class="pl-c1">self</span>._num_units, <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L420" class="blob-num js-line-number" data-line-number="420"></td> <td id="LC420" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._kernel_initializer)</td> </tr> <tr> <td id="L421" class="blob-num js-line-number" data-line-number="421"></td> <td id="LC421" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._candidate_bias <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L422" class="blob-num js-line-number" data-line-number="422"></td> <td id="LC422" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>candidate/<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">_BIAS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L423" class="blob-num js-line-number" data-line-number="423"></td> <td id="LC423" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L424" class="blob-num js-line-number" data-line-number="424"></td> <td id="LC424" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span>(</td> </tr> <tr> <td id="L425" class="blob-num js-line-number" data-line-number="425"></td> <td id="LC425" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias_initializer</td> </tr> <tr> <td id="L426" class="blob-num js-line-number" data-line-number="426"></td> <td id="LC426" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._bias_initializer <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L427" class="blob-num js-line-number" data-line-number="427"></td> <td id="LC427" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> init_ops.zeros_initializer(<span class="pl-v">dtype</span><span class="pl-k">=</span><span class="pl-c1">self</span>.dtype)))</td> </tr> <tr> <td id="L428" class="blob-num js-line-number" data-line-number="428"></td> <td id="LC428" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L429" class="blob-num js-line-number" data-line-number="429"></td> <td id="LC429" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.built <span class="pl-k">=</span> <span class="pl-c1">True</span></td> </tr> <tr> <td id="L430" class="blob-num js-line-number" data-line-number="430"></td> <td id="LC430" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L431" class="blob-num js-line-number" data-line-number="431"></td> <td id="LC431" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">call</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>):</td> </tr> <tr> <td id="L432" class="blob-num js-line-number" data-line-number="432"></td> <td id="LC432" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Gated recurrent unit (GRU) with nunits cells.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L433" class="blob-num js-line-number" data-line-number="433"></td> <td id="LC433" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L434" class="blob-num js-line-number" data-line-number="434"></td> <td id="LC434" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> math_ops.matmul(</td> </tr> <tr> <td id="L435" class="blob-num js-line-number" data-line-number="435"></td> <td id="LC435" class="blob-code blob-code-inner js-file-line"> array_ops.concat([inputs, state], <span class="pl-c1">1</span>), <span class="pl-c1">self</span>._gate_kernel)</td> </tr> <tr> <td id="L436" class="blob-num js-line-number" data-line-number="436"></td> <td id="LC436" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> nn_ops.bias_add(gate_inputs, <span class="pl-c1">self</span>._gate_bias)</td> </tr> <tr> <td id="L437" class="blob-num js-line-number" data-line-number="437"></td> <td id="LC437" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L438" class="blob-num js-line-number" data-line-number="438"></td> <td id="LC438" class="blob-code blob-code-inner js-file-line"> value <span class="pl-k">=</span> math_ops.sigmoid(gate_inputs)</td> </tr> <tr> <td id="L439" class="blob-num js-line-number" data-line-number="439"></td> <td id="LC439" class="blob-code blob-code-inner js-file-line"> r, u <span class="pl-k">=</span> array_ops.split(<span class="pl-v">value</span><span class="pl-k">=</span>value, <span class="pl-v">num_or_size_splits</span><span class="pl-k">=</span><span class="pl-c1">2</span>, <span class="pl-v">axis</span><span class="pl-k">=</span><span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L440" class="blob-num js-line-number" data-line-number="440"></td> <td id="LC440" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L441" class="blob-num js-line-number" data-line-number="441"></td> <td id="LC441" class="blob-code blob-code-inner js-file-line"> r_state <span class="pl-k">=</span> r <span class="pl-k">*</span> state</td> </tr> <tr> <td id="L442" class="blob-num js-line-number" data-line-number="442"></td> <td id="LC442" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L443" class="blob-num js-line-number" data-line-number="443"></td> <td id="LC443" class="blob-code blob-code-inner js-file-line"> candidate <span class="pl-k">=</span> math_ops.matmul(</td> </tr> <tr> <td id="L444" class="blob-num js-line-number" data-line-number="444"></td> <td id="LC444" class="blob-code blob-code-inner js-file-line"> array_ops.concat([inputs, r_state], <span class="pl-c1">1</span>), <span class="pl-c1">self</span>._candidate_kernel)</td> </tr> <tr> <td id="L445" class="blob-num js-line-number" data-line-number="445"></td> <td id="LC445" class="blob-code blob-code-inner js-file-line"> candidate <span class="pl-k">=</span> nn_ops.bias_add(candidate, <span class="pl-c1">self</span>._candidate_bias)</td> </tr> <tr> <td id="L446" class="blob-num js-line-number" data-line-number="446"></td> <td id="LC446" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L447" class="blob-num js-line-number" data-line-number="447"></td> <td id="LC447" class="blob-code blob-code-inner js-file-line"> c <span class="pl-k">=</span> <span class="pl-c1">self</span>._activation(candidate)</td> </tr> <tr> <td id="L448" class="blob-num js-line-number" data-line-number="448"></td> <td id="LC448" class="blob-code blob-code-inner js-file-line"> new_h <span class="pl-k">=</span> u <span class="pl-k">*</span> state <span class="pl-k">+</span> (<span class="pl-c1">1</span> <span class="pl-k">-</span> u) <span class="pl-k">*</span> c</td> </tr> <tr> <td id="L449" class="blob-num js-line-number" data-line-number="449"></td> <td id="LC449" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> new_h, new_h</td> </tr> <tr> <td id="L450" class="blob-num js-line-number" data-line-number="450"></td> <td id="LC450" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L451" class="blob-num js-line-number" data-line-number="451"></td> <td id="LC451" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L452" class="blob-num js-line-number" data-line-number="452"></td> <td id="LC452" class="blob-code blob-code-inner js-file-line">_LSTMStateTuple <span class="pl-k">=</span> collections.namedtuple(<span class="pl-s"><span class="pl-pds">&quot;</span>LSTMStateTuple<span class="pl-pds">&quot;</span></span>, (<span class="pl-s"><span class="pl-pds">&quot;</span>c<span class="pl-pds">&quot;</span></span>, <span class="pl-s"><span class="pl-pds">&quot;</span>h<span class="pl-pds">&quot;</span></span>))</td> </tr> <tr> <td id="L453" class="blob-num js-line-number" data-line-number="453"></td> <td id="LC453" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L454" class="blob-num js-line-number" data-line-number="454"></td> <td id="LC454" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L455" class="blob-num js-line-number" data-line-number="455"></td> <td id="LC455" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.LSTMStateTuple<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L456" class="blob-num js-line-number" data-line-number="456"></td> <td id="LC456" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">LSTMStateTuple</span>(<span class="pl-e">_LSTMStateTuple</span>):</td> </tr> <tr> <td id="L457" class="blob-num js-line-number" data-line-number="457"></td> <td id="LC457" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Tuple used by LSTM Cells for `state_size`, `zero_state`, and output state.</span></td> </tr> <tr> <td id="L458" class="blob-num js-line-number" data-line-number="458"></td> <td id="LC458" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L459" class="blob-num js-line-number" data-line-number="459"></td> <td id="LC459" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Stores two elements: `(c, h)`, in that order. Where `c` is the hidden state</span></td> </tr> <tr> <td id="L460" class="blob-num js-line-number" data-line-number="460"></td> <td id="LC460" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> and `h` is the output.</span></td> </tr> <tr> <td id="L461" class="blob-num js-line-number" data-line-number="461"></td> <td id="LC461" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L462" class="blob-num js-line-number" data-line-number="462"></td> <td id="LC462" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Only used when `state_is_tuple=True`.</span></td> </tr> <tr> <td id="L463" class="blob-num js-line-number" data-line-number="463"></td> <td id="LC463" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L464" class="blob-num js-line-number" data-line-number="464"></td> <td id="LC464" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">__slots__</span> <span class="pl-k">=</span> ()</td> </tr> <tr> <td id="L465" class="blob-num js-line-number" data-line-number="465"></td> <td id="LC465" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L466" class="blob-num js-line-number" data-line-number="466"></td> <td id="LC466" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L467" class="blob-num js-line-number" data-line-number="467"></td> <td id="LC467" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">dtype</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L468" class="blob-num js-line-number" data-line-number="468"></td> <td id="LC468" class="blob-code blob-code-inner js-file-line"> (c, h) <span class="pl-k">=</span> <span class="pl-c1">self</span></td> </tr> <tr> <td id="L469" class="blob-num js-line-number" data-line-number="469"></td> <td id="LC469" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> c.dtype <span class="pl-k">!=</span> h.dtype:</td> </tr> <tr> <td id="L470" class="blob-num js-line-number" data-line-number="470"></td> <td id="LC470" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">TypeError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Inconsistent internal state: <span class="pl-c1">%s</span> vs <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span></td> </tr> <tr> <td id="L471" class="blob-num js-line-number" data-line-number="471"></td> <td id="LC471" class="blob-code blob-code-inner js-file-line"> (<span class="pl-c1">str</span>(c.dtype), <span class="pl-c1">str</span>(h.dtype)))</td> </tr> <tr> <td id="L472" class="blob-num js-line-number" data-line-number="472"></td> <td id="LC472" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> c.dtype</td> </tr> <tr> <td id="L473" class="blob-num js-line-number" data-line-number="473"></td> <td id="LC473" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L474" class="blob-num js-line-number" data-line-number="474"></td> <td id="LC474" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L475" class="blob-num js-line-number" data-line-number="475"></td> <td id="LC475" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.BasicLSTMCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L476" class="blob-num js-line-number" data-line-number="476"></td> <td id="LC476" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">BasicLSTMCell</span>(<span class="pl-e">_LayerRNNCell</span>):</td> </tr> <tr> <td id="L477" class="blob-num js-line-number" data-line-number="477"></td> <td id="LC477" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Basic LSTM recurrent network cell.</span></td> </tr> <tr> <td id="L478" class="blob-num js-line-number" data-line-number="478"></td> <td id="LC478" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L479" class="blob-num js-line-number" data-line-number="479"></td> <td id="LC479" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> The implementation is based on: http://arxiv.org/abs/1409.2329.</span></td> </tr> <tr> <td id="L480" class="blob-num js-line-number" data-line-number="480"></td> <td id="LC480" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L481" class="blob-num js-line-number" data-line-number="481"></td> <td id="LC481" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> We add forget_bias (default: 1) to the biases of the forget gate in order to</span></td> </tr> <tr> <td id="L482" class="blob-num js-line-number" data-line-number="482"></td> <td id="LC482" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> reduce the scale of forgetting in the beginning of the training.</span></td> </tr> <tr> <td id="L483" class="blob-num js-line-number" data-line-number="483"></td> <td id="LC483" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L484" class="blob-num js-line-number" data-line-number="484"></td> <td id="LC484" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> It does not allow cell clipping, a projection layer, and does not</span></td> </tr> <tr> <td id="L485" class="blob-num js-line-number" data-line-number="485"></td> <td id="LC485" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> use peep-hole connections: it is the basic baseline.</span></td> </tr> <tr> <td id="L486" class="blob-num js-line-number" data-line-number="486"></td> <td id="LC486" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L487" class="blob-num js-line-number" data-line-number="487"></td> <td id="LC487" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> For advanced models, please use the full @{tf.nn.rnn_cell.LSTMCell}</span></td> </tr> <tr> <td id="L488" class="blob-num js-line-number" data-line-number="488"></td> <td id="LC488" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> that follows.</span></td> </tr> <tr> <td id="L489" class="blob-num js-line-number" data-line-number="489"></td> <td id="LC489" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L490" class="blob-num js-line-number" data-line-number="490"></td> <td id="LC490" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L491" class="blob-num js-line-number" data-line-number="491"></td> <td id="LC491" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">num_units</span>, <span class="pl-smi">forget_bias</span><span class="pl-k">=</span><span class="pl-c1">1.0</span>,</td> </tr> <tr> <td id="L492" class="blob-num js-line-number" data-line-number="492"></td> <td id="LC492" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">state_is_tuple</span><span class="pl-k">=</span><span class="pl-c1">True</span>, <span class="pl-smi">activation</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">reuse</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">name</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L493" class="blob-num js-line-number" data-line-number="493"></td> <td id="LC493" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Initialize the basic LSTM cell.</span></td> </tr> <tr> <td id="L494" class="blob-num js-line-number" data-line-number="494"></td> <td id="LC494" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L495" class="blob-num js-line-number" data-line-number="495"></td> <td id="LC495" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L496" class="blob-num js-line-number" data-line-number="496"></td> <td id="LC496" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_units: int, The number of units in the LSTM cell.</span></td> </tr> <tr> <td id="L497" class="blob-num js-line-number" data-line-number="497"></td> <td id="LC497" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> forget_bias: float, The bias added to forget gates (see above).</span></td> </tr> <tr> <td id="L498" class="blob-num js-line-number" data-line-number="498"></td> <td id="LC498" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Must set to `0.0` manually when restoring from CudnnLSTM-trained</span></td> </tr> <tr> <td id="L499" class="blob-num js-line-number" data-line-number="499"></td> <td id="LC499" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> checkpoints.</span></td> </tr> <tr> <td id="L500" class="blob-num js-line-number" data-line-number="500"></td> <td id="LC500" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state_is_tuple: If True, accepted and returned states are 2-tuples of</span></td> </tr> <tr> <td id="L501" class="blob-num js-line-number" data-line-number="501"></td> <td id="LC501" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the `c_state` and `m_state`. If False, they are concatenated</span></td> </tr> <tr> <td id="L502" class="blob-num js-line-number" data-line-number="502"></td> <td id="LC502" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> along the column axis. The latter behavior will soon be deprecated.</span></td> </tr> <tr> <td id="L503" class="blob-num js-line-number" data-line-number="503"></td> <td id="LC503" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> activation: Activation function of the inner states. Default: `tanh`.</span></td> </tr> <tr> <td id="L504" class="blob-num js-line-number" data-line-number="504"></td> <td id="LC504" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> reuse: (optional) Python boolean describing whether to reuse variables</span></td> </tr> <tr> <td id="L505" class="blob-num js-line-number" data-line-number="505"></td> <td id="LC505" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> in an existing scope. If not `True`, and the existing scope already has</span></td> </tr> <tr> <td id="L506" class="blob-num js-line-number" data-line-number="506"></td> <td id="LC506" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the given variables, an error is raised.</span></td> </tr> <tr> <td id="L507" class="blob-num js-line-number" data-line-number="507"></td> <td id="LC507" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> name: String, the name of the layer. Layers with the same name will</span></td> </tr> <tr> <td id="L508" class="blob-num js-line-number" data-line-number="508"></td> <td id="LC508" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> share weights, but to avoid mistakes we require reuse=True in such</span></td> </tr> <tr> <td id="L509" class="blob-num js-line-number" data-line-number="509"></td> <td id="LC509" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cases.</span></td> </tr> <tr> <td id="L510" class="blob-num js-line-number" data-line-number="510"></td> <td id="LC510" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L511" class="blob-num js-line-number" data-line-number="511"></td> <td id="LC511" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> When restoring from CudnnLSTM-trained checkpoints, must use</span></td> </tr> <tr> <td id="L512" class="blob-num js-line-number" data-line-number="512"></td> <td id="LC512" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `CudnnCompatibleLSTMCell` instead.</span></td> </tr> <tr> <td id="L513" class="blob-num js-line-number" data-line-number="513"></td> <td id="LC513" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L514" class="blob-num js-line-number" data-line-number="514"></td> <td id="LC514" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">super</span>(BasicLSTMCell, <span class="pl-c1">self</span>).<span class="pl-c1">__init__</span>(<span class="pl-v">_reuse</span><span class="pl-k">=</span>reuse, <span class="pl-v">name</span><span class="pl-k">=</span>name)</td> </tr> <tr> <td id="L515" class="blob-num js-line-number" data-line-number="515"></td> <td id="LC515" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> state_is_tuple:</td> </tr> <tr> <td id="L516" class="blob-num js-line-number" data-line-number="516"></td> <td id="LC516" class="blob-code blob-code-inner js-file-line"> logging.warn(<span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span>: Using a concatenated state is slower and will soon be <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L517" class="blob-num js-line-number" data-line-number="517"></td> <td id="LC517" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>deprecated. Use state_is_tuple=True.<span class="pl-pds">&quot;</span></span>, <span class="pl-c1">self</span>)</td> </tr> <tr> <td id="L518" class="blob-num js-line-number" data-line-number="518"></td> <td id="LC518" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L519" class="blob-num js-line-number" data-line-number="519"></td> <td id="LC519" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Inputs must be 2-dimensional.</span></td> </tr> <tr> <td id="L520" class="blob-num js-line-number" data-line-number="520"></td> <td id="LC520" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.input_spec <span class="pl-k">=</span> base_layer.InputSpec(<span class="pl-v">ndim</span><span class="pl-k">=</span><span class="pl-c1">2</span>)</td> </tr> <tr> <td id="L521" class="blob-num js-line-number" data-line-number="521"></td> <td id="LC521" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L522" class="blob-num js-line-number" data-line-number="522"></td> <td id="LC522" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_units <span class="pl-k">=</span> num_units</td> </tr> <tr> <td id="L523" class="blob-num js-line-number" data-line-number="523"></td> <td id="LC523" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._forget_bias <span class="pl-k">=</span> forget_bias</td> </tr> <tr> <td id="L524" class="blob-num js-line-number" data-line-number="524"></td> <td id="LC524" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">=</span> state_is_tuple</td> </tr> <tr> <td id="L525" class="blob-num js-line-number" data-line-number="525"></td> <td id="LC525" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._activation <span class="pl-k">=</span> activation <span class="pl-k">or</span> math_ops.tanh</td> </tr> <tr> <td id="L526" class="blob-num js-line-number" data-line-number="526"></td> <td id="LC526" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L527" class="blob-num js-line-number" data-line-number="527"></td> <td id="LC527" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L528" class="blob-num js-line-number" data-line-number="528"></td> <td id="LC528" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L529" class="blob-num js-line-number" data-line-number="529"></td> <td id="LC529" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (LSTMStateTuple(<span class="pl-c1">self</span>._num_units, <span class="pl-c1">self</span>._num_units)</td> </tr> <tr> <td id="L530" class="blob-num js-line-number" data-line-number="530"></td> <td id="LC530" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">else</span> <span class="pl-c1">2</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units)</td> </tr> <tr> <td id="L531" class="blob-num js-line-number" data-line-number="531"></td> <td id="LC531" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L532" class="blob-num js-line-number" data-line-number="532"></td> <td id="LC532" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L533" class="blob-num js-line-number" data-line-number="533"></td> <td id="LC533" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L534" class="blob-num js-line-number" data-line-number="534"></td> <td id="LC534" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L535" class="blob-num js-line-number" data-line-number="535"></td> <td id="LC535" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L536" class="blob-num js-line-number" data-line-number="536"></td> <td id="LC536" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">build</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs_shape</span>):</td> </tr> <tr> <td id="L537" class="blob-num js-line-number" data-line-number="537"></td> <td id="LC537" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> inputs_shape[<span class="pl-c1">1</span>].value <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L538" class="blob-num js-line-number" data-line-number="538"></td> <td id="LC538" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Expected inputs.shape[-1] to be known, saw shape: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L539" class="blob-num js-line-number" data-line-number="539"></td> <td id="LC539" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> inputs_shape)</td> </tr> <tr> <td id="L540" class="blob-num js-line-number" data-line-number="540"></td> <td id="LC540" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L541" class="blob-num js-line-number" data-line-number="541"></td> <td id="LC541" class="blob-code blob-code-inner js-file-line"> input_depth <span class="pl-k">=</span> inputs_shape[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L542" class="blob-num js-line-number" data-line-number="542"></td> <td id="LC542" class="blob-code blob-code-inner js-file-line"> h_depth <span class="pl-k">=</span> <span class="pl-c1">self</span>._num_units</td> </tr> <tr> <td id="L543" class="blob-num js-line-number" data-line-number="543"></td> <td id="LC543" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L544" class="blob-num js-line-number" data-line-number="544"></td> <td id="LC544" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L545" class="blob-num js-line-number" data-line-number="545"></td> <td id="LC545" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[input_depth <span class="pl-k">+</span> h_depth, <span class="pl-c1">4</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units])</td> </tr> <tr> <td id="L546" class="blob-num js-line-number" data-line-number="546"></td> <td id="LC546" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L547" class="blob-num js-line-number" data-line-number="547"></td> <td id="LC547" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_BIAS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L548" class="blob-num js-line-number" data-line-number="548"></td> <td id="LC548" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">4</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L549" class="blob-num js-line-number" data-line-number="549"></td> <td id="LC549" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span>init_ops.zeros_initializer(<span class="pl-v">dtype</span><span class="pl-k">=</span><span class="pl-c1">self</span>.dtype))</td> </tr> <tr> <td id="L550" class="blob-num js-line-number" data-line-number="550"></td> <td id="LC550" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L551" class="blob-num js-line-number" data-line-number="551"></td> <td id="LC551" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.built <span class="pl-k">=</span> <span class="pl-c1">True</span></td> </tr> <tr> <td id="L552" class="blob-num js-line-number" data-line-number="552"></td> <td id="LC552" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L553" class="blob-num js-line-number" data-line-number="553"></td> <td id="LC553" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">call</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>):</td> </tr> <tr> <td id="L554" class="blob-num js-line-number" data-line-number="554"></td> <td id="LC554" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Long short-term memory cell (LSTM).</span></td> </tr> <tr> <td id="L555" class="blob-num js-line-number" data-line-number="555"></td> <td id="LC555" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L556" class="blob-num js-line-number" data-line-number="556"></td> <td id="LC556" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L557" class="blob-num js-line-number" data-line-number="557"></td> <td id="LC557" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> inputs: `2-D` tensor with shape `[batch_size, input_size]`.</span></td> </tr> <tr> <td id="L558" class="blob-num js-line-number" data-line-number="558"></td> <td id="LC558" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state: An `LSTMStateTuple` of state tensors, each shaped</span></td> </tr> <tr> <td id="L559" class="blob-num js-line-number" data-line-number="559"></td> <td id="LC559" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `[batch_size, self.state_size]`, if `state_is_tuple` has been set to</span></td> </tr> <tr> <td id="L560" class="blob-num js-line-number" data-line-number="560"></td> <td id="LC560" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `True`. Otherwise, a `Tensor` shaped</span></td> </tr> <tr> <td id="L561" class="blob-num js-line-number" data-line-number="561"></td> <td id="LC561" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `[batch_size, 2 * self.state_size]`.</span></td> </tr> <tr> <td id="L562" class="blob-num js-line-number" data-line-number="562"></td> <td id="LC562" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L563" class="blob-num js-line-number" data-line-number="563"></td> <td id="LC563" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L564" class="blob-num js-line-number" data-line-number="564"></td> <td id="LC564" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> A pair containing the new hidden state, and the new state (either a</span></td> </tr> <tr> <td id="L565" class="blob-num js-line-number" data-line-number="565"></td> <td id="LC565" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `LSTMStateTuple` or a concatenated state, depending on</span></td> </tr> <tr> <td id="L566" class="blob-num js-line-number" data-line-number="566"></td> <td id="LC566" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `state_is_tuple`).</span></td> </tr> <tr> <td id="L567" class="blob-num js-line-number" data-line-number="567"></td> <td id="LC567" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L568" class="blob-num js-line-number" data-line-number="568"></td> <td id="LC568" class="blob-code blob-code-inner js-file-line"> sigmoid <span class="pl-k">=</span> math_ops.sigmoid</td> </tr> <tr> <td id="L569" class="blob-num js-line-number" data-line-number="569"></td> <td id="LC569" class="blob-code blob-code-inner js-file-line"> one <span class="pl-k">=</span> constant_op.constant(<span class="pl-c1">1</span>, <span class="pl-v">dtype</span><span class="pl-k">=</span>dtypes.int32)</td> </tr> <tr> <td id="L570" class="blob-num js-line-number" data-line-number="570"></td> <td id="LC570" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Parameters of gates are concatenated into one multiply for efficiency.</span></td> </tr> <tr> <td id="L571" class="blob-num js-line-number" data-line-number="571"></td> <td id="LC571" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L572" class="blob-num js-line-number" data-line-number="572"></td> <td id="LC572" class="blob-code blob-code-inner js-file-line"> c, h <span class="pl-k">=</span> state</td> </tr> <tr> <td id="L573" class="blob-num js-line-number" data-line-number="573"></td> <td id="LC573" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L574" class="blob-num js-line-number" data-line-number="574"></td> <td id="LC574" class="blob-code blob-code-inner js-file-line"> c, h <span class="pl-k">=</span> array_ops.split(<span class="pl-v">value</span><span class="pl-k">=</span>state, <span class="pl-v">num_or_size_splits</span><span class="pl-k">=</span><span class="pl-c1">2</span>, <span class="pl-v">axis</span><span class="pl-k">=</span>one)</td> </tr> <tr> <td id="L575" class="blob-num js-line-number" data-line-number="575"></td> <td id="LC575" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L576" class="blob-num js-line-number" data-line-number="576"></td> <td id="LC576" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> math_ops.matmul(</td> </tr> <tr> <td id="L577" class="blob-num js-line-number" data-line-number="577"></td> <td id="LC577" class="blob-code blob-code-inner js-file-line"> array_ops.concat([inputs, h], <span class="pl-c1">1</span>), <span class="pl-c1">self</span>._kernel)</td> </tr> <tr> <td id="L578" class="blob-num js-line-number" data-line-number="578"></td> <td id="LC578" class="blob-code blob-code-inner js-file-line"> gate_inputs <span class="pl-k">=</span> nn_ops.bias_add(gate_inputs, <span class="pl-c1">self</span>._bias)</td> </tr> <tr> <td id="L579" class="blob-num js-line-number" data-line-number="579"></td> <td id="LC579" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L580" class="blob-num js-line-number" data-line-number="580"></td> <td id="LC580" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> i = input_gate, j = new_input, f = forget_gate, o = output_gate</span></td> </tr> <tr> <td id="L581" class="blob-num js-line-number" data-line-number="581"></td> <td id="LC581" class="blob-code blob-code-inner js-file-line"> i, j, f, o <span class="pl-k">=</span> array_ops.split(</td> </tr> <tr> <td id="L582" class="blob-num js-line-number" data-line-number="582"></td> <td id="LC582" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">value</span><span class="pl-k">=</span>gate_inputs, <span class="pl-v">num_or_size_splits</span><span class="pl-k">=</span><span class="pl-c1">4</span>, <span class="pl-v">axis</span><span class="pl-k">=</span>one)</td> </tr> <tr> <td id="L583" class="blob-num js-line-number" data-line-number="583"></td> <td id="LC583" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L584" class="blob-num js-line-number" data-line-number="584"></td> <td id="LC584" class="blob-code blob-code-inner js-file-line"> forget_bias_tensor <span class="pl-k">=</span> constant_op.constant(<span class="pl-c1">self</span>._forget_bias, <span class="pl-v">dtype</span><span class="pl-k">=</span>f.dtype)</td> </tr> <tr> <td id="L585" class="blob-num js-line-number" data-line-number="585"></td> <td id="LC585" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Note that using `add` and `multiply` instead of `+` and `*` gives a</span></td> </tr> <tr> <td id="L586" class="blob-num js-line-number" data-line-number="586"></td> <td id="LC586" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> performance improvement. So using those at the cost of readability.</span></td> </tr> <tr> <td id="L587" class="blob-num js-line-number" data-line-number="587"></td> <td id="LC587" class="blob-code blob-code-inner js-file-line"> add <span class="pl-k">=</span> math_ops.add</td> </tr> <tr> <td id="L588" class="blob-num js-line-number" data-line-number="588"></td> <td id="LC588" class="blob-code blob-code-inner js-file-line"> multiply <span class="pl-k">=</span> math_ops.multiply</td> </tr> <tr> <td id="L589" class="blob-num js-line-number" data-line-number="589"></td> <td id="LC589" class="blob-code blob-code-inner js-file-line"> new_c <span class="pl-k">=</span> add(multiply(c, sigmoid(add(f, forget_bias_tensor))),</td> </tr> <tr> <td id="L590" class="blob-num js-line-number" data-line-number="590"></td> <td id="LC590" class="blob-code blob-code-inner js-file-line"> multiply(sigmoid(i), <span class="pl-c1">self</span>._activation(j)))</td> </tr> <tr> <td id="L591" class="blob-num js-line-number" data-line-number="591"></td> <td id="LC591" class="blob-code blob-code-inner js-file-line"> new_h <span class="pl-k">=</span> multiply(<span class="pl-c1">self</span>._activation(new_c), sigmoid(o))</td> </tr> <tr> <td id="L592" class="blob-num js-line-number" data-line-number="592"></td> <td id="LC592" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L593" class="blob-num js-line-number" data-line-number="593"></td> <td id="LC593" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L594" class="blob-num js-line-number" data-line-number="594"></td> <td id="LC594" class="blob-code blob-code-inner js-file-line"> new_state <span class="pl-k">=</span> LSTMStateTuple(new_c, new_h)</td> </tr> <tr> <td id="L595" class="blob-num js-line-number" data-line-number="595"></td> <td id="LC595" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L596" class="blob-num js-line-number" data-line-number="596"></td> <td id="LC596" class="blob-code blob-code-inner js-file-line"> new_state <span class="pl-k">=</span> array_ops.concat([new_c, new_h], <span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L597" class="blob-num js-line-number" data-line-number="597"></td> <td id="LC597" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> new_h, new_state</td> </tr> <tr> <td id="L598" class="blob-num js-line-number" data-line-number="598"></td> <td id="LC598" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L599" class="blob-num js-line-number" data-line-number="599"></td> <td id="LC599" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L600" class="blob-num js-line-number" data-line-number="600"></td> <td id="LC600" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.LSTMCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L601" class="blob-num js-line-number" data-line-number="601"></td> <td id="LC601" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">LSTMCell</span>(<span class="pl-e">_LayerRNNCell</span>):</td> </tr> <tr> <td id="L602" class="blob-num js-line-number" data-line-number="602"></td> <td id="LC602" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Long short-term memory unit (LSTM) recurrent network cell.</span></td> </tr> <tr> <td id="L603" class="blob-num js-line-number" data-line-number="603"></td> <td id="LC603" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L604" class="blob-num js-line-number" data-line-number="604"></td> <td id="LC604" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> The default non-peephole implementation is based on:</span></td> </tr> <tr> <td id="L605" class="blob-num js-line-number" data-line-number="605"></td> <td id="LC605" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L606" class="blob-num js-line-number" data-line-number="606"></td> <td id="LC606" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> http://www.bioinf.jku.at/publications/older/2604.pdf</span></td> </tr> <tr> <td id="L607" class="blob-num js-line-number" data-line-number="607"></td> <td id="LC607" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L608" class="blob-num js-line-number" data-line-number="608"></td> <td id="LC608" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> S. Hochreiter and J. Schmidhuber.</span></td> </tr> <tr> <td id="L609" class="blob-num js-line-number" data-line-number="609"></td> <td id="LC609" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> &quot;Long Short-Term Memory&quot;. Neural Computation, 9(8):1735-1780, 1997.</span></td> </tr> <tr> <td id="L610" class="blob-num js-line-number" data-line-number="610"></td> <td id="LC610" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L611" class="blob-num js-line-number" data-line-number="611"></td> <td id="LC611" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> The peephole implementation is based on:</span></td> </tr> <tr> <td id="L612" class="blob-num js-line-number" data-line-number="612"></td> <td id="LC612" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L613" class="blob-num js-line-number" data-line-number="613"></td> <td id="LC613" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> https://research.google.com/pubs/archive/43905.pdf</span></td> </tr> <tr> <td id="L614" class="blob-num js-line-number" data-line-number="614"></td> <td id="LC614" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L615" class="blob-num js-line-number" data-line-number="615"></td> <td id="LC615" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Hasim Sak, Andrew Senior, and Francoise Beaufays.</span></td> </tr> <tr> <td id="L616" class="blob-num js-line-number" data-line-number="616"></td> <td id="LC616" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> &quot;Long short-term memory recurrent neural network architectures for</span></td> </tr> <tr> <td id="L617" class="blob-num js-line-number" data-line-number="617"></td> <td id="LC617" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> large scale acoustic modeling.&quot; INTERSPEECH, 2014.</span></td> </tr> <tr> <td id="L618" class="blob-num js-line-number" data-line-number="618"></td> <td id="LC618" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L619" class="blob-num js-line-number" data-line-number="619"></td> <td id="LC619" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> The class uses optional peep-hole connections, optional cell clipping, and</span></td> </tr> <tr> <td id="L620" class="blob-num js-line-number" data-line-number="620"></td> <td id="LC620" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> an optional projection layer.</span></td> </tr> <tr> <td id="L621" class="blob-num js-line-number" data-line-number="621"></td> <td id="LC621" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L622" class="blob-num js-line-number" data-line-number="622"></td> <td id="LC622" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L623" class="blob-num js-line-number" data-line-number="623"></td> <td id="LC623" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">num_units</span>,</td> </tr> <tr> <td id="L624" class="blob-num js-line-number" data-line-number="624"></td> <td id="LC624" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">use_peepholes</span><span class="pl-k">=</span><span class="pl-c1">False</span>, <span class="pl-smi">cell_clip</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L625" class="blob-num js-line-number" data-line-number="625"></td> <td id="LC625" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">initializer</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">num_proj</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">proj_clip</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L626" class="blob-num js-line-number" data-line-number="626"></td> <td id="LC626" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">num_unit_shards</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">num_proj_shards</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L627" class="blob-num js-line-number" data-line-number="627"></td> <td id="LC627" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">forget_bias</span><span class="pl-k">=</span><span class="pl-c1">1.0</span>, <span class="pl-smi">state_is_tuple</span><span class="pl-k">=</span><span class="pl-c1">True</span>,</td> </tr> <tr> <td id="L628" class="blob-num js-line-number" data-line-number="628"></td> <td id="LC628" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">activation</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">reuse</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">name</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L629" class="blob-num js-line-number" data-line-number="629"></td> <td id="LC629" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Initialize the parameters for an LSTM cell.</span></td> </tr> <tr> <td id="L630" class="blob-num js-line-number" data-line-number="630"></td> <td id="LC630" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L631" class="blob-num js-line-number" data-line-number="631"></td> <td id="LC631" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L632" class="blob-num js-line-number" data-line-number="632"></td> <td id="LC632" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_units: int, The number of units in the LSTM cell.</span></td> </tr> <tr> <td id="L633" class="blob-num js-line-number" data-line-number="633"></td> <td id="LC633" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> use_peepholes: bool, set True to enable diagonal/peephole connections.</span></td> </tr> <tr> <td id="L634" class="blob-num js-line-number" data-line-number="634"></td> <td id="LC634" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cell_clip: (optional) A float value, if provided the cell state is clipped</span></td> </tr> <tr> <td id="L635" class="blob-num js-line-number" data-line-number="635"></td> <td id="LC635" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> by this value prior to the cell output activation.</span></td> </tr> <tr> <td id="L636" class="blob-num js-line-number" data-line-number="636"></td> <td id="LC636" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> initializer: (optional) The initializer to use for the weight and</span></td> </tr> <tr> <td id="L637" class="blob-num js-line-number" data-line-number="637"></td> <td id="LC637" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> projection matrices.</span></td> </tr> <tr> <td id="L638" class="blob-num js-line-number" data-line-number="638"></td> <td id="LC638" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_proj: (optional) int, The output dimensionality for the projection</span></td> </tr> <tr> <td id="L639" class="blob-num js-line-number" data-line-number="639"></td> <td id="LC639" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> matrices. If None, no projection is performed.</span></td> </tr> <tr> <td id="L640" class="blob-num js-line-number" data-line-number="640"></td> <td id="LC640" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> proj_clip: (optional) A float value. If `num_proj &gt; 0` and `proj_clip` is</span></td> </tr> <tr> <td id="L641" class="blob-num js-line-number" data-line-number="641"></td> <td id="LC641" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> provided, then the projected values are clipped elementwise to within</span></td> </tr> <tr> <td id="L642" class="blob-num js-line-number" data-line-number="642"></td> <td id="LC642" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `[-proj_clip, proj_clip]`.</span></td> </tr> <tr> <td id="L643" class="blob-num js-line-number" data-line-number="643"></td> <td id="LC643" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_unit_shards: Deprecated, will be removed by Jan. 2017.</span></td> </tr> <tr> <td id="L644" class="blob-num js-line-number" data-line-number="644"></td> <td id="LC644" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Use a variable_scope partitioner instead.</span></td> </tr> <tr> <td id="L645" class="blob-num js-line-number" data-line-number="645"></td> <td id="LC645" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_proj_shards: Deprecated, will be removed by Jan. 2017.</span></td> </tr> <tr> <td id="L646" class="blob-num js-line-number" data-line-number="646"></td> <td id="LC646" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Use a variable_scope partitioner instead.</span></td> </tr> <tr> <td id="L647" class="blob-num js-line-number" data-line-number="647"></td> <td id="LC647" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> forget_bias: Biases of the forget gate are initialized by default to 1</span></td> </tr> <tr> <td id="L648" class="blob-num js-line-number" data-line-number="648"></td> <td id="LC648" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> in order to reduce the scale of forgetting at the beginning of</span></td> </tr> <tr> <td id="L649" class="blob-num js-line-number" data-line-number="649"></td> <td id="LC649" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the training. Must set it manually to `0.0` when restoring from</span></td> </tr> <tr> <td id="L650" class="blob-num js-line-number" data-line-number="650"></td> <td id="LC650" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> CudnnLSTM trained checkpoints.</span></td> </tr> <tr> <td id="L651" class="blob-num js-line-number" data-line-number="651"></td> <td id="LC651" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state_is_tuple: If True, accepted and returned states are 2-tuples of</span></td> </tr> <tr> <td id="L652" class="blob-num js-line-number" data-line-number="652"></td> <td id="LC652" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the `c_state` and `m_state`. If False, they are concatenated</span></td> </tr> <tr> <td id="L653" class="blob-num js-line-number" data-line-number="653"></td> <td id="LC653" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> along the column axis. This latter behavior will soon be deprecated.</span></td> </tr> <tr> <td id="L654" class="blob-num js-line-number" data-line-number="654"></td> <td id="LC654" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> activation: Activation function of the inner states. Default: `tanh`.</span></td> </tr> <tr> <td id="L655" class="blob-num js-line-number" data-line-number="655"></td> <td id="LC655" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> reuse: (optional) Python boolean describing whether to reuse variables</span></td> </tr> <tr> <td id="L656" class="blob-num js-line-number" data-line-number="656"></td> <td id="LC656" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> in an existing scope. If not `True`, and the existing scope already has</span></td> </tr> <tr> <td id="L657" class="blob-num js-line-number" data-line-number="657"></td> <td id="LC657" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the given variables, an error is raised.</span></td> </tr> <tr> <td id="L658" class="blob-num js-line-number" data-line-number="658"></td> <td id="LC658" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> name: String, the name of the layer. Layers with the same name will</span></td> </tr> <tr> <td id="L659" class="blob-num js-line-number" data-line-number="659"></td> <td id="LC659" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> share weights, but to avoid mistakes we require reuse=True in such</span></td> </tr> <tr> <td id="L660" class="blob-num js-line-number" data-line-number="660"></td> <td id="LC660" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cases.</span></td> </tr> <tr> <td id="L661" class="blob-num js-line-number" data-line-number="661"></td> <td id="LC661" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L662" class="blob-num js-line-number" data-line-number="662"></td> <td id="LC662" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> When restoring from CudnnLSTM-trained checkpoints, use</span></td> </tr> <tr> <td id="L663" class="blob-num js-line-number" data-line-number="663"></td> <td id="LC663" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `CudnnCompatibleLSTMCell` instead.</span></td> </tr> <tr> <td id="L664" class="blob-num js-line-number" data-line-number="664"></td> <td id="LC664" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L665" class="blob-num js-line-number" data-line-number="665"></td> <td id="LC665" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">super</span>(LSTMCell, <span class="pl-c1">self</span>).<span class="pl-c1">__init__</span>(<span class="pl-v">_reuse</span><span class="pl-k">=</span>reuse, <span class="pl-v">name</span><span class="pl-k">=</span>name)</td> </tr> <tr> <td id="L666" class="blob-num js-line-number" data-line-number="666"></td> <td id="LC666" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> state_is_tuple:</td> </tr> <tr> <td id="L667" class="blob-num js-line-number" data-line-number="667"></td> <td id="LC667" class="blob-code blob-code-inner js-file-line"> logging.warn(<span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span>: Using a concatenated state is slower and will soon be <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L668" class="blob-num js-line-number" data-line-number="668"></td> <td id="LC668" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>deprecated. Use state_is_tuple=True.<span class="pl-pds">&quot;</span></span>, <span class="pl-c1">self</span>)</td> </tr> <tr> <td id="L669" class="blob-num js-line-number" data-line-number="669"></td> <td id="LC669" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> num_unit_shards <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> <span class="pl-k">or</span> num_proj_shards <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L670" class="blob-num js-line-number" data-line-number="670"></td> <td id="LC670" class="blob-code blob-code-inner js-file-line"> logging.warn(</td> </tr> <tr> <td id="L671" class="blob-num js-line-number" data-line-number="671"></td> <td id="LC671" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span>: The num_unit_shards and proj_unit_shards parameters are <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L672" class="blob-num js-line-number" data-line-number="672"></td> <td id="LC672" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>deprecated and will be removed in Jan 2017. <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L673" class="blob-num js-line-number" data-line-number="673"></td> <td id="LC673" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>Use a variable scope with a partitioner instead.<span class="pl-pds">&quot;</span></span>, <span class="pl-c1">self</span>)</td> </tr> <tr> <td id="L674" class="blob-num js-line-number" data-line-number="674"></td> <td id="LC674" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L675" class="blob-num js-line-number" data-line-number="675"></td> <td id="LC675" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Inputs must be 2-dimensional.</span></td> </tr> <tr> <td id="L676" class="blob-num js-line-number" data-line-number="676"></td> <td id="LC676" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.input_spec <span class="pl-k">=</span> base_layer.InputSpec(<span class="pl-v">ndim</span><span class="pl-k">=</span><span class="pl-c1">2</span>)</td> </tr> <tr> <td id="L677" class="blob-num js-line-number" data-line-number="677"></td> <td id="LC677" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L678" class="blob-num js-line-number" data-line-number="678"></td> <td id="LC678" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_units <span class="pl-k">=</span> num_units</td> </tr> <tr> <td id="L679" class="blob-num js-line-number" data-line-number="679"></td> <td id="LC679" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._use_peepholes <span class="pl-k">=</span> use_peepholes</td> </tr> <tr> <td id="L680" class="blob-num js-line-number" data-line-number="680"></td> <td id="LC680" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell_clip <span class="pl-k">=</span> cell_clip</td> </tr> <tr> <td id="L681" class="blob-num js-line-number" data-line-number="681"></td> <td id="LC681" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._initializer <span class="pl-k">=</span> initializer</td> </tr> <tr> <td id="L682" class="blob-num js-line-number" data-line-number="682"></td> <td id="LC682" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_proj <span class="pl-k">=</span> num_proj</td> </tr> <tr> <td id="L683" class="blob-num js-line-number" data-line-number="683"></td> <td id="LC683" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._proj_clip <span class="pl-k">=</span> proj_clip</td> </tr> <tr> <td id="L684" class="blob-num js-line-number" data-line-number="684"></td> <td id="LC684" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_unit_shards <span class="pl-k">=</span> num_unit_shards</td> </tr> <tr> <td id="L685" class="blob-num js-line-number" data-line-number="685"></td> <td id="LC685" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._num_proj_shards <span class="pl-k">=</span> num_proj_shards</td> </tr> <tr> <td id="L686" class="blob-num js-line-number" data-line-number="686"></td> <td id="LC686" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._forget_bias <span class="pl-k">=</span> forget_bias</td> </tr> <tr> <td id="L687" class="blob-num js-line-number" data-line-number="687"></td> <td id="LC687" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">=</span> state_is_tuple</td> </tr> <tr> <td id="L688" class="blob-num js-line-number" data-line-number="688"></td> <td id="LC688" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._activation <span class="pl-k">=</span> activation <span class="pl-k">or</span> math_ops.tanh</td> </tr> <tr> <td id="L689" class="blob-num js-line-number" data-line-number="689"></td> <td id="LC689" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L690" class="blob-num js-line-number" data-line-number="690"></td> <td id="LC690" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> num_proj:</td> </tr> <tr> <td id="L691" class="blob-num js-line-number" data-line-number="691"></td> <td id="LC691" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_size <span class="pl-k">=</span> (</td> </tr> <tr> <td id="L692" class="blob-num js-line-number" data-line-number="692"></td> <td id="LC692" class="blob-code blob-code-inner js-file-line"> LSTMStateTuple(num_units, num_proj)</td> </tr> <tr> <td id="L693" class="blob-num js-line-number" data-line-number="693"></td> <td id="LC693" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> state_is_tuple <span class="pl-k">else</span> num_units <span class="pl-k">+</span> num_proj)</td> </tr> <tr> <td id="L694" class="blob-num js-line-number" data-line-number="694"></td> <td id="LC694" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._output_size <span class="pl-k">=</span> num_proj</td> </tr> <tr> <td id="L695" class="blob-num js-line-number" data-line-number="695"></td> <td id="LC695" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L696" class="blob-num js-line-number" data-line-number="696"></td> <td id="LC696" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_size <span class="pl-k">=</span> (</td> </tr> <tr> <td id="L697" class="blob-num js-line-number" data-line-number="697"></td> <td id="LC697" class="blob-code blob-code-inner js-file-line"> LSTMStateTuple(num_units, num_units)</td> </tr> <tr> <td id="L698" class="blob-num js-line-number" data-line-number="698"></td> <td id="LC698" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> state_is_tuple <span class="pl-k">else</span> <span class="pl-c1">2</span> <span class="pl-k">*</span> num_units)</td> </tr> <tr> <td id="L699" class="blob-num js-line-number" data-line-number="699"></td> <td id="LC699" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._output_size <span class="pl-k">=</span> num_units</td> </tr> <tr> <td id="L700" class="blob-num js-line-number" data-line-number="700"></td> <td id="LC700" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L701" class="blob-num js-line-number" data-line-number="701"></td> <td id="LC701" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L702" class="blob-num js-line-number" data-line-number="702"></td> <td id="LC702" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L703" class="blob-num js-line-number" data-line-number="703"></td> <td id="LC703" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._state_size</td> </tr> <tr> <td id="L704" class="blob-num js-line-number" data-line-number="704"></td> <td id="LC704" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L705" class="blob-num js-line-number" data-line-number="705"></td> <td id="LC705" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L706" class="blob-num js-line-number" data-line-number="706"></td> <td id="LC706" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L707" class="blob-num js-line-number" data-line-number="707"></td> <td id="LC707" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._output_size</td> </tr> <tr> <td id="L708" class="blob-num js-line-number" data-line-number="708"></td> <td id="LC708" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L709" class="blob-num js-line-number" data-line-number="709"></td> <td id="LC709" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">build</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs_shape</span>):</td> </tr> <tr> <td id="L710" class="blob-num js-line-number" data-line-number="710"></td> <td id="LC710" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> inputs_shape[<span class="pl-c1">1</span>].value <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L711" class="blob-num js-line-number" data-line-number="711"></td> <td id="LC711" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Expected inputs.shape[-1] to be known, saw shape: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L712" class="blob-num js-line-number" data-line-number="712"></td> <td id="LC712" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> inputs_shape)</td> </tr> <tr> <td id="L713" class="blob-num js-line-number" data-line-number="713"></td> <td id="LC713" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L714" class="blob-num js-line-number" data-line-number="714"></td> <td id="LC714" class="blob-code blob-code-inner js-file-line"> input_depth <span class="pl-k">=</span> inputs_shape[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L715" class="blob-num js-line-number" data-line-number="715"></td> <td id="LC715" class="blob-code blob-code-inner js-file-line"> h_depth <span class="pl-k">=</span> <span class="pl-c1">self</span>._num_units <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_proj <span class="pl-k">is</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-c1">self</span>._num_proj</td> </tr> <tr> <td id="L716" class="blob-num js-line-number" data-line-number="716"></td> <td id="LC716" class="blob-code blob-code-inner js-file-line"> maybe_partitioner <span class="pl-k">=</span> (</td> </tr> <tr> <td id="L717" class="blob-num js-line-number" data-line-number="717"></td> <td id="LC717" class="blob-code blob-code-inner js-file-line"> partitioned_variables.fixed_size_partitioner(<span class="pl-c1">self</span>._num_unit_shards)</td> </tr> <tr> <td id="L718" class="blob-num js-line-number" data-line-number="718"></td> <td id="LC718" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_unit_shards <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L719" class="blob-num js-line-number" data-line-number="719"></td> <td id="LC719" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L720" class="blob-num js-line-number" data-line-number="720"></td> <td id="LC720" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L721" class="blob-num js-line-number" data-line-number="721"></td> <td id="LC721" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L722" class="blob-num js-line-number" data-line-number="722"></td> <td id="LC722" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[input_depth <span class="pl-k">+</span> h_depth, <span class="pl-c1">4</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L723" class="blob-num js-line-number" data-line-number="723"></td> <td id="LC723" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._initializer,</td> </tr> <tr> <td id="L724" class="blob-num js-line-number" data-line-number="724"></td> <td id="LC724" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">partitioner</span><span class="pl-k">=</span>maybe_partitioner)</td> </tr> <tr> <td id="L725" class="blob-num js-line-number" data-line-number="725"></td> <td id="LC725" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._bias <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L726" class="blob-num js-line-number" data-line-number="726"></td> <td id="LC726" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">_BIAS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L727" class="blob-num js-line-number" data-line-number="727"></td> <td id="LC727" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">4</span> <span class="pl-k">*</span> <span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L728" class="blob-num js-line-number" data-line-number="728"></td> <td id="LC728" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span>init_ops.zeros_initializer(<span class="pl-v">dtype</span><span class="pl-k">=</span><span class="pl-c1">self</span>.dtype))</td> </tr> <tr> <td id="L729" class="blob-num js-line-number" data-line-number="729"></td> <td id="LC729" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._use_peepholes:</td> </tr> <tr> <td id="L730" class="blob-num js-line-number" data-line-number="730"></td> <td id="LC730" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._w_f_diag <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(<span class="pl-s"><span class="pl-pds">&quot;</span>w_f_diag<span class="pl-pds">&quot;</span></span>, <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L731" class="blob-num js-line-number" data-line-number="731"></td> <td id="LC731" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._initializer)</td> </tr> <tr> <td id="L732" class="blob-num js-line-number" data-line-number="732"></td> <td id="LC732" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._w_i_diag <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(<span class="pl-s"><span class="pl-pds">&quot;</span>w_i_diag<span class="pl-pds">&quot;</span></span>, <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L733" class="blob-num js-line-number" data-line-number="733"></td> <td id="LC733" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._initializer)</td> </tr> <tr> <td id="L734" class="blob-num js-line-number" data-line-number="734"></td> <td id="LC734" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._w_o_diag <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(<span class="pl-s"><span class="pl-pds">&quot;</span>w_o_diag<span class="pl-pds">&quot;</span></span>, <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units],</td> </tr> <tr> <td id="L735" class="blob-num js-line-number" data-line-number="735"></td> <td id="LC735" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._initializer)</td> </tr> <tr> <td id="L736" class="blob-num js-line-number" data-line-number="736"></td> <td id="LC736" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L737" class="blob-num js-line-number" data-line-number="737"></td> <td id="LC737" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_proj <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L738" class="blob-num js-line-number" data-line-number="738"></td> <td id="LC738" class="blob-code blob-code-inner js-file-line"> maybe_proj_partitioner <span class="pl-k">=</span> (</td> </tr> <tr> <td id="L739" class="blob-num js-line-number" data-line-number="739"></td> <td id="LC739" class="blob-code blob-code-inner js-file-line"> partitioned_variables.fixed_size_partitioner(<span class="pl-c1">self</span>._num_proj_shards)</td> </tr> <tr> <td id="L740" class="blob-num js-line-number" data-line-number="740"></td> <td id="LC740" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_proj_shards <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L741" class="blob-num js-line-number" data-line-number="741"></td> <td id="LC741" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L742" class="blob-num js-line-number" data-line-number="742"></td> <td id="LC742" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._proj_kernel <span class="pl-k">=</span> <span class="pl-c1">self</span>.add_variable(</td> </tr> <tr> <td id="L743" class="blob-num js-line-number" data-line-number="743"></td> <td id="LC743" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>projection/<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">_WEIGHTS_VARIABLE_NAME</span>,</td> </tr> <tr> <td id="L744" class="blob-num js-line-number" data-line-number="744"></td> <td id="LC744" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">shape</span><span class="pl-k">=</span>[<span class="pl-c1">self</span>._num_units, <span class="pl-c1">self</span>._num_proj],</td> </tr> <tr> <td id="L745" class="blob-num js-line-number" data-line-number="745"></td> <td id="LC745" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">initializer</span><span class="pl-k">=</span><span class="pl-c1">self</span>._initializer,</td> </tr> <tr> <td id="L746" class="blob-num js-line-number" data-line-number="746"></td> <td id="LC746" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">partitioner</span><span class="pl-k">=</span>maybe_proj_partitioner)</td> </tr> <tr> <td id="L747" class="blob-num js-line-number" data-line-number="747"></td> <td id="LC747" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L748" class="blob-num js-line-number" data-line-number="748"></td> <td id="LC748" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>.built <span class="pl-k">=</span> <span class="pl-c1">True</span></td> </tr> <tr> <td id="L749" class="blob-num js-line-number" data-line-number="749"></td> <td id="LC749" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L750" class="blob-num js-line-number" data-line-number="750"></td> <td id="LC750" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">call</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>):</td> </tr> <tr> <td id="L751" class="blob-num js-line-number" data-line-number="751"></td> <td id="LC751" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run one step of LSTM.</span></td> </tr> <tr> <td id="L752" class="blob-num js-line-number" data-line-number="752"></td> <td id="LC752" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L753" class="blob-num js-line-number" data-line-number="753"></td> <td id="LC753" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L754" class="blob-num js-line-number" data-line-number="754"></td> <td id="LC754" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> inputs: input Tensor, 2D, `[batch, num_units].</span></td> </tr> <tr> <td id="L755" class="blob-num js-line-number" data-line-number="755"></td> <td id="LC755" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state: if `state_is_tuple` is False, this must be a state Tensor,</span></td> </tr> <tr> <td id="L756" class="blob-num js-line-number" data-line-number="756"></td> <td id="LC756" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `2-D, [batch, state_size]`. If `state_is_tuple` is True, this must be a</span></td> </tr> <tr> <td id="L757" class="blob-num js-line-number" data-line-number="757"></td> <td id="LC757" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> tuple of state Tensors, both `2-D`, with column sizes `c_state` and</span></td> </tr> <tr> <td id="L758" class="blob-num js-line-number" data-line-number="758"></td> <td id="LC758" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `m_state`.</span></td> </tr> <tr> <td id="L759" class="blob-num js-line-number" data-line-number="759"></td> <td id="LC759" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L760" class="blob-num js-line-number" data-line-number="760"></td> <td id="LC760" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L761" class="blob-num js-line-number" data-line-number="761"></td> <td id="LC761" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> A tuple containing:</span></td> </tr> <tr> <td id="L762" class="blob-num js-line-number" data-line-number="762"></td> <td id="LC762" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L763" class="blob-num js-line-number" data-line-number="763"></td> <td id="LC763" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - A `2-D, [batch, output_dim]`, Tensor representing the output of the</span></td> </tr> <tr> <td id="L764" class="blob-num js-line-number" data-line-number="764"></td> <td id="LC764" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> LSTM after reading `inputs` when previous state was `state`.</span></td> </tr> <tr> <td id="L765" class="blob-num js-line-number" data-line-number="765"></td> <td id="LC765" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Here output_dim is:</span></td> </tr> <tr> <td id="L766" class="blob-num js-line-number" data-line-number="766"></td> <td id="LC766" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_proj if num_proj was set,</span></td> </tr> <tr> <td id="L767" class="blob-num js-line-number" data-line-number="767"></td> <td id="LC767" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> num_units otherwise.</span></td> </tr> <tr> <td id="L768" class="blob-num js-line-number" data-line-number="768"></td> <td id="LC768" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> - Tensor(s) representing the new state of LSTM after reading `inputs` when</span></td> </tr> <tr> <td id="L769" class="blob-num js-line-number" data-line-number="769"></td> <td id="LC769" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the previous state was `state`. Same type and shape(s) as `state`.</span></td> </tr> <tr> <td id="L770" class="blob-num js-line-number" data-line-number="770"></td> <td id="LC770" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L771" class="blob-num js-line-number" data-line-number="771"></td> <td id="LC771" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L772" class="blob-num js-line-number" data-line-number="772"></td> <td id="LC772" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: If input size cannot be inferred from inputs via</span></td> </tr> <tr> <td id="L773" class="blob-num js-line-number" data-line-number="773"></td> <td id="LC773" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> static shape inference.</span></td> </tr> <tr> <td id="L774" class="blob-num js-line-number" data-line-number="774"></td> <td id="LC774" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L775" class="blob-num js-line-number" data-line-number="775"></td> <td id="LC775" class="blob-code blob-code-inner js-file-line"> num_proj <span class="pl-k">=</span> <span class="pl-c1">self</span>._num_units <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_proj <span class="pl-k">is</span> <span class="pl-c1">None</span> <span class="pl-k">else</span> <span class="pl-c1">self</span>._num_proj</td> </tr> <tr> <td id="L776" class="blob-num js-line-number" data-line-number="776"></td> <td id="LC776" class="blob-code blob-code-inner js-file-line"> sigmoid <span class="pl-k">=</span> math_ops.sigmoid</td> </tr> <tr> <td id="L777" class="blob-num js-line-number" data-line-number="777"></td> <td id="LC777" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L778" class="blob-num js-line-number" data-line-number="778"></td> <td id="LC778" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L779" class="blob-num js-line-number" data-line-number="779"></td> <td id="LC779" class="blob-code blob-code-inner js-file-line"> (c_prev, m_prev) <span class="pl-k">=</span> state</td> </tr> <tr> <td id="L780" class="blob-num js-line-number" data-line-number="780"></td> <td id="LC780" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L781" class="blob-num js-line-number" data-line-number="781"></td> <td id="LC781" class="blob-code blob-code-inner js-file-line"> c_prev <span class="pl-k">=</span> array_ops.slice(state, [<span class="pl-c1">0</span>, <span class="pl-c1">0</span>], [<span class="pl-k">-</span><span class="pl-c1">1</span>, <span class="pl-c1">self</span>._num_units])</td> </tr> <tr> <td id="L782" class="blob-num js-line-number" data-line-number="782"></td> <td id="LC782" class="blob-code blob-code-inner js-file-line"> m_prev <span class="pl-k">=</span> array_ops.slice(state, [<span class="pl-c1">0</span>, <span class="pl-c1">self</span>._num_units], [<span class="pl-k">-</span><span class="pl-c1">1</span>, num_proj])</td> </tr> <tr> <td id="L783" class="blob-num js-line-number" data-line-number="783"></td> <td id="LC783" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L784" class="blob-num js-line-number" data-line-number="784"></td> <td id="LC784" class="blob-code blob-code-inner js-file-line"> input_size <span class="pl-k">=</span> inputs.get_shape().with_rank(<span class="pl-c1">2</span>)[<span class="pl-c1">1</span>]</td> </tr> <tr> <td id="L785" class="blob-num js-line-number" data-line-number="785"></td> <td id="LC785" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> input_size.value <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L786" class="blob-num js-line-number" data-line-number="786"></td> <td id="LC786" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Could not infer input size from inputs.get_shape()[-1]<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L787" class="blob-num js-line-number" data-line-number="787"></td> <td id="LC787" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L788" class="blob-num js-line-number" data-line-number="788"></td> <td id="LC788" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> i = input_gate, j = new_input, f = forget_gate, o = output_gate</span></td> </tr> <tr> <td id="L789" class="blob-num js-line-number" data-line-number="789"></td> <td id="LC789" class="blob-code blob-code-inner js-file-line"> lstm_matrix <span class="pl-k">=</span> math_ops.matmul(</td> </tr> <tr> <td id="L790" class="blob-num js-line-number" data-line-number="790"></td> <td id="LC790" class="blob-code blob-code-inner js-file-line"> array_ops.concat([inputs, m_prev], <span class="pl-c1">1</span>), <span class="pl-c1">self</span>._kernel)</td> </tr> <tr> <td id="L791" class="blob-num js-line-number" data-line-number="791"></td> <td id="LC791" class="blob-code blob-code-inner js-file-line"> lstm_matrix <span class="pl-k">=</span> nn_ops.bias_add(lstm_matrix, <span class="pl-c1">self</span>._bias)</td> </tr> <tr> <td id="L792" class="blob-num js-line-number" data-line-number="792"></td> <td id="LC792" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L793" class="blob-num js-line-number" data-line-number="793"></td> <td id="LC793" class="blob-code blob-code-inner js-file-line"> i, j, f, o <span class="pl-k">=</span> array_ops.split(</td> </tr> <tr> <td id="L794" class="blob-num js-line-number" data-line-number="794"></td> <td id="LC794" class="blob-code blob-code-inner js-file-line"> <span class="pl-v">value</span><span class="pl-k">=</span>lstm_matrix, <span class="pl-v">num_or_size_splits</span><span class="pl-k">=</span><span class="pl-c1">4</span>, <span class="pl-v">axis</span><span class="pl-k">=</span><span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L795" class="blob-num js-line-number" data-line-number="795"></td> <td id="LC795" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Diagonal connections</span></td> </tr> <tr> <td id="L796" class="blob-num js-line-number" data-line-number="796"></td> <td id="LC796" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._use_peepholes:</td> </tr> <tr> <td id="L797" class="blob-num js-line-number" data-line-number="797"></td> <td id="LC797" class="blob-code blob-code-inner js-file-line"> c <span class="pl-k">=</span> (sigmoid(f <span class="pl-k">+</span> <span class="pl-c1">self</span>._forget_bias <span class="pl-k">+</span> <span class="pl-c1">self</span>._w_f_diag <span class="pl-k">*</span> c_prev) <span class="pl-k">*</span> c_prev <span class="pl-k">+</span></td> </tr> <tr> <td id="L798" class="blob-num js-line-number" data-line-number="798"></td> <td id="LC798" class="blob-code blob-code-inner js-file-line"> sigmoid(i <span class="pl-k">+</span> <span class="pl-c1">self</span>._w_i_diag <span class="pl-k">*</span> c_prev) <span class="pl-k">*</span> <span class="pl-c1">self</span>._activation(j))</td> </tr> <tr> <td id="L799" class="blob-num js-line-number" data-line-number="799"></td> <td id="LC799" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L800" class="blob-num js-line-number" data-line-number="800"></td> <td id="LC800" class="blob-code blob-code-inner js-file-line"> c <span class="pl-k">=</span> (sigmoid(f <span class="pl-k">+</span> <span class="pl-c1">self</span>._forget_bias) <span class="pl-k">*</span> c_prev <span class="pl-k">+</span> sigmoid(i) <span class="pl-k">*</span></td> </tr> <tr> <td id="L801" class="blob-num js-line-number" data-line-number="801"></td> <td id="LC801" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._activation(j))</td> </tr> <tr> <td id="L802" class="blob-num js-line-number" data-line-number="802"></td> <td id="LC802" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L803" class="blob-num js-line-number" data-line-number="803"></td> <td id="LC803" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._cell_clip <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L804" class="blob-num js-line-number" data-line-number="804"></td> <td id="LC804" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> pylint: disable=invalid-unary-operand-type</span></td> </tr> <tr> <td id="L805" class="blob-num js-line-number" data-line-number="805"></td> <td id="LC805" class="blob-code blob-code-inner js-file-line"> c <span class="pl-k">=</span> clip_ops.clip_by_value(c, <span class="pl-k">-</span><span class="pl-c1">self</span>._cell_clip, <span class="pl-c1">self</span>._cell_clip)</td> </tr> <tr> <td id="L806" class="blob-num js-line-number" data-line-number="806"></td> <td id="LC806" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> pylint: enable=invalid-unary-operand-type</span></td> </tr> <tr> <td id="L807" class="blob-num js-line-number" data-line-number="807"></td> <td id="LC807" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._use_peepholes:</td> </tr> <tr> <td id="L808" class="blob-num js-line-number" data-line-number="808"></td> <td id="LC808" class="blob-code blob-code-inner js-file-line"> m <span class="pl-k">=</span> sigmoid(o <span class="pl-k">+</span> <span class="pl-c1">self</span>._w_o_diag <span class="pl-k">*</span> c) <span class="pl-k">*</span> <span class="pl-c1">self</span>._activation(c)</td> </tr> <tr> <td id="L809" class="blob-num js-line-number" data-line-number="809"></td> <td id="LC809" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L810" class="blob-num js-line-number" data-line-number="810"></td> <td id="LC810" class="blob-code blob-code-inner js-file-line"> m <span class="pl-k">=</span> sigmoid(o) <span class="pl-k">*</span> <span class="pl-c1">self</span>._activation(c)</td> </tr> <tr> <td id="L811" class="blob-num js-line-number" data-line-number="811"></td> <td id="LC811" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L812" class="blob-num js-line-number" data-line-number="812"></td> <td id="LC812" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._num_proj <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L813" class="blob-num js-line-number" data-line-number="813"></td> <td id="LC813" class="blob-code blob-code-inner js-file-line"> m <span class="pl-k">=</span> math_ops.matmul(m, <span class="pl-c1">self</span>._proj_kernel)</td> </tr> <tr> <td id="L814" class="blob-num js-line-number" data-line-number="814"></td> <td id="LC814" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L815" class="blob-num js-line-number" data-line-number="815"></td> <td id="LC815" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._proj_clip <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L816" class="blob-num js-line-number" data-line-number="816"></td> <td id="LC816" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> pylint: disable=invalid-unary-operand-type</span></td> </tr> <tr> <td id="L817" class="blob-num js-line-number" data-line-number="817"></td> <td id="LC817" class="blob-code blob-code-inner js-file-line"> m <span class="pl-k">=</span> clip_ops.clip_by_value(m, <span class="pl-k">-</span><span class="pl-c1">self</span>._proj_clip, <span class="pl-c1">self</span>._proj_clip)</td> </tr> <tr> <td id="L818" class="blob-num js-line-number" data-line-number="818"></td> <td id="LC818" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> pylint: enable=invalid-unary-operand-type</span></td> </tr> <tr> <td id="L819" class="blob-num js-line-number" data-line-number="819"></td> <td id="LC819" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L820" class="blob-num js-line-number" data-line-number="820"></td> <td id="LC820" class="blob-code blob-code-inner js-file-line"> new_state <span class="pl-k">=</span> (LSTMStateTuple(c, m) <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">else</span></td> </tr> <tr> <td id="L821" class="blob-num js-line-number" data-line-number="821"></td> <td id="LC821" class="blob-code blob-code-inner js-file-line"> array_ops.concat([c, m], <span class="pl-c1">1</span>))</td> </tr> <tr> <td id="L822" class="blob-num js-line-number" data-line-number="822"></td> <td id="LC822" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> m, new_state</td> </tr> <tr> <td id="L823" class="blob-num js-line-number" data-line-number="823"></td> <td id="LC823" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L824" class="blob-num js-line-number" data-line-number="824"></td> <td id="LC824" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L825" class="blob-num js-line-number" data-line-number="825"></td> <td id="LC825" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_enumerated_map_structure_up_to</span>(<span class="pl-smi">shallow_structure</span>, <span class="pl-smi">map_fn</span>, <span class="pl-k">*</span><span class="pl-smi">args</span>, <span class="pl-k">**</span><span class="pl-smi">kwargs</span>):</td> </tr> <tr> <td id="L826" class="blob-num js-line-number" data-line-number="826"></td> <td id="LC826" class="blob-code blob-code-inner js-file-line"> ix <span class="pl-k">=</span> [<span class="pl-c1">0</span>]</td> </tr> <tr> <td id="L827" class="blob-num js-line-number" data-line-number="827"></td> <td id="LC827" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">enumerated_fn</span>(<span class="pl-k">*</span><span class="pl-smi">inner_args</span>, <span class="pl-k">**</span><span class="pl-smi">inner_kwargs</span>):</td> </tr> <tr> <td id="L828" class="blob-num js-line-number" data-line-number="828"></td> <td id="LC828" class="blob-code blob-code-inner js-file-line"> r <span class="pl-k">=</span> map_fn(ix[<span class="pl-c1">0</span>], <span class="pl-k">*</span>inner_args, <span class="pl-k">**</span>inner_kwargs)</td> </tr> <tr> <td id="L829" class="blob-num js-line-number" data-line-number="829"></td> <td id="LC829" class="blob-code blob-code-inner js-file-line"> ix[<span class="pl-c1">0</span>] <span class="pl-k">+=</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L830" class="blob-num js-line-number" data-line-number="830"></td> <td id="LC830" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> r</td> </tr> <tr> <td id="L831" class="blob-num js-line-number" data-line-number="831"></td> <td id="LC831" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> nest.map_structure_up_to(shallow_structure,</td> </tr> <tr> <td id="L832" class="blob-num js-line-number" data-line-number="832"></td> <td id="LC832" class="blob-code blob-code-inner js-file-line"> enumerated_fn, <span class="pl-k">*</span>args, <span class="pl-k">**</span>kwargs)</td> </tr> <tr> <td id="L833" class="blob-num js-line-number" data-line-number="833"></td> <td id="LC833" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L834" class="blob-num js-line-number" data-line-number="834"></td> <td id="LC834" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L835" class="blob-num js-line-number" data-line-number="835"></td> <td id="LC835" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_default_dropout_state_filter_visitor</span>(<span class="pl-smi">substate</span>):</td> </tr> <tr> <td id="L836" class="blob-num js-line-number" data-line-number="836"></td> <td id="LC836" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">isinstance</span>(substate, LSTMStateTuple):</td> </tr> <tr> <td id="L837" class="blob-num js-line-number" data-line-number="837"></td> <td id="LC837" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Do not perform dropout on the memory state.</span></td> </tr> <tr> <td id="L838" class="blob-num js-line-number" data-line-number="838"></td> <td id="LC838" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> LSTMStateTuple(<span class="pl-v">c</span><span class="pl-k">=</span><span class="pl-c1">False</span>, <span class="pl-v">h</span><span class="pl-k">=</span><span class="pl-c1">True</span>)</td> </tr> <tr> <td id="L839" class="blob-num js-line-number" data-line-number="839"></td> <td id="LC839" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">elif</span> <span class="pl-c1">isinstance</span>(substate, tensor_array_ops.TensorArray):</td> </tr> <tr> <td id="L840" class="blob-num js-line-number" data-line-number="840"></td> <td id="LC840" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">False</span></td> </tr> <tr> <td id="L841" class="blob-num js-line-number" data-line-number="841"></td> <td id="LC841" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">True</span></td> </tr> <tr> <td id="L842" class="blob-num js-line-number" data-line-number="842"></td> <td id="LC842" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L843" class="blob-num js-line-number" data-line-number="843"></td> <td id="LC843" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L844" class="blob-num js-line-number" data-line-number="844"></td> <td id="LC844" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.DropoutWrapper<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L845" class="blob-num js-line-number" data-line-number="845"></td> <td id="LC845" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">DropoutWrapper</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L846" class="blob-num js-line-number" data-line-number="846"></td> <td id="LC846" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Operator adding dropout to inputs and outputs of the given cell.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L847" class="blob-num js-line-number" data-line-number="847"></td> <td id="LC847" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L848" class="blob-num js-line-number" data-line-number="848"></td> <td id="LC848" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">cell</span>, <span class="pl-smi">input_keep_prob</span><span class="pl-k">=</span><span class="pl-c1">1.0</span>, <span class="pl-smi">output_keep_prob</span><span class="pl-k">=</span><span class="pl-c1">1.0</span>,</td> </tr> <tr> <td id="L849" class="blob-num js-line-number" data-line-number="849"></td> <td id="LC849" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">state_keep_prob</span><span class="pl-k">=</span><span class="pl-c1">1.0</span>, <span class="pl-smi">variational_recurrent</span><span class="pl-k">=</span><span class="pl-c1">False</span>,</td> </tr> <tr> <td id="L850" class="blob-num js-line-number" data-line-number="850"></td> <td id="LC850" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">input_size</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">dtype</span><span class="pl-k">=</span><span class="pl-c1">None</span>, <span class="pl-smi">seed</span><span class="pl-k">=</span><span class="pl-c1">None</span>,</td> </tr> <tr> <td id="L851" class="blob-num js-line-number" data-line-number="851"></td> <td id="LC851" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">dropout_state_filter_visitor</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L852" class="blob-num js-line-number" data-line-number="852"></td> <td id="LC852" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Create a cell with added input, state, and/or output dropout.</span></td> </tr> <tr> <td id="L853" class="blob-num js-line-number" data-line-number="853"></td> <td id="LC853" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L854" class="blob-num js-line-number" data-line-number="854"></td> <td id="LC854" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> If `variational_recurrent` is set to `True` (**NOT** the default behavior),</span></td> </tr> <tr> <td id="L855" class="blob-num js-line-number" data-line-number="855"></td> <td id="LC855" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> then the same dropout mask is applied at every step, as described in:</span></td> </tr> <tr> <td id="L856" class="blob-num js-line-number" data-line-number="856"></td> <td id="LC856" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L857" class="blob-num js-line-number" data-line-number="857"></td> <td id="LC857" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Y. Gal, Z Ghahramani. &quot;A Theoretically Grounded Application of Dropout in</span></td> </tr> <tr> <td id="L858" class="blob-num js-line-number" data-line-number="858"></td> <td id="LC858" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Recurrent Neural Networks&quot;. https://arxiv.org/abs/1512.05287</span></td> </tr> <tr> <td id="L859" class="blob-num js-line-number" data-line-number="859"></td> <td id="LC859" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L860" class="blob-num js-line-number" data-line-number="860"></td> <td id="LC860" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Otherwise a different dropout mask is applied at every time step.</span></td> </tr> <tr> <td id="L861" class="blob-num js-line-number" data-line-number="861"></td> <td id="LC861" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L862" class="blob-num js-line-number" data-line-number="862"></td> <td id="LC862" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Note, by default (unless a custom `dropout_state_filter` is provided),</span></td> </tr> <tr> <td id="L863" class="blob-num js-line-number" data-line-number="863"></td> <td id="LC863" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the memory state (`c` component of any `LSTMStateTuple`) passing through</span></td> </tr> <tr> <td id="L864" class="blob-num js-line-number" data-line-number="864"></td> <td id="LC864" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> a `DropoutWrapper` is never modified. This behavior is described in the</span></td> </tr> <tr> <td id="L865" class="blob-num js-line-number" data-line-number="865"></td> <td id="LC865" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> above article.</span></td> </tr> <tr> <td id="L866" class="blob-num js-line-number" data-line-number="866"></td> <td id="LC866" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L867" class="blob-num js-line-number" data-line-number="867"></td> <td id="LC867" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L868" class="blob-num js-line-number" data-line-number="868"></td> <td id="LC868" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cell: an RNNCell, a projection to output_size is added to it.</span></td> </tr> <tr> <td id="L869" class="blob-num js-line-number" data-line-number="869"></td> <td id="LC869" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> input_keep_prob: unit Tensor or float between 0 and 1, input keep</span></td> </tr> <tr> <td id="L870" class="blob-num js-line-number" data-line-number="870"></td> <td id="LC870" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> probability; if it is constant and 1, no input dropout will be added.</span></td> </tr> <tr> <td id="L871" class="blob-num js-line-number" data-line-number="871"></td> <td id="LC871" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> output_keep_prob: unit Tensor or float between 0 and 1, output keep</span></td> </tr> <tr> <td id="L872" class="blob-num js-line-number" data-line-number="872"></td> <td id="LC872" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> probability; if it is constant and 1, no output dropout will be added.</span></td> </tr> <tr> <td id="L873" class="blob-num js-line-number" data-line-number="873"></td> <td id="LC873" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state_keep_prob: unit Tensor or float between 0 and 1, output keep</span></td> </tr> <tr> <td id="L874" class="blob-num js-line-number" data-line-number="874"></td> <td id="LC874" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> probability; if it is constant and 1, no output dropout will be added.</span></td> </tr> <tr> <td id="L875" class="blob-num js-line-number" data-line-number="875"></td> <td id="LC875" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> State dropout is performed on the outgoing states of the cell.</span></td> </tr> <tr> <td id="L876" class="blob-num js-line-number" data-line-number="876"></td> <td id="LC876" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> **Note** the state components to which dropout is applied when</span></td> </tr> <tr> <td id="L877" class="blob-num js-line-number" data-line-number="877"></td> <td id="LC877" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `state_keep_prob` is in `(0, 1)` are also determined by</span></td> </tr> <tr> <td id="L878" class="blob-num js-line-number" data-line-number="878"></td> <td id="LC878" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the argument `dropout_state_filter_visitor` (e.g. by default dropout</span></td> </tr> <tr> <td id="L879" class="blob-num js-line-number" data-line-number="879"></td> <td id="LC879" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> is never applied to the `c` component of an `LSTMStateTuple`).</span></td> </tr> <tr> <td id="L880" class="blob-num js-line-number" data-line-number="880"></td> <td id="LC880" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> variational_recurrent: Python bool. If `True`, then the same</span></td> </tr> <tr> <td id="L881" class="blob-num js-line-number" data-line-number="881"></td> <td id="LC881" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> dropout pattern is applied across all time steps per run call.</span></td> </tr> <tr> <td id="L882" class="blob-num js-line-number" data-line-number="882"></td> <td id="LC882" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> If this parameter is set, `input_size` **must** be provided.</span></td> </tr> <tr> <td id="L883" class="blob-num js-line-number" data-line-number="883"></td> <td id="LC883" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> input_size: (optional) (possibly nested tuple of) `TensorShape` objects</span></td> </tr> <tr> <td id="L884" class="blob-num js-line-number" data-line-number="884"></td> <td id="LC884" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> containing the depth(s) of the input tensors expected to be passed in to</span></td> </tr> <tr> <td id="L885" class="blob-num js-line-number" data-line-number="885"></td> <td id="LC885" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the `DropoutWrapper`. Required and used **iff**</span></td> </tr> <tr> <td id="L886" class="blob-num js-line-number" data-line-number="886"></td> <td id="LC886" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `variational_recurrent = True` and `input_keep_prob &lt; 1`.</span></td> </tr> <tr> <td id="L887" class="blob-num js-line-number" data-line-number="887"></td> <td id="LC887" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> dtype: (optional) The `dtype` of the input, state, and output tensors.</span></td> </tr> <tr> <td id="L888" class="blob-num js-line-number" data-line-number="888"></td> <td id="LC888" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Required and used **iff** `variational_recurrent = True`.</span></td> </tr> <tr> <td id="L889" class="blob-num js-line-number" data-line-number="889"></td> <td id="LC889" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> seed: (optional) integer, the randomness seed.</span></td> </tr> <tr> <td id="L890" class="blob-num js-line-number" data-line-number="890"></td> <td id="LC890" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> dropout_state_filter_visitor: (optional), default: (see below). Function</span></td> </tr> <tr> <td id="L891" class="blob-num js-line-number" data-line-number="891"></td> <td id="LC891" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> that takes any hierarchical level of the state and returns</span></td> </tr> <tr> <td id="L892" class="blob-num js-line-number" data-line-number="892"></td> <td id="LC892" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> a scalar or depth=1 structure of Python booleans describing</span></td> </tr> <tr> <td id="L893" class="blob-num js-line-number" data-line-number="893"></td> <td id="LC893" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> which terms in the state should be dropped out. In addition, if the</span></td> </tr> <tr> <td id="L894" class="blob-num js-line-number" data-line-number="894"></td> <td id="LC894" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> function returns `True`, dropout is applied across this sublevel. If</span></td> </tr> <tr> <td id="L895" class="blob-num js-line-number" data-line-number="895"></td> <td id="LC895" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> the function returns `False`, dropout is not applied across this entire</span></td> </tr> <tr> <td id="L896" class="blob-num js-line-number" data-line-number="896"></td> <td id="LC896" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> sublevel.</span></td> </tr> <tr> <td id="L897" class="blob-num js-line-number" data-line-number="897"></td> <td id="LC897" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Default behavior: perform dropout on all terms except the memory (`c`)</span></td> </tr> <tr> <td id="L898" class="blob-num js-line-number" data-line-number="898"></td> <td id="LC898" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state of `LSTMCellState` objects, and don&#39;t try to apply dropout to</span></td> </tr> <tr> <td id="L899" class="blob-num js-line-number" data-line-number="899"></td> <td id="LC899" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `TensorArray` objects:</span></td> </tr> <tr> <td id="L900" class="blob-num js-line-number" data-line-number="900"></td> <td id="LC900" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ```</span></td> </tr> <tr> <td id="L901" class="blob-num js-line-number" data-line-number="901"></td> <td id="LC901" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> def dropout_state_filter_visitor(s):</span></td> </tr> <tr> <td id="L902" class="blob-num js-line-number" data-line-number="902"></td> <td id="LC902" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> if isinstance(s, LSTMCellState):</span></td> </tr> <tr> <td id="L903" class="blob-num js-line-number" data-line-number="903"></td> <td id="LC903" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> # Never perform dropout on the c state.</span></td> </tr> <tr> <td id="L904" class="blob-num js-line-number" data-line-number="904"></td> <td id="LC904" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> return LSTMCellState(c=False, h=True)</span></td> </tr> <tr> <td id="L905" class="blob-num js-line-number" data-line-number="905"></td> <td id="LC905" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> elif isinstance(s, TensorArray):</span></td> </tr> <tr> <td id="L906" class="blob-num js-line-number" data-line-number="906"></td> <td id="LC906" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> return False</span></td> </tr> <tr> <td id="L907" class="blob-num js-line-number" data-line-number="907"></td> <td id="LC907" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> return True</span></td> </tr> <tr> <td id="L908" class="blob-num js-line-number" data-line-number="908"></td> <td id="LC908" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ```</span></td> </tr> <tr> <td id="L909" class="blob-num js-line-number" data-line-number="909"></td> <td id="LC909" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L910" class="blob-num js-line-number" data-line-number="910"></td> <td id="LC910" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L911" class="blob-num js-line-number" data-line-number="911"></td> <td id="LC911" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> TypeError: if `cell` is not an `RNNCell`, or `keep_state_fn` is provided</span></td> </tr> <tr> <td id="L912" class="blob-num js-line-number" data-line-number="912"></td> <td id="LC912" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> but not `callable`.</span></td> </tr> <tr> <td id="L913" class="blob-num js-line-number" data-line-number="913"></td> <td id="LC913" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: if any of the keep_probs are not between 0 and 1.</span></td> </tr> <tr> <td id="L914" class="blob-num js-line-number" data-line-number="914"></td> <td id="LC914" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L915" class="blob-num js-line-number" data-line-number="915"></td> <td id="LC915" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> _like_rnncell(cell):</td> </tr> <tr> <td id="L916" class="blob-num js-line-number" data-line-number="916"></td> <td id="LC916" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">TypeError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>The parameter cell is not a RNNCell.<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L917" class="blob-num js-line-number" data-line-number="917"></td> <td id="LC917" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dropout_state_filter_visitor <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L918" class="blob-num js-line-number" data-line-number="918"></td> <td id="LC918" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">and</span> <span class="pl-k">not</span> <span class="pl-c1">callable</span>(dropout_state_filter_visitor)):</td> </tr> <tr> <td id="L919" class="blob-num js-line-number" data-line-number="919"></td> <td id="LC919" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">TypeError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>dropout_state_filter_visitor must be callable<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L920" class="blob-num js-line-number" data-line-number="920"></td> <td id="LC920" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._dropout_state_filter <span class="pl-k">=</span> (</td> </tr> <tr> <td id="L921" class="blob-num js-line-number" data-line-number="921"></td> <td id="LC921" class="blob-code blob-code-inner js-file-line"> dropout_state_filter_visitor <span class="pl-k">or</span> _default_dropout_state_filter_visitor)</td> </tr> <tr> <td id="L922" class="blob-num js-line-number" data-line-number="922"></td> <td id="LC922" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-s"><span class="pl-pds">&quot;</span>DropoutWrapperInit<span class="pl-pds">&quot;</span></span>):</td> </tr> <tr> <td id="L923" class="blob-num js-line-number" data-line-number="923"></td> <td id="LC923" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">tensor_and_const_value</span>(<span class="pl-smi">v</span>):</td> </tr> <tr> <td id="L924" class="blob-num js-line-number" data-line-number="924"></td> <td id="LC924" class="blob-code blob-code-inner js-file-line"> tensor_value <span class="pl-k">=</span> ops.convert_to_tensor(v)</td> </tr> <tr> <td id="L925" class="blob-num js-line-number" data-line-number="925"></td> <td id="LC925" class="blob-code blob-code-inner js-file-line"> const_value <span class="pl-k">=</span> tensor_util.constant_value(tensor_value)</td> </tr> <tr> <td id="L926" class="blob-num js-line-number" data-line-number="926"></td> <td id="LC926" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (tensor_value, const_value)</td> </tr> <tr> <td id="L927" class="blob-num js-line-number" data-line-number="927"></td> <td id="LC927" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> prob, attr <span class="pl-k">in</span> [(input_keep_prob, <span class="pl-s"><span class="pl-pds">&quot;</span>input_keep_prob<span class="pl-pds">&quot;</span></span>),</td> </tr> <tr> <td id="L928" class="blob-num js-line-number" data-line-number="928"></td> <td id="LC928" class="blob-code blob-code-inner js-file-line"> (state_keep_prob, <span class="pl-s"><span class="pl-pds">&quot;</span>state_keep_prob<span class="pl-pds">&quot;</span></span>),</td> </tr> <tr> <td id="L929" class="blob-num js-line-number" data-line-number="929"></td> <td id="LC929" class="blob-code blob-code-inner js-file-line"> (output_keep_prob, <span class="pl-s"><span class="pl-pds">&quot;</span>output_keep_prob<span class="pl-pds">&quot;</span></span>)]:</td> </tr> <tr> <td id="L930" class="blob-num js-line-number" data-line-number="930"></td> <td id="LC930" class="blob-code blob-code-inner js-file-line"> tensor_prob, const_prob <span class="pl-k">=</span> tensor_and_const_value(prob)</td> </tr> <tr> <td id="L931" class="blob-num js-line-number" data-line-number="931"></td> <td id="LC931" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> const_prob <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L932" class="blob-num js-line-number" data-line-number="932"></td> <td id="LC932" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> const_prob <span class="pl-k">&lt;</span> <span class="pl-c1">0</span> <span class="pl-k">or</span> const_prob <span class="pl-k">&gt;</span> <span class="pl-c1">1</span>:</td> </tr> <tr> <td id="L933" class="blob-num js-line-number" data-line-number="933"></td> <td id="LC933" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Parameter <span class="pl-c1">%s</span> must be between 0 and 1: <span class="pl-c1">%d</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L934" class="blob-num js-line-number" data-line-number="934"></td> <td id="LC934" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> (attr, const_prob))</td> </tr> <tr> <td id="L935" class="blob-num js-line-number" data-line-number="935"></td> <td id="LC935" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">setattr</span>(<span class="pl-c1">self</span>, <span class="pl-s"><span class="pl-pds">&quot;</span>_<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> attr, <span class="pl-c1">float</span>(const_prob))</td> </tr> <tr> <td id="L936" class="blob-num js-line-number" data-line-number="936"></td> <td id="LC936" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L937" class="blob-num js-line-number" data-line-number="937"></td> <td id="LC937" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">setattr</span>(<span class="pl-c1">self</span>, <span class="pl-s"><span class="pl-pds">&quot;</span>_<span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> attr, tensor_prob)</td> </tr> <tr> <td id="L938" class="blob-num js-line-number" data-line-number="938"></td> <td id="LC938" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L939" class="blob-num js-line-number" data-line-number="939"></td> <td id="LC939" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Set cell, variational_recurrent, seed before running the code below</span></td> </tr> <tr> <td id="L940" class="blob-num js-line-number" data-line-number="940"></td> <td id="LC940" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell <span class="pl-k">=</span> cell</td> </tr> <tr> <td id="L941" class="blob-num js-line-number" data-line-number="941"></td> <td id="LC941" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._variational_recurrent <span class="pl-k">=</span> variational_recurrent</td> </tr> <tr> <td id="L942" class="blob-num js-line-number" data-line-number="942"></td> <td id="LC942" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._seed <span class="pl-k">=</span> seed</td> </tr> <tr> <td id="L943" class="blob-num js-line-number" data-line-number="943"></td> <td id="LC943" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L944" class="blob-num js-line-number" data-line-number="944"></td> <td id="LC944" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_input_noise <span class="pl-k">=</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L945" class="blob-num js-line-number" data-line-number="945"></td> <td id="LC945" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_state_noise <span class="pl-k">=</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L946" class="blob-num js-line-number" data-line-number="946"></td> <td id="LC946" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_output_noise <span class="pl-k">=</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L947" class="blob-num js-line-number" data-line-number="947"></td> <td id="LC947" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L948" class="blob-num js-line-number" data-line-number="948"></td> <td id="LC948" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> variational_recurrent:</td> </tr> <tr> <td id="L949" class="blob-num js-line-number" data-line-number="949"></td> <td id="LC949" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> dtype <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L950" class="blob-num js-line-number" data-line-number="950"></td> <td id="LC950" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(</td> </tr> <tr> <td id="L951" class="blob-num js-line-number" data-line-number="951"></td> <td id="LC951" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>When variational_recurrent=True, dtype must be provided<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L952" class="blob-num js-line-number" data-line-number="952"></td> <td id="LC952" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L953" class="blob-num js-line-number" data-line-number="953"></td> <td id="LC953" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">convert_to_batch_shape</span>(<span class="pl-smi">s</span>):</td> </tr> <tr> <td id="L954" class="blob-num js-line-number" data-line-number="954"></td> <td id="LC954" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Prepend a 1 for the batch dimension; for recurrent</span></td> </tr> <tr> <td id="L955" class="blob-num js-line-number" data-line-number="955"></td> <td id="LC955" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> variational dropout we use the same dropout mask for all</span></td> </tr> <tr> <td id="L956" class="blob-num js-line-number" data-line-number="956"></td> <td id="LC956" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> batch elements.</span></td> </tr> <tr> <td id="L957" class="blob-num js-line-number" data-line-number="957"></td> <td id="LC957" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> array_ops.concat(</td> </tr> <tr> <td id="L958" class="blob-num js-line-number" data-line-number="958"></td> <td id="LC958" class="blob-code blob-code-inner js-file-line"> ([<span class="pl-c1">1</span>], tensor_shape.TensorShape(s).as_list()), <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L959" class="blob-num js-line-number" data-line-number="959"></td> <td id="LC959" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L960" class="blob-num js-line-number" data-line-number="960"></td> <td id="LC960" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">batch_noise</span>(<span class="pl-smi">s</span>, <span class="pl-smi">inner_seed</span>):</td> </tr> <tr> <td id="L961" class="blob-num js-line-number" data-line-number="961"></td> <td id="LC961" class="blob-code blob-code-inner js-file-line"> shape <span class="pl-k">=</span> convert_to_batch_shape(s)</td> </tr> <tr> <td id="L962" class="blob-num js-line-number" data-line-number="962"></td> <td id="LC962" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> random_ops.random_uniform(shape, <span class="pl-v">seed</span><span class="pl-k">=</span>inner_seed, <span class="pl-v">dtype</span><span class="pl-k">=</span>dtype)</td> </tr> <tr> <td id="L963" class="blob-num js-line-number" data-line-number="963"></td> <td id="LC963" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L964" class="blob-num js-line-number" data-line-number="964"></td> <td id="LC964" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">not</span> <span class="pl-c1">isinstance</span>(<span class="pl-c1">self</span>._input_keep_prob, numbers.Real) <span class="pl-k">or</span></td> </tr> <tr> <td id="L965" class="blob-num js-line-number" data-line-number="965"></td> <td id="LC965" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._input_keep_prob <span class="pl-k">&lt;</span> <span class="pl-c1">1.0</span>):</td> </tr> <tr> <td id="L966" class="blob-num js-line-number" data-line-number="966"></td> <td id="LC966" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> input_size <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L967" class="blob-num js-line-number" data-line-number="967"></td> <td id="LC967" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(</td> </tr> <tr> <td id="L968" class="blob-num js-line-number" data-line-number="968"></td> <td id="LC968" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>When variational_recurrent=True and input_keep_prob &lt; 1.0 or <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L969" class="blob-num js-line-number" data-line-number="969"></td> <td id="LC969" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>is unknown, input_size must be provided<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L970" class="blob-num js-line-number" data-line-number="970"></td> <td id="LC970" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_input_noise <span class="pl-k">=</span> _enumerated_map_structure_up_to(</td> </tr> <tr> <td id="L971" class="blob-num js-line-number" data-line-number="971"></td> <td id="LC971" class="blob-code blob-code-inner js-file-line"> input_size,</td> </tr> <tr> <td id="L972" class="blob-num js-line-number" data-line-number="972"></td> <td id="LC972" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">lambda</span> <span class="pl-smi">i</span>, <span class="pl-smi">s</span>: batch_noise(s, <span class="pl-v">inner_seed</span><span class="pl-k">=</span><span class="pl-c1">self</span>._gen_seed(<span class="pl-s"><span class="pl-pds">&quot;</span>input<span class="pl-pds">&quot;</span></span>, i)),</td> </tr> <tr> <td id="L973" class="blob-num js-line-number" data-line-number="973"></td> <td id="LC973" class="blob-code blob-code-inner js-file-line"> input_size)</td> </tr> <tr> <td id="L974" class="blob-num js-line-number" data-line-number="974"></td> <td id="LC974" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_state_noise <span class="pl-k">=</span> _enumerated_map_structure_up_to(</td> </tr> <tr> <td id="L975" class="blob-num js-line-number" data-line-number="975"></td> <td id="LC975" class="blob-code blob-code-inner js-file-line"> cell.state_size,</td> </tr> <tr> <td id="L976" class="blob-num js-line-number" data-line-number="976"></td> <td id="LC976" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">lambda</span> <span class="pl-smi">i</span>, <span class="pl-smi">s</span>: batch_noise(s, <span class="pl-v">inner_seed</span><span class="pl-k">=</span><span class="pl-c1">self</span>._gen_seed(<span class="pl-s"><span class="pl-pds">&quot;</span>state<span class="pl-pds">&quot;</span></span>, i)),</td> </tr> <tr> <td id="L977" class="blob-num js-line-number" data-line-number="977"></td> <td id="LC977" class="blob-code blob-code-inner js-file-line"> cell.state_size)</td> </tr> <tr> <td id="L978" class="blob-num js-line-number" data-line-number="978"></td> <td id="LC978" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_output_noise <span class="pl-k">=</span> _enumerated_map_structure_up_to(</td> </tr> <tr> <td id="L979" class="blob-num js-line-number" data-line-number="979"></td> <td id="LC979" class="blob-code blob-code-inner js-file-line"> cell.output_size,</td> </tr> <tr> <td id="L980" class="blob-num js-line-number" data-line-number="980"></td> <td id="LC980" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">lambda</span> <span class="pl-smi">i</span>, <span class="pl-smi">s</span>: batch_noise(s, <span class="pl-v">inner_seed</span><span class="pl-k">=</span><span class="pl-c1">self</span>._gen_seed(<span class="pl-s"><span class="pl-pds">&quot;</span>output<span class="pl-pds">&quot;</span></span>, i)),</td> </tr> <tr> <td id="L981" class="blob-num js-line-number" data-line-number="981"></td> <td id="LC981" class="blob-code blob-code-inner js-file-line"> cell.output_size)</td> </tr> <tr> <td id="L982" class="blob-num js-line-number" data-line-number="982"></td> <td id="LC982" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L983" class="blob-num js-line-number" data-line-number="983"></td> <td id="LC983" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_gen_seed</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">salt_prefix</span>, <span class="pl-smi">index</span>):</td> </tr> <tr> <td id="L984" class="blob-num js-line-number" data-line-number="984"></td> <td id="LC984" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._seed <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L985" class="blob-num js-line-number" data-line-number="985"></td> <td id="LC985" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">None</span></td> </tr> <tr> <td id="L986" class="blob-num js-line-number" data-line-number="986"></td> <td id="LC986" class="blob-code blob-code-inner js-file-line"> salt <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span>_<span class="pl-c1">%d</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> (salt_prefix, index)</td> </tr> <tr> <td id="L987" class="blob-num js-line-number" data-line-number="987"></td> <td id="LC987" class="blob-code blob-code-inner js-file-line"> string <span class="pl-k">=</span> (<span class="pl-c1">str</span>(<span class="pl-c1">self</span>._seed) <span class="pl-k">+</span> salt).encode(<span class="pl-s"><span class="pl-pds">&quot;</span>utf-8<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L988" class="blob-num js-line-number" data-line-number="988"></td> <td id="LC988" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">int</span>(hashlib.md5(string).hexdigest()[:<span class="pl-c1">8</span>], <span class="pl-c1">16</span>) <span class="pl-k">&amp;</span> <span class="pl-c1"><span class="pl-k">0x</span>7FFFFFFF</span></td> </tr> <tr> <td id="L989" class="blob-num js-line-number" data-line-number="989"></td> <td id="LC989" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L990" class="blob-num js-line-number" data-line-number="990"></td> <td id="LC990" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L991" class="blob-num js-line-number" data-line-number="991"></td> <td id="LC991" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">wrapped_cell</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L992" class="blob-num js-line-number" data-line-number="992"></td> <td id="LC992" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell</td> </tr> <tr> <td id="L993" class="blob-num js-line-number" data-line-number="993"></td> <td id="LC993" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L994" class="blob-num js-line-number" data-line-number="994"></td> <td id="LC994" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L995" class="blob-num js-line-number" data-line-number="995"></td> <td id="LC995" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L996" class="blob-num js-line-number" data-line-number="996"></td> <td id="LC996" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.state_size</td> </tr> <tr> <td id="L997" class="blob-num js-line-number" data-line-number="997"></td> <td id="LC997" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L998" class="blob-num js-line-number" data-line-number="998"></td> <td id="LC998" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L999" class="blob-num js-line-number" data-line-number="999"></td> <td id="LC999" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1000" class="blob-num js-line-number" data-line-number="1000"></td> <td id="LC1000" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.output_size</td> </tr> <tr> <td id="L1001" class="blob-num js-line-number" data-line-number="1001"></td> <td id="LC1001" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1002" class="blob-num js-line-number" data-line-number="1002"></td> <td id="LC1002" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">zero_state</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L1003" class="blob-num js-line-number" data-line-number="1003"></td> <td id="LC1003" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-c1">type</span>(<span class="pl-c1">self</span>).<span class="pl-c1">__name__</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ZeroState<span class="pl-pds">&quot;</span></span>, <span class="pl-v">values</span><span class="pl-k">=</span>[batch_size]):</td> </tr> <tr> <td id="L1004" class="blob-num js-line-number" data-line-number="1004"></td> <td id="LC1004" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.zero_state(batch_size, dtype)</td> </tr> <tr> <td id="L1005" class="blob-num js-line-number" data-line-number="1005"></td> <td id="LC1005" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1006" class="blob-num js-line-number" data-line-number="1006"></td> <td id="LC1006" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_variational_recurrent_dropout_value</span>(</td> </tr> <tr> <td id="L1007" class="blob-num js-line-number" data-line-number="1007"></td> <td id="LC1007" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">index</span>, <span class="pl-smi">value</span>, <span class="pl-smi">noise</span>, <span class="pl-smi">keep_prob</span>):</td> </tr> <tr> <td id="L1008" class="blob-num js-line-number" data-line-number="1008"></td> <td id="LC1008" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Performs dropout given the pre-calculated noise tensor.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1009" class="blob-num js-line-number" data-line-number="1009"></td> <td id="LC1009" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> uniform [keep_prob, 1.0 + keep_prob)</span></td> </tr> <tr> <td id="L1010" class="blob-num js-line-number" data-line-number="1010"></td> <td id="LC1010" class="blob-code blob-code-inner js-file-line"> random_tensor <span class="pl-k">=</span> keep_prob <span class="pl-k">+</span> noise</td> </tr> <tr> <td id="L1011" class="blob-num js-line-number" data-line-number="1011"></td> <td id="LC1011" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1012" class="blob-num js-line-number" data-line-number="1012"></td> <td id="LC1012" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> 0. if [keep_prob, 1.0) and 1. if [1.0, 1.0 + keep_prob)</span></td> </tr> <tr> <td id="L1013" class="blob-num js-line-number" data-line-number="1013"></td> <td id="LC1013" class="blob-code blob-code-inner js-file-line"> binary_tensor <span class="pl-k">=</span> math_ops.floor(random_tensor)</td> </tr> <tr> <td id="L1014" class="blob-num js-line-number" data-line-number="1014"></td> <td id="LC1014" class="blob-code blob-code-inner js-file-line"> ret <span class="pl-k">=</span> math_ops.div(value, keep_prob) <span class="pl-k">*</span> binary_tensor</td> </tr> <tr> <td id="L1015" class="blob-num js-line-number" data-line-number="1015"></td> <td id="LC1015" class="blob-code blob-code-inner js-file-line"> ret.set_shape(value.get_shape())</td> </tr> <tr> <td id="L1016" class="blob-num js-line-number" data-line-number="1016"></td> <td id="LC1016" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ret</td> </tr> <tr> <td id="L1017" class="blob-num js-line-number" data-line-number="1017"></td> <td id="LC1017" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1018" class="blob-num js-line-number" data-line-number="1018"></td> <td id="LC1018" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_dropout</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">values</span>, <span class="pl-smi">salt_prefix</span>, <span class="pl-smi">recurrent_noise</span>, <span class="pl-smi">keep_prob</span>,</td> </tr> <tr> <td id="L1019" class="blob-num js-line-number" data-line-number="1019"></td> <td id="LC1019" class="blob-code blob-code-inner js-file-line"> <span class="pl-smi">shallow_filtered_substructure</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1020" class="blob-num js-line-number" data-line-number="1020"></td> <td id="LC1020" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Decides whether to perform standard dropout or recurrent dropout.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1021" class="blob-num js-line-number" data-line-number="1021"></td> <td id="LC1021" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1022" class="blob-num js-line-number" data-line-number="1022"></td> <td id="LC1022" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> shallow_filtered_substructure <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L1023" class="blob-num js-line-number" data-line-number="1023"></td> <td id="LC1023" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Put something so we traverse the entire structure; inside the</span></td> </tr> <tr> <td id="L1024" class="blob-num js-line-number" data-line-number="1024"></td> <td id="LC1024" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> dropout function we check to see if leafs of this are bool or not.</span></td> </tr> <tr> <td id="L1025" class="blob-num js-line-number" data-line-number="1025"></td> <td id="LC1025" class="blob-code blob-code-inner js-file-line"> shallow_filtered_substructure <span class="pl-k">=</span> values</td> </tr> <tr> <td id="L1026" class="blob-num js-line-number" data-line-number="1026"></td> <td id="LC1026" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1027" class="blob-num js-line-number" data-line-number="1027"></td> <td id="LC1027" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> <span class="pl-c1">self</span>._variational_recurrent:</td> </tr> <tr> <td id="L1028" class="blob-num js-line-number" data-line-number="1028"></td> <td id="LC1028" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">dropout</span>(<span class="pl-smi">i</span>, <span class="pl-smi">do_dropout</span>, <span class="pl-smi">v</span>):</td> </tr> <tr> <td id="L1029" class="blob-num js-line-number" data-line-number="1029"></td> <td id="LC1029" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> <span class="pl-c1">isinstance</span>(do_dropout, <span class="pl-c1">bool</span>) <span class="pl-k">or</span> do_dropout:</td> </tr> <tr> <td id="L1030" class="blob-num js-line-number" data-line-number="1030"></td> <td id="LC1030" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> nn_ops.dropout(</td> </tr> <tr> <td id="L1031" class="blob-num js-line-number" data-line-number="1031"></td> <td id="LC1031" class="blob-code blob-code-inner js-file-line"> v, <span class="pl-v">keep_prob</span><span class="pl-k">=</span>keep_prob, <span class="pl-v">seed</span><span class="pl-k">=</span><span class="pl-c1">self</span>._gen_seed(salt_prefix, i))</td> </tr> <tr> <td id="L1032" class="blob-num js-line-number" data-line-number="1032"></td> <td id="LC1032" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1033" class="blob-num js-line-number" data-line-number="1033"></td> <td id="LC1033" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> v</td> </tr> <tr> <td id="L1034" class="blob-num js-line-number" data-line-number="1034"></td> <td id="LC1034" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> _enumerated_map_structure_up_to(</td> </tr> <tr> <td id="L1035" class="blob-num js-line-number" data-line-number="1035"></td> <td id="LC1035" class="blob-code blob-code-inner js-file-line"> shallow_filtered_substructure, dropout,</td> </tr> <tr> <td id="L1036" class="blob-num js-line-number" data-line-number="1036"></td> <td id="LC1036" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">*</span>[shallow_filtered_substructure, values])</td> </tr> <tr> <td id="L1037" class="blob-num js-line-number" data-line-number="1037"></td> <td id="LC1037" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1038" class="blob-num js-line-number" data-line-number="1038"></td> <td id="LC1038" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">dropout</span>(<span class="pl-smi">i</span>, <span class="pl-smi">do_dropout</span>, <span class="pl-smi">v</span>, <span class="pl-smi">n</span>):</td> </tr> <tr> <td id="L1039" class="blob-num js-line-number" data-line-number="1039"></td> <td id="LC1039" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> <span class="pl-c1">isinstance</span>(do_dropout, <span class="pl-c1">bool</span>) <span class="pl-k">or</span> do_dropout:</td> </tr> <tr> <td id="L1040" class="blob-num js-line-number" data-line-number="1040"></td> <td id="LC1040" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._variational_recurrent_dropout_value(i, v, n, keep_prob)</td> </tr> <tr> <td id="L1041" class="blob-num js-line-number" data-line-number="1041"></td> <td id="LC1041" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1042" class="blob-num js-line-number" data-line-number="1042"></td> <td id="LC1042" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> v</td> </tr> <tr> <td id="L1043" class="blob-num js-line-number" data-line-number="1043"></td> <td id="LC1043" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> _enumerated_map_structure_up_to(</td> </tr> <tr> <td id="L1044" class="blob-num js-line-number" data-line-number="1044"></td> <td id="LC1044" class="blob-code blob-code-inner js-file-line"> shallow_filtered_substructure, dropout,</td> </tr> <tr> <td id="L1045" class="blob-num js-line-number" data-line-number="1045"></td> <td id="LC1045" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">*</span>[shallow_filtered_substructure, values, recurrent_noise])</td> </tr> <tr> <td id="L1046" class="blob-num js-line-number" data-line-number="1046"></td> <td id="LC1046" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1047" class="blob-num js-line-number" data-line-number="1047"></td> <td id="LC1047" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1048" class="blob-num js-line-number" data-line-number="1048"></td> <td id="LC1048" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run the cell with the declared dropouts.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1049" class="blob-num js-line-number" data-line-number="1049"></td> <td id="LC1049" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_should_dropout</span>(<span class="pl-smi">p</span>):</td> </tr> <tr> <td id="L1050" class="blob-num js-line-number" data-line-number="1050"></td> <td id="LC1050" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">not</span> <span class="pl-c1">isinstance</span>(p, <span class="pl-c1">float</span>)) <span class="pl-k">or</span> p <span class="pl-k">&lt;</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L1051" class="blob-num js-line-number" data-line-number="1051"></td> <td id="LC1051" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1052" class="blob-num js-line-number" data-line-number="1052"></td> <td id="LC1052" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> _should_dropout(<span class="pl-c1">self</span>._input_keep_prob):</td> </tr> <tr> <td id="L1053" class="blob-num js-line-number" data-line-number="1053"></td> <td id="LC1053" class="blob-code blob-code-inner js-file-line"> inputs <span class="pl-k">=</span> <span class="pl-c1">self</span>._dropout(inputs, <span class="pl-s"><span class="pl-pds">&quot;</span>input<span class="pl-pds">&quot;</span></span>,</td> </tr> <tr> <td id="L1054" class="blob-num js-line-number" data-line-number="1054"></td> <td id="LC1054" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_input_noise,</td> </tr> <tr> <td id="L1055" class="blob-num js-line-number" data-line-number="1055"></td> <td id="LC1055" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._input_keep_prob)</td> </tr> <tr> <td id="L1056" class="blob-num js-line-number" data-line-number="1056"></td> <td id="LC1056" class="blob-code blob-code-inner js-file-line"> output, new_state <span class="pl-k">=</span> <span class="pl-c1">self</span>._cell(inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope)</td> </tr> <tr> <td id="L1057" class="blob-num js-line-number" data-line-number="1057"></td> <td id="LC1057" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> _should_dropout(<span class="pl-c1">self</span>._state_keep_prob):</td> </tr> <tr> <td id="L1058" class="blob-num js-line-number" data-line-number="1058"></td> <td id="LC1058" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Identify which subsets of the state to perform dropout on and</span></td> </tr> <tr> <td id="L1059" class="blob-num js-line-number" data-line-number="1059"></td> <td id="LC1059" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> which ones to keep.</span></td> </tr> <tr> <td id="L1060" class="blob-num js-line-number" data-line-number="1060"></td> <td id="LC1060" class="blob-code blob-code-inner js-file-line"> shallow_filtered_substructure <span class="pl-k">=</span> nest.get_traverse_shallow_structure(</td> </tr> <tr> <td id="L1061" class="blob-num js-line-number" data-line-number="1061"></td> <td id="LC1061" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._dropout_state_filter, new_state)</td> </tr> <tr> <td id="L1062" class="blob-num js-line-number" data-line-number="1062"></td> <td id="LC1062" class="blob-code blob-code-inner js-file-line"> new_state <span class="pl-k">=</span> <span class="pl-c1">self</span>._dropout(new_state, <span class="pl-s"><span class="pl-pds">&quot;</span>state<span class="pl-pds">&quot;</span></span>,</td> </tr> <tr> <td id="L1063" class="blob-num js-line-number" data-line-number="1063"></td> <td id="LC1063" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_state_noise,</td> </tr> <tr> <td id="L1064" class="blob-num js-line-number" data-line-number="1064"></td> <td id="LC1064" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_keep_prob,</td> </tr> <tr> <td id="L1065" class="blob-num js-line-number" data-line-number="1065"></td> <td id="LC1065" class="blob-code blob-code-inner js-file-line"> shallow_filtered_substructure)</td> </tr> <tr> <td id="L1066" class="blob-num js-line-number" data-line-number="1066"></td> <td id="LC1066" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> _should_dropout(<span class="pl-c1">self</span>._output_keep_prob):</td> </tr> <tr> <td id="L1067" class="blob-num js-line-number" data-line-number="1067"></td> <td id="LC1067" class="blob-code blob-code-inner js-file-line"> output <span class="pl-k">=</span> <span class="pl-c1">self</span>._dropout(output, <span class="pl-s"><span class="pl-pds">&quot;</span>output<span class="pl-pds">&quot;</span></span>,</td> </tr> <tr> <td id="L1068" class="blob-num js-line-number" data-line-number="1068"></td> <td id="LC1068" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._recurrent_output_noise,</td> </tr> <tr> <td id="L1069" class="blob-num js-line-number" data-line-number="1069"></td> <td id="LC1069" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._output_keep_prob)</td> </tr> <tr> <td id="L1070" class="blob-num js-line-number" data-line-number="1070"></td> <td id="LC1070" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> output, new_state</td> </tr> <tr> <td id="L1071" class="blob-num js-line-number" data-line-number="1071"></td> <td id="LC1071" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1072" class="blob-num js-line-number" data-line-number="1072"></td> <td id="LC1072" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1073" class="blob-num js-line-number" data-line-number="1073"></td> <td id="LC1073" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.ResidualWrapper<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L1074" class="blob-num js-line-number" data-line-number="1074"></td> <td id="LC1074" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">ResidualWrapper</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L1075" class="blob-num js-line-number" data-line-number="1075"></td> <td id="LC1075" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>RNNCell wrapper that ensures cell inputs are added to the outputs.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1076" class="blob-num js-line-number" data-line-number="1076"></td> <td id="LC1076" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1077" class="blob-num js-line-number" data-line-number="1077"></td> <td id="LC1077" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">cell</span>, <span class="pl-smi">residual_fn</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1078" class="blob-num js-line-number" data-line-number="1078"></td> <td id="LC1078" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Constructs a `ResidualWrapper` for `cell`.</span></td> </tr> <tr> <td id="L1079" class="blob-num js-line-number" data-line-number="1079"></td> <td id="LC1079" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1080" class="blob-num js-line-number" data-line-number="1080"></td> <td id="LC1080" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L1081" class="blob-num js-line-number" data-line-number="1081"></td> <td id="LC1081" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cell: An instance of `RNNCell`.</span></td> </tr> <tr> <td id="L1082" class="blob-num js-line-number" data-line-number="1082"></td> <td id="LC1082" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> residual_fn: (Optional) The function to map raw cell inputs and raw cell</span></td> </tr> <tr> <td id="L1083" class="blob-num js-line-number" data-line-number="1083"></td> <td id="LC1083" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> outputs to the actual cell outputs of the residual network.</span></td> </tr> <tr> <td id="L1084" class="blob-num js-line-number" data-line-number="1084"></td> <td id="LC1084" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Defaults to calling nest.map_structure on (lambda i, o: i + o), inputs</span></td> </tr> <tr> <td id="L1085" class="blob-num js-line-number" data-line-number="1085"></td> <td id="LC1085" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> and outputs.</span></td> </tr> <tr> <td id="L1086" class="blob-num js-line-number" data-line-number="1086"></td> <td id="LC1086" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1087" class="blob-num js-line-number" data-line-number="1087"></td> <td id="LC1087" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell <span class="pl-k">=</span> cell</td> </tr> <tr> <td id="L1088" class="blob-num js-line-number" data-line-number="1088"></td> <td id="LC1088" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._residual_fn <span class="pl-k">=</span> residual_fn</td> </tr> <tr> <td id="L1089" class="blob-num js-line-number" data-line-number="1089"></td> <td id="LC1089" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1090" class="blob-num js-line-number" data-line-number="1090"></td> <td id="LC1090" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1091" class="blob-num js-line-number" data-line-number="1091"></td> <td id="LC1091" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1092" class="blob-num js-line-number" data-line-number="1092"></td> <td id="LC1092" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.state_size</td> </tr> <tr> <td id="L1093" class="blob-num js-line-number" data-line-number="1093"></td> <td id="LC1093" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1094" class="blob-num js-line-number" data-line-number="1094"></td> <td id="LC1094" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1095" class="blob-num js-line-number" data-line-number="1095"></td> <td id="LC1095" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1096" class="blob-num js-line-number" data-line-number="1096"></td> <td id="LC1096" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.output_size</td> </tr> <tr> <td id="L1097" class="blob-num js-line-number" data-line-number="1097"></td> <td id="LC1097" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1098" class="blob-num js-line-number" data-line-number="1098"></td> <td id="LC1098" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">zero_state</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L1099" class="blob-num js-line-number" data-line-number="1099"></td> <td id="LC1099" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-c1">type</span>(<span class="pl-c1">self</span>).<span class="pl-c1">__name__</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ZeroState<span class="pl-pds">&quot;</span></span>, <span class="pl-v">values</span><span class="pl-k">=</span>[batch_size]):</td> </tr> <tr> <td id="L1100" class="blob-num js-line-number" data-line-number="1100"></td> <td id="LC1100" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.zero_state(batch_size, dtype)</td> </tr> <tr> <td id="L1101" class="blob-num js-line-number" data-line-number="1101"></td> <td id="LC1101" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1102" class="blob-num js-line-number" data-line-number="1102"></td> <td id="LC1102" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1103" class="blob-num js-line-number" data-line-number="1103"></td> <td id="LC1103" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run the cell and then apply the residual_fn on its inputs to its outputs.</span></td> </tr> <tr> <td id="L1104" class="blob-num js-line-number" data-line-number="1104"></td> <td id="LC1104" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1105" class="blob-num js-line-number" data-line-number="1105"></td> <td id="LC1105" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L1106" class="blob-num js-line-number" data-line-number="1106"></td> <td id="LC1106" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> inputs: cell inputs.</span></td> </tr> <tr> <td id="L1107" class="blob-num js-line-number" data-line-number="1107"></td> <td id="LC1107" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state: cell state.</span></td> </tr> <tr> <td id="L1108" class="blob-num js-line-number" data-line-number="1108"></td> <td id="LC1108" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> scope: optional cell scope.</span></td> </tr> <tr> <td id="L1109" class="blob-num js-line-number" data-line-number="1109"></td> <td id="LC1109" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1110" class="blob-num js-line-number" data-line-number="1110"></td> <td id="LC1110" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Returns:</span></td> </tr> <tr> <td id="L1111" class="blob-num js-line-number" data-line-number="1111"></td> <td id="LC1111" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Tuple of cell outputs and new state.</span></td> </tr> <tr> <td id="L1112" class="blob-num js-line-number" data-line-number="1112"></td> <td id="LC1112" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1113" class="blob-num js-line-number" data-line-number="1113"></td> <td id="LC1113" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L1114" class="blob-num js-line-number" data-line-number="1114"></td> <td id="LC1114" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> TypeError: If cell inputs and outputs have different structure (type).</span></td> </tr> <tr> <td id="L1115" class="blob-num js-line-number" data-line-number="1115"></td> <td id="LC1115" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: If cell inputs and outputs have different structure (value).</span></td> </tr> <tr> <td id="L1116" class="blob-num js-line-number" data-line-number="1116"></td> <td id="LC1116" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1117" class="blob-num js-line-number" data-line-number="1117"></td> <td id="LC1117" class="blob-code blob-code-inner js-file-line"> outputs, new_state <span class="pl-k">=</span> <span class="pl-c1">self</span>._cell(inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope)</td> </tr> <tr> <td id="L1118" class="blob-num js-line-number" data-line-number="1118"></td> <td id="LC1118" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Ensure shapes match</span></td> </tr> <tr> <td id="L1119" class="blob-num js-line-number" data-line-number="1119"></td> <td id="LC1119" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">assert_shape_match</span>(<span class="pl-smi">inp</span>, <span class="pl-smi">out</span>):</td> </tr> <tr> <td id="L1120" class="blob-num js-line-number" data-line-number="1120"></td> <td id="LC1120" class="blob-code blob-code-inner js-file-line"> inp.get_shape().assert_is_compatible_with(out.get_shape())</td> </tr> <tr> <td id="L1121" class="blob-num js-line-number" data-line-number="1121"></td> <td id="LC1121" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">default_residual_fn</span>(<span class="pl-smi">inputs</span>, <span class="pl-smi">outputs</span>):</td> </tr> <tr> <td id="L1122" class="blob-num js-line-number" data-line-number="1122"></td> <td id="LC1122" class="blob-code blob-code-inner js-file-line"> nest.assert_same_structure(inputs, outputs)</td> </tr> <tr> <td id="L1123" class="blob-num js-line-number" data-line-number="1123"></td> <td id="LC1123" class="blob-code blob-code-inner js-file-line"> nest.map_structure(assert_shape_match, inputs, outputs)</td> </tr> <tr> <td id="L1124" class="blob-num js-line-number" data-line-number="1124"></td> <td id="LC1124" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> nest.map_structure(<span class="pl-k">lambda</span> <span class="pl-smi">inp</span>, <span class="pl-smi">out</span>: inp <span class="pl-k">+</span> out, inputs, outputs)</td> </tr> <tr> <td id="L1125" class="blob-num js-line-number" data-line-number="1125"></td> <td id="LC1125" class="blob-code blob-code-inner js-file-line"> res_outputs <span class="pl-k">=</span> (<span class="pl-c1">self</span>._residual_fn <span class="pl-k">or</span> default_residual_fn)(inputs, outputs)</td> </tr> <tr> <td id="L1126" class="blob-num js-line-number" data-line-number="1126"></td> <td id="LC1126" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (res_outputs, new_state)</td> </tr> <tr> <td id="L1127" class="blob-num js-line-number" data-line-number="1127"></td> <td id="LC1127" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1128" class="blob-num js-line-number" data-line-number="1128"></td> <td id="LC1128" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1129" class="blob-num js-line-number" data-line-number="1129"></td> <td id="LC1129" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.DeviceWrapper<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L1130" class="blob-num js-line-number" data-line-number="1130"></td> <td id="LC1130" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">DeviceWrapper</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L1131" class="blob-num js-line-number" data-line-number="1131"></td> <td id="LC1131" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Operator that ensures an RNNCell runs on a particular device.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1132" class="blob-num js-line-number" data-line-number="1132"></td> <td id="LC1132" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1133" class="blob-num js-line-number" data-line-number="1133"></td> <td id="LC1133" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">cell</span>, <span class="pl-smi">device</span>):</td> </tr> <tr> <td id="L1134" class="blob-num js-line-number" data-line-number="1134"></td> <td id="LC1134" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Construct a `DeviceWrapper` for `cell` with device `device`.</span></td> </tr> <tr> <td id="L1135" class="blob-num js-line-number" data-line-number="1135"></td> <td id="LC1135" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1136" class="blob-num js-line-number" data-line-number="1136"></td> <td id="LC1136" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Ensures the wrapped `cell` is called with `tf.device(device)`.</span></td> </tr> <tr> <td id="L1137" class="blob-num js-line-number" data-line-number="1137"></td> <td id="LC1137" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1138" class="blob-num js-line-number" data-line-number="1138"></td> <td id="LC1138" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L1139" class="blob-num js-line-number" data-line-number="1139"></td> <td id="LC1139" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cell: An instance of `RNNCell`.</span></td> </tr> <tr> <td id="L1140" class="blob-num js-line-number" data-line-number="1140"></td> <td id="LC1140" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> device: A device string or function, for passing to `tf.device`.</span></td> </tr> <tr> <td id="L1141" class="blob-num js-line-number" data-line-number="1141"></td> <td id="LC1141" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1142" class="blob-num js-line-number" data-line-number="1142"></td> <td id="LC1142" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell <span class="pl-k">=</span> cell</td> </tr> <tr> <td id="L1143" class="blob-num js-line-number" data-line-number="1143"></td> <td id="LC1143" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._device <span class="pl-k">=</span> device</td> </tr> <tr> <td id="L1144" class="blob-num js-line-number" data-line-number="1144"></td> <td id="LC1144" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1145" class="blob-num js-line-number" data-line-number="1145"></td> <td id="LC1145" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1146" class="blob-num js-line-number" data-line-number="1146"></td> <td id="LC1146" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1147" class="blob-num js-line-number" data-line-number="1147"></td> <td id="LC1147" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.state_size</td> </tr> <tr> <td id="L1148" class="blob-num js-line-number" data-line-number="1148"></td> <td id="LC1148" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1149" class="blob-num js-line-number" data-line-number="1149"></td> <td id="LC1149" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1150" class="blob-num js-line-number" data-line-number="1150"></td> <td id="LC1150" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1151" class="blob-num js-line-number" data-line-number="1151"></td> <td id="LC1151" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.output_size</td> </tr> <tr> <td id="L1152" class="blob-num js-line-number" data-line-number="1152"></td> <td id="LC1152" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1153" class="blob-num js-line-number" data-line-number="1153"></td> <td id="LC1153" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">zero_state</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L1154" class="blob-num js-line-number" data-line-number="1154"></td> <td id="LC1154" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-c1">type</span>(<span class="pl-c1">self</span>).<span class="pl-c1">__name__</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ZeroState<span class="pl-pds">&quot;</span></span>, <span class="pl-v">values</span><span class="pl-k">=</span>[batch_size]):</td> </tr> <tr> <td id="L1155" class="blob-num js-line-number" data-line-number="1155"></td> <td id="LC1155" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.device(<span class="pl-c1">self</span>._device):</td> </tr> <tr> <td id="L1156" class="blob-num js-line-number" data-line-number="1156"></td> <td id="LC1156" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell.zero_state(batch_size, dtype)</td> </tr> <tr> <td id="L1157" class="blob-num js-line-number" data-line-number="1157"></td> <td id="LC1157" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1158" class="blob-num js-line-number" data-line-number="1158"></td> <td id="LC1158" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1159" class="blob-num js-line-number" data-line-number="1159"></td> <td id="LC1159" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run the cell on specified device.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1160" class="blob-num js-line-number" data-line-number="1160"></td> <td id="LC1160" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.device(<span class="pl-c1">self</span>._device):</td> </tr> <tr> <td id="L1161" class="blob-num js-line-number" data-line-number="1161"></td> <td id="LC1161" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cell(inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope)</td> </tr> <tr> <td id="L1162" class="blob-num js-line-number" data-line-number="1162"></td> <td id="LC1162" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1163" class="blob-num js-line-number" data-line-number="1163"></td> <td id="LC1163" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1164" class="blob-num js-line-number" data-line-number="1164"></td> <td id="LC1164" class="blob-code blob-code-inner js-file-line"><span class="pl-en">@tf_export</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>nn.rnn_cell.MultiRNNCell<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L1165" class="blob-num js-line-number" data-line-number="1165"></td> <td id="LC1165" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">MultiRNNCell</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L1166" class="blob-num js-line-number" data-line-number="1166"></td> <td id="LC1166" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>RNN cell composed sequentially of multiple simple cells.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1167" class="blob-num js-line-number" data-line-number="1167"></td> <td id="LC1167" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1168" class="blob-num js-line-number" data-line-number="1168"></td> <td id="LC1168" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">cells</span>, <span class="pl-smi">state_is_tuple</span><span class="pl-k">=</span><span class="pl-c1">True</span>):</td> </tr> <tr> <td id="L1169" class="blob-num js-line-number" data-line-number="1169"></td> <td id="LC1169" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Create a RNN cell composed sequentially of a number of RNNCells.</span></td> </tr> <tr> <td id="L1170" class="blob-num js-line-number" data-line-number="1170"></td> <td id="LC1170" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1171" class="blob-num js-line-number" data-line-number="1171"></td> <td id="LC1171" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L1172" class="blob-num js-line-number" data-line-number="1172"></td> <td id="LC1172" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cells: list of RNNCells that will be composed in this order.</span></td> </tr> <tr> <td id="L1173" class="blob-num js-line-number" data-line-number="1173"></td> <td id="LC1173" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state_is_tuple: If True, accepted and returned states are n-tuples, where</span></td> </tr> <tr> <td id="L1174" class="blob-num js-line-number" data-line-number="1174"></td> <td id="LC1174" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> `n = len(cells)`. If False, the states are all</span></td> </tr> <tr> <td id="L1175" class="blob-num js-line-number" data-line-number="1175"></td> <td id="LC1175" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> concatenated along the column axis. This latter behavior will soon be</span></td> </tr> <tr> <td id="L1176" class="blob-num js-line-number" data-line-number="1176"></td> <td id="LC1176" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> deprecated.</span></td> </tr> <tr> <td id="L1177" class="blob-num js-line-number" data-line-number="1177"></td> <td id="LC1177" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1178" class="blob-num js-line-number" data-line-number="1178"></td> <td id="LC1178" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L1179" class="blob-num js-line-number" data-line-number="1179"></td> <td id="LC1179" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: if cells is empty (not allowed), or at least one of the cells</span></td> </tr> <tr> <td id="L1180" class="blob-num js-line-number" data-line-number="1180"></td> <td id="LC1180" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> returns a state tuple but the flag `state_is_tuple` is `False`.</span></td> </tr> <tr> <td id="L1181" class="blob-num js-line-number" data-line-number="1181"></td> <td id="LC1181" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1182" class="blob-num js-line-number" data-line-number="1182"></td> <td id="LC1182" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">super</span>(MultiRNNCell, <span class="pl-c1">self</span>).<span class="pl-c1">__init__</span>()</td> </tr> <tr> <td id="L1183" class="blob-num js-line-number" data-line-number="1183"></td> <td id="LC1183" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> cells:</td> </tr> <tr> <td id="L1184" class="blob-num js-line-number" data-line-number="1184"></td> <td id="LC1184" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Must specify at least one cell for MultiRNNCell.<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="L1185" class="blob-num js-line-number" data-line-number="1185"></td> <td id="LC1185" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> nest.is_sequence(cells):</td> </tr> <tr> <td id="L1186" class="blob-num js-line-number" data-line-number="1186"></td> <td id="LC1186" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">TypeError</span>(</td> </tr> <tr> <td id="L1187" class="blob-num js-line-number" data-line-number="1187"></td> <td id="LC1187" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>cells must be a list or tuple, but saw: <span class="pl-c1">%s</span>.<span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> cells)</td> </tr> <tr> <td id="L1188" class="blob-num js-line-number" data-line-number="1188"></td> <td id="LC1188" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1189" class="blob-num js-line-number" data-line-number="1189"></td> <td id="LC1189" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cells <span class="pl-k">=</span> cells</td> </tr> <tr> <td id="L1190" class="blob-num js-line-number" data-line-number="1190"></td> <td id="LC1190" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">=</span> state_is_tuple</td> </tr> <tr> <td id="L1191" class="blob-num js-line-number" data-line-number="1191"></td> <td id="LC1191" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> state_is_tuple:</td> </tr> <tr> <td id="L1192" class="blob-num js-line-number" data-line-number="1192"></td> <td id="LC1192" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">any</span>(nest.is_sequence(c.state_size) <span class="pl-k">for</span> c <span class="pl-k">in</span> <span class="pl-c1">self</span>._cells):</td> </tr> <tr> <td id="L1193" class="blob-num js-line-number" data-line-number="1193"></td> <td id="LC1193" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Some cells return tuples of states, but the flag <span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L1194" class="blob-num js-line-number" data-line-number="1194"></td> <td id="LC1194" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>state_is_tuple is not set. State sizes are: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="L1195" class="blob-num js-line-number" data-line-number="1195"></td> <td id="LC1195" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">%</span> <span class="pl-c1">str</span>([c.state_size <span class="pl-k">for</span> c <span class="pl-k">in</span> <span class="pl-c1">self</span>._cells]))</td> </tr> <tr> <td id="L1196" class="blob-num js-line-number" data-line-number="1196"></td> <td id="LC1196" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1197" class="blob-num js-line-number" data-line-number="1197"></td> <td id="LC1197" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1198" class="blob-num js-line-number" data-line-number="1198"></td> <td id="LC1198" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1199" class="blob-num js-line-number" data-line-number="1199"></td> <td id="LC1199" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L1200" class="blob-num js-line-number" data-line-number="1200"></td> <td id="LC1200" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">tuple</span>(cell.state_size <span class="pl-k">for</span> cell <span class="pl-k">in</span> <span class="pl-c1">self</span>._cells)</td> </tr> <tr> <td id="L1201" class="blob-num js-line-number" data-line-number="1201"></td> <td id="LC1201" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1202" class="blob-num js-line-number" data-line-number="1202"></td> <td id="LC1202" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">sum</span>([cell.state_size <span class="pl-k">for</span> cell <span class="pl-k">in</span> <span class="pl-c1">self</span>._cells])</td> </tr> <tr> <td id="L1203" class="blob-num js-line-number" data-line-number="1203"></td> <td id="LC1203" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1204" class="blob-num js-line-number" data-line-number="1204"></td> <td id="LC1204" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1205" class="blob-num js-line-number" data-line-number="1205"></td> <td id="LC1205" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1206" class="blob-num js-line-number" data-line-number="1206"></td> <td id="LC1206" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._cells[<span class="pl-k">-</span><span class="pl-c1">1</span>].output_size</td> </tr> <tr> <td id="L1207" class="blob-num js-line-number" data-line-number="1207"></td> <td id="LC1207" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1208" class="blob-num js-line-number" data-line-number="1208"></td> <td id="LC1208" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">zero_state</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">batch_size</span>, <span class="pl-smi">dtype</span>):</td> </tr> <tr> <td id="L1209" class="blob-num js-line-number" data-line-number="1209"></td> <td id="LC1209" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> ops.name_scope(<span class="pl-c1">type</span>(<span class="pl-c1">self</span>).<span class="pl-c1">__name__</span> <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ZeroState<span class="pl-pds">&quot;</span></span>, <span class="pl-v">values</span><span class="pl-k">=</span>[batch_size]):</td> </tr> <tr> <td id="L1210" class="blob-num js-line-number" data-line-number="1210"></td> <td id="LC1210" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L1211" class="blob-num js-line-number" data-line-number="1211"></td> <td id="LC1211" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">tuple</span>(cell.zero_state(batch_size, dtype) <span class="pl-k">for</span> cell <span class="pl-k">in</span> <span class="pl-c1">self</span>._cells)</td> </tr> <tr> <td id="L1212" class="blob-num js-line-number" data-line-number="1212"></td> <td id="LC1212" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1213" class="blob-num js-line-number" data-line-number="1213"></td> <td id="LC1213" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> We know here that state_size of each cell is not a tuple and</span></td> </tr> <tr> <td id="L1214" class="blob-num js-line-number" data-line-number="1214"></td> <td id="LC1214" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> presumably does not contain TensorArrays or anything else fancy</span></td> </tr> <tr> <td id="L1215" class="blob-num js-line-number" data-line-number="1215"></td> <td id="LC1215" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">super</span>(MultiRNNCell, <span class="pl-c1">self</span>).zero_state(batch_size, dtype)</td> </tr> <tr> <td id="L1216" class="blob-num js-line-number" data-line-number="1216"></td> <td id="LC1216" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1217" class="blob-num js-line-number" data-line-number="1217"></td> <td id="LC1217" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">call</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>):</td> </tr> <tr> <td id="L1218" class="blob-num js-line-number" data-line-number="1218"></td> <td id="LC1218" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Run this multi-layer cell on inputs, starting from state.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1219" class="blob-num js-line-number" data-line-number="1219"></td> <td id="LC1219" class="blob-code blob-code-inner js-file-line"> cur_state_pos <span class="pl-k">=</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L1220" class="blob-num js-line-number" data-line-number="1220"></td> <td id="LC1220" class="blob-code blob-code-inner js-file-line"> cur_inp <span class="pl-k">=</span> inputs</td> </tr> <tr> <td id="L1221" class="blob-num js-line-number" data-line-number="1221"></td> <td id="LC1221" class="blob-code blob-code-inner js-file-line"> new_states <span class="pl-k">=</span> []</td> </tr> <tr> <td id="L1222" class="blob-num js-line-number" data-line-number="1222"></td> <td id="LC1222" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> i, cell <span class="pl-k">in</span> <span class="pl-c1">enumerate</span>(<span class="pl-c1">self</span>._cells):</td> </tr> <tr> <td id="L1223" class="blob-num js-line-number" data-line-number="1223"></td> <td id="LC1223" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">with</span> vs.variable_scope(<span class="pl-s"><span class="pl-pds">&quot;</span>cell_<span class="pl-c1">%d</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> i):</td> </tr> <tr> <td id="L1224" class="blob-num js-line-number" data-line-number="1224"></td> <td id="LC1224" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple:</td> </tr> <tr> <td id="L1225" class="blob-num js-line-number" data-line-number="1225"></td> <td id="LC1225" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> nest.is_sequence(state):</td> </tr> <tr> <td id="L1226" class="blob-num js-line-number" data-line-number="1226"></td> <td id="LC1226" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(</td> </tr> <tr> <td id="L1227" class="blob-num js-line-number" data-line-number="1227"></td> <td id="LC1227" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;</span>Expected state to be a tuple of length <span class="pl-c1">%d</span>, but received: <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span></td> </tr> <tr> <td id="L1228" class="blob-num js-line-number" data-line-number="1228"></td> <td id="LC1228" class="blob-code blob-code-inner js-file-line"> (<span class="pl-c1">len</span>(<span class="pl-c1">self</span>.state_size), state))</td> </tr> <tr> <td id="L1229" class="blob-num js-line-number" data-line-number="1229"></td> <td id="LC1229" class="blob-code blob-code-inner js-file-line"> cur_state <span class="pl-k">=</span> state[i]</td> </tr> <tr> <td id="L1230" class="blob-num js-line-number" data-line-number="1230"></td> <td id="LC1230" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span>:</td> </tr> <tr> <td id="L1231" class="blob-num js-line-number" data-line-number="1231"></td> <td id="LC1231" class="blob-code blob-code-inner js-file-line"> cur_state <span class="pl-k">=</span> array_ops.slice(state, [<span class="pl-c1">0</span>, cur_state_pos],</td> </tr> <tr> <td id="L1232" class="blob-num js-line-number" data-line-number="1232"></td> <td id="LC1232" class="blob-code blob-code-inner js-file-line"> [<span class="pl-k">-</span><span class="pl-c1">1</span>, cell.state_size])</td> </tr> <tr> <td id="L1233" class="blob-num js-line-number" data-line-number="1233"></td> <td id="LC1233" class="blob-code blob-code-inner js-file-line"> cur_state_pos <span class="pl-k">+=</span> cell.state_size</td> </tr> <tr> <td id="L1234" class="blob-num js-line-number" data-line-number="1234"></td> <td id="LC1234" class="blob-code blob-code-inner js-file-line"> cur_inp, new_state <span class="pl-k">=</span> cell(cur_inp, cur_state)</td> </tr> <tr> <td id="L1235" class="blob-num js-line-number" data-line-number="1235"></td> <td id="LC1235" class="blob-code blob-code-inner js-file-line"> new_states.append(new_state)</td> </tr> <tr> <td id="L1236" class="blob-num js-line-number" data-line-number="1236"></td> <td id="LC1236" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1237" class="blob-num js-line-number" data-line-number="1237"></td> <td id="LC1237" class="blob-code blob-code-inner js-file-line"> new_states <span class="pl-k">=</span> (<span class="pl-c1">tuple</span>(new_states) <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_is_tuple <span class="pl-k">else</span></td> </tr> <tr> <td id="L1238" class="blob-num js-line-number" data-line-number="1238"></td> <td id="LC1238" class="blob-code blob-code-inner js-file-line"> array_ops.concat(new_states, <span class="pl-c1">1</span>))</td> </tr> <tr> <td id="L1239" class="blob-num js-line-number" data-line-number="1239"></td> <td id="LC1239" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1240" class="blob-num js-line-number" data-line-number="1240"></td> <td id="LC1240" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> cur_inp, new_states</td> </tr> <tr> <td id="L1241" class="blob-num js-line-number" data-line-number="1241"></td> <td id="LC1241" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1242" class="blob-num js-line-number" data-line-number="1242"></td> <td id="LC1242" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1243" class="blob-num js-line-number" data-line-number="1243"></td> <td id="LC1243" class="blob-code blob-code-inner js-file-line"><span class="pl-k">class</span> <span class="pl-en">_SlimRNNCell</span>(<span class="pl-e">RNNCell</span>):</td> </tr> <tr> <td id="L1244" class="blob-num js-line-number" data-line-number="1244"></td> <td id="LC1244" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>A simple wrapper for slim.rnn_cells.<span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1245" class="blob-num js-line-number" data-line-number="1245"></td> <td id="LC1245" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1246" class="blob-num js-line-number" data-line-number="1246"></td> <td id="LC1246" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__init__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">cell_fn</span>):</td> </tr> <tr> <td id="L1247" class="blob-num js-line-number" data-line-number="1247"></td> <td id="LC1247" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Create a SlimRNNCell from a cell_fn.</span></td> </tr> <tr> <td id="L1248" class="blob-num js-line-number" data-line-number="1248"></td> <td id="LC1248" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1249" class="blob-num js-line-number" data-line-number="1249"></td> <td id="LC1249" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Args:</span></td> </tr> <tr> <td id="L1250" class="blob-num js-line-number" data-line-number="1250"></td> <td id="LC1250" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> cell_fn: a function which takes (inputs, state, scope) and produces the</span></td> </tr> <tr> <td id="L1251" class="blob-num js-line-number" data-line-number="1251"></td> <td id="LC1251" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> outputs and the new_state. Additionally when called with inputs=None and</span></td> </tr> <tr> <td id="L1252" class="blob-num js-line-number" data-line-number="1252"></td> <td id="LC1252" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> state=None it should return (initial_outputs, initial_state).</span></td> </tr> <tr> <td id="L1253" class="blob-num js-line-number" data-line-number="1253"></td> <td id="LC1253" class="blob-code blob-code-inner js-file-line"><span class="pl-s"></span></td> </tr> <tr> <td id="L1254" class="blob-num js-line-number" data-line-number="1254"></td> <td id="LC1254" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> Raises:</span></td> </tr> <tr> <td id="L1255" class="blob-num js-line-number" data-line-number="1255"></td> <td id="LC1255" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> TypeError: if cell_fn is not callable</span></td> </tr> <tr> <td id="L1256" class="blob-num js-line-number" data-line-number="1256"></td> <td id="LC1256" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> ValueError: if cell_fn cannot produce a valid initial state.</span></td> </tr> <tr> <td id="L1257" class="blob-num js-line-number" data-line-number="1257"></td> <td id="LC1257" class="blob-code blob-code-inner js-file-line"><span class="pl-s"> <span class="pl-pds">&quot;&quot;&quot;</span></span></td> </tr> <tr> <td id="L1258" class="blob-num js-line-number" data-line-number="1258"></td> <td id="LC1258" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-k">not</span> <span class="pl-c1">callable</span>(cell_fn):</td> </tr> <tr> <td id="L1259" class="blob-num js-line-number" data-line-number="1259"></td> <td id="LC1259" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">TypeError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>cell_fn <span class="pl-c1">%s</span> needs to be callable<span class="pl-pds">&quot;</span></span>, cell_fn)</td> </tr> <tr> <td id="L1260" class="blob-num js-line-number" data-line-number="1260"></td> <td id="LC1260" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell_fn <span class="pl-k">=</span> cell_fn</td> </tr> <tr> <td id="L1261" class="blob-num js-line-number" data-line-number="1261"></td> <td id="LC1261" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._cell_name <span class="pl-k">=</span> cell_fn.func.<span class="pl-c1">__name__</span></td> </tr> <tr> <td id="L1262" class="blob-num js-line-number" data-line-number="1262"></td> <td id="LC1262" class="blob-code blob-code-inner js-file-line"> init_output, init_state <span class="pl-k">=</span> <span class="pl-c1">self</span>._cell_fn(<span class="pl-c1">None</span>, <span class="pl-c1">None</span>)</td> </tr> <tr> <td id="L1263" class="blob-num js-line-number" data-line-number="1263"></td> <td id="LC1263" class="blob-code blob-code-inner js-file-line"> output_shape <span class="pl-k">=</span> init_output.get_shape()</td> </tr> <tr> <td id="L1264" class="blob-num js-line-number" data-line-number="1264"></td> <td id="LC1264" class="blob-code blob-code-inner js-file-line"> state_shape <span class="pl-k">=</span> init_state.get_shape()</td> </tr> <tr> <td id="L1265" class="blob-num js-line-number" data-line-number="1265"></td> <td id="LC1265" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._output_size <span class="pl-k">=</span> output_shape.with_rank(<span class="pl-c1">2</span>)[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L1266" class="blob-num js-line-number" data-line-number="1266"></td> <td id="LC1266" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">self</span>._state_size <span class="pl-k">=</span> state_shape.with_rank(<span class="pl-c1">2</span>)[<span class="pl-c1">1</span>].value</td> </tr> <tr> <td id="L1267" class="blob-num js-line-number" data-line-number="1267"></td> <td id="LC1267" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._output_size <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L1268" class="blob-num js-line-number" data-line-number="1268"></td> <td id="LC1268" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Initial output created by <span class="pl-c1">%s</span> has invalid shape <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span></td> </tr> <tr> <td id="L1269" class="blob-num js-line-number" data-line-number="1269"></td> <td id="LC1269" class="blob-code blob-code-inner js-file-line"> (<span class="pl-c1">self</span>._cell_name, output_shape))</td> </tr> <tr> <td id="L1270" class="blob-num js-line-number" data-line-number="1270"></td> <td id="LC1270" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-c1">self</span>._state_size <span class="pl-k">is</span> <span class="pl-c1">None</span>:</td> </tr> <tr> <td id="L1271" class="blob-num js-line-number" data-line-number="1271"></td> <td id="LC1271" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">raise</span> <span class="pl-c1">ValueError</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>Initial state created by <span class="pl-c1">%s</span> has invalid shape <span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span></td> </tr> <tr> <td id="L1272" class="blob-num js-line-number" data-line-number="1272"></td> <td id="LC1272" class="blob-code blob-code-inner js-file-line"> (<span class="pl-c1">self</span>._cell_name, state_shape))</td> </tr> <tr> <td id="L1273" class="blob-num js-line-number" data-line-number="1273"></td> <td id="LC1273" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1274" class="blob-num js-line-number" data-line-number="1274"></td> <td id="LC1274" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1275" class="blob-num js-line-number" data-line-number="1275"></td> <td id="LC1275" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">state_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1276" class="blob-num js-line-number" data-line-number="1276"></td> <td id="LC1276" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._state_size</td> </tr> <tr> <td id="L1277" class="blob-num js-line-number" data-line-number="1277"></td> <td id="LC1277" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1278" class="blob-num js-line-number" data-line-number="1278"></td> <td id="LC1278" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">@</span><span class="pl-c1">property</span></td> </tr> <tr> <td id="L1279" class="blob-num js-line-number" data-line-number="1279"></td> <td id="LC1279" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">output_size</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>):</td> </tr> <tr> <td id="L1280" class="blob-num js-line-number" data-line-number="1280"></td> <td id="LC1280" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">self</span>._output_size</td> </tr> <tr> <td id="L1281" class="blob-num js-line-number" data-line-number="1281"></td> <td id="LC1281" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1282" class="blob-num js-line-number" data-line-number="1282"></td> <td id="LC1282" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-c1">__call__</span>(<span class="pl-smi"><span class="pl-smi">self</span></span>, <span class="pl-smi">inputs</span>, <span class="pl-smi">state</span>, <span class="pl-smi">scope</span><span class="pl-k">=</span><span class="pl-c1">None</span>):</td> </tr> <tr> <td id="L1283" class="blob-num js-line-number" data-line-number="1283"></td> <td id="LC1283" class="blob-code blob-code-inner js-file-line"> scope <span class="pl-k">=</span> scope <span class="pl-k">or</span> <span class="pl-c1">self</span>._cell_name</td> </tr> <tr> <td id="L1284" class="blob-num js-line-number" data-line-number="1284"></td> <td id="LC1284" class="blob-code blob-code-inner js-file-line"> output, state <span class="pl-k">=</span> <span class="pl-c1">self</span>._cell_fn(inputs, state, <span class="pl-v">scope</span><span class="pl-k">=</span>scope)</td> </tr> <tr> <td id="L1285" class="blob-num js-line-number" data-line-number="1285"></td> <td id="LC1285" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> output, state</td> </tr> </table> <div class="BlobToolbar position-absolute js-file-line-actions dropdown js-menu-container js-select-menu d-none" aria-hidden="true"> <button class="btn-octicon ml-0 px-2 p-0 bg-white border border-gray-dark rounded-1 dropdown-toggle js-menu-target" id="js-file-line-action-button" type="button" aria-expanded="false" aria-haspopup="true" aria-label="Inline file action toolbar" aria-controls="inline-file-actions"> <svg class="octicon octicon-kebab-horizontal" viewBox="0 0 13 16" version="1.1" width="13" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M1.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"/></svg> </button> <div class="dropdown-menu-content js-menu-content" id="inline-file-actions"> <ul class="BlobToolbar-dropdown dropdown-menu dropdown-menu-se mt-2"> <li><clipboard-copy class="dropdown-item" style="cursor:pointer;" id="js-copy-lines" data-original-text="Copy lines">Copy lines</clipboard-copy></li> <li><clipboard-copy class="dropdown-item" id="js-copy-permalink" style="cursor:pointer;" data-original-text="Copy permalink">Copy permalink</clipboard-copy></li> <li><a class="dropdown-item js-update-url-with-hash" id="js-view-git-blame" href="/tensorflow/tensorflow/blame/cbc658095ae228f2f557af47e4901d552573aa15/tensorflow/python/ops/rnn_cell_impl.py">View git blame</a></li> <li><a class="dropdown-item" id="js-new-issue" href="/tensorflow/tensorflow/issues/new">Open new issue</a></li> </ul> </div> </div> </div> </div> <button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button> <div id="jump-to-line" style="display:none"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-jump-to-line-form" action="" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" /> <input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" aria-label="Jump to line" autofocus> <button type="submit" class="btn">Go</button> </form> </div> </div> <div class="modal-backdrop js-touch-events"></div> </div> </div> </div> </div> <div class="footer container-lg px-3" role="contentinfo"> <div class="position-relative d-flex flex-justify-between py-6 mt-6 f6 text-gray border-top border-gray-light "> <ul class="list-style-none d-flex flex-wrap "> <li class="mr-3">&copy; 2018 <span title="0.23060s from unicorn-1000010005-crk39">GitHub</span>, Inc.</li> <li class="mr-3"><a href="https://help.github.com/articles/github-terms-of-service/" data-ga-click="Footer, go to terms, text:terms">Terms</a></li> <li class="mr-3"><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li> <li class="mr-3"><a href="https://help.github.com/articles/github-security/" data-ga-click="Footer, go to security, text:security">Security</a></li> <li class="mr-3"><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li> <li><a data-ga-click="Footer, go to help, text:help" href="https://help.github.com">Help</a></li> </ul> <a aria-label="Homepage" title="GitHub" class="footer-octicon" href="https://github.com"> <svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> </a> <ul class="list-style-none d-flex flex-wrap "> <li class="mr-3"><a data-ga-click="Footer, go to contact, text:contact" href="https://github.com/contact">Contact GitHub</a></li> <li class="mr-3"><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li> <li class="mr-3"><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li> <li class="mr-3"><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li> <li class="mr-3"><a data-ga-click="Footer, go to blog, text:blog" href="https://github.com/blog">Blog</a></li> <li><a data-ga-click="Footer, go to about, text:about" href="https://github.com/about">About</a></li> </ul> </div> </div> <div id="ajax-error-message" class="ajax-error-message flash flash-error"> <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> </button> You can't perform that action at this time. </div> <script crossorigin="anonymous" type="application/javascript" src="https://assets-cdn.github.com/assets/compat-af4f19572e1d43f69746f70aa5f01dc9.js"></script> <script crossorigin="anonymous" type="application/javascript" src="https://assets-cdn.github.com/assets/frameworks-dd22b45b9495a43602787a69962f696c.js"></script> <script crossorigin="anonymous" async="async" type="application/javascript" src="https://assets-cdn.github.com/assets/github-48130667aaece5c4ce8ee28ecdb29539.js"></script> <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none"> <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg> <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span> <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span> </div> <div class="facebox" id="facebox" style="display:none;"> <div class="facebox-popup"> <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description"> </div> <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal"> <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> </button> </div> </div> </body> </html>
67.591094
766
0.599302
72,516
449,278
3.688096
0.073184
0.097085
0.114793
0.067266
0.825554
0.813592
0.796415
0.780236
0.767744
0.575447
0
0.053817
0.184663
449,278
6,646
767
67.601264
0.676271
0
0
0.513125
0
0.444565
0.343526
0.036417
0
0
0
0
0.000618
0
null
null
0.000618
0.004169
null
null
0.000154
0
0
0
null
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
f720c4b0ba8a3112b5e4c2e356fdfa9e370b254c
11,793
py
Python
test/unit/mongo_class/server_connect.py
mjpernot/mongo-lib
be8aa4f0cbf7fdf475bf67c07df813ffc560c3ef
[ "MIT" ]
null
null
null
test/unit/mongo_class/server_connect.py
mjpernot/mongo-lib
be8aa4f0cbf7fdf475bf67c07df813ffc560c3ef
[ "MIT" ]
null
null
null
test/unit/mongo_class/server_connect.py
mjpernot/mongo-lib
be8aa4f0cbf7fdf475bf67c07df813ffc560c3ef
[ "MIT" ]
null
null
null
#!/usr/bin/python # Classification (U) """Program: server_connect.py Description: Unit testing of Server.connect in mongo_class.py. Usage: test/unit/mongo_class/server_connect.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest # Third-party import mock # Local sys.path.append(os.getcwd()) import mongo_class import version __version__ = version.__version__ class UnitTest(unittest.TestCase): """Class: UnitTest Description: Class which is a representation of a unit testing. Methods: setUp test_auth_mech3 test_auth_mech2 test_auth_mech test_conn_false2 test_conn_false test_conn_true2 test_conn_true test_fail_get_srv_attr2 test_fail_get_srv_attr test_auth_arg4 test_auth_arg3 test_auth_arg2 test_auth_arg test_no_auth2 test_no_auth """ def setUp(self): """Function: setUp Description: Initialization for unit testing. Arguments: """ self.name = "Mongo_Server" self.user = "mongo_user" self.japd = "mongo_pd" self.host = "host_server" self.port = 27017 self.dbs = "test" self.coll = None self.db_auth = None self.conf_file = "Conf_File" self.errmsg = "Error Message" self.auth_mech = "SCRAM-SHA-1" self.auth_mech2 = "MONGODB-CR" @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_mech3(self, mock_cmd, mock_client): """Function: test_auth_mech3 Description: Test with auth_mech set to SCRAM-SHA-1. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True, auth_mech=self.auth_mech) mongo.conn = False mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port, mongo.auth_mech), (self.name, self.user, self.japd, self.host, self.port, self.auth_mech)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_mech2(self, mock_cmd, mock_client): """Function: test_auth_mech2 Description: Test with auth_mech set to MONGODB-CR. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True, auth_mech=self.auth_mech2) mongo.conn = False mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port, mongo.auth_mech), (self.name, self.user, self.japd, self.host, self.port, self.auth_mech2)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_mech(self, mock_cmd, mock_client): """Function: test_auth_mech Description: Test with auth_mech default. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True) mongo.conn = False mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port, mongo.auth_mech), (self.name, self.user, self.japd, self.host, self.port, self.auth_mech)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_conn_false2(self, mock_cmd, mock_client): """Function: test_conn_false2 Description: Test with conn set to False. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True) mongo.conn = False mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_conn_false(self, mock_cmd, mock_client): """Function: test_conn_false Description: Test with conn set to False. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True) mongo.conn = False self.assertEqual(mongo.connect(), (True, None)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_conn_true2(self, mock_cmd, mock_client): """Function: test_conn_true2 Description: Test with conn set to True. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True) mongo.conn = True mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_conn_true(self, mock_cmd, mock_client): """Function: test_conn_true Description: Test with conn set to True. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=True, use_arg=True) mongo.conn = True self.assertEqual(mongo.connect(), (True, None)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_fail_get_srv_attr2(self, mock_cmd, mock_client): """Function: test_fail_get_srv_attr2 Description: Test with failed get_srv_attr call. Arguments: """ mock_cmd.return_value = (False, self.errmsg) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port) mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_fail_get_srv_attr(self, mock_cmd, mock_client): """Function: test_fail_get_srv_attr Description: Test with failed get_srv_attr call. Arguments: """ mock_cmd.return_value = (False, self.errmsg) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port) self.assertEqual(mongo.connect(), (False, self.errmsg)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_arg4(self, mock_cmd, mock_client): """Function: test_auth_arg4 Description: Test with arg present and no auth. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=False) self.assertEqual(mongo.connect(), (True, None)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_arg3(self, mock_cmd, mock_client): """Function: test_auth_arg3 Description: Test with arg present and no auth. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port, auth=False) mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_arg2(self, mock_cmd, mock_client): """Function: test_auth_arg2 Description: Test with auth and arg present. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port) self.assertEqual(mongo.connect(), (True, None)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_auth_arg(self, mock_cmd, mock_client): """Function: test_auth_arg Description: Test with auth and arg present. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server( self.name, self.user, self.japd, host=self.host, port=self.port) mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_no_auth2(self, mock_cmd, mock_client): """Function: test_no_auth2 Description: Test with no auth present. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server(self.name, self.user, self.japd, host=self.host, port=self.port, auth=False) mongo.connect() self.assertEqual( (mongo.name, mongo.user, mongo.japd, mongo.host, mongo.port), (self.name, self.user, self.japd, self.host, self.port)) @mock.patch("mongo_class.pymongo.MongoClient") @mock.patch("mongo_class.Server.get_srv_attr") def test_no_auth(self, mock_cmd, mock_client): """Function: test_no_auth Description: Test with no auth present. Arguments: """ mock_cmd.return_value = (True, None) mock_client.return_value = True mongo = mongo_class.Server(self.name, self.user, self.japd, host=self.host, port=self.port, auth=False) self.assertEqual(mongo.connect(), (True, None)) if __name__ == "__main__": unittest.main()
27.425581
78
0.620114
1,491
11,793
4.688799
0.075788
0.06866
0.070948
0.081533
0.844228
0.832499
0.832499
0.823344
0.755114
0.755114
0
0.004635
0.26821
11,793
429
79
27.48951
0.805446
0.172136
0
0.765306
0
0
0.11207
0.101584
0
0
0
0
0.076531
1
0.081633
false
0
0.035714
0
0.122449
0
0
0
0
null
0
0
0
1
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
7
e3d838b354daecb990b9d25ed9222be9e7a60e84
6,160
gyp
Python
src/trusted/validator_x86/ncval.gyp
kapkic/native_client
51c8bc8c249d55606232ae011bdfc8b4cab3d794
[ "BSD-3-Clause" ]
1
2021-12-23T00:36:43.000Z
2021-12-23T00:36:43.000Z
src/trusted/validator_x86/ncval.gyp
kapkic/native_client
51c8bc8c249d55606232ae011bdfc8b4cab3d794
[ "BSD-3-Clause" ]
null
null
null
src/trusted/validator_x86/ncval.gyp
kapkic/native_client
51c8bc8c249d55606232ae011bdfc8b4cab3d794
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO(bradchen): eliminate need for the warning flag removals below { 'includes': [ '../../../build/common.gypi', ], 'target_defaults': { 'variables': { 'target_base': 'none', }, 'target_conditions': [ ['target_base=="ncdis_util"', { 'sources': [ 'ncdis_segments.c', 'nc_read_segment.c', ], 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB', ], 'cflags!': [ '-Wextra', '-Wswitch-enum', '-Wsign-compare' ], 'xcode_settings': { 'WARNING_CFLAGS!': [ '-Wextra', '-Wswitch-enum', '-Wsign-compare' ], }, }], ['target_base=="ncval"', { 'sources': [ 'ncval.c', ], 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB', ], 'cflags!': [ '-Wextra', '-Wswitch-enum', '-Wsign-compare' ], 'xcode_settings': { 'WARNING_CFLAGS!': [ '-Wextra', '-Wswitch-enum', '-Wsign-compare' ], }, }], ], }, # ---------------------------------------------------------------------- 'conditions': [ ['target_arch=="ia32"', { 'targets': [ { 'target_name': 'ncdis_util_x86_32', 'type': 'static_library', 'variables': { 'target_base': 'ncdis_util', }, 'sources': ['ncenuminsts_x86_32.c'], }, { 'target_name': 'ncval_x86_32', 'type': 'executable', 'variables': { 'target_base': 'ncval', }, 'dependencies': [ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils', '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_32', '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_32', 'ncdis_util_x86_32', ], }], }], ['OS=="win" and target_arch=="ia32"', { 'targets': [ { 'target_name': 'ncdis_util_x86_64', 'type': 'static_library', 'variables': { 'target_base': 'ncdis_util', 'win_target': 'x64', }, 'sources': ['ncenuminsts_x86_64.c'], }, { 'target_name': 'ncval_x86_64', 'type': 'executable', 'variables': { 'target_base': 'ncval', 'win_target': 'x64', }, 'dependencies': [ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils64', '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64', 'ncdis_util_x86_64', ], }], }], ['target_arch=="x64"', { 'targets': [ { 'target_name': 'ncdis_util_x86_64', 'type': 'static_library', 'variables': { 'target_base': 'ncdis_util', }, 'sources': ['ncenuminsts_x86_64.c'], }, { 'target_name': 'ncval_x86_64', 'type': 'executable', 'variables': { 'target_base': 'ncval', }, 'dependencies': [ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils', '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_64', '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64', 'ncdis_util_x86_64', ], }], }], [ 'target_arch=="arm"', { 'targets': [] }], ], }
40
127
0.583117
687
6,160
4.84425
0.152838
0.100962
0.137921
0.16226
0.880108
0.866587
0.866587
0.866587
0.866587
0.834135
0
0.046766
0.257143
6,160
153
128
40.261438
0.680507
0.049026
0
0.70068
0
0
0.647129
0.460185
0
0
0
0.006536
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
11
580f756c6ee61ae2dc9cd5280e4b79ea232d0449
23,478
py
Python
api/test/test_ixx.py
WeiShiwei/tornado_glearn
5e74bbaaee4d2b8c5abf3b60cffbe54694a3bc6f
[ "Apache-2.0" ]
null
null
null
api/test/test_ixx.py
WeiShiwei/tornado_glearn
5e74bbaaee4d2b8c5abf3b60cffbe54694a3bc6f
[ "Apache-2.0" ]
null
null
null
api/test/test_ixx.py
WeiShiwei/tornado_glearn
5e74bbaaee4d2b8c5abf3b60cffbe54694a3bc6f
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 u""" User: xulin Jerry.Fang Date: 13-12-19 """ import os, sys sys.path.append( os.path.join( os.path.abspath(os.path.dirname(__file__)) , '../..')) sys.path.append( os.path.join( os.path.abspath(os.path.dirname(__file__)) , '../../glearn/crf/ixx_glodon')) import requests import ujson import unittest from template.basic_template_generator import BasicTemplate from extractor.data_extractor import template_redis from model.session import * from model.basic_element import BasicElement from statistic.stat_info_querier import StatInfoQuerier from model.base_material_type import * from model.base_material_type_attr import * from model.base_material_type_attr_value import * from model.base_material_type_attr_rule import * from model.base_material_type_attr_key_word import * from sqlalchemy.orm import aliased class TestApiFunctions(unittest.TestCase): # def setUp(self): # # Initial test database. # m_basic_template = BasicTemplate() # m_basic_template.set_primary_path('../../../InputFile_test/primary_rule.xls') # m_basic_template.clean_table() ### 增删改查template # def test_api_add_all_value_template(self): # data = { # 'templates': ujson.dumps([ # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '15mm2', # }, # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name2(mm2)', # 'attr_val': '16', # }, # ]) # } # requests.post('http://127.0.0.1:9700/v1/template/create', data=data)#> # parent_bmt = aliased(BaseMaterialType) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrValue).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_values)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)', BaseMaterialTypeAttrValue.description==u'15mm2').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrValue).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_values)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)', BaseMaterialTypeAttrValue.description==u'16mm2').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)', BaseMaterialTypeAttr.is_all_match==True).all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)', BaseMaterialTypeAttrValue.description==u'16mm2', BaseMaterialTypeAttrRule.rule_description==u'\d+[.]{0,1}\d*[/]{0,1}\d*mm2').all() # self.assertEqual(1, len(be)) # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)', BaseMaterialTypeAttrValue.description==u'16mm2', BaseMaterialTypeAttrRule.rule_description==u're.I').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)', BaseMaterialTypeAttrValue.description==u'15mm2', BaseMaterialTypeAttrRule.rule_description==u'\d+[.]{0,1}\d*[/]{0,1}\d*mm2').all() # self.assertEqual(1, len(be)) # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)', BaseMaterialTypeAttrValue.description==u'15mm2', BaseMaterialTypeAttrRule.rule_description==u're.I').all() # self.assertEqual(1, len(be)) def test_api_retrieve_template(self): data = { 'templates': ujson.dumps([ { 'first_type_code': '99', 'second_type_code': '88', 'first_type_name': '测试类lv1', 'second_type_name': '测试类lv2', 'attr_name': '测试类attr_name3', 'attr_val': 'V聚氯乙烯护套', }, { 'first_type_code': '99', 'second_type_code': '88', 'first_type_name': '测试类lv1', 'second_type_name': '测试类lv2', 'attr_name': '测试类attr_name3', 'attr_val': 'JY聚氯乙烯绝缘', }, ]) } requests.post('http://127.0.0.1:9700/v1/template/create', data=data) # # Check result 1. # data = { # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '', # 'page': '1', # 'page_size': '5' # } # res = requests.get('http://127.0.0.1:9700/v1/template/retrieve', params=data) # actual_result = ujson.loads(res.content) # expect_result = { # u'total': 1, # u'rows': { # u'attr_name': [u'测试类attr_name3'] # } # } # self.assertEqual(expect_result, actual_result) # # Check result 2. # data = { # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '测试类attr_name3', # 'page': '1', # 'page_size': '3' # } # res = requests.get('http://127.0.0.1:9700/v1/template/retrieve', params=data) # actual_result = ujson.loads(res.content) # expect_result = { # u'total': 2, # u'rows': { # u'V聚氯乙烯护套': 1, # u'JY聚氯乙烯绝缘': 2, # u'attr_rule': [ # u'-attr_rule;-all_value;', # 0, # u'-attr_rule;-key_word;JY_JY聚氯乙烯绝缘;V_V聚氯乙烯护套;', # 0 # ] # } # } # self.assertEqual(expect_result, actual_result) # # Check result 3. # data = { # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '测试类attr_name3', # 'page': '3', # 'page_size': '3' # } # res = requests.get('http://127.0.0.1:9700/v1/template/retrieve', params=data) # actual_result = ujson.loads(res.content) # expect_result = { # u'total': 2, # u'rows': { # u'attr_rule': [ # u'-attr_rule;-all_value;', # 0, # u'-attr_rule;-key_word;JY_JY聚氯乙烯绝缘;V_V聚氯乙烯护套;', # 0 # ] # } # } # self.assertEqual(expect_result, actual_result) # def test_api_update_template(self): # data = { # 'templates': ujson.dumps([ # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '15mm2', # }, # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name3', # 'attr_val': 'JY聚氯乙烯绝缘', # }, # ]) # } # requests.post('http://127.0.0.1:9700/v1/template/create', data=data) # parent_bmt = aliased(BaseMaterialType) # data = { # 'unique_id': '', # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '测试类attr_name2(mm2)', # } # requests.post('http://127.0.0.1:9700/v1/template/update', data=data) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)').all() # self.assertEqual(1, len(be)) # data = { # 'unique_id': '1', # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '18mm2', # } # requests.post('http://127.0.0.1:9700/v1/template/update', data=data) # data = { # 'unique_id': '2', # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name3', # 'attr_val': 'YJV聚氯乙烯绝缘', # } # requests.post('http://127.0.0.1:9700/v1/template/update', data=data) # # check result. # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrValue).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_values)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttrValue.description==u'18mm2').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrValue).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_values)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name3', BaseMaterialTypeAttrValue.description==u'YJV聚氯乙烯绝缘').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)').all() # self.assertEqual(True, be[0][2].is_all_match) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)', BaseMaterialTypeAttrRule.rule_description==u'\d+[.]{0,1}\d*[/]{0,1}\d*mm2').all() # self.assertEqual(1, len(be)) # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrRule).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_rules)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name2(mm2)', BaseMaterialTypeAttrRule.rule_description==u're.I').all() # self.assertEqual(1, len(be)) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrKeyWord).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_key_words)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name3', BaseMaterialTypeAttrKeyWord.key_words==u'YJV_YJV聚氯乙烯绝缘').all() # self.assertEqual(1, len(be)) # def test_api_delete_template(self): # data = { # 'templates': ujson.dumps([ # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '15mm2', # }, # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name3', # 'attr_val': 'JY聚氯乙烯绝缘', # }, # ]) # } # requests.post('http://127.0.0.1:9700/v1/template/create', data=data) # # delete attribute name. # data = { # 'unique_id': '', # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '测试类attr_name1(mm2)' # } # requests.post('http://127.0.0.1:9700/v1/template/delete', data=data) # # Check # parent_bmt = aliased(BaseMaterialType) # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr, BaseMaterialTypeAttrValue).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs).join(BaseMaterialTypeAttr.base_material_type_attr_values)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)').all() # self.assertEqual(0, len(be)) # # delete attribute rule. # data = { # 'unique_id': '2', # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '测试类attr_name3' # } # requests.post('http://127.0.0.1:9700/v1/template/delete', data=data) # # Check. # with get_session() as session: # be = session.query(BaseMaterialType, parent_bmt, BaseMaterialTypeAttr).join((parent_bmt, parent_bmt.id == BaseMaterialType.parent_id)).join(BaseMaterialType.base_material_type_attrs)\ # .filter(BaseMaterialType.code == u'88', parent_bmt.code == u'99', BaseMaterialTypeAttr.description==u'测试类attr_name1(mm2)', BaseMaterialTypeAttrValue.description==u'JY聚氯乙烯绝缘').all() # self.assertEqual(0, len(be)) # # delete attribute rule. # data = { # 'unique_id': '2', # 'first_type_code': '99', # 'second_type_code': '88', # 'attr_name': '测试类attr_name3' # } ### # def test_api_extract_template(self): # data = { # 'templates': ujson.dumps([ # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name1(mm2)', # 'attr_val': '15mm2', # }, # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': '测试类attr_name3', # 'attr_val': 'JY聚氯乙烯绝缘', # }, # { # 'first_type_code': '99', # 'second_type_code': '88', # 'first_type_name': '测试类lv1', # 'second_type_name': '测试类lv2', # 'attr_name': 'assemblyAttrName', # 'attr_val': "JYV200|{'聚氯':'J','乙烯':'v','绝缘':'v','额定电压':'200'}", # }, # ]) # } # requests.post('http://127.0.0.1:9700/v1/template/create', data=data) ### 向表中插入相应的数据 # import pdb;pdb.set_trace() #------------------------------------------------------------------------------------- # # extract info. # data = { # 'first_type_code': '25', # 'second_type_code': '88', # 'product_info': '8.7/15kV\tJYV\t一芯 15m㎡\t结构7\tBB' # } # res = requests.post('http://127.0.0.1:9700/v1/extract', data=data) # # Check result. # actual_result = ujson.loads(res.content) # expect_result = { # u'first_type_code': u'25', # u'second_type_code': u'88', # u'product_info': u'8.7/15kV\tJYV\t一芯 15m㎡\t结构7\tBB', # u'result': {} # } # self.assertEqual(expect_result, actual_result) #------------------------------------------------------------------------------------- # extract info. # data = { # 'first_type_code': '99', # 'second_type_code': '88', # 'product_info': '8.7/15kV\tJYV200\t一芯 15m㎡\t结构7\tBB' ###JYV<->JYV200 # } # res = requests.post('http://127.0.0.1:9700/v1/extract', data=data) # import pdb;pdb.set_trace() # #----------------------------------------------------------------------------------------------- # #(Pdb) actual_result # # {u'product_info': u'8.7/15kV\tJYV200\t\u4e00\u82af 15m\u33a1\t\u7ed3\u67847\tBB', u'first_type_code': u'99', u'second_type_code': u'88', u'result': {u'\u6d4b\u8bd5\u7c7battr_name1(mm2)': u'\u805a\u6c2f\u4e59\u70ef(\u6750\u8d28)', u'\u6d4b\u8bd5\u7c7battr_name3': u'200V(\u989d\u5b9a\u7535\u538b)', u'\u65e0\u6cd5\u89e3\u6790\u90e8\u5206': u'8.7/15kV\tV200\t\u4e00\u82af\t\u7ed3\u67847\tBB\t'}} # #----------------------------------------------------------------------------------------------- # # Check result. # actual_result = ujson.loads(res.content) # expect_result = { # u'first_type_code': u'99', # u'second_type_code': u'88', # u'product_info': u'8.7/15kV\tJYV\t一芯 15m㎡\t结构7\tBB', # u'result': { # u'测试类attr_name1(mm2)': u'15mm2\t', # u'测试类attr_name3': u'JY聚氯乙烯绝缘', # u'无法解析部分': u'8.7/15kV\tV\t一芯\t结构7\tBB\t', # } # } # self.assertEqual(expect_result, actual_result) # pass # def test_api_stat_heart(self): # data = { # 'heart_request': 1, # } # res = requests.get('http://127.0.0.1:9700/v1/stat/heart', params=data) # actual_result = ujson.loads(res.content) # expect_result = { # u'heart_response': u'OK', # } # self.assertEqual(expect_result, actual_result) # def test_api_stat_query(self): # # initial # template_redis.flushdb() # data = { # 'query_msg_count': 1, # 'query_extract_rate': 1, # 'query_extract_time': 1, # } # res = requests.get('http://127.0.0.1:9700/v1/stat/query', params=data) # actual_result = ujson.loads(res.content) # expect_result = { # u'msg_count': 0, # u'extract_rate': u'0.0%', # u'extract_time': u'0ms', # } # self.assertEqual(expect_result, actual_result) # # record and query. # StatInfoQuerier.store_val( # u'msg_total_time', StatInfoQuerier.get_val(u'msg_total_time')+1000 # ) # StatInfoQuerier.store_val( # u'msg_count', StatInfoQuerier.get_val(u'msg_count')+20 # ) # StatInfoQuerier.store_val( # u'msg_total_len', StatInfoQuerier.get_val(u'msg_total_len')+300000 # ) # StatInfoQuerier.store_val( # u'msg_extract_len', StatInfoQuerier.get_val(u'msg_extract_len')+289000 # ) # data = { # 'query_msg_count': 1, # 'query_extract_rate': 1, # 'query_extract_time': 1, # 'query_msg_count_error1': 2, # 'query_msg_count_error2': u'', # } # expect_result1 = { # u'msg_count': 20, # u'extract_rate': u'96.3333333333%', # u'extract_time': u'50ms', # } # res = requests.get('http://127.0.0.1:9700/v1/stat/query', params=data) # actual_result = ujson.loads(res.content) # self.assertEqual(expect_result1, actual_result) # Run test cases. if __name__ == '__main__': unittest.main()
50.059701
406
0.561845
2,444
23,478
5.145663
0.096972
0.047948
0.041985
0.02799
0.860369
0.845817
0.821088
0.806536
0.800175
0.785226
0
0.044654
0.278899
23,478
468
407
50.166667
0.697696
0.812803
0
0.232558
0
0
0.080665
0.006806
0
0
0
0
0
1
0.023256
false
0
0.348837
0
0.395349
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
8
54445a671328082a143adfd59ced533672b1c3c2
26,109
py
Python
openstack_dashboard/api/sds_controller.py
iostackproject/SDS-dashboard
efa3d7968c738bfb10bc19776f24f2937d5802d8
[ "Apache-2.0" ]
1
2021-01-20T00:14:15.000Z
2021-01-20T00:14:15.000Z
openstack_dashboard/api/sds_controller.py
iostackproject/SDS-dashboard
efa3d7968c738bfb10bc19776f24f2937d5802d8
[ "Apache-2.0" ]
null
null
null
openstack_dashboard/api/sds_controller.py
iostackproject/SDS-dashboard
efa3d7968c738bfb10bc19776f24f2937d5802d8
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 from __future__ import unicode_literals import json import requests from horizon.utils.memoized import memoized # noqa # TODO: Take parameters from a config file URL_BASIC = "http://127.0.0.1:9000" @memoized def sds_controller_api(request): return request.user.token.id ############################## # Swift API # ############################## # # Swift - SLAs def bw_add_sla(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/bw/slas" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r def bw_get_all_slas(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/bw/slas" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def bw_update_sla(request, sla_id, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/bw/sla/" + str(sla_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def bw_get_sla(request, sla_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/bw/sla/" + str(sla_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def bw_delete_sla(request, sla_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/bw/sla/" + str(sla_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Swift - Sorting Methods def bw_add_sort_method(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sort_nodes" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r def bw_get_all_sort_method(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sort_nodes" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def bw_update_sort_method(request, name, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sort_nodes/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def bw_get_sort_method(request, name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sort_nodes/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def bw_delete_sort_method(request, name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sort_nodes/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Swift - Tenants def swift_list_tenants(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/tenants" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def enable_sds(request, tenant_name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/tenants" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" parameters = {"tenant_name": tenant_name} r = requests.post(url, json.dumps(parameters), headers=headers) return r def new_storage_policy(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/sdspolicies" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r # # Swift - Storage Policies def swift_list_storage_policies(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/swift/storage_policies" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r ############################## # Registry DSL API # ############################## # # Registry DSL - Storage Nodes def registry_storage_node(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/snode" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "text/plain" r = requests.post(url, json.dumps(data), headers=headers) return r def list_storage_nodes(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/snode" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "text/plain" r = requests.get(url, headers=headers) return r def remove_storage_nodes(request, storage_node_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/snode/" + str(storage_node_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Policies def dsl_add_policy(request, policy): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/dynamic_policy" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "text/plain" r = requests.post(url, policy, headers=headers) return r # # Registry DSL - Static Policies def dsl_get_all_static_policies(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/static_policy" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_update_static_policy(request, policy_id, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/static_policy/" + str(policy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def dsl_get_static_policy(request, policy_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/static_policy/" + str(policy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_delete_static_policy(request, policy_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/static_policy/" + str(policy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Dynamic Policies def list_dynamic_policies(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/dynamic_policy" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def remove_dynamic_policy(request, policy_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/dynamic_policy/" + str(policy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # TODO: Search usages and change it to dsl_get_all_workload_metris def list_metrics(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r # # Registry - Metric Modules def mtr_add_metric_module_metadata(request, data, in_memory_file): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module/data" headers["X-Auth-Token"] = str(token) # Content-Type header will be set to multipart by django because a file is uploaded files = {'file': (in_memory_file.name, in_memory_file.read())} data_to_send = {'metadata': json.dumps(data)} r = requests.post(url, data_to_send, files=files, headers=headers) return r def mtr_get_all_metric_modules(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def mtr_update_metric_module(request, metric_module_id, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module/" + str(metric_module_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def mtr_get_metric_module(request, metric_module_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module/" + str(metric_module_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def mtr_delete_metric_module(request, metric_module_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module/" + str(metric_module_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r def mtr_download_metric_module_data(request, metric_module_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metric_module/" + str(metric_module_id) + "/data" headers["X-Auth-Token"] = str(token) r = requests.get(url, headers=headers) return r # # Registry DSL - Metrics Workload def dsl_add_workload_metric(request, name, network_location, metric_type): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" parameters = {"name": str(name), "network_location": str(network_location), "metric_type": str(metric_type)} r = requests.post(url, json.dumps(parameters), headers=headers) return r def dsl_get_all_workload_metrics(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_update_workload_metric(request, metric_name, network_location=None, metric_type=None): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics/" + str(metric_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" parameters = {} if network_location is not None: parameters["network_location"] = str(network_location) if metric_type is not None: parameters["metric_type"] = str(metric_type) if len(parameters) == 0: raise ValueError r = requests.put(url, json.dumps(parameters), headers=headers) return r def dsl_get_metric_metadata(request, metric_name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics/" + str(metric_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_delete_workload_metric(request, metric_name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/metrics/" + str(metric_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Filters def dsl_add_filter(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/filters" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r def dsl_get_all_filters(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/filters" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_update_filter(request, name, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/filters/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def dsl_get_filter_metadata(request, name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/filters/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_delete_filter(request, name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/filters/" + str(name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Tenants Groups def dsl_create_tenants_group(request, name, tenants_list): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" # parameters = {"name": str(name), "tenants": str(tenants_list)} # r = requests.post(url, json.dumps(parameters), headers=headers) r = requests.post(url, json.dumps(tenants_list), headers=headers) return r def dsl_get_all_tenants_groups(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_list_tenants_group(request, group_name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants/" + str(group_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_add_tenant_group_member(request, group_name, tenant_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants/" + str(group_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" # TODO parameters = {"new": str(tenant_id)} r = requests.put(url, json.dumps(parameters), headers=headers) return r def dsl_delete_tenants_group(request, group_name): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants/" + str(group_name) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r def dsl_delete_tenant_group_member(request, group_name, tenant_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/gtenants/" + str(group_name) + "/tenants/" + str(tenant_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Object Types def dsl_get_all_object_types(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/object_type" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_create_object_type(request, name, extensions): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/object_type" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" parameters = {"name": str(name), "types_list": extensions} r = requests.post(url, json.dumps(parameters), headers=headers) return r def dsl_get_object_type(request, object_type_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/object_type/" + str(object_type_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_update_object_type(request, object_type_id, extensions): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/object_type/" + str(object_type_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(extensions), headers=headers) return r def dsl_delete_object_type(request, object_type_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/object_type/" + str(object_type_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r # # Registry DSL - Nodes def dsl_get_all_nodes(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/nodes" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_get_node_detail(request, node_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/nodes/" + str(node_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def dsl_update_node(request, node_id, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/registry/nodes/" + str(node_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r ############################## # Filters API # ############################## # Filters - Filters def fil_create_filter(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r def fil_upload_filter_data(request, filter_id, in_memory_file): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(filter_id) + "/data" headers["X-Auth-Token"] = str(token) files = {'file': (in_memory_file.name, in_memory_file.read())} r = requests.put(url, files=files, headers=headers) return r def fil_download_filter_data(request, filter_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(filter_id) + "/data" headers["X-Auth-Token"] = str(token) r = requests.get(url, headers=headers) return r def fil_delete_filter(request, filter_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r def fil_get_filter_metadata(request, filter_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def fil_list_filters(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def fil_update_filter_metadata(request, filter_id, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(data), headers=headers) return r def fil_deploy_filter(request, filter_id, account_id, parameters): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(account_id) + "/deploy/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(parameters), headers=headers) return r def fil_deploy_filter_with_container(request, filter_id, account_id, container_id, parameters): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(account_id) + "/" + str(container_id) + "/deploy/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, json.dumps(parameters), headers=headers) return r def fil_undeploy_filter(request, filter_id, account_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(account_id) + "/undeploy/" + str(filter_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, headers=headers) return r def fil_list_deployed_filters(request, account_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/" + str(account_id) + "/deploy" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r # # Filters - Dependencies def fil_create_dependency(request, data): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.post(url, json.dumps(data), headers=headers) return r def fil_upload_dependency_data(request, dependency_id, in_memory_file): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(dependency_id) + "/data" headers["X-Auth-Token"] = str(token) files = {'file': (in_memory_file.name, in_memory_file.read())} r = requests.put(url, files=files, headers=headers) return r def fil_delete_dependency(request, dependecy_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(dependecy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.delete(url, headers=headers) return r def fil_get_dependency_metadata(request, dependecy_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(dependecy_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def fil_list_dependencies(request): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r def fil_update_dependency_metadata(request, dependency_id, version, permissions): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(dependency_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" parameters = {"version": str(version), "permissions": str(permissions)} r = requests.put(url, json.dumps(parameters), headers=headers) return r def fil_deploy_dependency(request, dependency_id, account_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(account_id) + "/deploy/" + str(dependency_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, headers=headers) return r def fil_undeploy_dependency(request, dependency_id, account_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(account_id) + "/undeploy/" + str(dependency_id) headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.put(url, headers=headers) return r def fil_list_deployed_dependencies(request, account_id): token = sds_controller_api(request) headers = {} url = URL_BASIC + "/filters/dependencies/" + str(account_id) + "/deploy" headers["X-Auth-Token"] = str(token) headers['Content-Type'] = "application/json" r = requests.get(url, headers=headers) return r
24.701041
112
0.66659
3,337
26,109
5.029068
0.042853
0.036229
0.072459
0.104159
0.891729
0.872959
0.863544
0.854725
0.850793
0.847873
0
0.000567
0.189858
26,109
1,056
113
24.724432
0.792833
0.030564
0
0.807754
0
0
0.174846
0.025593
0
0
0
0.000947
0
1
0.122779
false
0
0.006462
0.001616
0.252019
0
0
0
0
null
0
0
0
1
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
7
54a0f0b56a1ddf037faa30a4391bce8e2b0961ef
15,920
py
Python
change_case/change_case.py
SkiftCreative/python-change-case
c86983c948f3090e2931fd4aa006a05f672d8eab
[ "MIT" ]
1
2017-05-04T09:13:39.000Z
2017-05-04T09:13:39.000Z
change_case/change_case.py
autoferrit/python-change-case
c86983c948f3090e2931fd4aa006a05f672d8eab
[ "MIT" ]
null
null
null
change_case/change_case.py
autoferrit/python-change-case
c86983c948f3090e2931fd4aa006a05f672d8eab
[ "MIT" ]
null
null
null
import os import re _underscorer1 = re.compile(r'(.)([A-Z][a-z]+)') _underscorer2 = re.compile('([a-z0-9])([A-Z])') def _get_camel_parts(subject: str) -> str: return ChangeCase.camel_to_snake(subject).split("_") class ChangeCase(object): """ Converts one type of string casing, to another. Easily convert to and from any of these types: - camelCase (lower camel case) - PascalCase (upper camel case) - WikiCase (PascalCase minus 1 letter words) - snake_case - param-case """ # # camelCasing # @staticmethod def camel_to_pascal(subject: str) -> str: return subject[0].upper() + subject[1:] @staticmethod def camel_to_upper_camel(subject: str) -> str: result = ChangeCase.camel_to_pascal(subject) return result @staticmethod def camel_to_wiki(subject: str) -> str: parts = _get_camel_parts(subject) words = [x.title() for x in parts if len(x) > 1] return "".join(words) @staticmethod def camel_to_snake(subject: str) -> str: subbed = _underscorer1.sub(r'\1_\2', subject) return _underscorer2.sub(r'\1_\2', subbed).lower() @staticmethod def camel_to_param(subject: str) -> str: parts = _get_camel_parts(subject) return "-".join(x for x in parts) # # END camelCasing # # # PascalCasing # @staticmethod def pascal_to_camel(subject: str) -> str: return subject[0].lower() + subject[1:] @staticmethod def pascal_to_upper_camel(subject: str) -> str: """ Really? :param subject: :return: """ return subject @staticmethod def pascal_to_wiki(subject: str) -> str: parts = _get_camel_parts(subject) words = [x.title() for x in parts if len(x) > 1] return "".join(words) @staticmethod def pascal_to_snake(subject: str) -> str: return ChangeCase.camel_to_snake(subject) @staticmethod def pascal_to_param(subject: str) -> str: parts = _get_camel_parts(subject) return "-".join(x for x in parts) # # END PascalCasing # # # WikiCasing # @staticmethod def wiki_to_camel(subject: str) -> str: return subject[0].lower() + subject[1:] @staticmethod def wiki_to_upper_camel(subject: str) -> str: """ Really? :param subject: :return: """ return subject @staticmethod def wiki_to_pascal(subject: str) -> str: return subject @staticmethod def wiki_to_snake(subject: str) -> str: return ChangeCase.camel_to_snake(subject) @staticmethod def wiki_to_param(subject: str) -> str: parts = _get_camel_parts(subject) return "-".join(x for x in parts) # # END WikiCasing # # # snake_casing # @staticmethod def snake_to_camel(subject: str) -> str: parts = subject.lower().split('_') return parts[0] + "".join(x.title() for x in parts[1:]) @staticmethod def snake_to_pascal(subject: str) -> str: parts = subject.lower().split('_') return "".join(x.title() for x in parts) @staticmethod def snake_to_upper_camel(subject: str) -> str: return ChangeCase.snake_to_pascal(subject) @staticmethod def snake_to_wiki(subject: str) -> str: parts = subject.lower().split('_') wiki = [x.title() for x in parts if len(x) > 1] return "".join(x.title() for x in wiki) @staticmethod def snake_to_param(subject: str) -> str: return subject.lower().replace('_', '-') # # END snake_casing # # # param-casing # @staticmethod def param_to_camel(subject: str) -> str: parts = subject.lower().split('-') return parts[0] + "".join(x.title() for x in parts[1:]) @staticmethod def param_to_upper_camel(subject: str) -> str: return ChangeCase.param_to_pascal(subject) @staticmethod def param_to_pascal(subject: str) -> str: parts = subject.lower().split('-') return "".join(x.title() for x in parts) @staticmethod def param_to_wiki(subject: str) -> str: parts = subject.lower().split('-') wiki = [x.title() for x in parts if len(x) > 1] return "".join(x.title() for x in wiki) @staticmethod def param_to_snake(subject: str) -> str: return subject.lower().replace('-', '_') # # END param-casing # # # Tests # @staticmethod def run_tests(): # # Camel # assert ChangeCase.camel_to_upper_camel('snakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.camel_to_upper_camel('SnakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.camel_to_upper_camel('IPhoneHysteria') == 'IPhoneHysteria' assert ChangeCase.camel_to_upper_camel('iPhoneHysteria') == 'IPhoneHysteria' print('camel_to_upper_camel tests passed.') assert ChangeCase.camel_to_pascal('snakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.camel_to_pascal('SnakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.camel_to_pascal('IPhoneHysteria') == 'IPhoneHysteria' assert ChangeCase.camel_to_pascal('iPhoneHysteria') == 'IPhoneHysteria' print('camel_to_pascal tests passed.') assert ChangeCase.camel_to_wiki('snakesOnAPlane') == 'SnakesOnPlane' assert ChangeCase.camel_to_wiki('SnakesOnAPlane') == 'SnakesOnPlane' assert ChangeCase.camel_to_wiki('IPhoneHysteria') == 'PhoneHysteria' assert ChangeCase.camel_to_wiki('iPhoneHysteria') == 'PhoneHysteria' print('camel_to_wiki tests passed.') assert ChangeCase.camel_to_snake('snakesOnAPlane') == 'snakes_on_a_plane' assert ChangeCase.camel_to_snake('SnakesOnAPlane') == 'snakes_on_a_plane' assert ChangeCase.camel_to_snake('IPhoneHysteria') == 'i_phone_hysteria' assert ChangeCase.camel_to_snake('iPhoneHysteria') == 'i_phone_hysteria' print('camel_to_snake tests passed.') assert ChangeCase.camel_to_param('snakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.camel_to_param('SnakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.camel_to_param('IPhoneHysteria') == 'i-phone-hysteria' assert ChangeCase.camel_to_param('iPhoneHysteria') == 'i-phone-hysteria' print('camel_to_param tests passed.') # # PascalCase # assert ChangeCase.pascal_to_camel('snakesOnAPlane') == 'snakesOnAPlane' assert ChangeCase.pascal_to_camel('SnakesOnAPlane') == 'snakesOnAPlane' assert ChangeCase.pascal_to_camel('IPhoneHysteria') == 'iPhoneHysteria' assert ChangeCase.pascal_to_camel('iPhoneHysteria') == 'iPhoneHysteria' print('pascal_to_camel tests passed.') assert ChangeCase.pascal_to_upper_camel('SnakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.pascal_to_upper_camel('SnakesOnAPlane') == 'SnakesOnAPlane' assert ChangeCase.pascal_to_upper_camel('IPhoneHysteria') == 'IPhoneHysteria' assert ChangeCase.pascal_to_upper_camel('IPhoneHysteria') == 'IPhoneHysteria' print('pascal_to_upper_camel tests passed.') assert ChangeCase.pascal_to_wiki('snakesOnAPlane') == 'SnakesOnPlane' assert ChangeCase.pascal_to_wiki('SnakesOnAPlane') == 'SnakesOnPlane' assert ChangeCase.pascal_to_wiki('IPhoneHysteria') == 'PhoneHysteria' assert ChangeCase.pascal_to_wiki('iPhoneHysteria') == 'PhoneHysteria' print('pascal_to_wiki tests passed.') assert ChangeCase.pascal_to_snake('snakesOnAPlane') == 'snakes_on_a_plane' assert ChangeCase.pascal_to_snake('SnakesOnAPlane') == 'snakes_on_a_plane' assert ChangeCase.pascal_to_snake('IPhoneHysteria') == 'i_phone_hysteria' assert ChangeCase.pascal_to_snake('iPhoneHysteria') == 'i_phone_hysteria' print('pascal_to_snake tests passed.') assert ChangeCase.pascal_to_param('snakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.pascal_to_param('SnakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.pascal_to_param('IPhoneHysteria') == 'i-phone-hysteria' assert ChangeCase.pascal_to_param('iPhoneHysteria') == 'i-phone-hysteria' print('pascal_to_param tests passed.') # # WikiCase # assert ChangeCase.wiki_to_camel('SnakesOnPlane') == 'snakesOnPlane' assert ChangeCase.wiki_to_camel('SnakesOnPlane') == 'snakesOnPlane' assert ChangeCase.wiki_to_camel('PhoneHysteria') == 'phoneHysteria' assert ChangeCase.wiki_to_camel('PhoneHysteria') == 'phoneHysteria' print('wiki_to_camel tests passed.') assert ChangeCase.wiki_to_upper_camel('SnakesOnPlane') == 'SnakesOnPlane' assert ChangeCase.wiki_to_upper_camel('SnakesOnPlane') == 'SnakesOnPlane' assert ChangeCase.wiki_to_upper_camel('PhoneHysteria') == 'PhoneHysteria' assert ChangeCase.wiki_to_upper_camel('PhoneHysteria') == 'PhoneHysteria' print('wiki_to_upper_camel tests passed.') assert ChangeCase.wiki_to_pascal('SnakesOnPlane') == 'SnakesOnPlane' assert ChangeCase.wiki_to_pascal('SnakesOnPlane') == 'SnakesOnPlane' assert ChangeCase.wiki_to_pascal('PhoneHysteria') == 'PhoneHysteria' assert ChangeCase.wiki_to_pascal('PhoneHysteria') == 'PhoneHysteria' print('wiki_to_pascal tests passed.') assert ChangeCase.wiki_to_snake('SnakesOnPlane') == 'snakes_on_plane' assert ChangeCase.wiki_to_snake('SnakesOnPlane') == 'snakes_on_plane' assert ChangeCase.wiki_to_snake('PhoneHysteria') == 'phone_hysteria' assert ChangeCase.wiki_to_snake('PhoneHysteria') == 'phone_hysteria' print('wiki_to_snake tests passed.') assert ChangeCase.wiki_to_param('SnakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.wiki_to_param('SnakesOnAPlane') == 'snakes-on-a-plane' assert ChangeCase.wiki_to_param('IPhoneHysteria') == 'i-phone-hysteria' assert ChangeCase.wiki_to_param('IPhoneHysteria') == 'i-phone-hysteria' print('wiki_to_param tests passed.') # # snake_case # assert ChangeCase.snake_to_camel('snakes_on_a_plane') == 'snakesOnAPlane' assert ChangeCase.snake_to_camel('Snakes_On_A_Plane') == 'snakesOnAPlane' assert ChangeCase.snake_to_camel('snakes_On_a_Plane') == 'snakesOnAPlane' assert ChangeCase.snake_to_camel('snakes_on_A_plane') == 'snakesOnAPlane' assert ChangeCase.snake_to_camel('i_phone_hysteria') == 'iPhoneHysteria' assert ChangeCase.snake_to_camel('i_Phone_Hysteria') == 'iPhoneHysteria' print('snake_to_camel tests passed.') assert ChangeCase.snake_to_upper_camel('snakes_on_a_plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_upper_camel('Snakes_On_A_Plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_upper_camel('snakes_On_a_Plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_upper_camel('snakes_on_A_plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_upper_camel('i_phone_hysteria') == 'IPhoneHysteria' assert ChangeCase.snake_to_upper_camel('i_Phone_Hysteria') == 'IPhoneHysteria' print('snake_to_upper_camel tests passed.') assert ChangeCase.snake_to_pascal('snakes_on_a_plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_pascal('Snakes_On_A_Plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_pascal('snakes_On_a_Plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_pascal('snakes_on_A_plane') == 'SnakesOnAPlane' assert ChangeCase.snake_to_pascal('i_phone_hysteria') == 'IPhoneHysteria' assert ChangeCase.snake_to_pascal('i_Phone_Hysteria') == 'IPhoneHysteria' print('snake_to_pascal tests passed.') assert ChangeCase.snake_to_wiki('snakes_on_a_plane') == 'SnakesOnPlane' assert ChangeCase.snake_to_wiki('Snakes_On_A_Plane') == 'SnakesOnPlane' assert ChangeCase.snake_to_wiki('snakes_On_a_Plane') == 'SnakesOnPlane' assert ChangeCase.snake_to_wiki('snakes_on_A_plane') == 'SnakesOnPlane' assert ChangeCase.snake_to_wiki('i_phone_hysteria') == 'PhoneHysteria' assert ChangeCase.snake_to_wiki('i_Phone_Hysteria') == 'PhoneHysteria' print('snake_to_wiki tests passed.') assert ChangeCase.snake_to_param('snakes_on_a_plane') == 'snakes-on-a-plane' assert ChangeCase.snake_to_param('Snakes_On_A_Plane') == 'snakes-on-a-plane' assert ChangeCase.snake_to_param('snakes_On_a_Plane') == 'snakes-on-a-plane' assert ChangeCase.snake_to_param('snakes_on_A_plane') == 'snakes-on-a-plane' assert ChangeCase.snake_to_param('i_phone_hysteria') == 'i-phone-hysteria' assert ChangeCase.snake_to_param('i_Phone_Hysteria') == 'i-phone-hysteria' print('snake_to_param tests passed.') # # param-case # assert ChangeCase.param_to_camel('snakes-on-a-plane') == 'snakesOnAPlane' assert ChangeCase.param_to_camel('Snakes-On-A-Plane') == 'snakesOnAPlane' assert ChangeCase.param_to_camel('snakes-On-a-Plane') == 'snakesOnAPlane' assert ChangeCase.param_to_camel('snakes-on-A-plane') == 'snakesOnAPlane' assert ChangeCase.param_to_camel('i-phone-hysteria') == 'iPhoneHysteria' assert ChangeCase.param_to_camel('i-Phone-Hysteria') == 'iPhoneHysteria' print('param_to_camel tests passed.') assert ChangeCase.param_to_upper_camel('snakes-on-a-plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_upper_camel('Snakes-On-A-Plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_upper_camel('snakes-On-a-Plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_upper_camel('snakes-on-A-plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_upper_camel('i-phone-hysteria') == 'IPhoneHysteria' assert ChangeCase.param_to_upper_camel('i-Phone-Hysteria') == 'IPhoneHysteria' print('param_to_upper_camel tests passed.') assert ChangeCase.param_to_pascal('snakes-on-a-plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_pascal('Snakes-On-A-Plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_pascal('snakes-On-a-Plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_pascal('snakes-on-A-plane') == 'SnakesOnAPlane' assert ChangeCase.param_to_pascal('i-phone-hysteria') == 'IPhoneHysteria' assert ChangeCase.param_to_pascal('i-Phone-Hysteria') == 'IPhoneHysteria' print('param_to_pascal tests passed.') assert ChangeCase.param_to_wiki('snakes-on-a-plane') == 'SnakesOnPlane' assert ChangeCase.param_to_wiki('Snakes-On-A-Plane') == 'SnakesOnPlane' assert ChangeCase.param_to_wiki('snakes-On-a-Plane') == 'SnakesOnPlane' assert ChangeCase.param_to_wiki('snakes-on-A-plane') == 'SnakesOnPlane' assert ChangeCase.param_to_wiki('i-phone-hysteria') == 'PhoneHysteria' assert ChangeCase.param_to_wiki('i-Phone-Hysteria') == 'PhoneHysteria' print('param_to_wiki tests passed.') assert ChangeCase.param_to_snake('snakes-on-a-plane') == 'snakes_on_a_plane' assert ChangeCase.param_to_snake('Snakes-On-A-Plane') == 'snakes_on_a_plane' assert ChangeCase.param_to_snake('snakes-On-a-Plane') == 'snakes_on_a_plane' assert ChangeCase.param_to_snake('snakes-on-A-plane') == 'snakes_on_a_plane' assert ChangeCase.param_to_snake('i-phone-hysteria') == 'i_phone_hysteria' assert ChangeCase.param_to_snake('i-Phone-Hysteria') == 'i_phone_hysteria' print('param_to_snake tests passed.') if __name__ == '__main__': ChangeCase.run_tests()
38.640777
87
0.675942
1,842
15,920
5.542345
0.047231
0.188069
0.051131
0.079538
0.905378
0.890489
0.861593
0.7799
0.725634
0.630718
0
0.001967
0.201759
15,920
412
88
38.640777
0.801385
0.030967
0
0.334677
0
0
0.285068
0.001376
0
0
0
0
0.483871
1
0.108871
false
0.100806
0.008065
0.044355
0.225806
0.100806
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
1
0
0
0
1
0
0
0
0
0
8
49ff1655c6eb5fff8477f3d4b25c83434a54f9bc
184
py
Python
tests/pyccel/project_rel_imports/runtest.py
noushi/pyccel
f20846897ba2418dc0f432e293bcf8b4ddb24915
[ "MIT" ]
null
null
null
tests/pyccel/project_rel_imports/runtest.py
noushi/pyccel
f20846897ba2418dc0f432e293bcf8b4ddb24915
[ "MIT" ]
null
null
null
tests/pyccel/project_rel_imports/runtest.py
noushi/pyccel
f20846897ba2418dc0f432e293bcf8b4ddb24915
[ "MIT" ]
1
2021-01-08T12:32:51.000Z
2021-01-08T12:32:51.000Z
# pylint: disable=missing-function-docstring, missing-module-docstring/ from project.folder2.mod3 import one_hundred_plus_sum_to_n_squared print(one_hundred_plus_sum_to_n_squared(4))
36.8
71
0.86413
29
184
5.068966
0.689655
0.136054
0.190476
0.231293
0.367347
0.367347
0.367347
0
0
0
0
0.017241
0.054348
184
4
72
46
0.827586
0.375
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
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
1
0
7
b71db9daa4f8412d80768902f853de16a49c5699
4,930
py
Python
ceph_deploy/hosts/common.py
alfredodeza/ceph-deploy
2e03209adf3b5ea8b977dd71e370f210f03a62a0
[ "MIT" ]
1
2020-07-29T15:09:23.000Z
2020-07-29T15:09:23.000Z
ceph_deploy/hosts/common.py
alfredodeza/ceph-deploy
2e03209adf3b5ea8b977dd71e370f210f03a62a0
[ "MIT" ]
null
null
null
ceph_deploy/hosts/common.py
alfredodeza/ceph-deploy
2e03209adf3b5ea8b977dd71e370f210f03a62a0
[ "MIT" ]
null
null
null
from ceph_deploy.util import paths from ceph_deploy import conf from ceph_deploy.lib import remoto from StringIO import StringIO def ceph_version(conn): """ Log the remote ceph-version by calling `ceph --version` """ return remoto.process.run(conn, ['ceph', '--version']) def mon_create(distro, args, monitor_keyring, hostname): logger = distro.conn.logger logger.debug('remote hostname: %s' % hostname) path = paths.mon.path(args.cluster, hostname) done_path = paths.mon.done(args.cluster, hostname) init_path = paths.mon.init(args.cluster, hostname, distro.init) configuration = conf.ceph.load(args) conf_data = StringIO() configuration.write(conf_data) # write the configuration file distro.conn.remote_module.write_conf( args.cluster, conf_data.getvalue(), args.overwrite_conf, ) # if the mon path does not exist, create it distro.conn.remote_module.create_mon_path(path) logger.debug('checking for done path: %s' % done_path) if not distro.conn.remote_module.path_exists(done_path): logger.debug('done path does not exist: %s' % done_path) if not distro.conn.remote_module.path_exists(paths.mon.constants.tmp_path): logger.info('creating tmp path: %s' % paths.mon.constants.tmp_path) distro.conn.remote_module.makedir(paths.mon.constants.tmp_path) keyring = paths.mon.keyring(args.cluster, hostname) logger.info('creating keyring file: %s' % keyring) distro.conn.remote_module.write_monitor_keyring( keyring, monitor_keyring, ) remoto.process.run( distro.conn, [ 'ceph-mon', '--cluster', args.cluster, '--mkfs', '-i', hostname, '--keyring', keyring, ], ) logger.info('unlinking keyring file %s' % keyring) distro.conn.remote_module.unlink(keyring) # create the done file distro.conn.remote_module.create_done_path(done_path) # create init path distro.conn.remote_module.create_init_path(init_path) def mon_add(distro, args, monitor_keyring): hostname = distro.conn.remote_module.shortname() logger = distro.conn.logger path = paths.mon.path(args.cluster, hostname) monmap_path = paths.mon.monmap(args.cluster, hostname) done_path = paths.mon.done(args.cluster, hostname) init_path = paths.mon.init(args.cluster, hostname, distro.init) configuration = conf.ceph.load(args) conf_data = StringIO() configuration.write(conf_data) # write the configuration file distro.conn.remote_module.write_conf( args.cluster, conf_data.getvalue(), args.overwrite_conf, ) # if the mon path does not exist, create it distro.conn.remote_module.create_mon_path(path) logger.debug('checking for done path: %s' % done_path) if not distro.conn.remote_module.path_exists(done_path): logger.debug('done path does not exist: %s' % done_path) if not distro.conn.remote_module.path_exists(paths.mon.constants.tmp_path): logger.info('creating tmp path: %s' % paths.mon.constants.tmp_path) distro.conn.remote_module.makedir(paths.mon.constants.tmp_path) keyring = paths.mon.keyring(args.cluster, hostname) logger.info('creating keyring file: %s' % keyring) distro.conn.remote_module.write_monitor_keyring( keyring, monitor_keyring, ) # get the monmap remoto.process.run( distro.conn, [ 'ceph', 'mon', 'getmap', '-o', monmap_path, ], ) # now use it to prepare the monitor's data dir remoto.process.run( distro.conn, [ 'ceph-mon', '--cluster', args.cluster, '--mkfs', '-i', hostname, '--monmap', monmap_path, '--keyring', keyring, ], ) # add it remoto.process.run( distro.conn, [ 'ceph', 'mon', 'add', hostname, args.address, ], ) logger.info('unlinking keyring file %s' % keyring) distro.conn.remote_module.unlink(keyring) # create the done file distro.conn.remote_module.create_done_path(done_path) # create init path distro.conn.remote_module.create_init_path(init_path) # start the mon using the address remoto.process.run( distro.conn, [ 'ceph-mon', '-i', hostname, '--public-addr', args.address, ], )
30.060976
83
0.590872
567
4,930
4.992945
0.134039
0.09184
0.107383
0.147651
0.805369
0.782762
0.782762
0.729777
0.729777
0.729777
0
0
0.303043
4,930
163
84
30.245399
0.823923
0.075659
0
0.743802
0
0
0.089625
0
0
0
0
0
0
1
0.024793
false
0
0.033058
0
0.066116
0
0
0
0
null
0
0
0
1
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
7
3ffa191f62312905bf2d4052f91b869176d48d94
30,685
py
Python
earning_expectation/factor_earning_expectation.py
flaght/panther
7920c1b78121cbb9a8cd7907419f5a42cb2aee69
[ "Apache-2.0" ]
3
2020-01-23T22:23:08.000Z
2020-10-12T20:02:16.000Z
earning_expectation/factor_earning_expectation.py
flaght/panther
7920c1b78121cbb9a8cd7907419f5a42cb2aee69
[ "Apache-2.0" ]
1
2019-10-28T05:53:08.000Z
2019-10-28T05:53:08.000Z
earning_expectation/factor_earning_expectation.py
flaght/panther
7920c1b78121cbb9a8cd7907419f5a42cb2aee69
[ "Apache-2.0" ]
9
2019-08-21T07:48:32.000Z
2020-04-04T09:17:54.000Z
#! /usr/bin/env python # -*- coding: utf-8 -*- """ @version: @author: zzh @file: factor_earning_expectation.py @time: 2019-9-19 """ import pandas as pd class FactorEarningExpectation(): """ 盈利预期 """ def __init__(self): __str__ = 'factor_earning_expectation' self.name = '盈利预测' self.factor_type1 = '盈利预测' self.factor_type2 = '盈利预测' self.description = '个股盈利预测因子' @staticmethod def NPFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['net_profit_fy1']): """ :name: 一致预期净利润(FY1) :desc: 一致预期净利润的未来第一年度的预测 :unit: 元 :view_dimension: 10000 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'net_profit_fy1': 'NPFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['net_profit_fy2']): """ :name: 一致预期净利润(FY2) :desc: 一致预期净利润的未来第二年度的预测 :unit: 元 :view_dimension: 10000 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'net_profit_fy2': 'NPFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['eps_fy1']): """ :name: 一致预期每股收益(FY1) :desc: 一致预期每股收益未来第一年度的预测均值 :unit: 元 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'eps_fy1': 'EPSFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['eps_fy2']): """ :name: 一致预期每股收益(FY2) :desc: 一致预期每股收益未来第二年度的预测均值 :unit: 元 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'eps_fy2': 'EPSFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['operating_revenue_fy1']): """ :name: 一致预期营业收入(FY1) :desc: 一致预期营业收入未来第一年度的预测均值 :unit: 元 :view_dimension: 10000 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'operating_revenue_fy1': 'OptIncFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['operating_revenue_fy2']): """ :name: 一致预期营业收入(FY2) :desc: 一致预期营业收入未来第二年度的预测均值 :unit: 元 :view_dimension: 10000 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'operating_revenue_fy2': 'OptIncFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPEFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['pe_fy1']): """ :name: 一致预期市盈率(PE)(FY1) :desc: 一致预期市盈率未来第一年度的预测均值 :unit: 倍 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'pe_fy1': 'CEPEFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPEFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['pe_fy2']): """ :name: 一致预期市盈率(PE)(FY2) :desc: 一致预期市盈率未来第二年度的预测均值 :unit: 倍 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'pe_fy2': 'CEPEFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPBFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['pb_fy1']): """ :name: 一致预期市净率(PB)(FY1) :desc: 一致预期市净率未来第一年度的预测均值 :unit: 倍 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'pb_fy1': 'CEPBFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPBFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['pb_fy2']): """ :name: 一致预期市净率(PB)(FY2) :desc: 一致预期市净率未来第二年度的预测均值 :unit: 倍 :view_dimension: 1 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'pb_fy2': 'CEPBFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPEGFY1(tp_earning, factor_earning_expect, trade_date, dependencies=['peg_fy1']): """ :name: 市盈率相对盈利增长比率(FY1) :desc: 未来第一年度市盈率相对盈利增长比率 :unit: :view_dimension: 0.01 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'peg_fy1': 'CEPEGFY1'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CEPEGFY2(tp_earning, factor_earning_expect, trade_date, dependencies=['peg_fy2']): """ :name: 市盈率相对盈利增长比率(FY2) :desc: 未来第二年度市盈率相对盈利增长比率 :unit: :view_dimension: 0.01 """ earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, dependencies] earning_expect.rename(columns={'peg_fy2': 'CEPEGFY2'}, inplace=True) factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def _change_rate(tp_earning, trade_date, pre_trade_date, colunm, factor_name): earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, colunm] earning_expect_pre = tp_earning[tp_earning['publish_date'] == pre_trade_date].loc[:, colunm] earning_expect = pd.merge(earning_expect, earning_expect_pre, on='security_code', how='left') earning_expect[factor_name] = (earning_expect[colunm + '_x'] - earning_expect[colunm + '_y']) / \ earning_expect[colunm + '_y'] earning_expect.drop(columns=[colunm + '_x', colunm + '_y'], inplace=True) return earning_expect @staticmethod def _change_value(tp_earning, trade_date, pre_trade_date, colunm, factor_name): earning_expect = tp_earning[tp_earning['publish_date'] == trade_date].loc[:, colunm] earning_expect_pre = tp_earning[tp_earning['publish_date'] == pre_trade_date].loc[:, colunm] earning_expect = pd.merge(earning_expect, earning_expect_pre, on='security_code', how='left') earning_expect[factor_name] = (earning_expect[colunm + '_x'] - earning_expect[colunm + '_y']) earning_expect.drop(columns=[colunm + '_x', colunm + '_y'], inplace=True) return earning_expect @staticmethod def NPFY11WRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化率_一周 :desc: 未来第一年度一致预测净利润一周内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[1], 'net_profit_fy1', 'NPFY11WRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY11MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化率_一月 :desc: 未来第一年度一致预测净利润一月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[2], 'net_profit_fy1', 'NPFY11MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY13MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化率_三月 :desc: 未来第一年度一致预测净利润三月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[3], 'net_profit_fy1', 'NPFY13MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY16MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化率_六月 :desc: 未来第一年度一致预测净利润六月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[4], 'net_profit_fy1', 'NPFY16MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY11WChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化_一周 :desc: 未来第一年度一致预测每股收益一周内预测值变化 :unit: 元 :view_dimension: 1 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[1], 'eps_fy1', 'EPSFY11WChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY11MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化_一月 :desc: 未来第一年度一致预测每股收益一月内预测值变化 :unit: 元 :view_dimension: 1 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[2], 'eps_fy1', 'EPSFY11MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY13MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化_三月 :desc: 未来第一年度一致预测每股收益三月内预测值变化 :unit: 元 :view_dimension: 1 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[3], 'eps_fy1', 'EPSFY13MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY16MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化_六月 :desc: 未来第一年度一致预测每股收益六月内预测值变化 :unit: 元 :view_dimension: 1 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[4], 'eps_fy1', 'EPSFY16MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY11WRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化率_一周 :desc: 未来第一年度一致预测每股收益一周内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[1], 'eps_fy1', 'EPSFY11WRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY11MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化率_一月 :desc: 未来第一年度一致预测每股收益一月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[2], 'eps_fy1', 'EPSFY11MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY13MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化率_三月 :desc: 未来第一年度一致预测每股收益三月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[3], 'eps_fy1', 'EPSFY13MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def EPSFY16MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY1)变化率_六月 :desc: 未来第一年度一致预测每股收益六月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[4], 'eps_fy1', 'EPSFY16MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY11WChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化_一周 :desc: 未来第一年度一致预测净利润一周内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[1], 'net_profit_fy1', 'NPFY11WChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY11MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化_一月 :desc: 未来第一年度一致预测净利润一月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[2], 'net_profit_fy1', 'NPFY11MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY13MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化_三月 :desc: 未来第一年度一致预测净利润三月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[3], 'net_profit_fy1', 'NPFY13MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def NPFY16MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY1)变化_六月 :desc: 未来第一年度一致预测净利润六月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[4], 'net_profit_fy1', 'NPFY16MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def ChgNPFY1FY2(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测净利润(FY2)与一致预期净利润(FY1)的变化率 :desc: 未来第二年度一致预测净利润与未来第一年度一致预测净利润变化率 :unit: :view_dimension: 0.01 """ factor_earning_expect['ChgNPFY1FY2'] = factor_earning_expect['NPFY2'] - factor_earning_expect['NPFY1'] / abs( factor_earning_expect['NPFY1']) * 100 return factor_earning_expect @staticmethod def ChgEPSFY1FY2(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测每股收益(FY2)与一致预期每股收益(FY1)的变化率 :desc: 未来第二年度一致预测每股收益与未来第一年度一致预测每股收益变化率 :unit: :view_dimension: 0.01 """ factor_earning_expect['ChgEPSFY1FY2'] = factor_earning_expect['EPSFY2'] - factor_earning_expect['EPSFY1'] / abs( factor_earning_expect['EPSFY1']) * 100 return factor_earning_expect @staticmethod def OptIncFY11WRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化_一周 :desc: 未来第一年度一致预测营业收入一周内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[1], 'operating_revenue_fy1', 'OptIncFY11WRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY11MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化_一月 :desc: 未来第一年度一致预测营业收入一月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[2], 'operating_revenue_fy1', 'OptIncFY11MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY13MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化_三月 :desc: 未来第一年度一致预测营业收入三月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[3], 'operating_revenue_fy1', 'OptIncFY13MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY16MRT(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化_六月 :desc: 未来第一年度一致预测营业收入六月内预测值变化 :unit: 元 :view_dimension: 10000 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_value(tp_earning, trade_date, trade_dates[4], 'operating_revenue_fy1', 'OptIncFY16MRT') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY11WChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化率_一周 :desc: 未来第一年度一致预测营业收入一周内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[1], 'operating_revenue_fy1', 'OptIncFY11WChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY11MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化率_一月 :desc: 未来第一年度一致预测营业收入一月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[2], 'operating_revenue_fy1', 'OptIncFY11MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY13MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化率_三月 :desc: 未来第一年度一致预测营业收入三月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[3], 'operating_revenue_fy1', 'OptIncFY13MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def OptIncFY16MChg(tp_earning, factor_earning_expect, trade_date): """ :name: 一致预测营业收入(FY1)变化率_六月 :desc: 未来第一年度一致预测营业收入六月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[4], 'operating_revenue_fy1', 'OptIncFY16MChg') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect # @staticmethod # def OptIncFY1SDT(tp_earning, factor_earning_expect, trade_date): # """ # :name: 一致预测营业收入(FY1)标准差 # :desc: 未来第一年度一致预测营业收入标准差 # """ # return factor_earning_expect @staticmethod def CERATINGRATE1W(tp_earning, factor_earning_expect, trade_date): """ :name: 一周评级变化率 :desc: 研究机构买入评级一周内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 2: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[1], 'rating2', 'CERATINGRATE1W') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CERATINGRATE1M(tp_earning, factor_earning_expect, trade_date): """ :name: 一月评级变化率 :desc: 研究机构买入评级一月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 3: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[2], 'rating2', 'CERATINGRATE1M') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CERATINGRATE3M(tp_earning, factor_earning_expect, trade_date): """ :name: 三月评级变化率 :desc: 研究机构买入评级三月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 4: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[3], 'rating2', 'CERATINGRATE3M') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect @staticmethod def CERATINGRATE6M(tp_earning, factor_earning_expect, trade_date): """ :name: 六月评级变化率 :desc: 研究机构买入评级六月内预测值变化率 :unit: :view_dimension: 0.01 """ trade_dates = sorted(set(tp_earning['publish_date']), reverse=True) if len(trade_dates) >= 5: earning_expect = FactorEarningExpectation._change_rate(tp_earning, trade_date, trade_dates[4], 'rating2', 'CERATINGRATE6M') factor_earning_expect = pd.merge(factor_earning_expect, earning_expect, on='security_code') return factor_earning_expect
45.125
120
0.58716
2,995
30,685
5.652421
0.068447
0.220391
0.195286
0.051982
0.837262
0.837262
0.833658
0.828578
0.814283
0.78209
0
0.020998
0.320222
30,685
679
121
45.191458
0.790594
0.123839
0
0.724234
0
0
0.089148
0.011174
0
0
0
0
0
1
0.125348
false
0
0.002786
0
0.253482
0
0
0
0
null
1
1
0
1
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
9
b74cd78efa3ba3c997d72f8b2c89e86d81e211a6
45,012
py
Python
dabasco/aspic/tests/test_export_toast.py
hhucn/dabasco
847cf550b4f55baf21446564c908e992a69366f0
[ "MIT" ]
5
2017-08-02T16:55:10.000Z
2019-05-15T21:05:10.000Z
dabasco/aspic/tests/test_export_toast.py
hhucn/dabasco
847cf550b4f55baf21446564c908e992a69366f0
[ "MIT" ]
null
null
null
dabasco/aspic/tests/test_export_toast.py
hhucn/dabasco
847cf550b4f55baf21446564c908e992a69366f0
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import unittest from dabasco.aspic.export_toast import export_toast from dabasco.dbas.dbas_import import import_dbas_user, import_dbas_graph from os import path import logging.config log_file_path = path.join(path.dirname(path.abspath(__file__)), '../../logging.ini') logging.config.fileConfig(log_file_path, disable_existing_loggers=False) logger = logging.getLogger('test') class TestASPICExport(unittest.TestCase): def test_discussion1_weak_user1_no_assumptions(self): discussion_id = 1 user_id = 1 opinion_type = "weak" assumptions_type = None assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua2] opinion_dummy=>2", "[ur3] opinion_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[ua2] < [i1]", "[ua2] < [i2]", "[ur3] < [i1]", "[ur3] < [i2]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_weak_assumptions_no_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "weak" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[a1] < [i1]", "[a1] < [i2]", "[r1] < [i1]", "[r1] < [i2]", "[a2] < [i1]", "[a2] < [i2]", "[r2] < [i1]", "[r2] < [i2]", "[a3] < [i1]", "[a3] < [i2]", "[r3] < [i1]", "[r3] < [i2]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_weak_assumptions_positive_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "weak" assumptions_bias = "positive" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[a2] assumptions_dummy=>2", "[a3] assumptions_dummy=>3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[a1] < [i1]", "[a1] < [i2]", "[a2] < [i1]", "[a2] < [i2]", "[a3] < [i1]", "[a3] < [i2]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_weak_assumptions_negative_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "weak" assumptions_bias = "negative" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[r1] assumptions_dummy=>~1", "[r2] assumptions_dummy=>~2", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[r1] < [i1]", "[r1] < [i2]", "[r2] < [i1]", "[r2] < [i2]", "[r3] < [i1]", "[r3] < [i2]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_strong_assumptions_no_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "strong" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_strong_assumptions_positive_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "strong" assumptions_bias = "positive" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[a2] assumptions_dummy=>2", "[a3] assumptions_dummy=>3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_no_user_strong_assumptions_negative_bias(self): discussion_id = 1 opinion_type = None assumptions_type = "strong" assumptions_bias = "negative" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = None aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[r1] assumptions_dummy=>~1", "[r2] assumptions_dummy=>~2", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strong_user1_weak_assumptions_no_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strong" assumptions_type = "weak" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua2] opinion_dummy=>2", "[ur3] opinion_dummy=>~3", "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[a1] < [i1]", "[a1] < [i2]", "[r1] < [i1]", "[r1] < [i2]", "[a2] < [i1]", "[a2] < [i2]", "[r2] < [i1]", "[r2] < [i2]", "[a3] < [i1]", "[a3] < [i2]", "[r3] < [i1]", "[r3] < [i2]", "[a1] < [ua2]", "[a1] < [ur3]", "[r1] < [ua2]", "[r1] < [ur3]", "[a2] < [ua2]", "[a2] < [ur3]", "[r2] < [ua2]", "[r2] < [ur3]", "[a3] < [ua2]", "[a3] < [ur3]", "[r3] < [ua2]", "[r3] < [ur3]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strong_user1_weak_assumptions_positive_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strong" assumptions_type = "weak" assumptions_bias = "positive" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua2] opinion_dummy=>2", "[ur3] opinion_dummy=>~3", "[a1] assumptions_dummy=>1", "[a2] assumptions_dummy=>2", "[a3] assumptions_dummy=>3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[a1] < [i1]", "[a1] < [i2]", "[a2] < [i1]", "[a2] < [i2]", "[a3] < [i1]", "[a3] < [i2]", "[a1] < [ua2]", "[a1] < [ur3]", "[a2] < [ua2]", "[a2] < [ur3]", "[a3] < [ua2]", "[a3] < [ur3]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strong_user1_weak_assumptions_negative_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strong" assumptions_type = "weak" assumptions_bias = "negative" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua2] opinion_dummy=>2", "[ur3] opinion_dummy=>~3", "[r1] assumptions_dummy=>~1", "[r2] assumptions_dummy=>~2", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = { "[r1] < [i1]", "[r1] < [i2]", "[r2] < [i1]", "[r2] < [i2]", "[r3] < [i1]", "[r3] < [i2]", "[r1] < [ua2]", "[r1] < [ur3]", "[r2] < [ua2]", "[r2] < [ur3]", "[r3] < [ua2]", "[r3] < [ur3]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strict_user1_strong_assumptions_no_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strict" assumptions_type = "strong" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "2", "~3"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strict_user1_strong_assumptions_positive_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strict" assumptions_type = "strong" assumptions_bias = "positive" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "2", "~3"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[a2] assumptions_dummy=>2", "[a3] assumptions_dummy=>3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion1_strict_user1_strong_assumptions_negative_bias(self): discussion_id = 1 user_id = 1 opinion_type = "strict" assumptions_type = "strong" assumptions_bias = "negative" semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]} ], "nodes": [1, 2, 3], "undercuts": [] } dbas_user_json = { "accepted_statements_via_click": [2], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [3], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "2", "~3"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[r1] assumptions_dummy=>~1", "[r2] assumptions_dummy=>~2", "[r3] assumptions_dummy=>~3", "[i1] 2=>1", "[i2] 3=>~1" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion2_weak_user2_no_assumptions(self): discussion_id = 2 user_id = 2 opinion_type = "weak" assumptions_type = None assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]}, {"conclusion": 2, "id": 3, "is_supportive": False, "premises": [4]} ], "nodes": [1, 2, 3, 4, 5], "undercuts": [ {"conclusion": 2, "id": 4, "premises": [5]} ] } dbas_user_json = { "accepted_statements_via_click": [3], "marked_arguments": [], "marked_statements": [4], "rejected_arguments": [], "rejected_statements_via_click": [5], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua3] opinion_dummy=>3", "[ua4] opinion_dummy=>4", "[ur5] opinion_dummy=>~5", "[i1] 2=>1", "[i2] 3=>~1", "[i3] 4=>~2", "[i4] 5=>~[i2]" } reference_rulePrefs = { "[ua3] < [i1]", "[ua3] < [i2]", "[ua3] < [i3]", "[ua3] < [i4]", "[ua4] < [i1]", "[ua4] < [i2]", "[ua4] < [i3]", "[ua4] < [i4]", "[ur5] < [i1]", "[ur5] < [i2]", "[ur5] < [i3]", "[ur5] < [i4]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion2_strong_user2_weak_assumptions_no_bias(self): discussion_id = 2 user_id = 2 opinion_type = "strong" assumptions_type = "weak" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]}, {"conclusion": 2, "id": 3, "is_supportive": False, "premises": [4]} ], "nodes": [1, 2, 3, 4, 5], "undercuts": [ {"conclusion": 2, "id": 4, "premises": [5]} ] } dbas_user_json = { "accepted_statements_via_click": [3], "marked_arguments": [], "marked_statements": [4], "rejected_arguments": [], "rejected_statements_via_click": [5], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua3] opinion_dummy=>3", "[ua4] opinion_dummy=>4", "[ur5] opinion_dummy=>~5", "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[a4] assumptions_dummy=>4", "[r4] assumptions_dummy=>~4", "[a5] assumptions_dummy=>5", "[r5] assumptions_dummy=>~5", "[i1] 2=>1", "[i2] 3=>~1", "[i3] 4=>~2", "[i4] 5=>~[i2]" } reference_rulePrefs = { "[a1] < [i1]", "[a1] < [i2]", "[a1] < [i3]", "[a1] < [i4]", "[r1] < [i1]", "[r1] < [i2]", "[r1] < [i3]", "[r1] < [i4]", "[a2] < [i1]", "[a2] < [i2]", "[a2] < [i3]", "[a2] < [i4]", "[r2] < [i1]", "[r2] < [i2]", "[r2] < [i3]", "[r2] < [i4]", "[a3] < [i1]", "[a3] < [i2]", "[a3] < [i3]", "[a3] < [i4]", "[r3] < [i1]", "[r3] < [i2]", "[r3] < [i3]", "[r3] < [i4]", "[a4] < [i1]", "[a4] < [i2]", "[a4] < [i3]", "[a4] < [i4]", "[r4] < [i1]", "[r4] < [i2]", "[r4] < [i3]", "[r4] < [i4]", "[a5] < [i1]", "[a5] < [i2]", "[a5] < [i3]", "[a5] < [i4]", "[r5] < [i1]", "[r5] < [i2]", "[r5] < [i3]", "[r5] < [i4]", "[a1] < [ua3]", "[a1] < [ua4]", "[a1] < [ur5]", "[r1] < [ua3]", "[r1] < [ua4]", "[r1] < [ur5]", "[a2] < [ua3]", "[a2] < [ua4]", "[a2] < [ur5]", "[r2] < [ua3]", "[r2] < [ua4]", "[r2] < [ur5]", "[a3] < [ua3]", "[a3] < [ua4]", "[a3] < [ur5]", "[r3] < [ua3]", "[r3] < [ua4]", "[r3] < [ur5]", "[a4] < [ua3]", "[a4] < [ua4]", "[a4] < [ur5]", "[r4] < [ua3]", "[r4] < [ua4]", "[r4] < [ur5]", "[a5] < [ua3]", "[a5] < [ua4]", "[a5] < [ur5]", "[r5] < [ua3]", "[r5] < [ua4]", "[r5] < [ur5]" } self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion2_strict_user2_strong_assumptions_no_bias(self): discussion_id = 2 user_id = 2 opinion_type = "strict" assumptions_type = "strong" assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]}, {"conclusion": 2, "id": 3, "is_supportive": False, "premises": [4]} ], "nodes": [1, 2, 3, 4, 5], "undercuts": [ {"conclusion": 2, "id": 4, "premises": [5]} ] } dbas_user_json = { "accepted_statements_via_click": [3], "marked_arguments": [], "marked_statements": [4], "rejected_arguments": [], "rejected_statements_via_click": [5], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"assumptions_dummy", "3", "4", "~5"} reference_contrariness = set() reference_kb_prefs = set() reference_rules = { "[a1] assumptions_dummy=>1", "[r1] assumptions_dummy=>~1", "[a2] assumptions_dummy=>2", "[r2] assumptions_dummy=>~2", "[a3] assumptions_dummy=>3", "[r3] assumptions_dummy=>~3", "[a4] assumptions_dummy=>4", "[r4] assumptions_dummy=>~4", "[a5] assumptions_dummy=>5", "[r5] assumptions_dummy=>~5", "[i1] 2=>1", "[i2] 3=>~1", "[i3] 4=>~2", "[i4] 5=>~[i2]" } reference_rule_prefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kb_prefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rule_prefs) self.assertEqual(aspic_result["semantics"], semantics) def test_discussion2_strong_user99_no_assumptions(self): discussion_id = 2 user_id = 99 opinion_type = "strong" assumptions_type = None assumptions_bias = None semantics = "preferred" dbas_discussion_json = { "inferences": [ {"conclusion": 1, "id": 1, "is_supportive": True, "premises": [2]}, {"conclusion": 1, "id": 2, "is_supportive": False, "premises": [3]}, {"conclusion": 2, "id": 3, "is_supportive": False, "premises": [4]} ], "nodes": [1, 2, 3, 4, 5], "undercuts": [ {"conclusion": 2, "id": 4, "premises": [5]} ] } dbas_user_json = { "accepted_statements_via_click": [3, 4, 99], "marked_arguments": [], "marked_statements": [], "rejected_arguments": [], "rejected_statements_via_click": [5, 999], } dbas_discussion = import_dbas_graph(discussion_id=discussion_id, graph_export=dbas_discussion_json) dbas_user = import_dbas_user(discussion_id=discussion_id, user_id=user_id, user_export=dbas_user_json) aspic_result = export_toast(dbas_graph=dbas_discussion, opinion_type=opinion_type, opinion=dbas_user, assumptions_type=assumptions_type, assumptions_bias=assumptions_bias, semantics=semantics) reference_assumptions = set() reference_axioms = {"opinion_dummy"} reference_contrariness = set() reference_kbPrefs = set() reference_rules = { "[ua3] opinion_dummy=>3", "[ua4] opinion_dummy=>4", "[ur5] opinion_dummy=>~5", "[i1] 2=>1", "[i2] 3=>~1", "[i3] 4=>~2", "[i4] 5=>~[i2]" } reference_rulePrefs = set() self.assertEqual(set(aspic_result["assumptions"]), reference_assumptions) self.assertEqual(set(aspic_result["axioms"]), reference_axioms) self.assertEqual(set(aspic_result["contrariness"]), reference_contrariness) self.assertEqual(set(aspic_result["kbPrefs"]), reference_kbPrefs) self.assertEqual(set(aspic_result["rules"]), reference_rules) self.assertEqual(set(aspic_result["rulePrefs"]), reference_rulePrefs) self.assertEqual(aspic_result["semantics"], semantics) if __name__ == '__main__': unittest.main()
39.904255
110
0.530192
4,142
45,012
5.452197
0.027764
0.066245
0.0813
0.103883
0.96028
0.955542
0.955188
0.9547
0.952531
0.950405
0
0.029975
0.33591
45,012
1,127
111
39.939663
0.725512
0.000467
0
0.831858
0
0
0.200089
0.030051
0
0
0
0
0.117011
1
0.016716
false
0
0.032448
0
0.050147
0
0
0
0
null
0
0
0
1
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
7
b7545c9a6e2d356bcd1ffbd4e73e808f1ffbdcd9
148
py
Python
src/sentry_plugins/github/__init__.py
Mattlk13/sentry
0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2
[ "Apache-2.0" ]
null
null
null
src/sentry_plugins/github/__init__.py
Mattlk13/sentry
0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2
[ "Apache-2.0" ]
null
null
null
src/sentry_plugins/github/__init__.py
Mattlk13/sentry
0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import from sentry_plugins.base import assert_package_not_installed assert_package_not_installed('sentry-github')
24.666667
60
0.885135
20
148
5.95
0.6
0.218487
0.268908
0.420168
0
0
0
0
0
0
0
0
0.074324
148
5
61
29.6
0.868613
0
0
0
0
0
0.087838
0
0
0
0
0
0.666667
1
0
true
0
0.666667
0
0.666667
0
1
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
1
0
0
1
0
1
0
1
0
0
9
b778d02b63ea95a27a015d37e4b97300ff64846f
45,581
py
Python
stat_graph.py
yagongso/KBO_crawler
c799b5c010a78ee2ca96a5a279655e962c4d1f40
[ "MIT" ]
7
2018-03-31T12:02:40.000Z
2021-04-30T00:22:28.000Z
stat_graph.py
yagongso/KBO_crawler
c799b5c010a78ee2ca96a5a279655e962c4d1f40
[ "MIT" ]
null
null
null
stat_graph.py
yagongso/KBO_crawler
c799b5c010a78ee2ca96a5a279655e962c4d1f40
[ "MIT" ]
3
2018-05-17T07:45:09.000Z
2019-01-18T11:59:29.000Z
# coding: utf-8 import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import ipywidgets as widgets from IPython.display import clear_output import matplotlib.dates as mdates import matplotlib.ticker as ticker def graph_batting_result(df, batter, ma_term=0, options=[True, True, True, True, True]): datesFmt = mdates.DateFormatter('%m-%d') if df.game_date.dtype == np.int64: df = df.assign(game_date = pd.to_datetime(df.game_date, format='%Y%m%d').dt.date) df = df.assign(pa=np.where(df.pa_result.notnull(), 1, 0)) df = df.assign(ab=np.where(df.pa_result.isin(['1루타', '내야안타', '안타', '2루타', '3루타', '홈런', '희생번트 야수선택', '삼진', '실책', '필드 아웃', '포스 아웃', '병살타', '타구맞음 아웃', '낫아웃 폭투', '희생번트 실책', '야수선택', '낫아웃 포일', '삼중살']), 1, 0)) df = df.assign(single=np.where(df.pa_result.isin(['1루타', '내야안타', '안타']), 1, 0)) df = df.assign(double=np.where(df.pa_result == '2루타', 1, 0)) df = df.assign(triple=np.where(df.pa_result == '3루타', 1, 0)) df = df.assign(hr=np.where(df.pa_result == '홈런', 1, 0)) df = df.assign(sh=np.where(df.pa_result == '희생번트', 1, 0)) df = df.assign(sf=np.where(df.pa_result == '희생플라이', 1, 0)) df = df.assign(so=np.where(df.pa_result.isin(['삼진', '낫아웃 폭투', '낫아웃 포일']), 1, 0)) df = df.assign(bb=np.where(df.pa_result.isin(['볼넷', '고의4구']), 1, 0)) df = df.assign(hbp=np.where(df.pa_result == '몸에 맞는 볼', 1, 0)) df = df.assign(hit=df.single + df.double + df.triple + df.hr) df = df.assign(tb=df.single + df.double*2 + df.triple*3 + df.hr*4) sub_df = df.loc[df.batter == batter] tab = sub_df.pivot_table(index='game_date', values=['hit', 'tb', 'ab', 'pa', 'hr', 'sh', 'sf', 'so', 'bb', 'hbp'], aggfunc='sum' ) #babip = (hit-hr) / (ab-so-hr+sf) tab = tab.fillna(0) result_sum = [] hit_sum = tb_sum = 0 ab_sum = pa_sum = 0 hr_sum = sh_sum = sf_sum = 0 so_sum = bb_sum = hbp_sum = 0 fig, a1 = plt.subplots(figsize=(3, 3), dpi=144, facecolor='white') if (ma_term <= 1) or (ma_term >= len(tab.index)): for i in tab.index: hit_sum += tab.loc[i].hit tb_sum += tab.loc[i].tb ab_sum += tab.loc[i].ab pa_sum += tab.loc[i].pa hr_sum += tab.loc[i].hr sh_sum += tab.loc[i].sh sf_sum += tab.loc[i].sf so_sum += tab.loc[i].so bb_sum += tab.loc[i].bb hbp_sum += tab.loc[i].hbp # avg, obp, slg, ops, babip _avg = hit_sum/ab_sum if ab_sum > 0 else 0 _obp = (hit_sum+bb_sum+hbp_sum)/(ab_sum+bb_sum+hbp_sum+sf_sum) if (ab_sum+bb_sum+hbp_sum+sf_sum) > 0 else 0 _slg = tb_sum/ab_sum if ab_sum > 0 else 0 _ops = _obp + _slg _babip = (hit_sum-hr_sum)/(ab_sum-so_sum-hr_sum+sf_sum) if (ab_sum-so_sum-hr_sum+sf_sum) > 0 else 0 result_sum.append([_avg, _obp, _slg, _ops, _babip]) fig.suptitle(f'{batter}\'s Cumulative Average', fontsize=10) else: term = ma_term - 1 for i in range(0, len(tab.index) - term): hit_sum = tab.loc[tab.index[i]:tab.index[i+term]].hit.sum() tb_sum = tab.loc[tab.index[i]:tab.index[i+term]].tb.sum() ab_sum = tab.loc[tab.index[i]:tab.index[i+term]].ab.sum() pa_sum = tab.loc[tab.index[i]:tab.index[i+term]].pa.sum() hr_sum = tab.loc[tab.index[i]:tab.index[i+term]].hr.sum() sh_sum = tab.loc[tab.index[i]:tab.index[i+term]].sh.sum() sf_sum = tab.loc[tab.index[i]:tab.index[i+term]].sf.sum() so_sum = tab.loc[tab.index[i]:tab.index[i+term]].so.sum() bb_sum = tab.loc[tab.index[i]:tab.index[i+term]].bb.sum() hbp_sum = tab.loc[tab.index[i]:tab.index[i+term]].hbp.sum() # avg, obp, slg, ops, babip _avg = hit_sum/ab_sum if ab_sum > 0 else 0 _obp = (hit_sum+bb_sum+hbp_sum)/(ab_sum+bb_sum+hbp_sum+sf_sum) if (ab_sum+bb_sum+hbp_sum+sf_sum) > 0 else 0 _slg = tb_sum/ab_sum if ab_sum > 0 else 0 _ops = _obp + _slg _babip = (hit_sum-hr_sum)/(ab_sum-so_sum-hr_sum+sf_sum) if (ab_sum-so_sum-hr_sum+sf_sum) > 0 else 0 result_sum.append([_avg, _obp, _slg, _ops, _babip]) fig.suptitle(f'{batter}\'s {ma_term}-Game Rolling Average') rs = np.array(result_sum) a1.yaxis.set_major_formatter(ticker.FormatStrFormatter('%.3f')) min_y = 10000 max_y = -10000 a2 = a3 = a4 = a5 = None if options[0] == True: if (ma_term <= 1) or (ma_term >= len(tab.index)): a1.plot(tab.index, rs[:, 0], label='AVG', color='k') else: a1.plot(tab.index[term:], rs[:, 0], label='AVG', color='k') a1.xaxis.set_major_formatter(datesFmt) a1.grid(True) a1.set_yticks([]) max_y = max(max_y, rs[:, 0].max()) min_y = min(min_y, rs[:, 0].min()) if options[1] == True: a2 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a2.plot(tab.index, rs[:, 1], label='OBP', color='blueviolet', linestyle=':', linewidth=2) else: a2.plot(tab.index[term:], rs[:, 1], label='OBP', color='blueviolet', linestyle=':', linewidth=2) a2.xaxis.set_major_formatter(datesFmt) a2.grid(True) a2.set_yticks([]) if max_y < rs[:, 1].max(): max_y = rs[:, 1].max() if min_y > rs[:, 1].min(): min_y = rs[:, 1].min() if options[2] == True: a3 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a3.plot(tab.index, rs[:, 2], label='SLG', color='orangered', marker='o', markersize='2.5') else: a3.plot(tab.index[term:], rs[:, 2], label='SLG', color='orangered', marker='o', markersize='2.5') a3.xaxis.set_major_formatter(datesFmt) a3.grid(True) a3.set_yticks([]) if max_y < rs[:, 2].max(): max_y = rs[:, 2].max() if min_y > rs[:, 2].min(): min_y = rs[:, 2].min() if options[3] == True: a4 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a4.plot(tab.index, rs[:, 3], label='OPS', color='royalblue') else: a4.plot(tab.index[term:], rs[:, 3], label='OPS', color='royalblue') a4.xaxis.set_major_formatter(datesFmt) a4.grid(True) a4.set_yticks([]) if max_y < rs[:, 3].max(): max_y = rs[:, 3].max() if min_y > rs[:, 3].min(): min_y = rs[:, 3].min() if options[4] == True: a5 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a5.plot(tab.index, rs[:, 4], label='BABIP', color='gold', linestyle='--') else: a5.plot(tab.index[term:], rs[:, 4], label='BABIP', color='gold', linestyle='--') a5.xaxis.set_major_formatter(datesFmt) a5.grid(True) a5.set_yticks([]) if max_y < rs[:, 4].max(): max_y = rs[:, 4].max() if min_y > rs[:, 4].min(): min_y = rs[:, 4].min() a1.set_ylim([max(0, min_y-0.025), max_y+0.025]) a1.set_ylabel('') if a2 is not None: a2.set_ylim([max(0, min_y-0.025), max_y+0.025]) a2.set_ylabel('') if a3 is not None: a3.set_ylim([max(0, min_y-0.025), max_y+0.025]) a3.set_ylabel('') if a4 is not None: a4.set_ylim([max(0, min_y-0.025), max_y+0.025]) a4.set_ylabel('') if a5 is not None: a5.set_ylim([max(0, min_y-0.025), max_y+0.025]) a5.set_ylabel('') fig.legend(loc='lower center', ncol=np.array(options).sum(), fontsize='xx-small', bbox_to_anchor=(0.5, -0.005)) a1.yaxis.set_major_locator(ticker.MultipleLocator(0.05)) a1.yaxis.set_minor_locator(ticker.MultipleLocator(0.01)) a1.grid(True) a1.tick_params(labelsize='x-small') return fig def graph_batter_plate_discipline(df, batter, ma_term=0, options=[True, True, True, True, True, True]): datesFmt = mdates.DateFormatter('%m-%d') if df.game_date.dtype == np.int64: df = df.assign(game_date = pd.to_datetime(df.game_date, format='%Y%m%d').dt.date) if df.px.dtypes == np.object: df.loc[:, 'px'] = pd.to_numeric(df.px, errors='coerce') if df.isnull().any().px == False: df = df.drop(df.loc[df.px.isnull()].index) if df.pz.dtypes == np.object: df.loc[:, 'pz'] = pd.to_numeric(df.pz, errors='coerce') if df.isnull().any().pz == False: df = df.drop(df.loc[df.pz.isnull()].index) df = df.assign(swing=np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']), 1, 0)) df = df.assign(miss=np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']), 1, 0)) izmask = df.px.between(-10/12, 10/12) & df.pz.between(1.6, 3.6) ozmask = ~izmask df = df.assign(iz_swing= np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']) & izmask, 1, 0)) df = df.assign(iz_miss= np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']) & izmask, 1, 0)) df = df.assign(oz_swing= np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']) & ozmask, 1, 0)) df = df.assign(oz_miss= np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']) & ozmask, 1, 0)) sub_df = df.loc[df.batter == batter] tab = sub_df.pivot_table(index='game_date', values=['swing', 'miss', 'iz_swing', 'iz_miss', 'oz_swing', 'oz_miss'], aggfunc='sum' ) tab = tab.assign(raw_num = sub_df.groupby('game_date').count().speed) tab = tab.assign(iz_raw_num = sub_df.loc[izmask].groupby('game_date').count().speed) tab = tab.assign(oz_raw_num = sub_df.loc[ozmask].groupby('game_date').count().speed) tab = tab.fillna(0) result_sum = [] raw_num_sum = iz_raw_num_sum = oz_raw_num_sum = 0 swing_sum = iz_swing_sum = oz_swing_sum = 0 miss_sum = iz_miss_sum = oz_miss_sum = 0 fig, a1 = plt.subplots(figsize=(3, 3), dpi=144, facecolor='white') if (ma_term <= 1) or (ma_term >= len(tab.index)): for i in tab.index: raw_num_sum += tab.loc[i].raw_num swing_sum += tab.loc[i].swing miss_sum += tab.loc[i].miss iz_raw_num_sum += tab.loc[i].iz_raw_num iz_swing_sum += tab.loc[i].iz_swing iz_miss_sum += tab.loc[i].iz_miss oz_raw_num_sum += tab.loc[i].oz_raw_num oz_swing_sum += tab.loc[i].oz_swing oz_miss_sum += tab.loc[i].oz_miss #swing%, con%, izswing%, izcon%, ozswing%, ozcon% _swing = swing_sum/raw_num_sum*100 if raw_num_sum > 0 else 0 _con = (1-miss_sum/swing_sum)*100 if swing_sum > 0 else 0 _izswing = iz_swing_sum/iz_raw_num_sum*100 if iz_raw_num_sum > 0 else 0 _izcon = (1-iz_miss_sum/iz_swing_sum)*100 if iz_swing_sum > 0 else 0 _ozswing = oz_swing_sum/oz_raw_num_sum*100 if oz_raw_num_sum > 0 else 0 _ozcon = (1-oz_miss_sum/oz_swing_sum)*100 if oz_swing_sum > 0 else 0 result_sum.append([_swing, _con, _izswing, _izcon, _ozswing, _ozcon]) fig.suptitle(f'{batter}\'s Cumulative Average', fontsize=10) else: term = ma_term - 1 for i in range(0, len(tab.index) - term): raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].raw_num.sum() swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].swing.sum() miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].miss.sum() iz_raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_raw_num.sum() iz_swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_swing.sum() iz_miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_miss.sum() oz_raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_raw_num.sum() oz_swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_swing.sum() oz_miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_miss.sum() #swing%, con%, izswing%, izcon%, ozswing%, ozcon% _swing = swing_sum/raw_num_sum*100 if raw_num_sum > 0 else 0 _con = (1-miss_sum/swing_sum)*100 if swing_sum > 0 else 0 _izswing = iz_swing_sum/iz_raw_num_sum*100 if iz_raw_num_sum > 0 else 0 _izcon = (1-iz_miss_sum/iz_swing_sum)*100 if iz_swing_sum > 0 else 0 _ozswing = oz_swing_sum/oz_raw_num_sum*100 if oz_raw_num_sum > 0 else 0 _ozcon = (1-oz_miss_sum/oz_swing_sum)*100 if oz_swing_sum > 0 else 0 result_sum.append([_swing, _con, _izswing, _izcon, _ozswing, _ozcon]) fig.suptitle(f'{batter}\'s {ma_term}-Game Rolling Average') rs = np.array(result_sum) a1.yaxis.set_major_formatter(ticker.FormatStrFormatter('%d%%')) min_y = 10000 max_y = -10000 a2 = a3 = a4 = a5 = a6 = None #swing%, con%, izswing%, izcon%, ozswing%, ozcon% if options[0] == True: if (ma_term <= 1) or (ma_term >= len(tab.index)): a1.plot(tab.index, rs[:, 0], label='Swing%', color='k') else: a1.plot(tab.index[term:], rs[:, 0], label='Swing%', color='k') a1.xaxis.set_major_formatter(datesFmt) a1.grid(True) a1.set_yticks([]) max_y = max(max_y, rs[:, 0].max()) min_y = min(min_y, rs[:, 0].min()) if options[1] == True: a2 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a2.plot(tab.index, rs[:, 1], label='Contact%', color='dimgrey', linestyle='--') else: a2.plot(tab.index[term:], rs[:, 1], label='Contact%', color='dimgrey', linestyle='--') a2.xaxis.set_major_formatter(datesFmt) a2.grid(True) a2.set_yticks([]) if max_y < rs[:, 1].max(): max_y = rs[:, 1].max() if min_y > rs[:, 1].min(): min_y = rs[:, 1].min() if options[2] == True: a3 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a3.plot(tab.index, rs[:, 2], label='Z-Swing%', color='blue') else: a3.plot(tab.index[term:], rs[:, 2], label='Z-Swing%', color='blue') a3.xaxis.set_major_formatter(datesFmt) a3.grid(True) a3.set_yticks([]) if max_y < rs[:, 2].max(): max_y = rs[:, 2].max() if min_y > rs[:, 2].min(): min_y = rs[:, 2].min() if options[3] == True: a4 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a4.plot(tab.index, rs[:, 3], label='Z-Contact%', color='lightskyblue', linestyle='--') else: a4.plot(tab.index[term:], rs[:, 3], label='Z-Contact%', color='lightskyblue', linestyle='--') a4.xaxis.set_major_formatter(datesFmt) a4.grid(True) a4.set_yticks([]) if max_y < rs[:, 3].max(): max_y = rs[:, 3].max() if min_y > rs[:, 3].min(): min_y = rs[:, 3].min() if options[4] == True: a5 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a5.plot(tab.index, rs[:, 4], label='O-Swing%', color='green') else: a5.plot(tab.index[term:], rs[:, 4], label='O-Swing%', color='green') a5.xaxis.set_major_formatter(datesFmt) a5.grid(True) a5.set_yticks([]) if max_y < rs[:, 4].max(): max_y = rs[:, 4].max() if min_y > rs[:, 4].min(): min_y = rs[:, 4].min() if options[5] == True: a6 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a6.plot(tab.index, rs[:, 5], label='O-Contact%', color='lime', linestyle='--') else: a6.plot(tab.index[term:], rs[:, 5], label='O-Contact%', color='lime', linestyle='--') a6.xaxis.set_major_formatter(datesFmt) a6.grid(True) a6.set_yticks([]) if max_y < rs[:, 5].max(): max_y = rs[:, 5].max() if min_y > rs[:, 5].min(): min_y = rs[:, 5].min() a1.set_ylim([max(0, min_y-5), max_y+5]) a1.set_ylabel('') if a2 is not None: a2.set_ylim([max(0, min_y-5), max_y+5]) a2.set_ylabel('') if a3 is not None: a3.set_ylim([max(0, min_y-5), max_y+5]) a3.set_ylabel('') if a4 is not None: a4.set_ylim([max(0, min_y-5), max_y+5]) a4.set_ylabel('') if a5 is not None: a5.set_ylim([max(0, min_y-5), max_y+5]) a5.set_ylabel('') if a6 is not None: a6.set_ylim([max(0, min_y-5), max_y+5]) a6.set_ylabel('') fig.legend(loc='lower center', ncol=min(np.array(options).sum(), 3), fontsize='xx-small', bbox_to_anchor=(0.5, -0.01)) a1.yaxis.set_major_locator(ticker.MultipleLocator(5)) a1.yaxis.set_minor_locator(ticker.MultipleLocator(1)) a1.grid(True) a1.tick_params(labelsize='x-small') return fig def graph_pitching_result(df, pitcher, ma_term=0, options=[True, True, True, True, True, True, True]): # K%, BB%, BABIP, OAVG, OOBP, OSLG, OOPS datesFmt = mdates.DateFormatter('%m-%d') if df.game_date.dtype == np.int64: df = df.assign(game_date = pd.to_datetime(df.game_date, format='%Y%m%d').dt.date) df = df.assign(pa=np.where(df.pa_result.notnull(), 1, 0)) df = df.assign(ab=np.where(df.pa_result.isin(['1루타', '내야안타', '안타', '2루타', '3루타', '홈런', '희생번트 야수선택', '삼진', '실책', '필드 아웃', '포스 아웃', '병살타', '타구맞음 아웃', '낫아웃 폭투', '희생번트 실책', '야수선택', '낫아웃 포일', '삼중살']), 1, 0)) df = df.assign(single=np.where(df.pa_result.isin(['1루타', '내야안타', '안타']), 1, 0)) df = df.assign(double=np.where(df.pa_result == '2루타', 1, 0)) df = df.assign(triple=np.where(df.pa_result == '3루타', 1, 0)) df = df.assign(hr=np.where(df.pa_result == '홈런', 1, 0)) df = df.assign(sh=np.where(df.pa_result == '희생번트', 1, 0)) df = df.assign(sf=np.where(df.pa_result == '희생플라이', 1, 0)) df = df.assign(so=np.where(df.pa_result.isin(['삼진', '낫아웃 폭투', '낫아웃 포일']), 1, 0)) df = df.assign(bb=np.where(df.pa_result.isin(['볼넷', '고의4구']), 1, 0)) df = df.assign(hbp=np.where(df.pa_result == '몸에 맞는 볼', 1, 0)) df = df.assign(hit=df.single + df.double + df.triple + df.hr) df = df.assign(tb=df.single + df.double*2 + df.triple*3 + df.hr*4) sub_df = df.loc[df.pitcher == pitcher] tab = sub_df.pivot_table(index='game_date', values=['hit', 'tb', 'ab', 'pa', 'hr', 'sh', 'sf', 'so', 'bb', 'hbp'], aggfunc='sum' ) #babip = (hit-hr) / (ab-so-hr+sf) tab = tab.fillna(0) result_sum = [] hit_sum = tb_sum = 0 ab_sum = pa_sum = 0 hr_sum = sh_sum = sf_sum = 0 so_sum = bb_sum = hbp_sum = 0 fig, a1 = plt.subplots(figsize=(3, 3), dpi=144, facecolor='white') if (ma_term <= 1) or (ma_term >= len(tab.index)): for i in tab.index: hit_sum += tab.loc[i].hit tb_sum += tab.loc[i].tb ab_sum += tab.loc[i].ab pa_sum += tab.loc[i].pa hr_sum += tab.loc[i].hr sh_sum += tab.loc[i].sh sf_sum += tab.loc[i].sf so_sum += tab.loc[i].so bb_sum += tab.loc[i].bb hbp_sum += tab.loc[i].hbp # avg, obp, slg, ops, babip # OAVG, OOBP, OSLG, OOPS, BABIP, K%, BB% _oavg = hit_sum/ab_sum if ab_sum > 0 else 0 _oobp = (hit_sum+bb_sum+hbp_sum)/(ab_sum+bb_sum+hbp_sum+sf_sum) if (ab_sum+bb_sum+hbp_sum+sf_sum) > 0 else 0 _oslg = tb_sum/ab_sum if ab_sum > 0 else 0 _oops = _oobp + _oslg _obabip = (hit_sum-hr_sum)/(ab_sum-so_sum-hr_sum+sf_sum) if (ab_sum-so_sum-hr_sum+sf_sum) > 0 else 0 _krate = so_sum / pa_sum if pa_sum > 0 else 0 _bbrate = bb_sum / pa_sum if pa_sum > 0 else 0 result_sum.append([_oavg, _oobp, _oslg, _oops, _obabip, _krate, _bbrate]) fig.suptitle(f'{pitcher}\'s Cumulative Average', fontsize=10) else: term = ma_term - 1 for i in range(0, len(tab.index) - term): hit_sum = tab.loc[tab.index[i]:tab.index[i+term]].hit.sum() tb_sum = tab.loc[tab.index[i]:tab.index[i+term]].tb.sum() ab_sum = tab.loc[tab.index[i]:tab.index[i+term]].ab.sum() pa_sum = tab.loc[tab.index[i]:tab.index[i+term]].pa.sum() hr_sum = tab.loc[tab.index[i]:tab.index[i+term]].hr.sum() sh_sum = tab.loc[tab.index[i]:tab.index[i+term]].sh.sum() sf_sum = tab.loc[tab.index[i]:tab.index[i+term]].sf.sum() so_sum = tab.loc[tab.index[i]:tab.index[i+term]].so.sum() bb_sum = tab.loc[tab.index[i]:tab.index[i+term]].bb.sum() hbp_sum = tab.loc[tab.index[i]:tab.index[i+term]].hbp.sum() # avg, obp, slg, ops, babip _oavg = hit_sum/ab_sum if ab_sum > 0 else 0 _oobp = (hit_sum+bb_sum+hbp_sum)/(ab_sum+bb_sum+hbp_sum+sf_sum) if (ab_sum+bb_sum+hbp_sum+sf_sum) > 0 else 0 _oslg = tb_sum/ab_sum if ab_sum > 0 else 0 _oops = _oobp + _oslg _obabip = (hit_sum-hr_sum)/(ab_sum-so_sum-hr_sum+sf_sum) if (ab_sum-so_sum-hr_sum+sf_sum) > 0 else 0 _krate = so_sum / pa_sum if pa_sum > 0 else 0 _bbrate = bb_sum / pa_sum if pa_sum > 0 else 0 result_sum.append([_oavg, _oobp, _oslg, _oops, _obabip, _krate, _bbrate]) fig.suptitle(f'{pitcher}\'s {ma_term}-Game Rolling Average') rs = np.array(result_sum) a1.yaxis.set_major_formatter(ticker.FormatStrFormatter('%.3f')) min_y = 10000 max_y = -10000 a2 = a3 = a4 = a5 = a6 = a7 = None if options[0] == True: if (ma_term <= 1) or (ma_term >= len(tab.index)): a1.plot(tab.index, rs[:, 0], label='AVG', color='k') else: a1.plot(tab.index[term:], rs[:, 0], label='AVG', color='k') a1.xaxis.set_major_formatter(datesFmt) a1.grid(True) a1.set_yticks([]) max_y = max(max_y, rs[:, 0].max()) min_y = min(min_y, rs[:, 0].min()) if options[1] == True: a2 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a2.plot(tab.index, rs[:, 1], label='OBP', color='blueviolet', linestyle=':', linewidth=2) else: a2.plot(tab.index[term:], rs[:, 1], label='OBP', color='blueviolet', linestyle=':', linewidth=2) a2.xaxis.set_major_formatter(datesFmt) a2.grid(True) a2.set_yticks([]) if max_y < rs[:, 1].max(): max_y = rs[:, 1].max() if min_y > rs[:, 1].min(): min_y = rs[:, 1].min() if options[2] == True: a3 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a3.plot(tab.index, rs[:, 2], label='SLG', color='orangered', marker='o', markersize='2.5') else: a3.plot(tab.index[term:], rs[:, 2], label='SLG', color='orangered', marker='o', markersize='2.5') a3.xaxis.set_major_formatter(datesFmt) a3.grid(True) a3.set_yticks([]) if max_y < rs[:, 2].max(): max_y = rs[:, 2].max() if min_y > rs[:, 2].min(): min_y = rs[:, 2].min() if options[3] == True: a4 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a4.plot(tab.index, rs[:, 3], label='OPS', color='royalblue') else: a4.plot(tab.index[term:], rs[:, 3], label='OPS', color='royalblue') a4.xaxis.set_major_formatter(datesFmt) a4.grid(True) a4.set_yticks([]) if max_y < rs[:, 3].max(): max_y = rs[:, 3].max() if min_y > rs[:, 3].min(): min_y = rs[:, 3].min() if options[4] == True: a5 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a5.plot(tab.index, rs[:, 4], label='BABIP', color='gold', linestyle='--') else: a5.plot(tab.index[term:], rs[:, 4], label='BABIP', color='gold', linestyle='--') a5.xaxis.set_major_formatter(datesFmt) a5.grid(True) a5.set_yticks([]) if max_y < rs[:, 4].max(): max_y = rs[:, 4].max() if min_y > rs[:, 4].min(): min_y = rs[:, 4].min() if options[5] == True: a6 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a6.plot(tab.index, rs[:, 5], label='K%', color='green', linestyle='--') else: a6.plot(tab.index[term:], rs[:, 5], label='K%', color='green', linestyle='--') a6.xaxis.set_major_formatter(datesFmt) a6.grid(True) a6.set_yticks([]) if max_y < rs[:, 5].max(): max_y = rs[:, 5].max() if min_y > rs[:, 5].min(): min_y = rs[:, 5].min() if options[6] == True: a7 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a7.plot(tab.index, rs[:, 6], label='BB%', color='lime', linestyle='--') else: a7.plot(tab.index[term:], rs[:, 6], label='BB%', color='lime', linestyle='--') a7.xaxis.set_major_formatter(datesFmt) a7.grid(True) a7.set_yticks([]) if max_y < rs[:, 6].max(): max_y = rs[:, 6].max() if min_y > rs[:, 6].min(): min_y = rs[:, 6].min() a1.set_ylim([max(0, min_y-0.025), max_y+0.025]) a1.set_ylabel('') if a2 is not None: a2.set_ylim([max(0, min_y-0.025), max_y+0.025]) a2.set_ylabel('') if a3 is not None: a3.set_ylim([max(0, min_y-0.025), max_y+0.025]) a3.set_ylabel('') if a4 is not None: a4.set_ylim([max(0, min_y-0.025), max_y+0.025]) a4.set_ylabel('') if a5 is not None: a5.set_ylim([max(0, min_y-0.025), max_y+0.025]) a5.set_ylabel('') if a6 is not None: a6.set_ylim([max(0, min_y-0.025), max_y+0.025]) a6.set_ylabel('') if a7 is not None: a7.set_ylim([max(0, min_y-0.025), max_y+0.025]) a7.set_ylabel('') fig.legend(loc='lower center', ncol=min(np.array(options).sum(), 4), fontsize='xx-small', bbox_to_anchor=(0.5, -0.01)) a1.yaxis.set_major_locator(ticker.MultipleLocator(0.05)) a1.yaxis.set_minor_locator(ticker.MultipleLocator(0.01)) a1.grid(True) a1.tick_params(labelsize='x-small') return fig def graph_pitcher_plate_discipline(df, pitcher, ma_term=0, options=[True, True, True, True, True, True]): datesFmt = mdates.DateFormatter('%m-%d') if df.game_date.dtype == np.int64: df = df.assign(game_date = pd.to_datetime(df.game_date, format='%Y%m%d').dt.date) if df.px.dtypes == np.object: df.loc[:, 'px'] = pd.to_numeric(df.px, errors='coerce') if df.isnull().any().px == False: df = df.drop(df.loc[df.px.isnull()].index) if df.pz.dtypes == np.object: df.loc[:, 'pz'] = pd.to_numeric(df.pz, errors='coerce') if df.isnull().any().pz == False: df = df.drop(df.loc[df.pz.isnull()].index) df = df.assign(swing=np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']), 1, 0)) df = df.assign(miss=np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']), 1, 0)) izmask = df.px.between(-10/12, 10/12) & df.pz.between(1.6, 3.6) ozmask = ~izmask df = df.assign(iz_swing= np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']) & izmask, 1, 0)) df = df.assign(iz_miss= np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']) & izmask, 1, 0)) df = df.assign(oz_swing= np.where(df.pitch_result.isin(['타격', '번트파울', '번트헛스윙', '헛스윙', '파울']) & ozmask, 1, 0)) df = df.assign(oz_miss= np.where(df.pitch_result.isin(['번트헛스윙', '헛스윙']) & ozmask, 1, 0)) sub_df = df.loc[df.pitcher == pitcher] tab = sub_df.pivot_table(index='game_date', values=['swing', 'miss', 'iz_swing', 'iz_miss', 'oz_swing', 'oz_miss'], aggfunc='sum' ) tab = tab.assign(raw_num = sub_df.groupby('game_date').count().speed) tab = tab.assign(iz_raw_num = sub_df.loc[izmask].groupby('game_date').count().speed) tab = tab.assign(oz_raw_num = sub_df.loc[ozmask].groupby('game_date').count().speed) tab = tab.fillna(0) result_sum = [] raw_num_sum = iz_raw_num_sum = oz_raw_num_sum = 0 swing_sum = iz_swing_sum = oz_swing_sum = 0 miss_sum = iz_miss_sum = oz_miss_sum = 0 fig, a1 = plt.subplots(figsize=(3, 3), dpi=144, facecolor='white') if (ma_term <= 1) or (ma_term >= len(tab.index)): for i in tab.index: raw_num_sum += tab.loc[i].raw_num swing_sum += tab.loc[i].swing miss_sum += tab.loc[i].miss iz_raw_num_sum += tab.loc[i].iz_raw_num iz_swing_sum += tab.loc[i].iz_swing iz_miss_sum += tab.loc[i].iz_miss oz_raw_num_sum += tab.loc[i].oz_raw_num oz_swing_sum += tab.loc[i].oz_swing oz_miss_sum += tab.loc[i].oz_miss #swing%, con%, izswing%, izcon%, ozswing%, ozcon% _swing = swing_sum/raw_num_sum*100 if raw_num_sum > 0 else 0 _con = (1-miss_sum/swing_sum)*100 if swing_sum > 0 else 0 _izswing = iz_swing_sum/iz_raw_num_sum*100 if iz_raw_num_sum > 0 else 0 _izcon = (1-iz_miss_sum/iz_swing_sum)*100 if iz_swing_sum > 0 else 0 _ozswing = oz_swing_sum/oz_raw_num_sum*100 if oz_raw_num_sum > 0 else 0 _ozcon = (1-oz_miss_sum/oz_swing_sum)*100 if oz_swing_sum > 0 else 0 result_sum.append([_swing, _con, _izswing, _izcon, _ozswing, _ozcon]) fig.suptitle(f'{pitcher}\'s Cumulative Average', fontsize=10) else: term = ma_term - 1 for i in range(0, len(tab.index) - term): raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].raw_num.sum() swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].swing.sum() miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].miss.sum() iz_raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_raw_num.sum() iz_swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_swing.sum() iz_miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].iz_miss.sum() oz_raw_num_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_raw_num.sum() oz_swing_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_swing.sum() oz_miss_sum = tab.loc[tab.index[i]:tab.index[i+term]].oz_miss.sum() #swing%, con%, izswing%, izcon%, ozswing%, ozcon% _swing = swing_sum/raw_num_sum*100 if raw_num_sum > 0 else 0 _con = (1-miss_sum/swing_sum)*100 if swing_sum > 0 else 0 _izswing = iz_swing_sum/iz_raw_num_sum*100 if iz_raw_num_sum > 0 else 0 _izcon = (1-iz_miss_sum/iz_swing_sum)*100 if iz_swing_sum > 0 else 0 _ozswing = oz_swing_sum/oz_raw_num_sum*100 if oz_raw_num_sum > 0 else 0 _ozcon = (1-oz_miss_sum/oz_swing_sum)*100 if oz_swing_sum > 0 else 0 result_sum.append([_swing, _con, _izswing, _izcon, _ozswing, _ozcon]) fig.suptitle(f'{pitcher}\'s {ma_term}-Game Rolling Average') rs = np.array(result_sum) a1.yaxis.set_major_formatter(ticker.FormatStrFormatter('%d%%')) min_y = 10000 max_y = -10000 a2 = a3 = a4 = a5 = a6 = None #swing%, con%, izswing%, izcon%, ozswing%, ozcon% if options[0] == True: if (ma_term <= 1) or (ma_term >= len(tab.index)): a1.plot(tab.index, rs[:, 0], label='Swing%', color='k') else: a1.plot(tab.index[term:], rs[:, 0], label='Swing%', color='k') a1.xaxis.set_major_formatter(datesFmt) a1.grid(True) a1.set_yticks([]) max_y = max(max_y, rs[:, 0].max()) min_y = min(min_y, rs[:, 0].min()) if options[1] == True: a2 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a2.plot(tab.index, rs[:, 1], label='Contact%', color='dimgrey', linestyle='--') else: a2.plot(tab.index[term:], rs[:, 1], label='Contact%', color='dimgrey', linestyle='--') a2.xaxis.set_major_formatter(datesFmt) a2.grid(True) a2.set_yticks([]) if max_y < rs[:, 1].max(): max_y = rs[:, 1].max() if min_y > rs[:, 1].min(): min_y = rs[:, 1].min() if options[2] == True: a3 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a3.plot(tab.index, rs[:, 2], label='Z-Swing%', color='blue') else: a3.plot(tab.index[term:], rs[:, 2], label='Z-Swing%', color='blue') a3.xaxis.set_major_formatter(datesFmt) a3.grid(True) a3.set_yticks([]) if max_y < rs[:, 2].max(): max_y = rs[:, 2].max() if min_y > rs[:, 2].min(): min_y = rs[:, 2].min() if options[3] == True: a4 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a4.plot(tab.index, rs[:, 3], label='Z-Contact%', color='lightskyblue', linestyle='--') else: a4.plot(tab.index[term:], rs[:, 3], label='Z-Contact%', color='lightskyblue', linestyle='--') a4.xaxis.set_major_formatter(datesFmt) a4.grid(True) a4.set_yticks([]) if max_y < rs[:, 3].max(): max_y = rs[:, 3].max() if min_y > rs[:, 3].min(): min_y = rs[:, 3].min() if options[4] == True: a5 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a5.plot(tab.index, rs[:, 4], label='O-Swing%', color='green') else: a5.plot(tab.index[term:], rs[:, 4], label='O-Swing%', color='green') a5.xaxis.set_major_formatter(datesFmt) a5.grid(True) a5.set_yticks([]) if max_y < rs[:, 4].max(): max_y = rs[:, 4].max() if min_y > rs[:, 4].min(): min_y = rs[:, 4].min() if options[5] == True: a6 = a1.twinx() if (ma_term <= 1) or (ma_term >= len(tab.index)): a6.plot(tab.index, rs[:, 5], label='O-Contact%', color='lime', linestyle='--') else: a6.plot(tab.index[term:], rs[:, 5], label='O-Contact%', color='lime', linestyle='--') a6.xaxis.set_major_formatter(datesFmt) a6.grid(True) a6.set_yticks([]) if max_y < rs[:, 5].max(): max_y = rs[:, 5].max() if min_y > rs[:, 5].min(): min_y = rs[:, 5].min() a1.set_ylim([max(0, min_y-5), max_y+5]) a1.set_ylabel('') if a2 is not None: a2.set_ylim([max(0, min_y-5), max_y+5]) a2.set_ylabel('') if a3 is not None: a3.set_ylim([max(0, min_y-5), max_y+5]) a3.set_ylabel('') if a4 is not None: a4.set_ylim([max(0, min_y-5), max_y+5]) a4.set_ylabel('') if a5 is not None: a5.set_ylim([max(0, min_y-5), max_y+5]) a5.set_ylabel('') if a6 is not None: a6.set_ylim([max(0, min_y-5), max_y+5]) a6.set_ylabel('') fig.legend(loc='lower center', ncol=min(np.array(options).sum(), 3), fontsize='xx-small', bbox_to_anchor=(0.5, -0.01)) a1.yaxis.set_major_locator(ticker.MultipleLocator(5)) a1.yaxis.set_minor_locator(ticker.MultipleLocator(1)) a1.grid(True) a1.tick_params(labelsize='x-small') return fig def interactive_batting_graph(df): batters = df.batter.drop_duplicates().values.tolist() batters.sort() batter = batters[0] term= df.game_date.drop_duplicates().shape[0] batterSelect = widgets.Dropdown( options=batters, index=0, description='Batter:' ) termSelectSlider = widgets.IntSlider( value=0, min=0, max=df.loc[df.batter == batterSelect.value].game_date.drop_duplicates().shape[0], step=1, description='Term:', continuous_update=True ) def onSelectBatter(b): termSelectSlider.max = df.loc[df.batter == batterSelect.value].game_date.drop_duplicates().shape[0] batterSelect.observe(onSelectBatter, names='value') words = ['AVG', 'OBP', 'SLG', 'OPS', 'BABIP'] items = [widgets.ToggleButton(description=w, value=True, layout=widgets.Layout(width='80px')) for w in words] statSelectButton = widgets.HBox(items) options = [True, True, True, True, True] interactive_batting_graph.fig = graph_batting_result(df, batterSelect.value, termSelectSlider.value) updateButton = widgets.Button( disabled=False, description='Update', icon='check', layout=widgets.Layout(width='80px') ) def onClickUpdateButton(b): clear_output() display(batterSelect, termSelectSlider, statSelectButton, updateButton) options = [it.value for it in items] interactive_batting_graph.fig = graph_batting_result(df, batterSelect.value, termSelectSlider.value, options) display(interactive_batting_graph.fig) plt.close(interactive_batting_graph.fig) updateButton.on_click(onClickUpdateButton) display(batterSelect, termSelectSlider, statSelectButton, updateButton) display(interactive_batting_graph.fig) plt.close(interactive_batting_graph.fig) def interactive_batter_discipline_graph(df): batters = df.batter.drop_duplicates().values.tolist() batters.sort() batter = batters[0] term= df.game_date.drop_duplicates().shape[0] batterSelect = widgets.Dropdown( options=batters, index=0, description='Batter:' ) termSelectSlider = widgets.IntSlider( value=0, min=0, max=df.loc[df.batter == batterSelect.value].game_date.drop_duplicates().shape[0], step=1, description='Term:', continuous_update=True ) def onSelectBatter(b): termSelectSlider.max = df.loc[df.batter == batterSelect.value].game_date.drop_duplicates().shape[0] batterSelect.observe(onSelectBatter, names='value') words = ['Swing%', 'Contact%', 'Z-Swing%', 'Z-Contact%', 'O-Swing%', 'O-Contact%'] items = [widgets.ToggleButton(description=w, value=True, layout=widgets.Layout(width='100px')) for w in words] box1 = widgets.HBox([items[0], items[2], items[4]]) box2 = widgets.HBox([items[1], items[3], items[5]]) statSelectButton = widgets.VBox([box1, box2]) options = [True, True, True, True, True, True] interactive_batter_discipline_graph.fig = graph_batter_plate_discipline(df, batterSelect.value, termSelectSlider.value) updateButton = widgets.Button( disabled=False, description='Update', icon='check', layout=widgets.Layout(width='80px') ) def onClickUpdateButton(b): clear_output() display(batterSelect, termSelectSlider, statSelectButton, updateButton) options = [it.value for it in items] interactive_batter_discipline_graph.fig = graph_batter_plate_discipline(df, batterSelect.value, termSelectSlider.value, options) display(interactive_batter_discipline_graph.fig) plt.close(interactive_batter_discipline_graph.fig) updateButton.on_click(onClickUpdateButton) display(batterSelect, termSelectSlider, statSelectButton, updateButton) display(interactive_batter_discipline_graph.fig) plt.close(interactive_batter_discipline_graph.fig) def interactive_pitching_graph(df): pitchers = df.pitcher.drop_duplicates().values.tolist() pitchers.sort() pitcher = pitchers[0] term= df.game_date.drop_duplicates().shape[0] pitcherSelect = widgets.Dropdown( options=pitchers, index=0, description='pitcher:' ) termSelectSlider = widgets.IntSlider( value=0, min=0, max=df.loc[df.pitcher == pitcherSelect.value].game_date.drop_duplicates().shape[0], step=1, description='Term:', continuous_update=True ) def onSelectPitcher(b): termSelectSlider.max = df.loc[df.pitcher == pitcherSelect.value].game_date.drop_duplicates().shape[0] pitcherSelect.observe(onSelectPitcher, names='value') words = ['AVG', 'OBP', 'SLG', 'OPS', 'BABIP', 'K%', 'BB%'] items = [widgets.ToggleButton(description=w, value=True, layout=widgets.Layout(width='100px')) for w in words] box1 = widgets.HBox([items[0], items[1], items[2], items[3]]) box2 = widgets.HBox([items[4], items[5], items[6]]) statSelectButton = widgets.VBox([box1, box2]) options = [True, True, True, True, True, True, True] interactive_pitching_graph.fig = graph_pitching_result(df, pitcherSelect.value, termSelectSlider.value) updateButton = widgets.Button( disabled=False, description='Update', icon='check', layout=widgets.Layout(width='80px') ) def onClickUpdateButton(b): clear_output() display(pitcherSelect, termSelectSlider, statSelectButton, updateButton) options = [it.value for it in items] interactive_pitching_graph.fig = graph_pitching_result(df, pitcherSelect.value, termSelectSlider.value, options) display(interactive_pitching_graph.fig) plt.close(interactive_pitching_graph.fig) updateButton.on_click(onClickUpdateButton) display(pitcherSelect, termSelectSlider, statSelectButton, updateButton) display(interactive_pitching_graph.fig) plt.close(interactive_pitching_graph.fig) def interactive_pitcher_discipline_graph(df): pitchers = df.pitcher.drop_duplicates().values.tolist() pitchers.sort() pitcher = pitchers[0] term= df.game_date.drop_duplicates().shape[0] pitcherSelect = widgets.Dropdown( options=pitchers, index=0, description='pitcher:' ) termSelectSlider = widgets.IntSlider( value=0, min=0, max=df.loc[df.pitcher == pitcherSelect.value].game_date.drop_duplicates().shape[0], step=1, description='Term:', continuous_update=True ) def onSelectpitcher(b): termSelectSlider.max = df.loc[df.pitcher == pitcherSelect.value].game_date.drop_duplicates().shape[0] pitcherSelect.observe(onSelectpitcher, names='value') words = ['Swing%', 'Contact%', 'Z-Swing%', 'Z-Contact%', 'O-Swing%', 'O-Contact%'] items = [widgets.ToggleButton(description=w, value=True, layout=widgets.Layout(width='100px')) for w in words] box1 = widgets.HBox([items[0], items[2], items[4]]) box2 = widgets.HBox([items[1], items[3], items[5]]) statSelectButton = widgets.VBox([box1, box2]) #options = [True, True, True, True, True, True] interactive_pitcher_discipline_graph.fig = graph_pitcher_plate_discipline(df, pitcherSelect.value, termSelectSlider.value) updateButton = widgets.Button( disabled=False, description='Update', icon='check', layout=widgets.Layout(width='80px') ) def onClickUpdateButton(b): clear_output() display(pitcherSelect, termSelectSlider, statSelectButton, updateButton) options = [it.value for it in items] interactive_pitcher_discipline_graph.fig = graph_pitcher_plate_discipline(df, pitcherSelect.value, termSelectSlider.value, options) display(interactive_pitcher_discipline_graph.fig) plt.close(interactive_pitcher_discipline_graph.fig) updateButton.on_click(onClickUpdateButton) display(pitcherSelect, termSelectSlider, statSelectButton, updateButton) display(interactive_pitcher_discipline_graph.fig) plt.close(interactive_pitcher_discipline_graph.fig)
40.230362
139
0.553871
6,653
45,581
3.612355
0.04389
0.05326
0.028461
0.016477
0.977406
0.97079
0.968793
0.965547
0.961511
0.960263
0
0.034399
0.278669
45,581
1,132
140
40.265901
0.696554
0.013032
0
0.919006
0
0.045356
0.040695
0
0
0
0
0
0
1
0.017279
false
0
0.008639
0
0.030238
0
0
0
0
null
0
0
0
1
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
7
b79f71e263f760a3eb710bd0de347d57b34c01aa
258
py
Python
entity/cards/LT21_05H/__init__.py
x014/lushi_script
edab2b88e3f0de8139de2541ab2daa331f777c0e
[ "MIT" ]
102
2021-10-20T09:06:39.000Z
2022-03-28T13:35:11.000Z
entity/cards/LT21_05H/__init__.py
x014/lushi_script
edab2b88e3f0de8139de2541ab2daa331f777c0e
[ "MIT" ]
98
2021-10-19T16:13:27.000Z
2022-03-27T13:27:49.000Z
entity/cards/LT21_05H/__init__.py
x014/lushi_script
edab2b88e3f0de8139de2541ab2daa331f777c0e
[ "MIT" ]
55
2021-10-19T03:56:50.000Z
2022-03-25T08:25:26.000Z
# -*- coding: utf-8 -*- import entity.cards.LT21_05H.LT21_05P1 import entity.cards.LT21_05H.LT21_05P2 import entity.cards.LT21_05H.LT21_05P3 import entity.cards.LT21_05H.LT21_05E1 import entity.cards.LT21_05H.LT21_05E2 import entity.cards.LT21_05H.LT21_05E3
32.25
38
0.829457
45
258
4.488889
0.311111
0.356436
0.504951
0.623762
0.831683
0.831683
0
0
0
0
0
0.228216
0.065891
258
7
39
36.857143
0.609959
0.081395
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
10
b7e3adbda74db19a9c4db4c5e6ca64382e7926f8
17,353
py
Python
tests/transformations_test/RemoveEpsilonRules/MultipleUsageTest.py
PatrikValkovic/grammpy
8308a1fd349bf9ea0d267360cc9a4ab20d1629e8
[ "MIT" ]
1
2021-02-04T12:41:08.000Z
2021-02-04T12:41:08.000Z
tests/transformations_test/RemoveEpsilonRules/MultipleUsageTest.py
PatrikValkovic/grammpy
8308a1fd349bf9ea0d267360cc9a4ab20d1629e8
[ "MIT" ]
3
2017-07-08T16:28:52.000Z
2020-04-23T18:06:24.000Z
tests/transformations_test/RemoveEpsilonRules/MultipleUsageTest.py
PatrikValkovic/grammpy
8308a1fd349bf9ea0d267360cc9a4ab20d1629e8
[ "MIT" ]
1
2021-02-04T12:41:10.000Z
2021-02-04T12:41:10.000Z
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 20.08.2017 15:55 :Licence MIT Part of grammpy """ from inspect import isclass from unittest import TestCase, main from grammpy import * from grammpy.transforms import ContextFree class S(Nonterminal): pass class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class D(Nonterminal): pass class Rules(Rule): rules = [ ([S], [A, 0, A]), ([S], [0]), ([A], [B, C]), ([A], [2]), ([A], [C, C, C]), # multiple here ([B], [1, C]), ([B], [3, D]), ([B], [EPS]), ([C], [A, A, 3]), ([C], [EPS]), ([D], [A, A, B]), ([D], [A, A, 3])] """ S->A0A S->0 A->BC A->2 A->CCC B->1C B->3D B->eps C->AA3 C->eps D->AAB D->AA3 ToEpsilon: A, B, C, D S->A0A S->0 A->BC A->2 A->CCC B->1C B->3D B->eps C->AA3 C->eps D->AAB D->AA3 ------ ------ S->0A A->C A->CC B->1 B->3 C->A3 D->AB D->A3 S->A0 A->B D->AA C->3 D->B D->3 D->A """ class MultipleUsageTest(TestCase): def test_multipleUsage(self): g = Grammar(terminals=[0, 1, 2, 3], nonterminals=[S, A, B, C, D], rules=[Rules], start_symbol=S) com = ContextFree.remove_rules_with_epsilon(g) self.assertEqual(len(com.rules), 25) self.assertEqual(com.rules.size(), 25) class RuleNewSto0A(Rule): rule = ([S], [0, A]) self.assertIn(RuleNewSto0A, com.rules) fromSto0A = list(filter(lambda x: hash(x) == hash(RuleNewSto0A), com.rules))[0] self.assertTrue(isclass(fromSto0A)) self.assertTrue(issubclass(fromSto0A, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromSto0A.from_rule.rule, ([S], [A, 0, A])) self.assertEqual(fromSto0A.replace_index, 0) class RuleNewStoA0(Rule): rule = ([S], [A, 0]) self.assertIn(RuleNewStoA0, com.rules) fromStoA0 = list(filter(lambda x: hash(x) == hash(RuleNewStoA0), com.rules))[0] self.assertTrue(isclass(fromStoA0)) self.assertTrue(issubclass(fromStoA0, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromStoA0.from_rule.rule, ([S], [A, 0, A])) self.assertEqual(fromStoA0.replace_index, 2) class RuleNewAtoB(Rule): rule = ([A], [B]) self.assertIn(RuleNewAtoB, com.rules) fromAtoB = list(filter(lambda x: hash(x) == hash(RuleNewAtoB), com.rules))[0] self.assertTrue(isclass(fromAtoB)) self.assertTrue(issubclass(fromAtoB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoB.from_rule.rule, ([A], [B, C])) self.assertEqual(fromAtoB.replace_index, 1) class RuleNewAtoC(Rule): rule = ([A], [C]) self.assertIn(RuleNewAtoC, com.rules) fromAtoC = list(filter(lambda x: hash(x) == hash(RuleNewAtoC), com.rules))[0] self.assertTrue(isclass(fromAtoC)) self.assertTrue(issubclass(fromAtoC, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoC.from_rule.rule, ([A], [B, C])) self.assertEqual(fromAtoC.replace_index, 0) class RuleNewAtoCC(Rule): rule = ([A], [C, C]) self.assertIn(RuleNewAtoCC, com.rules) fromAtoCC = list(filter(lambda x: hash(x) == hash(RuleNewAtoCC), com.rules))[0] self.assertTrue(isclass(fromAtoCC)) self.assertTrue(issubclass(fromAtoCC, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoCC.from_rule.rule, ([A], [C, C, C])) self.assertEqual(fromAtoCC.replace_index, 0) class RuleNewBto1(Rule): rule = ([B], [1]) self.assertIn(RuleNewBto1, com.rules) fromBto1 = list(filter(lambda x: hash(x) == hash(RuleNewBto1), com.rules))[0] self.assertTrue(isclass(fromBto1)) self.assertTrue(issubclass(fromBto1, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromBto1.from_rule.rule, ([B], [1, C])) self.assertEqual(fromBto1.replace_index, 1) class RuleNewBto3(Rule): rule = ([B], [3]) self.assertIn(RuleNewBto3, com.rules) fromBto3 = list(filter(lambda x: hash(x) == hash(RuleNewBto3), com.rules))[0] self.assertTrue(isclass(fromBto3)) self.assertTrue(issubclass(fromBto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromBto3.from_rule.rule, ([B], [3, D])) self.assertEqual(fromBto3.replace_index, 1) class RuleNewCtoA3(Rule): rule = ([C], [A, 3]) self.assertIn(RuleNewCtoA3, com.rules) fromCtoA3 = list(filter(lambda x: hash(x) == hash(RuleNewCtoA3), com.rules))[0] self.assertTrue(isclass(fromCtoA3)) self.assertTrue(issubclass(fromCtoA3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromCtoA3.from_rule.rule, ([C], [A, A, 3])) self.assertEqual(fromCtoA3.replace_index, 0) class RuleNewDtoAB(Rule): rule = ([D], [A, B]) self.assertIn(RuleNewDtoAB, com.rules) fromDtoAB = list(filter(lambda x: hash(x) == hash(RuleNewDtoAB), com.rules))[0] self.assertTrue(isclass(fromDtoAB)) self.assertTrue(issubclass(fromDtoAB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoAB.from_rule.rule, ([D], [A, A, B])) self.assertEqual(fromDtoAB.replace_index, 0) class RuleNewDtoAA(Rule): rule = ([D], [A, A]) self.assertIn(RuleNewDtoAA, com.rules) fromDtoAA = list(filter(lambda x: hash(x) == hash(RuleNewDtoAA), com.rules))[0] self.assertTrue(isclass(fromDtoAA)) self.assertTrue(issubclass(fromDtoAA, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoAA.from_rule.rule, ([D], [A, A, B])) self.assertEqual(fromDtoAA.replace_index, 2) class RuleNewDtoA3(Rule): rule = ([D], [A, 3]) self.assertIn(RuleNewDtoA3, com.rules) fromDtoA3 = list(filter(lambda x: hash(x) == hash(RuleNewDtoA3), com.rules))[0] self.assertTrue(isclass(fromDtoA3)) self.assertTrue(issubclass(fromDtoA3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoA3.from_rule.rule, ([D], [A, A, 3])) self.assertEqual(fromDtoA3.replace_index, 0) class RuleNewCto3(Rule): rule = ([C], [3]) self.assertIn(RuleNewCto3, com.rules) fromCto3 = list(filter(lambda x: hash(x) == hash(RuleNewCto3), com.rules))[0] self.assertTrue(isclass(fromCto3)) self.assertTrue(issubclass(fromCto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromCto3.from_rule.rule, ([C], [A, 3])) self.assertEqual(fromCto3.replace_index, 0) class RuleNewDtoA(Rule): rule = ([D], [A]) self.assertIn(RuleNewDtoA, com.rules) fromDtoA = list(filter(lambda x: hash(x) == hash(RuleNewDtoA), com.rules))[0] self.assertTrue(isclass(fromDtoA)) self.assertTrue(issubclass(fromDtoA, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoA.from_rule.rule, ([D], [A, B])) self.assertEqual(fromDtoA.replace_index, 1) class RuleNewDtoB(Rule): rule = ([D], [B]) self.assertIn(RuleNewDtoB, com.rules) fromDtoB = list(filter(lambda x: hash(x) == hash(RuleNewDtoB), com.rules))[0] self.assertTrue(isclass(fromDtoB)) self.assertTrue(issubclass(fromDtoB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoB.from_rule.rule, ([D], [A, B])) self.assertEqual(fromDtoB.replace_index, 0) class RuleNewDto3(Rule): rule = ([D], [3]) self.assertIn(RuleNewDto3, com.rules) fromDto3 = list(filter(lambda x: hash(x) == hash(RuleNewDto3), com.rules))[0] self.assertTrue(isclass(fromDto3)) self.assertTrue(issubclass(fromDto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDto3.from_rule.rule, ([D], [A, 3])) self.assertEqual(fromDto3.replace_index, 0) class BtoEps(Rule): rule=([B], [EPS]) class CtoEps(Rule): rule=([B], [EPS]) self.assertNotIn(BtoEps, com.rules) self.assertNotIn(CtoEps, com.rules) def test_multipleUsageShouldNotChange(self): g = Grammar(terminals=[0, 1, 2, 3], nonterminals=[S, A, B, C, D], rules=[Rules], start_symbol=S) ContextFree.remove_rules_with_epsilon(g) self.assertEqual(len(g.rules), 12) self.assertEqual(g.rules.size(), 12) class RuleNewAto0A(Rule): rule = ([A], [0, A]) class RuleNewAtoA0(Rule): rule = ([A], [A, 0]) class RuleNewAtoB(Rule): rule = ([A], [B]) class RuleNewAtoC(Rule): rule = ([A], [C]) class RuleNewAtoCC(Rule): rule = ([A], [C, C]) class RuleNewAto1(Rule): rule = ([A], [1]) class RuleNewBto3(Rule): rule = ([B], [3]) class RuleNewCtoA3(Rule): rule = ([C], [A, 3]) class RuleNewDtoAB(Rule): rule = ([D], [A, B]) class RuleNewDtoAA(Rule): rule = ([D], [A, A]) class RuleNewDtoA3(Rule): rule = ([D], [A, 3]) class RuleNewCto3(Rule): rule = ([C], [3]) class RuleNewDtoA(Rule): rule = ([D], [A]) class RuleNewDtoB(Rule): rule = ([D], [B]) class RuleNewDto3(Rule): rule = ([D], [3]) self.assertNotIn(RuleNewAto0A, g.rules) self.assertNotIn(RuleNewAtoA0, g.rules) self.assertNotIn(RuleNewAtoB, g.rules) self.assertNotIn(RuleNewAtoC, g.rules) self.assertNotIn(RuleNewAtoCC, g.rules) self.assertNotIn(RuleNewAto1, g.rules) self.assertNotIn(RuleNewBto3, g.rules) self.assertNotIn(RuleNewCtoA3, g.rules) self.assertNotIn(RuleNewDtoAB, g.rules) self.assertNotIn(RuleNewDtoAA, g.rules) self.assertNotIn(RuleNewDtoA3, g.rules) self.assertNotIn(RuleNewCto3, g.rules) self.assertNotIn(RuleNewDtoA, g.rules) self.assertNotIn(RuleNewDtoB, g.rules) self.assertNotIn(RuleNewDto3, g.rules) class BtoEps(Rule): rule=([B], [EPS]) class CtoEps(Rule): rule=([B], [EPS]) self.assertIn(BtoEps, g.rules) self.assertIn(CtoEps, g.rules) def test_multipleUsageShouldChange(self): g = Grammar(terminals=[0, 1, 2, 3], nonterminals=[S, A, B, C, D], rules=[Rules], start_symbol=S) ContextFree.remove_rules_with_epsilon(g, True) self.assertEqual(len(g.rules), 25) self.assertEqual(g.rules.size(), 25) class RuleNewSto0A(Rule): rule = ([S], [0, A]) self.assertIn(RuleNewSto0A, g.rules) fromSto0A = list(filter(lambda x: hash(x) == hash(RuleNewSto0A), g.rules))[0] self.assertTrue(isclass(fromSto0A)) self.assertTrue(issubclass(fromSto0A, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromSto0A.from_rule.rule, ([S], [A, 0, A])) self.assertEqual(fromSto0A.replace_index, 0) class RuleNewStoA0(Rule): rule = ([S], [A, 0]) self.assertIn(RuleNewStoA0, g.rules) fromStoA0 = list(filter(lambda x: hash(x) == hash(RuleNewStoA0), g.rules))[0] self.assertTrue(isclass(fromStoA0)) self.assertTrue(issubclass(fromStoA0, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromStoA0.from_rule.rule, ([S], [A, 0, A])) self.assertEqual(fromStoA0.replace_index, 2) class RuleNewAtoB(Rule): rule = ([A], [B]) self.assertIn(RuleNewAtoB, g.rules) fromAtoB = list(filter(lambda x: hash(x) == hash(RuleNewAtoB), g.rules))[0] self.assertTrue(isclass(fromAtoB)) self.assertTrue(issubclass(fromAtoB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoB.from_rule.rule, ([A], [B, C])) self.assertEqual(fromAtoB.replace_index, 1) class RuleNewAtoC(Rule): rule = ([A], [C]) self.assertIn(RuleNewAtoC, g.rules) fromAtoC = list(filter(lambda x: hash(x) == hash(RuleNewAtoC), g.rules))[0] self.assertTrue(isclass(fromAtoC)) self.assertTrue(issubclass(fromAtoC, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoC.from_rule.rule, ([A], [B, C])) self.assertEqual(fromAtoC.replace_index, 0) class RuleNewAtoCC(Rule): rule = ([A], [C, C]) self.assertIn(RuleNewAtoCC, g.rules) fromAtoCC = list(filter(lambda x: hash(x) == hash(RuleNewAtoCC), g.rules))[0] self.assertTrue(isclass(fromAtoCC)) self.assertTrue(issubclass(fromAtoCC, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromAtoCC.from_rule.rule, ([A], [C, C, C])) self.assertEqual(fromAtoCC.replace_index, 0) class RuleNewBto1(Rule): rule = ([B], [1]) self.assertIn(RuleNewBto1, g.rules) fromBto1 = list(filter(lambda x: hash(x) == hash(RuleNewBto1), g.rules))[0] self.assertTrue(isclass(fromBto1)) self.assertTrue(issubclass(fromBto1, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromBto1.from_rule.rule, ([B], [1, C])) self.assertEqual(fromBto1.replace_index, 1) class RuleNewBto3(Rule): rule = ([B], [3]) self.assertIn(RuleNewBto3, g.rules) fromBto3 = list(filter(lambda x: hash(x) == hash(RuleNewBto3), g.rules))[0] self.assertTrue(isclass(fromBto3)) self.assertTrue(issubclass(fromBto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromBto3.from_rule.rule, ([B], [3, D])) self.assertEqual(fromBto3.replace_index, 1) class RuleNewCtoA3(Rule): rule = ([C], [A, 3]) self.assertIn(RuleNewCtoA3, g.rules) fromCtoA3 = list(filter(lambda x: hash(x) == hash(RuleNewCtoA3), g.rules))[0] self.assertTrue(isclass(fromCtoA3)) self.assertTrue(issubclass(fromCtoA3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromCtoA3.from_rule.rule, ([C], [A, A, 3])) self.assertEqual(fromCtoA3.replace_index, 0) class RuleNewDtoAB(Rule): rule = ([D], [A, B]) self.assertIn(RuleNewDtoAB, g.rules) fromDtoAB = list(filter(lambda x: hash(x) == hash(RuleNewDtoAB), g.rules))[0] self.assertTrue(isclass(fromDtoAB)) self.assertTrue(issubclass(fromDtoAB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoAB.from_rule.rule, ([D], [A, A, B])) self.assertEqual(fromDtoAB.replace_index, 0) class RuleNewDtoAA(Rule): rule = ([D], [A, A]) self.assertIn(RuleNewDtoAA, g.rules) fromDtoAA = list(filter(lambda x: hash(x) == hash(RuleNewDtoAA), g.rules))[0] self.assertTrue(isclass(fromDtoAA)) self.assertTrue(issubclass(fromDtoAA, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoAA.from_rule.rule, ([D], [A, A, B])) self.assertEqual(fromDtoAA.replace_index, 2) class RuleNewDtoA3(Rule): rule = ([D], [A, 3]) self.assertIn(RuleNewDtoA3, g.rules) fromDtoA3 = list(filter(lambda x: hash(x) == hash(RuleNewDtoA3), g.rules))[0] self.assertTrue(isclass(fromDtoA3)) self.assertTrue(issubclass(fromDtoA3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoA3.from_rule.rule, ([D], [A, A, 3])) self.assertEqual(fromDtoA3.replace_index, 0) class RuleNewCto3(Rule): rule = ([C], [3]) self.assertIn(RuleNewCto3, g.rules) fromCto3 = list(filter(lambda x: hash(x) == hash(RuleNewCto3), g.rules))[0] self.assertTrue(isclass(fromCto3)) self.assertTrue(issubclass(fromCto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromCto3.from_rule.rule, ([C], [A, 3])) self.assertEqual(fromCto3.replace_index, 0) class RuleNewDtoA(Rule): rule = ([D], [A]) self.assertIn(RuleNewDtoA, g.rules) fromDtoA = list(filter(lambda x: hash(x) == hash(RuleNewDtoA), g.rules))[0] self.assertTrue(isclass(fromDtoA)) self.assertTrue(issubclass(fromDtoA, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoA.from_rule.rule, ([D], [A, B])) self.assertEqual(fromDtoA.replace_index, 1) class RuleNewDtoB(Rule): rule = ([D], [B]) self.assertIn(RuleNewDtoB, g.rules) fromDtoB = list(filter(lambda x: hash(x) == hash(RuleNewDtoB), g.rules))[0] self.assertTrue(isclass(fromDtoB)) self.assertTrue(issubclass(fromDtoB, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDtoB.from_rule.rule, ([D], [A, B])) self.assertEqual(fromDtoB.replace_index, 0) class RuleNewDto3(Rule): rule = ([D], [3]) self.assertIn(RuleNewDto3, g.rules) fromDto3 = list(filter(lambda x: hash(x) == hash(RuleNewDto3), g.rules))[0] self.assertTrue(isclass(fromDto3)) self.assertTrue(issubclass(fromDto3, ContextFree.EpsilonRemovedRule)) self.assertEqual(fromDto3.from_rule.rule, ([D], [A, 3])) self.assertEqual(fromDto3.replace_index, 0) class BtoEps(Rule): rule=([B], [EPS]) class CtoEps(Rule): rule=([B], [EPS]) self.assertNotIn(BtoEps, g.rules) self.assertNotIn(CtoEps, g.rules) if __name__ == '__main__': main()
52.111111
94
0.616147
2,016
17,353
5.262401
0.064484
0.06108
0.045245
0.048072
0.875295
0.868602
0.850693
0.832124
0.832124
0.825526
0
0.023151
0.230853
17,353
332
95
52.268072
0.771709
0.006512
0
0.596026
0
0
0.000484
0
0
0
0
0
0.586093
1
0.009934
false
0.016556
0.013245
0
0.218543
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
1
0
0
0
0
0
0
0
0
0
7
b7ec74a1d068940e88ef8e6c76f16c786ae0f110
2,569
py
Python
util/rotations.py
Heng-Z/mwr
28e42a3a64f46dc627333b2c6ae4b317803648ba
[ "MIT" ]
21
2021-07-21T06:27:11.000Z
2022-03-24T10:26:08.000Z
util/rotations.py
Heng-Z/mwr
28e42a3a64f46dc627333b2c6ae4b317803648ba
[ "MIT" ]
14
2021-07-28T12:35:32.000Z
2022-02-19T03:23:29.000Z
util/rotations.py
Heng-Z/mwr
28e42a3a64f46dc627333b2c6ae4b317803648ba
[ "MIT" ]
1
2021-11-08T21:16:03.000Z
2021-11-08T21:16:03.000Z
''' rotation_list = { 0: [(((0,1),1),((1,2),1)), (((0,2),1),((1,2),1))], 1: [(((1,0),1),((1,2),1)), (((2,0),1),((1,2),1))], 2: [(((0,1),1),((1,2),3)), (((0,2),1),((1,2),3))], 3: [(((1,0),1),((1,2),3)), (((2,0),1),((1,2),3))], 4: [(((0,1),1),((1,2),0)), (((0,2),1),((1,2),0))], 5: [(((1,0),1),((1,2),0)), (((2,0),1),((1,2),0))], 6: [(((0,1),1),((1,2),2)), (((0,2),1),((1,2),2))], 7: [(((1,0),1),((1,2),2)), (((2,0),1),((1,2),2))], } rotation_list = { 0: [(((0,1),1),((1,2),0)), (((0,1),1),((1,2),1)), (((0,2),1),((1,2),0)), (((0,2),1),((1,2),1))], 1: [(((0,1),1),((1,2),2)), (((0,1),1),((1,2),3)), (((0,2),1),((1,2),2)), (((0,2),1),((1,2),3))], 2: [(((0,1),3),((1,2),0)), (((0,1),3),((1,2),1)), (((0,2),3),((1,2),0)), (((0,2),1),((1,2),1))], 3: [(((0,1),3),((1,2),2)), (((0,1),3),((1,2),3)), (((0,2),3),((1,2),2)), (((0,2),1),((1,2),3))], } ''' # this is used in mwr_cli 26 Dec # rotation_list = [(((0,1),1),((1,2),0)), (((0,1),1),((1,2),1)), (((1,2),1),((0,2),0)), (((0,2),1),((1,2),1)), # (((0,1),1),((1,2),2)), (((0,1),1),((1,2),3)), (((1,2),1),((0,2),2)), (((0,2),1),((1,2),3)), # (((0,1),3),((1,2),0)), (((0,1),3),((1,2),1)), (((1,2),3),((0,2),0)), (((0,2),1),((1,2),1)), # (((0,1),3),((1,2),2)), (((0,1),3),((1,2),3)), (((1,2),3),((0,2),2)), (((0,2),1),((1,2),3))] # this is from old dgx(workhorse branch) version # rotation_list = [(((0,1),1),((1,2),0)), (((0,1),1),((1,2),1)), (((0,2),1),((1,2),0)), (((0,2),1),((1,2),1)), # (((0,1),1),((1,2),2)), (((0,1),1),((1,2),3)), (((0,2),1),((1,2),2)), (((0,2),1),((1,2),3)), # (((0,1),3),((1,2),0)), (((0,1),3),((1,2),1)), (((0,2),3),((1,2),0)), (((0,2),1),((1,2),1)), # (((0,1),3),((1,2),2)), (((0,1),3),((1,2),3)), (((0,2),3),((1,2),2)), (((0,2),1),((1,2),3))] #All 20 rotation rotation_list = [(((0,1),1),((1,2),0)), (((0,1),1),((1,2),1)), (((0,2),1),((1,2),0)), (((0,2),1),((1,2),1)), (((0,1),1),((1,2),2)), (((0,1),1),((1,2),3)), (((0,2),1),((1,2),2)), (((0,2),1),((1,2),3)), (((0,1),3),((1,2),0)), (((0,1),3),((1,2),1)), (((0,2),3),((1,2),0)), (((0,2),1),((1,2),1)), (((0,1),3),((1,2),2)), (((0,1),3),((1,2),3)), (((0,2),3),((1,2),2)), (((0,2),1),((1,2),3)), (((1,2),1),((0,2),0)), (((1,2),1),((0,2),2)), (((1,2),3),((0,2),0)), (((1,2),3),((0,2),2))] #((0,1),0),((1,2),0)), (((0,1),0),((1,2),1)), #((0,1),0),((1,2),2)), (((0,1),0),((1,2),3)), #((0,1),2),((1,2),0)), (((0,1),2),((1,2),1)), #((0,1),2),((1,2),2)), (((0,1),2),((1,2),3)),
52.428571
111
0.274037
593
2,569
1.177066
0.043845
0.280802
0.240688
0.160458
0.902579
0.809456
0.776504
0.726361
0.690544
0.63467
0
0.253232
0.126898
2,569
48
112
53.520833
0.057958
0.752822
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
1
1
1
1
1
1
1
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
4da2c32d94bd0630dbf0cc87735a1e5240a11df1
34,410
py
Python
modules/unit_tests/s3db/hrm.py
PeterDaveHello/eden
26174a9dde2f19cd3bc879694f373ad5f765b6ed
[ "MIT" ]
1
2015-01-24T04:31:51.000Z
2015-01-24T04:31:51.000Z
modules/unit_tests/s3db/hrm.py
PeterDaveHello/eden
26174a9dde2f19cd3bc879694f373ad5f765b6ed
[ "MIT" ]
null
null
null
modules/unit_tests/s3db/hrm.py
PeterDaveHello/eden
26174a9dde2f19cd3bc879694f373ad5f765b6ed
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # HRM Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3db/hrm.py # import unittest from gluon import * from gluon.storage import Storage # ============================================================================= class LocationSettingTests(unittest.TestCase): """ Test setting/updating of the location_id field in hrm_human_resource """ # ------------------------------------------------------------------------- def setUp(self): current.auth.override = True # ------------------------------------------------------------------------- def tearDown(self): current.db.rollback() current.auth.override = False # ------------------------------------------------------------------------- def _testStaffWithExistingLocations(self, site, address): """ Test a New Staff with existing Site &/or Home Address """ db = current.db s3db = current.s3db gtable = s3db.gis_location if site: # Create a Site Location record = Storage(name = "Test Site Location", ) site_location_id = gtable.insert(**record) self.assertNotEqual(site_location_id, None) record["id"] = site_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Create a Site with that Location otable = s3db.org_office record = Storage(name = "Test Office", location_id = site_location_id, ) office_id = otable.insert(**record) self.assertNotEqual(office_id, None) record["id"] = office_id s3db.update_super(otable, record) s3db.onaccept(otable, record, method="create") site_id = record["site_id"] else: site_id = site_location_id = None # Create a Person ptable = s3db.pr_person record = Storage(first_name = "Test", last_name = "Person", ) person_id = ptable.insert(**record) self.assertNotEqual(person_id, None) record["id"] = person_id s3db.update_super(ptable, record) s3db.onaccept(ptable, record, method="create") if address: pe_id = record["pe_id"] # Create an Address Location record = Storage(name = "Test Address Location", ) address_location_id = gtable.insert(**record) self.assertNotEqual(address_location_id, None) record["id"] = address_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Give them a Home Address with that Location atable = s3db.pr_address record = Storage(pe_id = pe_id, type = 1, location_id = address_location_id, ) address_id = atable.insert(**record) self.assertNotEqual(address_id, None) record["id"] = address_id #s3db.update_super(atable, record) s3db.onaccept(atable, record, method="create") else: address_location_id = None # Make them a Staff htable = s3db.hrm_human_resource record = Storage(person_id = person_id, type = 1, site_id = site_id, ) human_resource_id = htable.insert(**record) self.assertNotEqual(human_resource_id, None) record["id"] = human_resource_id s3db.update_super(htable, record) s3db.onaccept(htable, record, method="create") # Test that the HR location is set correctly row = db(htable.id == human_resource_id).select(htable.location_id, limitby=(0, 1)).first() self.assertNotEqual(row, None) return row, address_location_id, site_location_id # ------------------------------------------------------------------------- def testStaffWithExistingLocations1(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations2(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations3(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations4(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations5(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations6(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations7(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations8(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations9(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations10(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations11(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations12(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations13(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations14(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffWithExistingLocations15(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testStaffWithExistingLocations16(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def _testStaffUpdateFromSite(self, address): """ Test a Staff which has a Site assigned after creation """ db = current.db s3db = current.s3db gtable = s3db.gis_location # Create a Site Location record = Storage(name = "Test Site Location", ) site_location_id = gtable.insert(**record) self.assertNotEqual(site_location_id, None) record["id"] = site_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Create a Site with that Location otable = s3db.org_office record = Storage(name = "Test Office", location_id = site_location_id, ) office_id = otable.insert(**record) self.assertNotEqual(office_id, None) record["id"] = office_id s3db.update_super(otable, record) s3db.onaccept(otable, record, method="create") site_id = record["site_id"] # Create a Person ptable = s3db.pr_person record = Storage(first_name = "Test", last_name = "Person", ) person_id = ptable.insert(**record) self.assertNotEqual(person_id, None) record["id"] = person_id s3db.update_super(ptable, record) s3db.onaccept(ptable, record, method="create") if address: pe_id = record["pe_id"] # Create an Address Location record = Storage(name = "Test Address Location", ) address_location_id = gtable.insert(**record) self.assertNotEqual(address_location_id, None) record["id"] = address_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Give them a Home Address with that Location atable = s3db.pr_address record = Storage(pe_id = pe_id, type = 1, location_id = address_location_id, ) address_id = atable.insert(**record) self.assertNotEqual(address_id, None) record["id"] = address_id #s3db.update_super(atable, record) s3db.onaccept(atable, record, method="create") else: address_location_id = None # Make them a Staff htable = s3db.hrm_human_resource record = Storage(person_id = person_id, type = 1, #site_id = site_id, ) human_resource_id = htable.insert(**record) self.assertNotEqual(human_resource_id, None) record["id"] = human_resource_id s3db.update_super(htable, record) s3db.onaccept(htable, record, method="create") # Assign the Staff to a Site ltable = s3db.hrm_human_resource_site record = Storage(human_resource_id = human_resource_id, site_id = site_id, ) link_id = ltable.insert(**record) self.assertNotEqual(link_id, None) record["id"] = link_id #s3db.update_super(ltable, record) s3db.onaccept(ltable, record, method="create") # Test that the HR location is set correctly row = db(htable.id == human_resource_id).select(htable.location_id, limitby=(0, 1)).first() self.assertNotEqual(row, None) return row, address_location_id, site_location_id # ------------------------------------------------------------------------- def testStaffUpdateFromSite1(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite2(self): current.deployment_settings.hrm.location_staff = "site_id" row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite3(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite4(self): current.deployment_settings.hrm.location_staff = ("site_id", "person_id") row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite5(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite6(self): current.deployment_settings.hrm.location_staff = ("person_id", "site_id") row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testStaffUpdateFromSite7(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testStaffUpdateFromSite8(self): current.deployment_settings.hrm.location_staff = "person_id" row, address_location_id, site_location_id = self._testStaffUpdateFromSite(address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def _testVolWithExistingLocations(self, site, address): """ Test a New Volunteer with existing Site &/or Home Address """ db = current.db s3db = current.s3db gtable = s3db.gis_location # Create a Person ptable = s3db.pr_person record = Storage(first_name = "Test", last_name = "Person", ) person_id = ptable.insert(**record) self.assertNotEqual(person_id, None) record["id"] = person_id s3db.update_super(ptable, record) s3db.onaccept(ptable, record, method="create") pe_id = record["pe_id"] if address: # Create an Address Location record = Storage(name = "Test Address Location", ) address_location_id = gtable.insert(**record) self.assertNotEqual(address_location_id, None) record["id"] = address_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Give them a Home Address with that Location atable = s3db.pr_address record = Storage(pe_id = pe_id, type = 1, location_id = address_location_id, ) address_id = atable.insert(**record) self.assertNotEqual(address_id, None) record["id"] = address_id #s3db.update_super(atable, record) s3db.onaccept(atable, record, method="create") else: address_location_id = None if site: # Create a Site Location record = Storage(name = "Test Site Location", ) site_location_id = gtable.insert(**record) self.assertNotEqual(site_location_id, None) record["id"] = site_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Create a Site with that Location otable = s3db.org_office record = Storage(name = "Test Office", location_id = site_location_id, ) office_id = otable.insert(**record) self.assertNotEqual(office_id, None) record["id"] = office_id s3db.update_super(otable, record) s3db.onaccept(otable, record, method="create") site_id = record["site_id"] else: site_location_id = site_id = None # Make them a Volunteer htable = s3db.hrm_human_resource record = Storage(person_id = person_id, type = 2, site_id = site_id ) human_resource_id = htable.insert(**record) self.assertNotEqual(human_resource_id, None) record["id"] = human_resource_id s3db.update_super(htable, record) s3db.onaccept(htable, record, method="create") # Test that the HR location is set correctly row = db(htable.id == human_resource_id).select(htable.location_id, limitby=(0, 1)).first() self.assertNotEqual(row, None) return row, address_location_id, site_location_id # ------------------------------------------------------------------------- def testVolWithExistingLocations1(self): current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations2(self): current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations3(self): current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations4(self): current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations5(self): current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations6(self): current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations7(self): current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations8(self): current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations9(self): current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations10(self): current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations11(self): current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations12(self): current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations13(self): current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=True) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations14(self): current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=False, address=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolWithExistingLocations15(self): current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testVolWithExistingLocations16(self): current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolWithExistingLocations(site=True, address=False) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def _testVolUpdateFromPersonAddress(self, site): """ Test a Volunteer which has a Home Address added after creation """ db = current.db s3db = current.s3db gtable = s3db.gis_location if site: # Create a Site Location record = Storage(name = "Test Site Location", ) site_location_id = gtable.insert(**record) self.assertNotEqual(site_location_id, None) record["id"] = site_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Create a Site with that Location otable = s3db.org_office record = Storage(name = "Test Office", location_id = site_location_id, ) office_id = otable.insert(**record) self.assertNotEqual(office_id, None) record["id"] = office_id s3db.update_super(otable, record) s3db.onaccept(otable, record, method="create") site_id = record["site_id"] else: site_location_id = site_id = None # Create a Person ptable = s3db.pr_person record = Storage(first_name = "Test", last_name = "Person", ) person_id = ptable.insert(**record) self.assertNotEqual(person_id, None) record["id"] = person_id s3db.update_super(ptable, record) s3db.onaccept(ptable, record, method="create") pe_id = record["pe_id"] # Make them a Volunteer htable = s3db.hrm_human_resource record = Storage(person_id = person_id, type = 2, site_id = site_id, ) human_resource_id = htable.insert(**record) self.assertNotEqual(human_resource_id, None) record["id"] = human_resource_id s3db.update_super(htable, record) s3db.onaccept(htable, record, method="create") # Create a Location #gtable = s3db.gis_location record = Storage(name = "Test Location", ) address_location_id = gtable.insert(**record) self.assertNotEqual(address_location_id, None) record["id"] = address_location_id #s3db.update_super(gtable, record) s3db.onaccept(gtable, record, method="create") # Give them a Home Address with that Location atable = s3db.pr_address record = Storage(pe_id = pe_id, type = 1, location_id = address_location_id, ) address = atable.insert(**record) self.assertNotEqual(address, None) record["id"] = address #s3db.update_super(atable, record) s3db.onaccept(atable, record, method="create") # Test that the HR location is set correctly row = db(htable.id == human_resource_id).select(htable.location_id, limitby=(0, 1)).first() self.assertNotEqual(row, None) return row, address_location_id, site_location_id # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress1(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with just "person_id" """ current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=False) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress2(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with just "person_id" """ current.deployment_settings.hrm.location_vol = "person_id" row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress3(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with "person_id" 1st """ current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=False) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress4(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with "person_id" 1st """ current.deployment_settings.hrm.location_vol = ("person_id", "site_id") row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=True) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress5(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with "person_id" 2nd """ current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=False) self.assertEqual(row.location_id, address_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress6(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with "person_id" 2nd """ current.deployment_settings.hrm.location_vol = ("site_id", "person_id") row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=True) self.assertEqual(row.location_id, site_location_id) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress7(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with no "person_id" """ current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=False) self.assertEqual(row.location_id, None) # ------------------------------------------------------------------------- def testVolUpdateFromPersonAddress8(self): """ Test that a Volunteer can get their location_id updated from a New Home Address: with no "person_id" """ current.deployment_settings.hrm.location_vol = "site_id" row, address_location_id, site_location_id = self._testVolUpdateFromPersonAddress(site=True) self.assertEqual(row.location_id, site_location_id) # ============================================================================= def run_suite(*test_classes): """ Run the test suite """ loader = unittest.TestLoader() suite = unittest.TestSuite() for test_class in test_classes: tests = loader.loadTestsFromTestCase(test_class) suite.addTests(tests) if suite is not None: unittest.TextTestRunner(verbosity=2).run(suite) return if __name__ == "__main__": run_suite( LocationSettingTests, ) # END ========================================================================
41.507841
116
0.562714
3,208
34,410
5.772756
0.058915
0.132297
0.066526
0.06739
0.863546
0.861602
0.856796
0.856796
0.856418
0.85604
0
0.006349
0.240192
34,410
828
117
41.557971
0.70197
0.198198
0
0.766316
0
0
0.039335
0
0
0
0
0
0.162105
1
0.115789
false
0
0.006316
0
0.134737
0
0
0
0
null
0
0
0
1
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
7
4da8cb30fc44a2fc581017ebf1fe9122a2b4a179
101
py
Python
pyqtcheck.py
justinkjackson/ImpactTestFixture
96d6aee6de30b34558dcd77a975f21424801061e
[ "Apache-2.0" ]
null
null
null
pyqtcheck.py
justinkjackson/ImpactTestFixture
96d6aee6de30b34558dcd77a975f21424801061e
[ "Apache-2.0" ]
null
null
null
pyqtcheck.py
justinkjackson/ImpactTestFixture
96d6aee6de30b34558dcd77a975f21424801061e
[ "Apache-2.0" ]
null
null
null
from PyQt5.Qt import PYQT_VERSION_STR #cfg = Configuration() print("PyQT version: ",PYQT_VERSION_STR)
33.666667
40
0.80198
15
101
5.133333
0.666667
0.428571
0.363636
0
0
0
0
0
0
0
0
0.01087
0.089109
101
3
40
33.666667
0.826087
0.207921
0
0
0
0
0.175
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
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
1
0
7
4dcb7efff1e779a2ac3546fafb69c790babb93c4
62,491
py
Python
codes/models/archs/EDVR_arch.py
DengpanFu/mmsr
addfabdaee86d2f9e41988dcfe92a817c5efe7ab
[ "Apache-2.0" ]
null
null
null
codes/models/archs/EDVR_arch.py
DengpanFu/mmsr
addfabdaee86d2f9e41988dcfe92a817c5efe7ab
[ "Apache-2.0" ]
null
null
null
codes/models/archs/EDVR_arch.py
DengpanFu/mmsr
addfabdaee86d2f9e41988dcfe92a817c5efe7ab
[ "Apache-2.0" ]
null
null
null
''' network architecture for EDVR ''' import functools import math import torch import torch.nn as nn import torch.nn.functional as F import models.archs.arch_util as arch_util from models.archs.dcn.deform_conv import ModulatedDeformConvPack as DCN class Predeblur_ResNet_Pyramid(nn.Module): def __init__(self, nf=128, HR_in=False): ''' HR_in: True if the inputs are high spatial size ''' super(Predeblur_ResNet_Pyramid, self).__init__() self.HR_in = True if HR_in else False if self.HR_in: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) basic_block = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) self.RB_L1_1 = basic_block() self.RB_L1_2 = basic_block() self.RB_L1_3 = basic_block() self.RB_L1_4 = basic_block() self.RB_L1_5 = basic_block() self.RB_L2_1 = basic_block() self.RB_L2_2 = basic_block() self.RB_L3_1 = basic_block() self.deblur_L2_conv = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.deblur_L3_conv = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x): if self.HR_in: L1_fea = self.lrelu(self.conv_first_1(x)) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) else: L1_fea = self.lrelu(self.conv_first(x)) L2_fea = self.lrelu(self.deblur_L2_conv(L1_fea)) L3_fea = self.lrelu(self.deblur_L3_conv(L2_fea)) L3_fea = F.interpolate(self.RB_L3_1(L3_fea), scale_factor=2, mode='bilinear', align_corners=False) L2_fea = self.RB_L2_1(L2_fea) + L3_fea L2_fea = F.interpolate(self.RB_L2_2(L2_fea), scale_factor=2, mode='bilinear', align_corners=False) L1_fea = self.RB_L1_2(self.RB_L1_1(L1_fea)) + L2_fea out = self.RB_L1_5(self.RB_L1_4(self.RB_L1_3(L1_fea))) return out class PCD_Align(nn.Module): ''' Alignment module using Pyramid, Cascading and Deformable convolution with 3 pyramid levels. ''' def __init__(self, nf=64, groups=8): super(PCD_Align, self).__init__() # L3: level 3, 1/4 spatial size self.L3_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L3_offset_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L3_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True) # L2: level 2, 1/2 spatial size self.L2_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L2_offset_conv2 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for offset self.L2_offset_conv3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L2_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True) self.L2_fea_conv = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for fea # L1: level 1, original spatial size self.L1_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L1_offset_conv2 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for offset self.L1_offset_conv3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L1_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True) self.L1_fea_conv = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for fea # Cascading DCN self.cas_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.cas_offset_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.cas_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True) self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, nbr_fea_l, ref_fea_l): '''align other neighboring frames to the reference frame in the feature level nbr_fea_l, ref_fea_l: [L1, L2, L3], each with [B,C,H,W] features ''' # L3 L3_offset = torch.cat([nbr_fea_l[2], ref_fea_l[2]], dim=1) L3_offset = self.lrelu(self.L3_offset_conv1(L3_offset)) L3_offset = self.lrelu(self.L3_offset_conv2(L3_offset)) L3_fea = self.lrelu(self.L3_dcnpack([nbr_fea_l[2], L3_offset])) # L2 L2_offset = torch.cat([nbr_fea_l[1], ref_fea_l[1]], dim=1) L2_offset = self.lrelu(self.L2_offset_conv1(L2_offset)) L3_offset = F.interpolate(L3_offset, scale_factor=2, mode='bilinear', align_corners=False) L2_offset = self.lrelu(self.L2_offset_conv2(torch.cat([L2_offset, L3_offset * 2], dim=1))) L2_offset = self.lrelu(self.L2_offset_conv3(L2_offset)) L2_fea = self.L2_dcnpack([nbr_fea_l[1], L2_offset]) L3_fea = F.interpolate(L3_fea, scale_factor=2, mode='bilinear', align_corners=False) L2_fea = self.lrelu(self.L2_fea_conv(torch.cat([L2_fea, L3_fea], dim=1))) # L1 L1_offset = torch.cat([nbr_fea_l[0], ref_fea_l[0]], dim=1) L1_offset = self.lrelu(self.L1_offset_conv1(L1_offset)) L2_offset = F.interpolate(L2_offset, scale_factor=2, mode='bilinear', align_corners=False) L1_offset = self.lrelu(self.L1_offset_conv2(torch.cat([L1_offset, L2_offset * 2], dim=1))) L1_offset = self.lrelu(self.L1_offset_conv3(L1_offset)) L1_fea = self.L1_dcnpack([nbr_fea_l[0], L1_offset]) L2_fea = F.interpolate(L2_fea, scale_factor=2, mode='bilinear', align_corners=False) L1_fea = self.L1_fea_conv(torch.cat([L1_fea, L2_fea], dim=1)) # Cascading offset = torch.cat([L1_fea, ref_fea_l[0]], dim=1) offset = self.lrelu(self.cas_offset_conv1(offset)) offset = self.lrelu(self.cas_offset_conv2(offset)) L1_fea = self.lrelu(self.cas_dcnpack([L1_fea, offset])) return L1_fea class PCD_Align_Valid(nn.Module): ''' Alignment module using Pyramid, Cascading and Deformable convolution with 3 pyramid levels. ''' def __init__(self, nf=64, groups=8): super(PCD_Align_Valid, self).__init__() # L3: level 3, 1/4 spatial size self.L3_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L3_offset_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L3_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True, return_valid=True) # L2: level 2, 1/2 spatial size self.L2_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L2_offset_conv2 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for offset self.L2_offset_conv3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L2_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True, return_valid=True) self.L2_fea_conv = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for fea # L1: level 1, original spatial size self.L1_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.L1_offset_conv2 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for offset self.L1_offset_conv3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.L1_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True, return_valid=True) self.L1_fea_conv = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for fea # Cascading DCN self.cas_offset_conv1 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) # concat for diff self.cas_offset_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.cas_dcnpack = DCN(nf, nf, 3, stride=1, padding=1, dilation=1, deformable_groups=groups, extra_offset_mask=True, return_valid=True) self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, nbr_fea_l, ref_fea_l): '''align other neighboring frames to the reference frame in the feature level nbr_fea_l, ref_fea_l: [L1, L2, L3], each with [B,C,H,W] features ''' # L3 L3_offset = torch.cat([nbr_fea_l[2], ref_fea_l[2]], dim=1) L3_offset = self.lrelu(self.L3_offset_conv1(L3_offset)) L3_offset = self.lrelu(self.L3_offset_conv2(L3_offset)) L3_offset, valid3 = self.L3_dcnpack([nbr_fea_l[2], L3_offset]) L3_fea = self.lrelu(L3_offset) # L2 L2_offset = torch.cat([nbr_fea_l[1], ref_fea_l[1]], dim=1) L2_offset = self.lrelu(self.L2_offset_conv1(L2_offset)) L3_offset = F.interpolate(L3_offset, scale_factor=2, mode='bilinear', align_corners=False) L2_offset = self.lrelu(self.L2_offset_conv2(torch.cat([L2_offset, L3_offset * 2], dim=1))) L2_offset = self.lrelu(self.L2_offset_conv3(L2_offset)) L2_fea, valid2 = self.L2_dcnpack([nbr_fea_l[1], L2_offset]) L3_fea = F.interpolate(L3_fea, scale_factor=2, mode='bilinear', align_corners=False) L2_fea = self.lrelu(self.L2_fea_conv(torch.cat([L2_fea, L3_fea], dim=1))) # L1 L1_offset = torch.cat([nbr_fea_l[0], ref_fea_l[0]], dim=1) L1_offset = self.lrelu(self.L1_offset_conv1(L1_offset)) L2_offset = F.interpolate(L2_offset, scale_factor=2, mode='bilinear', align_corners=False) L1_offset = self.lrelu(self.L1_offset_conv2(torch.cat([L1_offset, L2_offset * 2], dim=1))) L1_offset = self.lrelu(self.L1_offset_conv3(L1_offset)) L1_fea, valid1 = self.L1_dcnpack([nbr_fea_l[0], L1_offset]) L2_fea = F.interpolate(L2_fea, scale_factor=2, mode='bilinear', align_corners=False) L1_fea = self.L1_fea_conv(torch.cat([L1_fea, L2_fea], dim=1)) # Cascading offset = torch.cat([L1_fea, ref_fea_l[0]], dim=1) offset = self.lrelu(self.cas_offset_conv1(offset)) offset = self.lrelu(self.cas_offset_conv2(offset)) L1_fea, valid0 = self.cas_dcnpack([L1_fea, offset]) L1_fea = self.lrelu(L1_fea) valid = valid3 & valid2 & valid1 & valid0 return L1_fea, valid class TSA_Fusion(nn.Module): ''' Temporal Spatial Attention fusion module Temporal: correlation; Spatial: 3 pyramid levels. ''' def __init__(self, nf=64, nframes=5, center=2): super(TSA_Fusion, self).__init__() self.center = center # temporal attention (before fusion conv) self.tAtt_1 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.tAtt_2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) # fusion conv: using 1x1 to save parameters and computation self.fea_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) # spatial attention (after fusion conv) self.sAtt_1 = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) self.maxpool = nn.MaxPool2d(3, stride=2, padding=1) self.avgpool = nn.AvgPool2d(3, stride=2, padding=1) self.sAtt_2 = nn.Conv2d(nf * 2, nf, 1, 1, bias=True) self.sAtt_3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.sAtt_4 = nn.Conv2d(nf, nf, 1, 1, bias=True) self.sAtt_5 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.sAtt_L1 = nn.Conv2d(nf, nf, 1, 1, bias=True) self.sAtt_L2 = nn.Conv2d(nf * 2, nf, 3, 1, 1, bias=True) self.sAtt_L3 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.sAtt_add_1 = nn.Conv2d(nf, nf, 1, 1, bias=True) self.sAtt_add_2 = nn.Conv2d(nf, nf, 1, 1, bias=True) self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, aligned_fea): B, N, C, H, W = aligned_fea.size() # N video frames #### temporal attention emb_ref = self.tAtt_2(aligned_fea[:, self.center, :, :, :].clone()) emb = self.tAtt_1(aligned_fea.view(-1, C, H, W)).view(B, N, -1, H, W) # [B, N, C(nf), H, W] cor_l = [] for i in range(N): emb_nbr = emb[:, i, :, :, :] cor_tmp = torch.sum(emb_nbr * emb_ref, 1).unsqueeze(1) # B, 1, H, W cor_l.append(cor_tmp) cor_prob = torch.sigmoid(torch.cat(cor_l, dim=1)) # B, N, H, W cor_prob = cor_prob.unsqueeze(2).repeat(1, 1, C, 1, 1).view(B, -1, H, W) aligned_fea = aligned_fea.view(B, -1, H, W) * cor_prob #### fusion fea = self.lrelu(self.fea_fusion(aligned_fea)) #### spatial attention att = self.lrelu(self.sAtt_1(aligned_fea)) att_max = self.maxpool(att) att_avg = self.avgpool(att) att = self.lrelu(self.sAtt_2(torch.cat([att_max, att_avg], dim=1))) # pyramid levels att_L = self.lrelu(self.sAtt_L1(att)) att_max = self.maxpool(att_L) att_avg = self.avgpool(att_L) att_L = self.lrelu(self.sAtt_L2(torch.cat([att_max, att_avg], dim=1))) att_L = self.lrelu(self.sAtt_L3(att_L)) att_L = F.interpolate(att_L, scale_factor=2, mode='bilinear', align_corners=False) att = self.lrelu(self.sAtt_3(att)) att = att + att_L att = self.lrelu(self.sAtt_4(att)) att = F.interpolate(att, scale_factor=2, mode='bilinear', align_corners=False) att = self.sAtt_5(att) att_add = self.sAtt_add_2(self.lrelu(self.sAtt_add_1(att))) att = torch.sigmoid(att) fea = fea * att * 2 + att_add return fea class EDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, predeblur=False, HR_in=False, w_TSA=True): super(EDVR, self).__init__() self.nf = nf self.center = nframes // 2 if center is None else center self.is_predeblur = True if predeblur else False self.HR_in = True if HR_in else False self.w_TSA = w_TSA ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.is_predeblur: self.pre_deblur = Predeblur_ResNet_Pyramid(nf=nf, HR_in=self.HR_in) self.conv_1x1 = nn.Conv2d(nf, nf, 1, 1, bias=True) else: if self.HR_in: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x): B, N, C, H, W = x.size() # N video frames x_center = x[:, self.center, :, :, :].contiguous() #### extract LR features # L1 if self.is_predeblur: L1_fea = self.pre_deblur(x.view(-1, C, H, W)) L1_fea = self.conv_1x1(L1_fea) if self.HR_in: H, W = H // 4, W // 4 else: if self.HR_in: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) # BN,64,64,64 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [ L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone() ] aligned_fea = [] for i in range(N): nbr_fea_l = [ L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone() ] aligned_fea.append(self.pcd_align(nbr_fea_l, ref_fea_l)) aligned_fea = torch.stack(aligned_fea, dim=1) # [B, N, C, H, W] if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) fea = self.tsa_fusion(aligned_fea) out = self.recon_trunk(fea) # B,C,64,64 out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) # B,C,128,128 out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) # B,C,256,256 out = self.lrelu(self.HRconv(out)) # B,C,256,256 out = self.conv_last(out) # B,3,256,256 if self.HR_in: base = x_center else: base = F.interpolate(x_center, scale_factor=4, mode='bilinear', align_corners=False) # B,3,256,256 out += base return out class EDVR2X(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, predeblur=False, HR_in=False, w_TSA=True): super(EDVR2X, self).__init__() self.nf = nf self.center = nframes // 2 if center is None else center self.is_predeblur = True if predeblur else False self.HR_in = True if HR_in else False self.w_TSA = w_TSA ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.is_predeblur: self.pre_deblur = Predeblur_ResNet_Pyramid(nf=nf, HR_in=self.HR_in) self.conv_1x1 = nn.Conv2d(nf, nf, 1, 1, bias=True) else: if self.HR_in: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling self.upconv = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x): B, N, C, H, W = x.size() # N video frames x_center = x[:, self.center, :, :, :].contiguous() #### extract LR features # L1 if self.is_predeblur: L1_fea = self.pre_deblur(x.view(-1, C, H, W)) L1_fea = self.conv_1x1(L1_fea) if self.HR_in: H, W = H // 4, W // 4 else: if self.HR_in: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) # BN,64,64,64 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [ L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone() ] aligned_fea = [] for i in range(N): nbr_fea_l = [ L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone() ] aligned_fea.append(self.pcd_align(nbr_fea_l, ref_fea_l)) aligned_fea = torch.stack(aligned_fea, dim=1) # [B, N, C, H, W] if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) fea = self.tsa_fusion(aligned_fea) out = self.recon_trunk(fea) # B,C,64,64 out = self.lrelu(self.pixel_shuffle(self.upconv(out))) # B,C,128,128 out = self.lrelu(self.HRconv(out)) # B,C,128,128 out = self.conv_last(out) # B,3,128,128 if self.HR_in: base = x_center else: base = F.interpolate(x_center, scale_factor=2, mode='bilinear', align_corners=False) # B,3,128,128 out += base return out class EDVRImage(nn.Module): def __init__(self, nf=64, front_RBs=5, back_RBs=10, down_scale=True): super(EDVRImage, self).__init__() self.nf = nf self.front_RBs = front_RBs self.back_RBs = back_RBs self.down_scale = down_scale ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.down_scale: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x, scale): N, C, H, W = x.size() if self.down_scale: x = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) base = x feat = self.lrelu(self.conv_first_1(x)) feat = self.lrelu(self.conv_first_2(feat)) feat = self.lrelu(self.conv_first_3(feat)) # H, W = H // 4, W // 4 else: base = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) feat = self.lrelu(self.conv_first(x)) feat = self.feature_extraction(feat) # BN,64,64,64 out = self.recon_trunk(feat) # B,C,64,64 out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) # B,C,128,128 out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) # B,C,256,256 out = self.lrelu(self.HRconv(out)) # B,C,256,256 out = self.conv_last(out) # B,3,256,256 out += base return out class EDVR3D(nn.Module): def __init__(self, nf=64, front_RBs=5, back_RBs=10, conv_type='normal', down_scale=True): super(EDVR3D, self).__init__() self.nf = nf self.front_RBs = front_RBs self.back_RBs = back_RBs self.conv_type = conv_type self.down_scale = down_scale ResidualBlock_3D = functools.partial(arch_util.ResidualBlock_3D, planes=nf, conv_type=conv_type, padding_mode='const', has_bias=True) #### extract features (for each frame) if self.down_scale: self.conv_first_1 = nn.Conv3d(3, nf, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1), bias=True) self.conv_first_2 = nn.Conv3d(nf, nf, kernel_size=(3, 3, 3), stride=(1, 2, 2), padding=(1, 1, 1), bias=True) self.conv_first_3 = nn.Conv3d(nf, nf, kernel_size=(3, 3, 3), stride=(1, 2, 2), padding=(1, 1, 1), bias=True) else: self.conv_first = nn.Conv3d(3, nf, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1), bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_3D, front_RBs) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_3D, back_RBs) #### upsampling self.upconv1 = nn.ConvTranspose3d(nf, nf, kernel_size=(3, 3, 3), stride=(1, 2, 2), padding=(1, 1, 1), output_padding=(0, 1, 1), bias=True) self.upconv2 = nn.ConvTranspose3d(nf, 64, kernel_size=(3, 3, 3), stride=(1, 2, 2), padding=(1, 1, 1), output_padding=(0, 1, 1), bias=True) self.HRconv = nn.Conv3d(64, 64, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1), bias=True) self.conv_last = nn.Conv3d(64, 3, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1), bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x, scale): N, C, T, H, W = x.size() x = x.view(N, C*T, H, W) x = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) H, W = x.shape[-2:] x = x.view(N, C, T, H, W) base = x.detach() if self.down_scale: feat = self.lrelu(self.conv_first_1(x)) feat = self.lrelu(self.conv_first_2(feat)) feat = self.lrelu(self.conv_first_3(feat)) # H, W = H // 4, W // 4 else: feat = self.lrelu(self.conv_first(x)) feat = self.feature_extraction(feat) out = self.recon_trunk(feat) out = self.lrelu(self.upconv1(out)) out = self.lrelu(self.upconv2(out)) out = self.lrelu(self.HRconv(out)) out = self.conv_last(out) out += base return out class UPEDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, w_TSA=True, down_scale=False, align_target=True, ret_valid=False): super(UPEDVR, self).__init__() self.nf = nf self.nframes = nframes self.center = nframes // 2 if center is None else center self.w_TSA = w_TSA self.down_scale = down_scale self.align_target = align_target self.ret_valid = ret_valid ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.down_scale: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) if self.ret_valid: self.pcd_align = PCD_Align_Valid(nf=nf, groups=groups) else: self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: if self.align_target: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes - 1, center=self.center) else: if self.align_target: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) else: self.tsa_fusion = nn.Conv2d((nframes - 1) * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x, scale): B, N, C, H, W = x.shape x = x.view(-1, C, H, W) x = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) H, W = x.shape[-2:] x = x.view(B, N, C, H, W) x_center = x[:, self.center, :, :, :].contiguous() # L1 if self.down_scale: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) # BN,64,64,64 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone()] # [(B,64,64,64), (B,64,32,32), (B,64,16,16)] if self.ret_valid: aligned_fea, valids = [], [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat, valid = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) valids.append(valid) else: aligned_fea = [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) aligned_fea = torch.stack(aligned_fea, dim=1) # [B, N-1, C, H, W] if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) # B,NC,64,64 fea = self.tsa_fusion(aligned_fea) # B,C,64,64 out = self.recon_trunk(fea) # B,C,64,64 out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) # B,C,128,128 out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) # B,C,256,256 out = self.lrelu(self.HRconv(out)) # B,C,256,256 out = self.conv_last(out) # B,3,256,256 out += x_center if not self.training: return out if self.ret_valid: return out, valid else: return out class Scale2Weight(nn.Module): def __init__(self, kernel_size=3, inC=64, outC=64, dims=[8]): super(Scale2Weight,self).__init__() self.kernel_size=kernel_size self.inC = inC self.outC = outC self.dims = dims fcs = [] in_dim = 1 for dim in self.dims: fcs.append(nn.Linear(in_dim, dim)) fcs.append(nn.ReLU(inplace=True)) in_dim = dim fcs.append(nn.Linear(in_dim, self.kernel_size*self.kernel_size*self.inC*self.outC)) self.scale_block=nn.Sequential(*fcs) def forward(self, input, scale): scale = input.new([scale]) weight = self.scale_block(scale) weight = weight.view(self.outC, self.inC, self.kernel_size, self.kernel_size) output = F.conv2d(input, weight, padding=1) return output class UPControlEDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, w_TSA=True, down_scale=True, align_target=True, ret_valid=False, multi_scale_cont=False): super(UPControlEDVR, self).__init__() self.nf = nf self.nframes = nframes self.center = nframes // 2 if center is None else center self.w_TSA = w_TSA self.down_scale = down_scale self.align_target = align_target self.ret_valid = ret_valid self.multi_scale_cont = multi_scale_cont ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.down_scale: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.control_conv = Scale2Weight(kernel_size=3, inC=nf, outC=nf) if self.multi_scale_cont: self.control_conv2 = Scale2Weight(kernel_size=3, inC=nf, outC=nf) self.control_conv3 = Scale2Weight(kernel_size=3, inC=64, outC=64) if self.ret_valid: self.pcd_align = PCD_Align_Valid(nf=nf, groups=groups) else: self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: if self.align_target: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) else: self.tsa_fusion = nn.Conv2d((nframes - 1) * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling if self.down_scale: self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) if self.multi_scale_cont: self.cont_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.cont_conv3 = nn.Conv2d(64, 64, 3, 1, 1, bias=True) else: self.upconv1 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64, 3, 1, 1, bias=True) # self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x, scale): B, N, C, H, W = x.shape x = x.view(-1, C, H, W) x = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) H, W = x.shape[-2:] x = x.view(B, N, C, H, W) x_center = x[:, self.center, :, :, :].contiguous() # L1 if self.down_scale: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone()] # [(B,64,64,64), (B,64,32,32), (B,64,16,16)] if self.ret_valid: aligned_fea, valids = [], [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat, valid = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) valids.append(valid) else: aligned_fea = [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) aligned_fea = torch.stack(aligned_fea, dim=1) if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) fea = self.tsa_fusion(aligned_fea) out = self.control_conv(fea, scale) out = self.recon_trunk(out) if self.down_scale: out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) if self.multi_scale_cont: out = self.control_conv2(out, scale) out = self.lrelu(self.cont_conv2(out)) out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) out = self.control_conv3(out, scale) out = self.lrelu(self.cont_conv3(out)) else: out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) else: out = self.lrelu(self.upconv1(out)) out = self.lrelu(self.upconv2(out)) out = self.lrelu(self.HRconv(out)) out = self.conv_last(out) out += x_center if self.ret_valid: return out, valid else: return out class FlowUPControlEDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, w_TSA=True, down_scale=True, align_target=True, ret_valid=False, multi_scale_cont=False): super(FlowUPControlEDVR, self).__init__() self.nf = nf self.nframes = nframes self.center = nframes // 2 if center is None else center self.w_TSA = w_TSA self.down_scale = down_scale self.align_target = align_target self.ret_valid = ret_valid self.multi_scale_cont = multi_scale_cont ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.down_scale: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.control_conv = Scale2Weight(kernel_size=3, inC=nf, outC=nf) if self.multi_scale_cont: self.control_conv2 = Scale2Weight(kernel_size=3, inC=nf, outC=nf) self.control_conv3 = Scale2Weight(kernel_size=3, inC=64, outC=64) if self.ret_valid: self.pcd_align = PCD_Align_Valid(nf=nf, groups=groups) else: self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: if self.align_target: self.tsa_fusion = nn.Conv2d((nframes + 1) * nf, nf, 1, 1, bias=True) else: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling if self.down_scale: self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) if self.multi_scale_cont: self.cont_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.cont_conv3 = nn.Conv2d(64, 64, 3, 1, 1, bias=True) else: self.upconv1 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64, 3, 1, 1, bias=True) # self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x, y, scale): B, N, C, H, W = x.shape x = x.view(-1, C, H, W) x = F.interpolate(x, scale_factor=scale, mode='bilinear', align_corners=False) H, W = x.shape[-2:] x = x.view(B, N, C, H, W) x_center = x[:, self.center, :, :, :].contiguous() # L1 if self.down_scale: # LQs feature L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) # frame(t-1) feature y1_fea = self.lrelu(self.conv_first_1(y)) y1_fea = self.lrelu(self.conv_first_2(y1_fea)) y1_fea = self.lrelu(self.conv_first_3(y1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) y1_fea = self.lrelu(self.conv_first(y)) # L1 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 y_fea = self.feature_extraction(y1_fea) # B,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone()] # [(B,64,64,64), (B,64,32,32), (B,64,16,16)] if self.ret_valid: aligned_fea, valids = [], [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat, valid = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) valids.append(valid) else: aligned_fea = [] for i in range(N): if not self.align_target and (i == self.center): continue nbr_fea_l = [L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone()] feat = self.pcd_align(nbr_fea_l, ref_fea_l) aligned_fea.append(feat) aligned_fea.append(y_fea) aligned_fea = torch.stack(aligned_fea, dim=1) if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) fea = self.tsa_fusion(aligned_fea) out = self.control_conv(fea, scale) out = self.recon_trunk(out) if self.down_scale: out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) if self.multi_scale_cont: out = self.control_conv2(out, scale) out = self.lrelu(self.cont_conv2(out)) out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) out = self.control_conv3(out, scale) out = self.lrelu(self.cont_conv3(out)) else: out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) else: out = self.lrelu(self.upconv1(out)) out = self.lrelu(self.upconv2(out)) out = self.lrelu(self.HRconv(out)) out = self.conv_last(out) out += x_center if self.ret_valid: return out, valid else: return out class MultiEDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, predeblur=False, HR_in=False, w_TSA=True): super(MultiEDVR, self).__init__() self.nf = nf self.nframes = nframes self.center = nframes // 2 if center is None else center self.is_predeblur = True if predeblur else False self.HR_in = True if HR_in else False self.w_TSA = w_TSA ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.is_predeblur: self.pre_deblur = Predeblur_ResNet_Pyramid(nf=nf, HR_in=self.HR_in) self.conv_1x1 = nn.Conv2d(nf, nf, 1, 1, bias=True) else: if self.HR_in: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) #### upsampling self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) self.pixel_shuffle = nn.PixelShuffle(2) self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) self.conv_last = nn.Conv2d(64, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def forward(self, x): B, N, C, H, W = x.size() # N video frames x_center = x[:, self.center:N-self.center, :, :, :].contiguous() #B,K,C,H,W #### extract LR features # L1 if self.is_predeblur: L1_fea = self.pre_deblur(x.view(-1, C, H, W)) L1_fea = self.conv_1x1(L1_fea) if self.HR_in: H, W = H // 4, W // 4 else: if self.HR_in: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) # BN,64,64,64 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list aligned_feas = [] for i in range(self.center, N - self.center): ref_fea_l = [ L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone() ] # [(B,64,64,64), (B,64,32,32), (B,64,16,16)] * (N-2*center) aligned_fea = [] start = i - self.center for j in range(start, start + self.nframes): nbr_fea_l = [ L1_fea[:, j, :, :, :].clone(), L2_fea[:, j, :, :, :].clone(), L3_fea[:, j, :, :, :].clone() ] aligned_fea.append(self.pcd_align(nbr_fea_l, ref_fea_l)) # N,(B,64,64,64) aligned_fea = torch.stack(aligned_fea, dim=1) # [B, N, 64, 64, 64] aligned_feas.append(aligned_fea) aligned_feas = torch.stack(aligned_feas, dim=1) if not self.w_TSA: aligned_feas = aligned_feas.view(B*aligned_feas.shape[1], -1, H, W) # BK,N64,64,64 fea = self.tsa_fusion(aligned_feas) # BK,64,64,64 out = self.recon_trunk(fea) # BK,64,64,64 out = self.lrelu(self.pixel_shuffle(self.upconv1(out))) # BK,64,128,128 out = self.lrelu(self.pixel_shuffle(self.upconv2(out))) # BK,64,256,256 out = self.lrelu(self.HRconv(out)) # BK,64,256,256 out = self.conv_last(out) # BK,3,256,256 out_c, out_h, out_w = out.shape[1:] out = out.view(B, -1, out_c, out_h, out_w) if self.HR_in: base = x_center else: x_center = x_center.view(-1, C, H, W) base = F.interpolate(x_center, scale_factor=4, mode='bilinear', align_corners=False) # B,3,256,256 base = base.view(B, -1, C, out_h, out_w) out += base return out # Meta class Pos2Weight(nn.Module): def __init__(self,inC, kernel_size=3, outC=3): super(Pos2Weight,self).__init__() self.inC = inC self.kernel_size=kernel_size self.outC = outC self.meta_block=nn.Sequential( nn.Linear(3,256), nn.ReLU(inplace=True), nn.Linear(256,self.kernel_size*self.kernel_size*self.inC*self.outC) ) def forward(self,x): output = self.meta_block(x) return output class MetaEDVR(nn.Module): def __init__(self, nf=64, nframes=5, groups=8, front_RBs=5, back_RBs=10, center=None, predeblur=False, HR_in=False, w_TSA=True, has_final_conv=False, fix_edvr=False): """ EDVR based arbitrary scale SR. """ super(MetaEDVR, self).__init__() self.nf = nf self.center = nframes // 2 if center is None else center self.is_predeblur = True if predeblur else False self.HR_in = True if HR_in else False self.w_TSA = w_TSA self.has_final_conv = has_final_conv self.fix_edvr = fix_edvr ResidualBlock_noBN_f = functools.partial(arch_util.ResidualBlock_noBN, nf=nf) #### extract features (for each frame) if self.is_predeblur: self.pre_deblur = Predeblur_ResNet_Pyramid(nf=nf, HR_in=self.HR_in) self.conv_1x1 = nn.Conv2d(nf, nf, 1, 1, bias=True) else: if self.HR_in: self.conv_first_1 = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.conv_first_2 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.conv_first_3 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) else: self.conv_first = nn.Conv2d(3, nf, 3, 1, 1, bias=True) self.feature_extraction = arch_util.make_layer(ResidualBlock_noBN_f, front_RBs) self.fea_L2_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L2_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.fea_L3_conv1 = nn.Conv2d(nf, nf, 3, 2, 1, bias=True) self.fea_L3_conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True) self.pcd_align = PCD_Align(nf=nf, groups=groups) if self.w_TSA: self.tsa_fusion = TSA_Fusion(nf=nf, nframes=nframes, center=self.center) else: self.tsa_fusion = nn.Conv2d(nframes * nf, nf, 1, 1, bias=True) #### reconstruction self.recon_trunk = arch_util.make_layer(ResidualBlock_noBN_f, back_RBs) ## position to weight self.P2W = Pos2Weight(inC=nf) # #### upsampling # self.upconv1 = nn.Conv2d(nf, nf * 4, 3, 1, 1, bias=True) # self.upconv2 = nn.Conv2d(nf, 64 * 4, 3, 1, 1, bias=True) # self.pixel_shuffle = nn.PixelShuffle(2) # self.HRconv = nn.Conv2d(64, 64, 3, 1, 1, bias=True) if self.has_final_conv: self.conv_final = nn.Conv2d(3, 3, 3, 1, 1, bias=True) #### activation function self.lrelu = nn.LeakyReLU(negative_slope=0.1, inplace=True) def train(self, mode=True): nn.Module.train(self, mode) if mode: if self.fix_edvr: for k, v in self.named_parameters(): if not ('P2W' in k or 'conv_final' in k): v.requires_grad = False def meta_upsample(self, x, pos_mat, scale): scale_int = math.ceil(scale) N,C,H,W = x.size() up_x = x.view(N,C,H,1,W,1) up_x = torch.cat([up_x]*scale_int,3) up_x = torch.cat([up_x]*scale_int,5).permute(0,3,5,1,2,4) up_x = up_x.contiguous().view(-1, C, H, W) local_weight = self.P2W(pos_mat.view(pos_mat.size(1),-1)) cols = F.unfold(up_x, 3, padding=1) # cols: N*r*r,64*9,H*W if not self.training: torch.cuda.empty_cache() cols = cols.view(cols.size(0)//(scale_int**2), scale_int**2, cols.size(1), cols.size(2), 1).permute(0, 1, 3, 4, 2).contiguous() # cols: N, r*r, H*W, 1, 64*9 if not self.training: torch.cuda.empty_cache() local_weight = local_weight.view(x.size(2), scale_int, x.size(3), scale_int, -1, 3).permute(1,3,0,2,4,5).contiguous() # local_weight: r,r,H,W,64*9,3 if not self.training: torch.cuda.empty_cache() local_weight = local_weight.view(scale_int**2, x.size(2) * x.size(3), -1, 3).contiguous() # r*r,H*W,64*9,3 if not self.training: torch.cuda.empty_cache() out = torch.matmul(cols, local_weight).permute(0, 1, 4, 2, 3) # N,r*r,H*W,1,3 => N,r*r,3,H*W,1 out = out.contiguous().view(x.size(0),scale_int,scale_int, 3, x.size(2), x.size(3)).permute(0, 3, 4, 1, 5, 2) # N,r,r,3,50,50 => N,3,H,r,W,r out = out.contiguous().view(x.size(0), 3, scale_int*x.size(2), scale_int*x.size(3)) # N,3,H*r,W*r return out def forward(self, x, scale, pos_mat, mask): B, N, C, H, W = x.size() # N video frames x_center = x[:, self.center, :, :, :].contiguous() #### extract LR features # L1 if self.is_predeblur: L1_fea = self.pre_deblur(x.view(-1, C, H, W)) L1_fea = self.conv_1x1(L1_fea) if self.HR_in: H, W = H // 4, W // 4 else: if self.HR_in: L1_fea = self.lrelu(self.conv_first_1(x.view(-1, C, H, W))) L1_fea = self.lrelu(self.conv_first_2(L1_fea)) L1_fea = self.lrelu(self.conv_first_3(L1_fea)) H, W = H // 4, W // 4 else: L1_fea = self.lrelu(self.conv_first(x.view(-1, C, H, W))) # BN,64,64,64 L1_fea = self.feature_extraction(L1_fea) # BN,64,64,64 # L2 L2_fea = self.lrelu(self.fea_L2_conv1(L1_fea)) # BN,64,32,32 L2_fea = self.lrelu(self.fea_L2_conv2(L2_fea)) # BN,64,32,32 # L3 L3_fea = self.lrelu(self.fea_L3_conv1(L2_fea)) # BN,64,16,16 L3_fea = self.lrelu(self.fea_L3_conv2(L3_fea)) # BN,64,16,16 L1_fea = L1_fea.view(B, N, -1, H, W) # B,N,64,64,64 L2_fea = L2_fea.view(B, N, -1, H // 2, W // 2) # B,N,64,32,32 L3_fea = L3_fea.view(B, N, -1, H // 4, W // 4) # B,N,64,16,16 #### pcd align # ref feature list ref_fea_l = [ L1_fea[:, self.center, :, :, :].clone(), L2_fea[:, self.center, :, :, :].clone(), L3_fea[:, self.center, :, :, :].clone() ] # [(B,64,64,64), (B,64,32,32), (B,64,16,16)] aligned_fea = [] for i in range(N): nbr_fea_l = [ L1_fea[:, i, :, :, :].clone(), L2_fea[:, i, :, :, :].clone(), L3_fea[:, i, :, :, :].clone() ] aligned_fea.append(self.pcd_align(nbr_fea_l, ref_fea_l)) # N,(B,64,64,64) aligned_fea = torch.stack(aligned_fea, dim=1) # [B, N, C, H, W] if not self.w_TSA: aligned_fea = aligned_fea.view(B, -1, H, W) # B,NC,64,64 fea = self.tsa_fusion(aligned_fea) # B,C,64,64 out = self.recon_trunk(fea) # B,C,64,64 out = self.meta_upsample(out, pos_mat, scale) out = torch.masked_select(out, mask) out = out.contiguous().view(B, C, int(H*scale), int(W*scale)) # out = self.lrelu(self.HRconv(out)) # B,C,256,256 if self.has_final_conv: out = self.conv_final(out) # B,3,256,256 if self.HR_in: base = x_center else: base = F.interpolate(x_center, scale_factor=scale, mode='bilinear', align_corners=False) # B,3,256,256 out += base return out
45.915503
114
0.562305
9,624
62,491
3.454801
0.030133
0.0397
0.044392
0.039099
0.893019
0.870553
0.853469
0.841048
0.828145
0.819183
0
0.064485
0.295739
62,491
1,360
115
45.949265
0.691002
0.075275
0
0.779614
0
0
0.003494
0
0
0
0
0
0
1
0.029385
false
0
0.006428
0
0.067034
0
0
0
0
null
0
0
0
1
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
7
4de281fd78a382b8535a60cbcccd46c4a6e189a2
12,878
py
Python
src/ebay_rest/api/sell_account/api/program_api.py
craiga/ebay_rest
a0be2677c65a787e9566df848ffa3ad0c309a9d9
[ "MIT" ]
null
null
null
src/ebay_rest/api/sell_account/api/program_api.py
craiga/ebay_rest
a0be2677c65a787e9566df848ffa3ad0c309a9d9
[ "MIT" ]
null
null
null
src/ebay_rest/api/sell_account/api/program_api.py
craiga/ebay_rest
a0be2677c65a787e9566df848ffa3ad0c309a9d9
[ "MIT" ]
null
null
null
# coding: utf-8 """ Account API The <b>Account API</b> gives sellers the ability to configure their eBay seller accounts, including the seller's policies (the Fulfillment Policy, Payment Policy, and Return Policy), opt in and out of eBay seller programs, configure sales tax tables, and get account information. <br><br>For details on the availability of the methods in this API, see <a href=\"/api-docs/sell/account/overview.html#requirements\">Account API requirements and restrictions</a>. # noqa: E501 OpenAPI spec version: v1.6.3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from ...sell_account.api_client import ApiClient class ProgramApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def get_opted_in_programs(self, **kwargs): # noqa: E501 """get_opted_in_programs # noqa: E501 This method gets a list of the seller programs that the seller has opted-in to. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_opted_in_programs(async_req=True) >>> result = thread.get() :param async_req bool :return: Programs If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_opted_in_programs_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_opted_in_programs_with_http_info(**kwargs) # noqa: E501 return data def get_opted_in_programs_with_http_info(self, **kwargs): # noqa: E501 """get_opted_in_programs # noqa: E501 This method gets a list of the seller programs that the seller has opted-in to. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_opted_in_programs_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :return: Programs If the method is called asynchronously, returns the request thread. """ all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_opted_in_programs" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['api_auth'] # noqa: E501 return self.api_client.call_api( '/program/get_opted_in_programs', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Programs', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def opt_in_to_program(self, body, **kwargs): # noqa: E501 """opt_in_to_program # noqa: E501 This method opts the seller in to an eBay seller program. Refer to the Account API overview for information about available eBay seller programs. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after the processing period has passed. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.opt_in_to_program(body, async_req=True) >>> result = thread.get() :param async_req bool :param Program body: Program being opted-in to. (required) :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.opt_in_to_program_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.opt_in_to_program_with_http_info(body, **kwargs) # noqa: E501 return data def opt_in_to_program_with_http_info(self, body, **kwargs): # noqa: E501 """opt_in_to_program # noqa: E501 This method opts the seller in to an eBay seller program. Refer to the Account API overview for information about available eBay seller programs. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after the processing period has passed. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.opt_in_to_program_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool :param Program body: Program being opted-in to. (required) :return: object If the method is called asynchronously, returns the request thread. """ all_params = ['body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method opt_in_to_program" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `opt_in_to_program`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['api_auth'] # noqa: E501 return self.api_client.call_api( '/program/opt_in', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def opt_out_of_program(self, body, **kwargs): # noqa: E501 """opt_out_of_program # noqa: E501 This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.opt_out_of_program(body, async_req=True) >>> result = thread.get() :param async_req bool :param Program body: Program being opted-out of. (required) :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.opt_out_of_program_with_http_info(body, **kwargs) # noqa: E501 else: (data) = self.opt_out_of_program_with_http_info(body, **kwargs) # noqa: E501 return data def opt_out_of_program_with_http_info(self, body, **kwargs): # noqa: E501 """opt_out_of_program # noqa: E501 This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.opt_out_of_program_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool :param Program body: Program being opted-out of. (required) :return: object If the method is called asynchronously, returns the request thread. """ all_params = ['body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method opt_out_of_program" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `opt_out_of_program`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['api_auth'] # noqa: E501 return self.api_client.call_api( '/program/opt_out', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
40.369906
479
0.625718
1,605
12,878
4.786916
0.127103
0.044774
0.021866
0.028114
0.894572
0.890668
0.886763
0.864506
0.864506
0.864506
0
0.015529
0.289952
12,878
318
480
40.496855
0.824694
0.403945
0
0.792683
0
0
0.160841
0.035379
0
0
0
0
0
1
0.042683
false
0
0.02439
0
0.128049
0
0
0
0
null
0
0
0
1
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
7
12b38f73f523d113fccf7e5ee5509e70be4b91c5
59,559
py
Python
msldap/protocol/ldap_filter/parser.py
blshkv/msldap
435601df85faa407793555ed0da582aa709e3be1
[ "MIT" ]
18
2018-03-03T20:17:19.000Z
2022-02-02T17:02:41.000Z
msldap/protocol/ldap_filter/parser.py
blshkv/msldap
435601df85faa407793555ed0da582aa709e3be1
[ "MIT" ]
2
2018-03-05T00:28:29.000Z
2020-05-02T20:26:24.000Z
msldap/protocol/ldap_filter/parser.py
blshkv/msldap
435601df85faa407793555ed0da582aa709e3be1
[ "MIT" ]
3
2020-03-10T22:49:07.000Z
2022-02-02T17:18:27.000Z
# -*- coding: utf-8 -*- """LDAP Parser This parser is generated by the canopy library (`canopy.jcoglan.com <http://canopy.jcoglan.com/>`__). """ from collections import defaultdict import re class TreeNode(object): def __init__(self, text, offset, elements=None): self.text = text self.offset = offset self.elements = elements or [] def __iter__(self): for el in self.elements: yield el class TreeNode1(TreeNode): def __init__(self, text, offset, elements): super(TreeNode1, self).__init__(text, offset, elements) self.filt = elements[2] self.filtercomp = elements[2] class TreeNode2(TreeNode): def __init__(self, text, offset, elements): super(TreeNode2, self).__init__(text, offset, elements) self.filt = elements[1] self.item = elements[1] class TreeNode3(TreeNode): def __init__(self, text, offset, elements): super(TreeNode3, self).__init__(text, offset, elements) self.filters = elements[2] self.filterlist = elements[2] class TreeNode4(TreeNode): def __init__(self, text, offset, elements): super(TreeNode4, self).__init__(text, offset, elements) self.filters = elements[2] self.filterlist = elements[2] class TreeNode5(TreeNode): def __init__(self, text, offset, elements): super(TreeNode5, self).__init__(text, offset, elements) self.filt = elements[2] self.filter = elements[2] class TreeNode6(TreeNode): def __init__(self, text, offset, elements): super(TreeNode6, self).__init__(text, offset, elements) self.attr = elements[0] self.filtertype = elements[1] self.value = elements[2] class TreeNode7(TreeNode): def __init__(self, text, offset, elements): super(TreeNode7, self).__init__(text, offset, elements) self.attr = elements[0] self.equal = elements[1] self.wildcard_value = elements[2] class TreeNode8(TreeNode): def __init__(self, text, offset, elements): super(TreeNode8, self).__init__(text, offset, elements) self.any = elements[1] class TreeNode9(TreeNode): def __init__(self, text, offset, elements): super(TreeNode9, self).__init__(text, offset, elements) self.value = elements[0] class TreeNode10(TreeNode): def __init__(self, text, offset, elements): super(TreeNode10, self).__init__(text, offset, elements) self.attr = elements[0] self.AttributeType = elements[0] self.opts = elements[1] class TreeNode11(TreeNode): def __init__(self, text, offset, elements): super(TreeNode11, self).__init__(text, offset, elements) self.options = elements[1] class TreeNode12(TreeNode): def __init__(self, text, offset, elements): super(TreeNode12, self).__init__(text, offset, elements) self.options = elements[1] class TreeNode13(TreeNode): def __init__(self, text, offset, elements): super(TreeNode13, self).__init__(text, offset, elements) self.ALPHA = elements[0] class TreeNode14(TreeNode): def __init__(self, text, offset, elements): super(TreeNode14, self).__init__(text, offset, elements) self.option = elements[0] self.options = elements[2] class TreeNode15(TreeNode): def __init__(self, text, offset, elements): super(TreeNode15, self).__init__(text, offset, elements) self.ASCII_VALUE = elements[1] class TreeNode16(TreeNode): def __init__(self, text, offset, elements): super(TreeNode16, self).__init__(text, offset, elements) self.HEX_CHAR = elements[1] class ParseError(SyntaxError): pass FAILURE = object() class Grammar(object): _cache = None _input = None _input_size = None _actions = None REGEX_1 = re.compile('^[^!*\\x29]') REGEX_2 = re.compile('^[a-fA-F0-9]') REGEX_3 = re.compile('^[\\x20]') REGEX_4 = re.compile('^[\\x09]') REGEX_5 = re.compile('^[0-9]') REGEX_6 = re.compile('^[a-zA-Z:.]') def _read_root(self): address0, index0 = FAILURE, self._offset cached = self._cache['root'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_filter() if address0 is FAILURE: self._offset = index1 address0 = self._read_filter_item() if address0 is FAILURE: self._offset = index1 self._cache['root'][index0] = (address0, self._offset) return address0 def _read_filter(self): address0, index0 = FAILURE, self._offset cached = self._cache['filter'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] remaining0, index2, elements1, address2 = 0, self._offset, [], True while address2 is not FAILURE: address2 = self._read_FILL() if address2 is not FAILURE: elements1.append(address2) remaining0 -= 1 if remaining0 <= 0: address1 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address1 = FAILURE if address1 is not FAILURE: elements0.append(address1) chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '(': address3 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address3 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'(\'') if address3 is not FAILURE: elements0.append(address3) address4 = self._read_filtercomp() if address4 is not FAILURE: elements0.append(address4) chunk1 = None if self._offset < self._input_size: chunk1 = self._input[self._offset:self._offset + 1] if chunk1 == ')': address5 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address5 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\')\'') if address5 is not FAILURE: elements0.append(address5) remaining1, index3, elements2, address7 = 0, self._offset, [], True while address7 is not FAILURE: address7 = self._read_FILL() if address7 is not FAILURE: elements2.append(address7) remaining1 -= 1 if remaining1 <= 0: address6 = TreeNode(self._input[index3:self._offset], index3, elements2) self._offset = self._offset else: address6 = FAILURE if address6 is not FAILURE: elements0.append(address6) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['filter'][index0] = (address0, self._offset) return address0 def _read_filter_item(self): address0, index0 = FAILURE, self._offset cached = self._cache['filter_item'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] remaining0, index2, elements1, address2 = 0, self._offset, [], True while address2 is not FAILURE: address2 = self._read_FILL() if address2 is not FAILURE: elements1.append(address2) remaining0 -= 1 if remaining0 <= 0: address1 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address1 = FAILURE if address1 is not FAILURE: elements0.append(address1) address3 = self._read_item() if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['filter_item'][index0] = (address0, self._offset) return address0 def _read_filtercomp(self): address0, index0 = FAILURE, self._offset cached = self._cache['filtercomp'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_and() if address0 is FAILURE: self._offset = index1 address0 = self._read_or() if address0 is FAILURE: self._offset = index1 address0 = self._read_not() if address0 is FAILURE: self._offset = index1 address0 = self._read_item() if address0 is FAILURE: self._offset = index1 self._cache['filtercomp'][index0] = (address0, self._offset) return address0 def _read_and(self): address0, index0 = FAILURE, self._offset cached = self._cache['and'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '&': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'&\'') if address1 is not FAILURE: elements0.append(address1) remaining0, index2, elements1, address3 = 0, self._offset, [], True while address3 is not FAILURE: address3 = self._read_FILL() if address3 is not FAILURE: elements1.append(address3) remaining0 -= 1 if remaining0 <= 0: address2 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address2 = FAILURE if address2 is not FAILURE: elements0.append(address2) address4 = self._read_filterlist() if address4 is not FAILURE: elements0.append(address4) remaining1, index3, elements2, address6 = 0, self._offset, [], True while address6 is not FAILURE: address6 = self._read_FILL() if address6 is not FAILURE: elements2.append(address6) remaining1 -= 1 if remaining1 <= 0: address5 = TreeNode(self._input[index3:self._offset], index3, elements2) self._offset = self._offset else: address5 = FAILURE if address5 is not FAILURE: elements0.append(address5) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_and_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['and'][index0] = (address0, self._offset) return address0 def _read_or(self): address0, index0 = FAILURE, self._offset cached = self._cache['or'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '|': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'|\'') if address1 is not FAILURE: elements0.append(address1) remaining0, index2, elements1, address3 = 0, self._offset, [], True while address3 is not FAILURE: address3 = self._read_FILL() if address3 is not FAILURE: elements1.append(address3) remaining0 -= 1 if remaining0 <= 0: address2 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address2 = FAILURE if address2 is not FAILURE: elements0.append(address2) address4 = self._read_filterlist() if address4 is not FAILURE: elements0.append(address4) remaining1, index3, elements2, address6 = 0, self._offset, [], True while address6 is not FAILURE: address6 = self._read_FILL() if address6 is not FAILURE: elements2.append(address6) remaining1 -= 1 if remaining1 <= 0: address5 = TreeNode(self._input[index3:self._offset], index3, elements2) self._offset = self._offset else: address5 = FAILURE if address5 is not FAILURE: elements0.append(address5) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_or_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['or'][index0] = (address0, self._offset) return address0 def _read_not(self): address0, index0 = FAILURE, self._offset cached = self._cache['not'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '!': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'!\'') if address1 is not FAILURE: elements0.append(address1) remaining0, index2, elements1, address3 = 0, self._offset, [], True while address3 is not FAILURE: address3 = self._read_FILL() if address3 is not FAILURE: elements1.append(address3) remaining0 -= 1 if remaining0 <= 0: address2 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address2 = FAILURE if address2 is not FAILURE: elements0.append(address2) address4 = self._read_filter() if address4 is not FAILURE: elements0.append(address4) remaining1, index3, elements2, address6 = 0, self._offset, [], True while address6 is not FAILURE: address6 = self._read_FILL() if address6 is not FAILURE: elements2.append(address6) remaining1 -= 1 if remaining1 <= 0: address5 = TreeNode(self._input[index3:self._offset], index3, elements2) self._offset = self._offset else: address5 = FAILURE if address5 is not FAILURE: elements0.append(address5) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_not_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['not'][index0] = (address0, self._offset) return address0 def _read_filterlist(self): address0, index0 = FAILURE, self._offset cached = self._cache['filterlist'].get(index0) if cached: self._offset = cached[1] return cached[0] remaining0, index1, elements0, address1 = 1, self._offset, [], True while address1 is not FAILURE: address1 = self._read_filter() if address1 is not FAILURE: elements0.append(address1) remaining0 -= 1 if remaining0 <= 0: address0 = TreeNode(self._input[index1:self._offset], index1, elements0) self._offset = self._offset else: address0 = FAILURE self._cache['filterlist'][index0] = (address0, self._offset) return address0 def _read_item(self): address0, index0 = FAILURE, self._offset cached = self._cache['item'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_wildcard() if address0 is FAILURE: self._offset = index1 address0 = self._read_simple() if address0 is FAILURE: self._offset = index1 self._cache['item'][index0] = (address0, self._offset) return address0 def _read_simple(self): address0, index0 = FAILURE, self._offset cached = self._cache['simple'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] address1 = self._read_attr() if address1 is not FAILURE: elements0.append(address1) address2 = self._read_filtertype() if address2 is not FAILURE: elements0.append(address2) address3 = self._read_value() if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_simple_filter(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['simple'][index0] = (address0, self._offset) return address0 def _read_filtertype(self): address0, index0 = FAILURE, self._offset cached = self._cache['filtertype'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_equal() if address0 is FAILURE: self._offset = index1 address0 = self._read_approx() if address0 is FAILURE: self._offset = index1 address0 = self._read_greater() if address0 is FAILURE: self._offset = index1 address0 = self._read_less() if address0 is FAILURE: self._offset = index1 self._cache['filtertype'][index0] = (address0, self._offset) return address0 def _read_equal(self): address0, index0 = FAILURE, self._offset cached = self._cache['equal'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '=': address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'=\'') self._cache['equal'][index0] = (address0, self._offset) return address0 def _read_approx(self): address0, index0 = FAILURE, self._offset cached = self._cache['approx'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 2] if chunk0 == '~=': address0 = TreeNode(self._input[self._offset:self._offset + 2], self._offset) self._offset = self._offset + 2 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'~=\'') self._cache['approx'][index0] = (address0, self._offset) return address0 def _read_greater(self): address0, index0 = FAILURE, self._offset cached = self._cache['greater'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 2] if chunk0 == '>=': address0 = TreeNode(self._input[self._offset:self._offset + 2], self._offset) self._offset = self._offset + 2 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'>=\'') self._cache['greater'][index0] = (address0, self._offset) return address0 def _read_less(self): address0, index0 = FAILURE, self._offset cached = self._cache['less'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 2] if chunk0 == '<=': address0 = TreeNode(self._input[self._offset:self._offset + 2], self._offset) self._offset = self._offset + 2 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'<=\'') self._cache['less'][index0] = (address0, self._offset) return address0 def _read_wildcard(self): address0, index0 = FAILURE, self._offset cached = self._cache['wildcard'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] address1 = self._read_attr() if address1 is not FAILURE: elements0.append(address1) address2 = self._read_equal() if address2 is not FAILURE: elements0.append(address2) address3 = self._read_wildcard_value() if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_wildcard(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['wildcard'][index0] = (address0, self._offset) return address0 def _read_wildcard_value(self): address0, index0 = FAILURE, self._offset cached = self._cache['wildcard_value'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] index2 = self._offset address1 = self._read_value() if address1 is FAILURE: address1 = TreeNode(self._input[index2:index2], index2) self._offset = index2 if address1 is not FAILURE: elements0.append(address1) address2 = self._read_any() if address2 is not FAILURE: elements0.append(address2) index3 = self._offset address3 = self._read_value() if address3 is FAILURE: address3 = TreeNode(self._input[index3:index3], index3) self._offset = index3 if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = TreeNode8(self._input[index1:self._offset], index1, elements0) self._offset = self._offset self._cache['wildcard_value'][index0] = (address0, self._offset) return address0 def _read_any(self): address0, index0 = FAILURE, self._offset cached = self._cache['any'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '*': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'*\'') if address1 is not FAILURE: elements0.append(address1) remaining0, index2, elements1, address3 = 0, self._offset, [], True while address3 is not FAILURE: index3, elements2 = self._offset, [] address4 = self._read_value() if address4 is not FAILURE: elements2.append(address4) chunk1 = None if self._offset < self._input_size: chunk1 = self._input[self._offset:self._offset + 1] if chunk1 == '*': address5 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address5 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'*\'') if address5 is not FAILURE: elements2.append(address5) else: elements2 = None self._offset = index3 else: elements2 = None self._offset = index3 if elements2 is None: address3 = FAILURE else: address3 = TreeNode9(self._input[index3:self._offset], index3, elements2) self._offset = self._offset if address3 is not FAILURE: elements1.append(address3) remaining0 -= 1 if remaining0 <= 0: address2 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address2 = FAILURE if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_string(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['any'][index0] = (address0, self._offset) return address0 def _read_attr(self): address0, index0 = FAILURE, self._offset cached = self._cache['attr'].get(index0) if cached: self._offset = cached[1] return cached[0] address0 = self._read_AttributeDescription() self._cache['attr'][index0] = (address0, self._offset) return address0 def _read_value(self): address0, index0 = FAILURE, self._offset cached = self._cache['value'].get(index0) if cached: self._offset = cached[1] return cached[0] remaining0, index1, elements0, address1 = 1, self._offset, [], True while address1 is not FAILURE: address1 = self._read_AttributeValue() if address1 is not FAILURE: elements0.append(address1) remaining0 -= 1 if remaining0 <= 0: address0 = self._actions.return_string(self._input, index1, self._offset, elements0) self._offset = self._offset else: address0 = FAILURE self._cache['value'][index0] = (address0, self._offset) return address0 def _read_AttributeDescription(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttributeDescription'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] address1 = self._read_AttributeType() if address1 is not FAILURE: elements0.append(address1) index2 = self._offset index3, elements1 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == ';': address3 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address3 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('";"') if address3 is not FAILURE: elements1.append(address3) address4 = self._read_options() if address4 is not FAILURE: elements1.append(address4) else: elements1 = None self._offset = index3 else: elements1 = None self._offset = index3 if elements1 is None: address2 = FAILURE else: address2 = TreeNode11(self._input[index3:self._offset], index3, elements1) self._offset = self._offset if address2 is FAILURE: address2 = TreeNode(self._input[index2:index2], index2) self._offset = index2 if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_options(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['AttributeDescription'][index0] = (address0, self._offset) return address0 def _read_AttributeOptions(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttributeOptions'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == ';': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('";"') if address1 is not FAILURE: elements0.append(address1) address2 = self._read_options() if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = TreeNode12(self._input[index1:self._offset], index1, elements0) self._offset = self._offset self._cache['AttributeOptions'][index0] = (address0, self._offset) return address0 def _read_AttributeType(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttributeType'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_LDAP_OID() if address0 is FAILURE: self._offset = index1 address0 = self._read_AttrTypeName() if address0 is FAILURE: self._offset = index1 self._cache['AttributeType'][index0] = (address0, self._offset) return address0 def _read_AttrTypeName(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttrTypeName'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] address1 = self._read_ALPHA() if address1 is not FAILURE: elements0.append(address1) remaining0, index2, elements1, address3 = 0, self._offset, [], True while address3 is not FAILURE: address3 = self._read_AttrTypeChars() if address3 is not FAILURE: elements1.append(address3) remaining0 -= 1 if remaining0 <= 0: address2 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address2 = FAILURE if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_attr_type(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['AttrTypeName'][index0] = (address0, self._offset) return address0 def _read_AttrTypeChars(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttrTypeChars'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_ALPHA() if address0 is FAILURE: self._offset = index1 address0 = self._read_DIGIT() if address0 is FAILURE: self._offset = index1 chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '-': address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('"-"') if address0 is FAILURE: self._offset = index1 self._cache['AttrTypeChars'][index0] = (address0, self._offset) return address0 def _read_LDAP_OID(self): address0, index0 = FAILURE, self._offset cached = self._cache['LDAP_OID'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] remaining0, index2, elements1, address2 = 1, self._offset, [], True while address2 is not FAILURE: address2 = self._read_DIGIT() if address2 is not FAILURE: elements1.append(address2) remaining0 -= 1 if remaining0 <= 0: address1 = TreeNode(self._input[index2:self._offset], index2, elements1) self._offset = self._offset else: address1 = FAILURE if address1 is not FAILURE: elements0.append(address1) remaining1, index3, elements2, address4 = 0, self._offset, [], True while address4 is not FAILURE: index4, elements3 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '.': address5 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address5 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('"."') if address5 is not FAILURE: elements3.append(address5) address6 = FAILURE remaining2, index5, elements4, address7 = 1, self._offset, [], True while address7 is not FAILURE: address7 = self._read_DIGIT() if address7 is not FAILURE: elements4.append(address7) remaining2 -= 1 if remaining2 <= 0: address6 = TreeNode(self._input[index5:self._offset], index5, elements4) self._offset = self._offset else: address6 = FAILURE if address6 is not FAILURE: elements3.append(address6) else: elements3 = None self._offset = index4 else: elements3 = None self._offset = index4 if elements3 is None: address4 = FAILURE else: address4 = TreeNode(self._input[index4:self._offset], index4, elements3) self._offset = self._offset if address4 is not FAILURE: elements2.append(address4) remaining1 -= 1 if remaining1 <= 0: address3 = TreeNode(self._input[index3:self._offset], index3, elements2) self._offset = self._offset else: address3 = FAILURE if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_oid_type(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['LDAP_OID'][index0] = (address0, self._offset) return address0 def _read_options(self): address0, index0 = FAILURE, self._offset cached = self._cache['options'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset index2, elements0 = self._offset, [] address1 = self._read_option() if address1 is not FAILURE: elements0.append(address1) chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == ';': address2 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address2 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('";"') if address2 is not FAILURE: elements0.append(address2) address3 = self._read_options() if address3 is not FAILURE: elements0.append(address3) else: elements0 = None self._offset = index2 else: elements0 = None self._offset = index2 else: elements0 = None self._offset = index2 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_string(self._input, index2, self._offset, elements0) self._offset = self._offset if address0 is FAILURE: self._offset = index1 address0 = self._read_option() if address0 is FAILURE: self._offset = index1 self._cache['options'][index0] = (address0, self._offset) return address0 def _read_option(self): address0, index0 = FAILURE, self._offset cached = self._cache['option'].get(index0) if cached: self._offset = cached[1] return cached[0] remaining0, index1, elements0, address1 = 1, self._offset, [], True while address1 is not FAILURE: address1 = self._read_AttrTypeChars() if address1 is not FAILURE: elements0.append(address1) remaining0 -= 1 if remaining0 <= 0: address0 = self._actions.return_string(self._input, index1, self._offset, elements0) self._offset = self._offset else: address0 = FAILURE self._cache['option'][index0] = (address0, self._offset) return address0 def _read_AttributeValue(self): address0, index0 = FAILURE, self._offset cached = self._cache['AttributeValue'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_EscapedCharacter() if address0 is FAILURE: self._offset = index1 chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_1.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[^!*\\x29]') if address0 is FAILURE: self._offset = index1 self._cache['AttributeValue'][index0] = (address0, self._offset) return address0 def _read_EscapedCharacter(self): address0, index0 = FAILURE, self._offset cached = self._cache['EscapedCharacter'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 == '\\': address1 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address1 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'\\\\\'') if address1 is not FAILURE: elements0.append(address1) address2 = self._read_ASCII_VALUE() if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_escaped_char(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['EscapedCharacter'][index0] = (address0, self._offset) return address0 def _read_ASCII_VALUE(self): address0, index0 = FAILURE, self._offset cached = self._cache['ASCII_VALUE'].get(index0) if cached: self._offset = cached[1] return cached[0] index1, elements0 = self._offset, [] address1 = self._read_HEX_CHAR() if address1 is not FAILURE: elements0.append(address1) address2 = self._read_HEX_CHAR() if address2 is not FAILURE: elements0.append(address2) else: elements0 = None self._offset = index1 else: elements0 = None self._offset = index1 if elements0 is None: address0 = FAILURE else: address0 = self._actions.return_hex(self._input, index1, self._offset, elements0) self._offset = self._offset self._cache['ASCII_VALUE'][index0] = (address0, self._offset) return address0 def _read_HEX_CHAR(self): address0, index0 = FAILURE, self._offset cached = self._cache['HEX_CHAR'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_2.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[a-fA-F0-9]') self._cache['HEX_CHAR'][index0] = (address0, self._offset) return address0 def _read_FILL(self): address0, index0 = FAILURE, self._offset cached = self._cache['FILL'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset address0 = self._read_SPACE() if address0 is FAILURE: self._offset = index1 address0 = self._read_TAB() if address0 is FAILURE: self._offset = index1 address0 = self._read_SEP() if address0 is FAILURE: self._offset = index1 self._cache['FILL'][index0] = (address0, self._offset) return address0 def _read_SPACE(self): address0, index0 = FAILURE, self._offset cached = self._cache['SPACE'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_3.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[\\x20]') self._cache['SPACE'][index0] = (address0, self._offset) return address0 def _read_TAB(self): address0, index0 = FAILURE, self._offset cached = self._cache['TAB'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_4.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[\\x09]') self._cache['TAB'][index0] = (address0, self._offset) return address0 def _read_DIGIT(self): address0, index0 = FAILURE, self._offset cached = self._cache['DIGIT'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_5.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[0-9]') self._cache['DIGIT'][index0] = (address0, self._offset) return address0 def _read_ALPHA(self): address0, index0 = FAILURE, self._offset cached = self._cache['ALPHA'].get(index0) if cached: self._offset = cached[1] return cached[0] chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 1] if chunk0 is not None and Grammar.REGEX_6.search(chunk0): address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('[a-zA-Z]') self._cache['ALPHA'][index0] = (address0, self._offset) return address0 def _read_SEP(self): address0, index0 = FAILURE, self._offset cached = self._cache['SEP'].get(index0) if cached: self._offset = cached[1] return cached[0] index1 = self._offset chunk0 = None if self._offset < self._input_size: chunk0 = self._input[self._offset:self._offset + 2] if chunk0 == '\r\n': address0 = TreeNode(self._input[self._offset:self._offset + 2], self._offset) self._offset = self._offset + 2 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('"\\r\\n"') if address0 is FAILURE: self._offset = index1 chunk1 = None if self._offset < self._input_size: chunk1 = self._input[self._offset:self._offset + 1] if chunk1 == '\n': address0 = TreeNode(self._input[self._offset:self._offset + 1], self._offset) self._offset = self._offset + 1 else: address0 = FAILURE if self._offset > self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('"\\n"') if address0 is FAILURE: self._offset = index1 self._cache['SEP'][index0] = (address0, self._offset) return address0 class Parser(Grammar): def __init__(self, inpt, actions, types): self._input = inpt self._input_size = len(inpt) self._actions = actions self._types = types self._offset = 0 self._cache = defaultdict(dict) self._failure = 0 self._expected = [] def parse(self): tree = self._read_root() if tree is not FAILURE and self._offset == self._input_size: return tree if not self._expected: self._failure = self._offset self._expected.append('<EOF>') raise ParseError(format_error(self._input, self._failure, self._expected)) def format_error(inpt, offset, expected): lines, line_no, position = inpt.split('\n'), 0, 0 while position <= offset: position += len(lines[line_no]) + 1 line_no += 1 message, line = 'Line ' + str(line_no) + ': expected ' + ', '.join(expected) + '\n', lines[line_no - 1] message += line + '\n' position -= len(line) + 1 message += ' ' * (offset - position) return message + '^' def parse(inpt, actions=None, types=None): parser = Parser(inpt, actions, types) return parser.parse()
38.902025
107
0.533622
5,805
59,559
5.231352
0.030491
0.207455
0.116636
0.089568
0.883134
0.867031
0.847669
0.845298
0.769791
0.692143
0
0.039613
0.375661
59,559
1,530
108
38.927451
0.777061
0.0023
0
0.752613
1
0
0.013297
0
0.000697
0
0
0
0
1
0.041812
false
0.000697
0.001394
0
0.119164
0
0
0
0
null
1
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
42533b84f07b2a1083ae86133f281696ee2c26ef
1,625
py
Python
referentiel/models/glpi.py
ZuluPro/snafu
dbd79da4617db315ba7e76a0af6805cc3b1cbae2
[ "BSD-3-Clause" ]
1
2017-12-13T20:28:32.000Z
2017-12-13T20:28:32.000Z
referentiel/models/glpi.py
ZuluPro/snafu
dbd79da4617db315ba7e76a0af6805cc3b1cbae2
[ "BSD-3-Clause" ]
null
null
null
referentiel/models/glpi.py
ZuluPro/snafu
dbd79da4617db315ba7e76a0af6805cc3b1cbae2
[ "BSD-3-Clause" ]
null
null
null
from django.db import models from simple_glpi_manager import SimpleGLPI_Manager class GlpiUrgency(models.Model): """ Static data imported by syncdb (initial_data). """ name = models.CharField(max_length=150, verbose_name='Nom') glpi_id = models.IntegerField(unique=True, blank=True, verbose_name='ID GLPI') class Meta: app_label = 'referentiel' def __unicode__(self): return self.name class GlpiPriority(models.Model): """ Static data imported by syncdb (initial_data). """ name = models.CharField(max_length=150, verbose_name='Nom') glpi_id = models.IntegerField(unique=True, blank=True, verbose_name='ID GLPI') class Meta: app_label = 'referentiel' def __unicode__(self): return self.name class GlpiImpact(models.Model): name = models.CharField(max_length=150, verbose_name='Nom') glpi_id = models.IntegerField(unique=True, verbose_name='ID GLPI') class Meta: app_label = 'referentiel' def __unicode__(self): return self.name class GlpiCategory(models.Model): name = models.CharField(max_length=150, verbose_name='Nom') glpi_id = models.IntegerField(unique=True, verbose_name='ID GLPI') objects = SimpleGLPI_Manager(type='ITILCategory') class Meta: app_label = 'referentiel' ordering = ['name','glpi_id'] def __unicode__(self): return self.name class GlpiSupplier(models.Model): name = models.CharField(max_length=150, verbose_name='Nom') glpi_id = models.IntegerField(unique=True, verbose_name='ID GLPI') objects = SimpleGLPI_Manager(type='supplier') class Meta: app_label = 'referentiel' ordering = ['glpi_id'] def __unicode__(self): return self.name
24.621212
79
0.750154
217
1,625
5.368664
0.21659
0.094421
0.081545
0.094421
0.867811
0.867811
0.806009
0.801717
0.743348
0.743348
0
0.010586
0.128
1,625
65
80
25
0.811574
0.057231
0
0.731707
0
0
0.094577
0
0
0
0
0
0
1
0.121951
false
0
0.04878
0.121951
0.829268
0
0
0
0
null
0
0
0
1
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
1
1
0
0
9
42542ff9a7b44570dd9f721e672d514f921e0fbd
41,272
py
Python
venv/lib/python3.9/site-packages/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
630dcef73e6a258b6e9a52f934e2dd912ce741f8
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.9/site-packages/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
630dcef73e6a258b6e9a52f934e2dd912ce741f8
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.9/site-packages/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
630dcef73e6a258b6e9a52f934e2dd912ce741f8
[ "Apache-2.0" ]
null
null
null
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.cloud.spanner_admin_database_v1.proto import ( backup_pb2 as google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2, ) from google.cloud.spanner_admin_database_v1.proto import ( spanner_database_admin_pb2 as google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2, ) from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, ) from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class DatabaseAdminStub(object): """Cloud Spanner Database Admin API The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also enables updating the schema of pre-existing databases. It can be also used to create, delete and list backups for a database and to restore from an existing backup. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.ListDatabases = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesResponse.FromString, ) self.CreateDatabase = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/CreateDatabase", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.CreateDatabaseRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.GetDatabase = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabase", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.Database.FromString, ) self.UpdateDatabaseDdl = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateDatabaseDdl", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.UpdateDatabaseDdlRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.DropDatabase = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/DropDatabase", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.DropDatabaseRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) self.GetDatabaseDdl = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabaseDdl", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlResponse.FromString, ) self.SetIamPolicy = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/SetIamPolicy", request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString, response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, ) self.GetIamPolicy = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy", request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString, response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, ) self.TestIamPermissions = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/TestIamPermissions", request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString, response_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString, ) self.CreateBackup = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/CreateBackup", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.CreateBackupRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.GetBackup = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/GetBackup", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.GetBackupRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.FromString, ) self.UpdateBackup = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackup", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.UpdateBackupRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.FromString, ) self.DeleteBackup = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackup", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.DeleteBackupRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) self.ListBackups = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackups", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsResponse.FromString, ) self.RestoreDatabase = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/RestoreDatabase", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.RestoreDatabaseRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.ListDatabaseOperations = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabaseOperations", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsResponse.FromString, ) self.ListBackupOperations = channel.unary_unary( "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackupOperations", request_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsResponse.FromString, ) class DatabaseAdminServicer(object): """Cloud Spanner Database Admin API The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also enables updating the schema of pre-existing databases. It can be also used to create, delete and list backups for a database and to restore from an existing backup. """ def ListDatabases(self, request, context): """Lists Cloud Spanner databases. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def CreateDatabase(self, request, context): """Creates a new Cloud Spanner database and starts to prepare it for serving. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track preparation of the database. The [metadata][google.longrunning.Operation.metadata] field type is [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The [response][google.longrunning.Operation.response] field type is [Database][google.spanner.admin.database.v1.Database], if successful. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetDatabase(self, request, context): """Gets the state of a Cloud Spanner database. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def UpdateDatabaseDdl(self, request, context): """Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track execution of the schema change(s). The [metadata][google.longrunning.Operation.metadata] field type is [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def DropDatabase(self, request, context): """Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetDatabaseDdl(self, request, context): """Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def SetIamPolicy(self, request, context): """Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires `spanner.backups.setIamPolicy` permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetIamPolicy(self, request, context): """Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires `spanner.backups.getIamPolicy` permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def TestIamPermissions(self, request, context): """Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def CreateBackup(self, request, context): """Starts creating a new Cloud Spanner Backup. The returned backup [long-running operation][google.longrunning.Operation] will have a name of the format `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>` and can be used to track creation of the backup. The [metadata][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetBackup(self, request, context): """Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def UpdateBackup(self, request, context): """Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def DeleteBackup(self, request, context): """Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListBackups(self, request, context): """Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def RestoreDatabase(self, request, context): """Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database [long-running operation][google.longrunning.Operation] has a name of the format `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`, and can be used to track the progress of the operation, and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is [Database][google.spanner.admin.database.v1.Database], if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListDatabaseOperations(self, request, context): """Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has a name of the form `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. The long-running operation [metadata][google.longrunning.Operation.metadata] field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListBackupOperations(self, request, context): """Lists the backup [long-running operations][google.longrunning.Operation] in the given instance. A backup operation has a name of the form `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`. The long-running operation [metadata][google.longrunning.Operation.metadata] field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.progress.start_time` in descending order starting from the most recently started operation. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def add_DatabaseAdminServicer_to_server(servicer, server): rpc_method_handlers = { "ListDatabases": grpc.unary_unary_rpc_method_handler( servicer.ListDatabases, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesResponse.SerializeToString, ), "CreateDatabase": grpc.unary_unary_rpc_method_handler( servicer.CreateDatabase, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.CreateDatabaseRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "GetDatabase": grpc.unary_unary_rpc_method_handler( servicer.GetDatabase, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.Database.SerializeToString, ), "UpdateDatabaseDdl": grpc.unary_unary_rpc_method_handler( servicer.UpdateDatabaseDdl, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.UpdateDatabaseDdlRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "DropDatabase": grpc.unary_unary_rpc_method_handler( servicer.DropDatabase, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.DropDatabaseRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), "GetDatabaseDdl": grpc.unary_unary_rpc_method_handler( servicer.GetDatabaseDdl, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlResponse.SerializeToString, ), "SetIamPolicy": grpc.unary_unary_rpc_method_handler( servicer.SetIamPolicy, request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.FromString, response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, ), "GetIamPolicy": grpc.unary_unary_rpc_method_handler( servicer.GetIamPolicy, request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString, response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, ), "TestIamPermissions": grpc.unary_unary_rpc_method_handler( servicer.TestIamPermissions, request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.FromString, response_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.SerializeToString, ), "CreateBackup": grpc.unary_unary_rpc_method_handler( servicer.CreateBackup, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.CreateBackupRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "GetBackup": grpc.unary_unary_rpc_method_handler( servicer.GetBackup, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.GetBackupRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.SerializeToString, ), "UpdateBackup": grpc.unary_unary_rpc_method_handler( servicer.UpdateBackup, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.UpdateBackupRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.SerializeToString, ), "DeleteBackup": grpc.unary_unary_rpc_method_handler( servicer.DeleteBackup, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.DeleteBackupRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), "ListBackups": grpc.unary_unary_rpc_method_handler( servicer.ListBackups, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsResponse.SerializeToString, ), "RestoreDatabase": grpc.unary_unary_rpc_method_handler( servicer.RestoreDatabase, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.RestoreDatabaseRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "ListDatabaseOperations": grpc.unary_unary_rpc_method_handler( servicer.ListDatabaseOperations, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsResponse.SerializeToString, ), "ListBackupOperations": grpc.unary_unary_rpc_method_handler( servicer.ListBackupOperations, request_deserializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsRequest.FromString, response_serializer=google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( "google.spanner.admin.database.v1.DatabaseAdmin", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class DatabaseAdmin(object): """Cloud Spanner Database Admin API The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also enables updating the schema of pre-existing databases. It can be also used to create, delete and list backups for a database and to restore from an existing backup. """ @staticmethod def ListDatabases( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabasesResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def CreateDatabase( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/CreateDatabase", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.CreateDatabaseRequest.SerializeToString, google_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetDatabase( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabase", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.Database.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def UpdateDatabaseDdl( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateDatabaseDdl", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.UpdateDatabaseDdlRequest.SerializeToString, google_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def DropDatabase( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/DropDatabase", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.DropDatabaseRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetDatabaseDdl( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabaseDdl", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.GetDatabaseDdlResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def SetIamPolicy( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/SetIamPolicy", google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString, google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetIamPolicy( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy", google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString, google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def TestIamPermissions( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/TestIamPermissions", google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString, google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def CreateBackup( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/CreateBackup", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.CreateBackupRequest.SerializeToString, google_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetBackup( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/GetBackup", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.GetBackupRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def UpdateBackup( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackup", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.UpdateBackupRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.Backup.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def DeleteBackup( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackup", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.DeleteBackupRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def ListBackups( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackups", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def RestoreDatabase( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/RestoreDatabase", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.RestoreDatabaseRequest.SerializeToString, google_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def ListDatabaseOperations( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabaseOperations", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_spanner__database__admin__pb2.ListDatabaseOperationsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def ListBackupOperations( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.spanner.admin.database.v1.DatabaseAdmin/ListBackupOperations", google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsRequest.SerializeToString, google_dot_cloud_dot_spanner__admin__database__v1_dot_proto_dot_backup__pb2.ListBackupOperationsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, )
46.0625
175
0.711524
4,276
41,272
6.416277
0.06899
0.050299
0.083831
0.092215
0.845604
0.833686
0.824902
0.777081
0.77165
0.69766
0
0.008047
0.226182
41,272
895
176
46.113966
0.851019
0.175543
0
0.697443
1
0
0.095794
0.065677
0
0
0
0
0
1
0.051136
false
0
0.009943
0.024148
0.089489
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
42765938de7638f1581fb56099a27e7ffc066ef3
6,693
py
Python
tests/server/blueprints/variants/test_variants_views.py
gmc-norr/scout
ea8eaaa079c63e4033af6216ec08da4a314f9b5c
[ "BSD-3-Clause" ]
null
null
null
tests/server/blueprints/variants/test_variants_views.py
gmc-norr/scout
ea8eaaa079c63e4033af6216ec08da4a314f9b5c
[ "BSD-3-Clause" ]
null
null
null
tests/server/blueprints/variants/test_variants_views.py
gmc-norr/scout
ea8eaaa079c63e4033af6216ec08da4a314f9b5c
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from flask import url_for, current_app from flask_login import current_user from urllib.parse import urlencode def test_variants(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the variants page resp = client.get( url_for( "variants.variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ) ) # THEN it should return a page assert resp.status_code == 200 def test_variants_research(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the variants page resp = client.get( url_for( "variants.variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], variant_type="research", ) ) # THEN it should return a page assert resp.status_code == 200 # THEN a reset filters link with variant type should have been made assert "variant_type=research" in str(resp.data) def test_variants_post_data(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN submitting form data to the page (POST method) data = urlencode({"clinical_filter": True}) # clinical filter # WHEN requesting a clinical filter to variants page resp = client.post( url_for( "variants.variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ), data=data, content_type="application/x-www-form-urlencoded", ) # THEN it should return a page assert resp.status_code == 200 def test_sv_variants(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the sv-variants page resp = client.get( url_for( "variants.sv_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ) ) # THEN it should return a page assert resp.status_code == 200 def test_sv_variants_research(app, institute_obj, case_obj): with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the sv-variants page resp = client.get( url_for( "variants.sv_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], variant_type="research", ) ) # THEN it should return a page assert resp.status_code == 200 # THEN a reset filters link with variant type should have been made assert "variant_type=research" in str(resp.data) def test_sv_variants_post_data(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN requesting a clinical filter from the page (POST method) data = urlencode({"clinical_filter": True}) # clinical filter # WHEN posting an update description request to panel page resp = client.post( url_for( "variants.sv_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ), data=data, content_type="application/x-www-form-urlencoded", ) # THEN it should return a page assert resp.status_code == 200 def test_str_variants(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the str-variants page resp = client.get( url_for( "variants.str_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ) ) # THEN it should return a page assert resp.status_code == 200 def test_cancer_variants(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the sv-variants page resp = client.get( url_for( "variants.cancer_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ) ) # THEN it should return a page assert resp.status_code == 200 def test_sv_cancer_variants(app, institute_obj, case_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for("auto_login")) assert resp.status_code == 200 # WHEN accessing the sv-variants page resp = client.get( url_for( "variants.cancer_sv_variants", institute_id=institute_obj["internal_id"], case_name=case_obj["display_name"], ) ) # THEN it should return a page assert resp.status_code == 200
32.023923
75
0.610489
851
6,693
4.60517
0.101058
0.029089
0.073488
0.09186
0.950498
0.937739
0.937739
0.916816
0.906864
0.906864
0
0.01191
0.310025
6,693
208
76
32.177885
0.836726
0.258479
0
0.743802
0
0
0.129072
0.036645
0
0
0
0
0.165289
1
0.07438
false
0
0.024793
0
0.099174
0
0
0
0
null
0
0
0
1
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
7
42a1b612111ab28cbbfceb96f206538a92d32e7a
273,275
py
Python
french_law/python/src/allocations_familiales.py
pnmadelaine/catala
d301e0f434e744fe0557fcd612b841c448eeeaf6
[ "Apache-2.0" ]
null
null
null
french_law/python/src/allocations_familiales.py
pnmadelaine/catala
d301e0f434e744fe0557fcd612b841c448eeeaf6
[ "Apache-2.0" ]
null
null
null
french_law/python/src/allocations_familiales.py
pnmadelaine/catala
d301e0f434e744fe0557fcd612b841c448eeeaf6
[ "Apache-2.0" ]
null
null
null
# This file has been generated by the Catala compiler, do not edit! from .catala import * from typing import Any, List, Callable, Tuple from enum import Enum class PriseEnCharge_Code(Enum): GardeAlterneePartageAllocations = 0 GardeAlterneeAllocataireUnique = 1 EffectiveEtPermanente = 2 ServicesSociauxAllocationVerseeALaFamille = 3 ServicesSociauxAllocationVerseeAuxServicesSociaux = 4 class PriseEnCharge: def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, PriseEnCharge): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class SituationObligationScolaire_Code(Enum): Avant = 0 Pendant = 1 Apres = 2 class SituationObligationScolaire: def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, SituationObligationScolaire): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class Collectivite_Code(Enum): Guadeloupe = 0 Guyane = 1 Martinique = 2 LaReunion = 3 SaintBarthelemy = 4 SaintMartin = 5 Metropole = 6 SaintPierreEtMiquelon = 7 Mayotte = 8 class Collectivite: def __init__(self, code: Collectivite_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, Collectivite): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class PriseEnCompte_Code(Enum): Complete = 0 Partagee = 1 Zero = 2 class PriseEnCompte: def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, PriseEnCompte): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class VersementAllocations_Code(Enum): Normal = 0 AllocationVerseeAuxServicesSociaux = 1 class VersementAllocations: def __init__(self, code: VersementAllocations_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, VersementAllocations): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class ElementPrestationsFamiliales_Code(Enum): PrestationAccueilJeuneEnfant = 0 AllocationsFamiliales = 1 ComplementFamilial = 2 AllocationLogement = 3 AllocationEducationEnfantHandicape = 4 AllocationSoutienFamilial = 5 AllocationRentreeScolaire = 6 AllocationJournalierePresenceParentale = 7 class ElementPrestationsFamiliales: def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: self.code = code self.value = value def __eq__(self, other: object) -> bool: if isinstance(other, ElementPrestationsFamiliales): return self.code == other.code and self.value == other.value else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "{}({})".format(self.code, self.value) class EnfantEntree: def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: self.d_identifiant = d_identifiant self.d_remuneration_mensuelle = d_remuneration_mensuelle self.d_date_de_naissance = d_date_de_naissance self.d_prise_en_charge = d_prise_en_charge self.d_a_deja_ouvert_droit_aux_allocations_familiales = d_a_deja_ouvert_droit_aux_allocations_familiales def __eq__(self, other: object) -> bool: if isinstance(other, EnfantEntree): return (self.d_identifiant == other.d_identifiant and self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and self.d_date_de_naissance == other.d_date_de_naissance and self.d_prise_en_charge == other.d_prise_en_charge and self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.d_identifiant, self.d_remuneration_mensuelle, self.d_date_de_naissance, self.d_prise_en_charge, self.d_a_deja_ouvert_droit_aux_allocations_familiales) class Enfant: def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: self.identifiant = identifiant self.obligation_scolaire = obligation_scolaire self.remuneration_mensuelle = remuneration_mensuelle self.date_de_naissance = date_de_naissance self.age = age self.prise_en_charge = prise_en_charge self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales def __eq__(self, other: object) -> bool: if isinstance(other, Enfant): return (self.identifiant == other.identifiant and self.obligation_scolaire == other.obligation_scolaire and self.remuneration_mensuelle == other.remuneration_mensuelle and self.date_de_naissance == other.date_de_naissance and self.age == other.age and self.prise_en_charge == other.prise_en_charge and self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.identifiant, self.obligation_scolaire, self.remuneration_mensuelle, self.date_de_naissance, self.age, self.prise_en_charge, self.a_deja_ouvert_droit_aux_allocations_familiales) class SmicOut: def __init__(self, brut_horaire_out: Money) -> None: self.brut_horaire_out = brut_horaire_out def __eq__(self, other: object) -> bool: if isinstance(other, SmicOut): return (self.brut_horaire_out == other.brut_horaire_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "SmicOut(brut_horaire_out={})".format(self.brut_horaire_out) class SmicIn: def __init__(self, date_courante_in: Date, residence_in: Collectivite) -> None: self.date_courante_in = date_courante_in self.residence_in = residence_in def __eq__(self, other: object) -> bool: if isinstance(other, SmicIn): return (self.date_courante_in == other.date_courante_in and self.residence_in == other.residence_in) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "SmicIn(date_courante_in={},residence_in={})".format(self.date_courante_in, self.residence_in) class PrestationsFamilialesOut: def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool, base_mensuelle_out: Money) -> None: self.droit_ouvert_out = droit_ouvert_out self.conditions_hors_age_out = conditions_hors_age_out self.age_l512_3_2_out = age_l512_3_2_out self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out self.base_mensuelle_out = base_mensuelle_out def __eq__(self, other: object) -> bool: if isinstance(other, PrestationsFamilialesOut): return (self.droit_ouvert_out == other.droit_ouvert_out and self.conditions_hors_age_out == other.conditions_hors_age_out and self.age_l512_3_2_out == other.age_l512_3_2_out and self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out and self.base_mensuelle_out == other.base_mensuelle_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={},base_mensuelle_out={})".format(self.droit_ouvert_out, self.conditions_hors_age_out, self.age_l512_3_2_out, self.regime_outre_mer_l751_1_out, self.base_mensuelle_out) class PrestationsFamilialesIn: def __init__(self, date_courante_in: Date, prestation_courante_in: ElementPrestationsFamiliales, residence_in: Collectivite) -> None: self.date_courante_in = date_courante_in self.prestation_courante_in = prestation_courante_in self.residence_in = residence_in def __eq__(self, other: object) -> bool: if isinstance(other, PrestationsFamilialesIn): return (self.date_courante_in == other.date_courante_in and self.prestation_courante_in == other.prestation_courante_in and self.residence_in == other.residence_in) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "PrestationsFamilialesIn(date_courante_in={},prestation_courante_in={},residence_in={})".format(self.date_courante_in, self.prestation_courante_in, self.residence_in) class AllocationFamilialesAvril2008Out: def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out def __eq__(self, other: object) -> bool: if isinstance(other, AllocationFamilialesAvril2008Out): return (self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) class AllocationFamilialesAvril2008In: def __init__(self, ) -> None: pass def __eq__(self, other: object) -> bool: if isinstance(other, AllocationFamilialesAvril2008In): return (True) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "AllocationFamilialesAvril2008In()".format() class EnfantLePlusAgeOut: def __init__(self, le_plus_age_out: Enfant) -> None: self.le_plus_age_out = le_plus_age_out def __eq__(self, other: object) -> bool: if isinstance(other, EnfantLePlusAgeOut): return (self.le_plus_age_out == other.le_plus_age_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "EnfantLePlusAgeOut(le_plus_age_out={})".format(self.le_plus_age_out) class EnfantLePlusAgeIn: def __init__(self, enfants_in: List[Enfant]) -> None: self.enfants_in = enfants_in def __eq__(self, other: object) -> bool: if isinstance(other, EnfantLePlusAgeIn): return (self.enfants_in == other.enfants_in) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "EnfantLePlusAgeIn(enfants_in={})".format(self.enfants_in) class AllocationsFamilialesOut: def __init__(self, montant_verse_out: Money) -> None: self.montant_verse_out = montant_verse_out def __eq__(self, other: object) -> bool: if isinstance(other, AllocationsFamilialesOut): return (self.montant_verse_out == other.montant_verse_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "AllocationsFamilialesOut(montant_verse_out={})".format(self.montant_verse_out) class AllocationsFamilialesIn: def __init__(self, personne_charge_effective_permanente_est_parent_in: bool, personne_charge_effective_permanente_remplit_titre_I_in: bool, ressources_menage_in: Money, residence_in: Collectivite, date_courante_in: Date, enfants_a_charge_in: List[Enfant], avait_enfant_a_charge_avant_1er_janvier_2012_in: bool) -> None: self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in self.ressources_menage_in = ressources_menage_in self.residence_in = residence_in self.date_courante_in = date_courante_in self.enfants_a_charge_in = enfants_a_charge_in self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in def __eq__(self, other: object) -> bool: if isinstance(other, AllocationsFamilialesIn): return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and self.ressources_menage_in == other.ressources_menage_in and self.residence_in == other.residence_in and self.date_courante_in == other.date_courante_in and self.enfants_a_charge_in == other.enfants_a_charge_in and self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.personne_charge_effective_permanente_est_parent_in, self.personne_charge_effective_permanente_remplit_titre_I_in, self.ressources_menage_in, self.residence_in, self.date_courante_in, self.enfants_a_charge_in, self.avait_enfant_a_charge_avant_1er_janvier_2012_in) class InterfaceAllocationsFamilialesOut: def __init__(self, i_montant_verse_out: Money) -> None: self.i_montant_verse_out = i_montant_verse_out def __eq__(self, other: object) -> bool: if isinstance(other, InterfaceAllocationsFamilialesOut): return (self.i_montant_verse_out == other.i_montant_verse_out) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "InterfaceAllocationsFamilialesOut(i_montant_verse_out={})".format(self.i_montant_verse_out) class InterfaceAllocationsFamilialesIn: def __init__(self, i_date_courante_in: Date, i_enfants_in: List[EnfantEntree], i_ressources_menage_in: Money, i_residence_in: Collectivite, i_personne_charge_effective_permanente_est_parent_in: bool, i_personne_charge_effective_permanente_remplit_titre_I_in: bool, i_avait_enfant_a_charge_avant_1er_janvier_2012_in: bool) -> None: self.i_date_courante_in = i_date_courante_in self.i_enfants_in = i_enfants_in self.i_ressources_menage_in = i_ressources_menage_in self.i_residence_in = i_residence_in self.i_personne_charge_effective_permanente_est_parent_in = i_personne_charge_effective_permanente_est_parent_in self.i_personne_charge_effective_permanente_remplit_titre_I_in = i_personne_charge_effective_permanente_remplit_titre_I_in self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in = i_avait_enfant_a_charge_avant_1er_janvier_2012_in def __eq__(self, other: object) -> bool: if isinstance(other, InterfaceAllocationsFamilialesIn): return (self.i_date_courante_in == other.i_date_courante_in and self.i_enfants_in == other.i_enfants_in and self.i_ressources_menage_in == other.i_ressources_menage_in and self.i_residence_in == other.i_residence_in and self.i_personne_charge_effective_permanente_est_parent_in == other.i_personne_charge_effective_permanente_est_parent_in and self.i_personne_charge_effective_permanente_remplit_titre_I_in == other.i_personne_charge_effective_permanente_remplit_titre_I_in and self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in == other.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) else: return False def __ne__(self, other: object) -> bool: return not (self == other) def __str__(self) -> str: return "InterfaceAllocationsFamilialesIn(i_date_courante_in={},i_enfants_in={},i_ressources_menage_in={},i_residence_in={},i_personne_charge_effective_permanente_est_parent_in={},i_personne_charge_effective_permanente_remplit_titre_I_in={},i_avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.i_date_courante_in, self.i_enfants_in, self.i_ressources_menage_in, self.i_residence_in, self.i_personne_charge_effective_permanente_est_parent_in, self.i_personne_charge_effective_permanente_remplit_titre_I_in, self.i_avait_enfant_a_charge_avant_1er_janvier_2012_in) def smic(smic_in_1: SmicIn): date_courante_2 = smic_in_1.date_courante_in residence_3 = smic_in_1.residence_in try: def local_var_16(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=219, start_column=5, end_line=228, end_column=6, law_headings=["Article 1", "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= date_of_numbers(2019, 12, 31)) and ((residence_3 == Collectivite(Collectivite_Code.Metropole, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guyane, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Martinique, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.LaReunion, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, Unit())) or (residence_3 == Collectivite(Collectivite_Code.SaintPierreEtMiquelon, Unit())))))))))))): return money_of_cents_string("1003") else: raise EmptyError def local_var_14(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=237, start_column=5, end_line=239, end_column=6, law_headings=["Article 1", "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= date_of_numbers(2019, 12, 31)) and (residence_3 == Collectivite(Collectivite_Code.Mayotte, Unit()))))): return money_of_cents_string("757") else: raise EmptyError def local_var_12(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=258, start_column=5, end_line=267, end_column=6, law_headings=["Article 1", "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= date_of_numbers(2020, 12, 31)) and ((residence_3 == Collectivite(Collectivite_Code.Metropole, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guyane, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Martinique, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.LaReunion, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, Unit())) or (residence_3 == Collectivite(Collectivite_Code.SaintPierreEtMiquelon, Unit())))))))))))): return money_of_cents_string("1015") else: raise EmptyError def local_var_10(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=276, start_column=5, end_line=278, end_column=6, law_headings=["Article 1", "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= date_of_numbers(2020, 12, 31)) and (residence_3 == Collectivite(Collectivite_Code.Mayotte, Unit()))))): return money_of_cents_string("766") else: raise EmptyError def local_var_8(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=297, start_column=5, end_line=306, end_column=6, law_headings=["Article 1", "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= date_of_numbers(2021, 12, 31)) and ((residence_3 == Collectivite(Collectivite_Code.Metropole, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Guyane, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.Martinique, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.LaReunion, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, Unit())) or (residence_3 == Collectivite(Collectivite_Code.SaintPierreEtMiquelon, Unit())))))))))))): return money_of_cents_string("1025") else: raise EmptyError def local_var_6(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=315, start_column=5, end_line=317, end_column=6, law_headings=["Article 1", "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", "Montant du salaire minimum de croissance", "Décrets divers"]), ((date_courante_2 >= date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= date_of_numbers(2021, 12, 31)) and (residence_3 == Collectivite(Collectivite_Code.Mayotte, Unit()))))): return money_of_cents_string("774") else: raise EmptyError def local_var_18(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=43, start_column=10, end_line=43, end_column=22, law_headings=["Prologue"]), True) def local_var_20(_: Any): raise EmptyError local_var_5 = handle_default([local_var_6, local_var_8, local_var_10, local_var_12, local_var_14, local_var_16], local_var_18, local_var_20) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=43, start_column=10, end_line=43, end_column=22, law_headings=["Prologue"])) brut_horaire_4 = log_variable_definition(["Smic", "brut_horaire"], local_var_5) return SmicOut(brut_horaire_out=brut_horaire_4) def allocation_familiales_avril2008(allocation_familiales_avril2008_in_22: AllocationFamilialesAvril2008In): try: local_var_24 = integer_of_string("16") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=81, start_column=10, end_line=81, end_column=37, law_headings=["Prologue"])) age_minimum_alinea_1_l521_3_23 = log_variable_definition(["AllocationFamilialesAvril2008", "âge_minimum_alinéa_1_l521_3"], local_var_24) return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3_23) def enfant_le_plus_age(enfant_le_plus_age_in_25: EnfantLePlusAgeIn): enfants_26 = enfant_le_plus_age_in_25.enfants_in try: def local_var_29(acc_30: Any, item_31: Any): if (acc_30.age > item_31.age): return acc_30 else: return item_31 local_var_28 = list_fold_left(local_var_29, Enfant(identifiant=- integer_of_string("1"), obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, Unit()), remuneration_mensuelle=money_of_cents_string("0"), date_de_naissance=date_of_numbers( 1900, 1, 1), age=integer_of_string("0"), prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, Unit()), a_deja_ouvert_droit_aux_allocations_familiales=False), enfants_26) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=85, start_column=10, end_line=85, end_column=21, law_headings=["Prologue"])) le_plus_age_27 = log_variable_definition(["EnfantLePlusÂgé", "le_plus_âgé"], local_var_28) return EnfantLePlusAgeOut(le_plus_age_out=le_plus_age_27) def prestations_familiales(prestations_familiales_in_32: PrestationsFamilialesIn): date_courante_33 = prestations_familiales_in_32.date_courante_in prestation_courante_34 = prestations_familiales_in_32.prestation_courante_in residence_35 = prestations_familiales_in_32.residence_in try: local_var_37 = integer_of_string("20") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=68, start_column=10, end_line=68, end_column=22, law_headings=["Prologue"])) age_l512_3_2_36 = log_variable_definition(["PrestationsFamiliales", "âge_l512_3_2"], local_var_37) try: def local_var_44(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=24, start_column=5, end_line=25, end_column=34, law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", "Montant de la base mensuelle des allocations familiales", "Décrets divers"]), ((date_courante_33 >= date_of_numbers(2019, 4, 1)) and (date_courante_33 < date_of_numbers(2020, 4, 1)))): return money_of_cents_string("41316") else: raise EmptyError def local_var_42(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=44, start_column=5, end_line=45, end_column=34, law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", "Montant de la base mensuelle des allocations familiales", "Décrets divers"]), ((date_courante_33 >= date_of_numbers(2020, 4, 1)) and (date_courante_33 < date_of_numbers(2021, 4, 1)))): return money_of_cents_string("41404") else: raise EmptyError def local_var_40(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=60, start_column=5, end_line=61, end_column=34, law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", "Montant de la base mensuelle des allocations familiales", "Décrets divers"]), ((date_courante_33 >= date_of_numbers(2021, 4, 1)) and (date_courante_33 < date_of_numbers(2022, 4, 1)))): return money_of_cents_string("41481") else: raise EmptyError def local_var_46(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=74, start_column=10, end_line=74, end_column=24, law_headings=["Prologue"]), True) def local_var_48(_: Any): raise EmptyError local_var_39 = handle_default([local_var_40, local_var_42, local_var_44], local_var_46, local_var_48) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=74, start_column=10, end_line=74, end_column=24, law_headings=["Prologue"])) base_mensuelle_38 = log_variable_definition(["PrestationsFamiliales", "base_mensuelle"], local_var_39) try: local_var_51 = log_variable_definition(["PrestationsFamiliales", "smic.date_courante"], date_courante_33) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=41, start_column=10, end_line=41, end_column=23, law_headings=["Prologue"])) smic_dot_date_courante_50 = local_var_51 try: local_var_53 = log_variable_definition(["PrestationsFamiliales", "smic.résidence"], residence_35) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=42, start_column=10, end_line=42, end_column=19, law_headings=["Prologue"])) smic_dot_residence_52 = local_var_53 result_54 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, SmicIn(date_courante_in=smic_dot_date_courante_50, residence_in=smic_dot_residence_52))) smic_dot_brut_horaire_55 = result_54.brut_horaire_out try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=354, start_column=5, end_line=359, end_column=30, law_headings=["Article L751-1", "Chapitre 1er : Généralités", "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", "Livre 7 : Régimes divers - Dispositions diverses", "Partie législative", "Code de la sécurité sociale"]), ((residence_35 == Collectivite(Collectivite_Code.Guadeloupe, Unit())) or ((residence_35 == Collectivite(Collectivite_Code.Guyane, Unit())) or ((residence_35 == Collectivite(Collectivite_Code.Martinique, Unit())) or ((residence_35 == Collectivite(Collectivite_Code.LaReunion, Unit())) or ((residence_35 == Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or (residence_35 == Collectivite(Collectivite_Code.SaintMartin, Unit())))))))): local_var_57 = True else: raise EmptyError except EmptyError: local_var_57 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=69, start_column=10, end_line=69, end_column=33, law_headings=["Prologue"])) regime_outre_mer_l751_1_56 = log_variable_definition(["PrestationsFamiliales", "régime_outre_mer_l751_1"], local_var_57) try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", start_line=216, start_column=18, end_line=216, end_column=41, law_headings=["Article R755-0-2", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets en Conseil d'Etat", "Code de la sécurité sociale"]), regime_outre_mer_l751_1_56): local_var_59 = ((smic_dot_brut_horaire_55 * decimal_of_string("0.55")) * decimal_of_string("169.")) else: raise EmptyError except EmptyError: local_var_59 = ((smic_dot_brut_horaire_55 * decimal_of_string("0.55")) * decimal_of_string("169.")) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=67, start_column=11, end_line=67, end_column=27, law_headings=["Prologue"])) plafond_l512_3_2_58 = log_variable_definition(["PrestationsFamiliales", "plafond_l512_3_2"], local_var_59) try: def local_var_61(param_62: Enfant): try: try: match_arg_529 = param_62.obligation_scolaire if match_arg_529.code == SituationObligationScolaire_Code.Avant: _ = match_arg_529.value local_var_63 = True elif match_arg_529.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_529.value local_var_63 = False elif match_arg_529.code == SituationObligationScolaire_Code.Apres: _ = match_arg_529.value local_var_63 = False match_arg_530 = param_62.obligation_scolaire if match_arg_530.code == SituationObligationScolaire_Code.Avant: _ = match_arg_530.value local_var_71 = False elif match_arg_530.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_530.value local_var_71 = False elif match_arg_530.code == SituationObligationScolaire_Code.Apres: _ = match_arg_530.value local_var_71 = True match_arg_531 = param_62.obligation_scolaire if match_arg_531.code == SituationObligationScolaire_Code.Avant: _ = match_arg_531.value local_var_67 = False elif match_arg_531.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_531.value local_var_67 = True elif match_arg_531.code == SituationObligationScolaire_Code.Apres: _ = match_arg_531.value local_var_67 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=68, start_column=5, end_line=71, end_column=57, law_headings=["Article L512-3", "Chapitre 2 : Champ d'application", "Titre 1 : Champ d'application - Généralités", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), ((local_var_63 or (local_var_67 or local_var_71)) and (param_62.remuneration_mensuelle <= plafond_l512_3_2_58))): return True else: raise EmptyError except EmptyError: return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=66, start_column=10, end_line=66, end_column=29, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=66, start_column=10, end_line=66, end_column=29, law_headings=["Prologue"])) conditions_hors_age_60 = log_variable_definition(["PrestationsFamiliales", "conditions_hors_âge"], local_var_61) try: def local_var_76(param_77: Enfant): try: def local_var_84(_: Any): match_arg_532 = param_77.obligation_scolaire if match_arg_532.code == SituationObligationScolaire_Code.Avant: _ = match_arg_532.value local_var_90 = False elif match_arg_532.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_532.value local_var_90 = True elif match_arg_532.code == SituationObligationScolaire_Code.Apres: _ = match_arg_532.value local_var_90 = False match_arg_533 = param_77.obligation_scolaire if match_arg_533.code == SituationObligationScolaire_Code.Avant: _ = match_arg_533.value local_var_86 = True elif match_arg_533.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_533.value local_var_86 = False elif match_arg_533.code == SituationObligationScolaire_Code.Apres: _ = match_arg_533.value local_var_86 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=49, start_column=5, end_line=50, end_column=50, law_headings=["Article L512-3", "Chapitre 2 : Champ d'application", "Titre 1 : Champ d'application - Généralités", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), (local_var_86 or local_var_90)): return True else: raise EmptyError def local_var_78(_: Any): match_arg_534 = param_77.obligation_scolaire if match_arg_534.code == SituationObligationScolaire_Code.Avant: _ = match_arg_534.value local_var_80 = False elif match_arg_534.code == SituationObligationScolaire_Code.Pendant: _ = match_arg_534.value local_var_80 = False elif match_arg_534.code == SituationObligationScolaire_Code.Apres: _ = match_arg_534.value local_var_80 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=60, start_column=5, end_line=62, end_column=32, law_headings=["Article L512-3", "Chapitre 2 : Champ d'application", "Titre 1 : Champ d'application - Généralités", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), (local_var_80 and ((param_77.remuneration_mensuelle <= plafond_l512_3_2_58) and (param_77.age < age_l512_3_2_36)))): return True else: raise EmptyError def local_var_94(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=22, law_headings=["Prologue"]), True) def local_var_96(_: Any): return False return handle_default([local_var_78, local_var_84], local_var_94, local_var_96) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=22, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=22, law_headings=["Prologue"])) droit_ouvert_75 = log_variable_definition(["PrestationsFamiliales", "droit_ouvert"], local_var_76) return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert_75, conditions_hors_age_out=conditions_hors_age_60, age_l512_3_2_out=age_l512_3_2_36, regime_outre_mer_l751_1_out=regime_outre_mer_l751_1_56, base_mensuelle_out=base_mensuelle_38) def allocations_familiales(allocations_familiales_in_98: AllocationsFamilialesIn): personne_charge_effective_permanente_est_parent_99 = allocations_familiales_in_98.personne_charge_effective_permanente_est_parent_in personne_charge_effective_permanente_remplit_titre__i_100 = allocations_familiales_in_98.personne_charge_effective_permanente_remplit_titre_I_in ressources_menage_101 = allocations_familiales_in_98.ressources_menage_in residence_102 = allocations_familiales_in_98.residence_in date_courante_103 = allocations_familiales_in_98.date_courante_in enfants_a_charge_104 = allocations_familiales_in_98.enfants_a_charge_in avait_enfant_a_charge_avant_1er_janvier_2012_105 = allocations_familiales_in_98.avait_enfant_a_charge_avant_1er_janvier_2012_in try: def local_var_107(param_108: Enfant): try: def local_var_141(_: Any): match_arg_535 = param_108.prise_en_charge if match_arg_535.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_535.value local_var_143 = False elif match_arg_535.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_535.value local_var_143 = False elif match_arg_535.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_535.value local_var_143 = True elif match_arg_535.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_535.value local_var_143 = False elif match_arg_535.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_535.value local_var_143 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=184, start_column=5, end_line=184, end_column=60, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_143): return PriseEnCompte(PriseEnCompte_Code.Complete, Unit()) else: raise EmptyError def local_var_133(_: Any): match_arg_536 = param_108.prise_en_charge if match_arg_536.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_536.value local_var_135 = False elif match_arg_536.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_536.value local_var_135 = True elif match_arg_536.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_536.value local_var_135 = False elif match_arg_536.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_536.value local_var_135 = False elif match_arg_536.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_536.value local_var_135 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=204, start_column=5, end_line=204, end_column=69, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_135): return PriseEnCompte(PriseEnCompte_Code.Complete, Unit()) else: raise EmptyError def local_var_125(_: Any): match_arg_537 = param_108.prise_en_charge if match_arg_537.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_537.value local_var_127 = True elif match_arg_537.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_537.value local_var_127 = False elif match_arg_537.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_537.value local_var_127 = False elif match_arg_537.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_537.value local_var_127 = False elif match_arg_537.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_537.value local_var_127 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=214, start_column=5, end_line=214, end_column=70, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_127): return PriseEnCompte(PriseEnCompte_Code.Partagee, Unit()) else: raise EmptyError def local_var_117(_: Any): match_arg_538 = param_108.prise_en_charge if match_arg_538.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_538.value local_var_119 = False elif match_arg_538.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_538.value local_var_119 = False elif match_arg_538.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_538.value local_var_119 = False elif match_arg_538.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_538.value local_var_119 = False elif match_arg_538.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_538.value local_var_119 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=253, start_column=5, end_line=254, end_column=56, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_119): return PriseEnCompte(PriseEnCompte_Code.Zero, Unit()) else: raise EmptyError def local_var_109(_: Any): match_arg_539 = param_108.prise_en_charge if match_arg_539.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_539.value local_var_111 = False elif match_arg_539.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_539.value local_var_111 = False elif match_arg_539.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_539.value local_var_111 = False elif match_arg_539.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_539.value local_var_111 = True elif match_arg_539.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_539.value local_var_111 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=263, start_column=5, end_line=264, end_column=48, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_111): return PriseEnCompte(PriseEnCompte_Code.Complete, Unit()) else: raise EmptyError def local_var_149(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, end_column=26, law_headings=["Prologue"]), True) def local_var_151(_: Any): raise EmptyError return handle_default([local_var_109, local_var_117, local_var_125, local_var_133, local_var_141], local_var_149, local_var_151) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, end_column=26, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, end_column=26, law_headings=["Prologue"])) prise_en_compte_106 = log_variable_definition(["AllocationsFamiliales", "prise_en_compte"], local_var_107) try: def local_var_154(param_155: Enfant): try: def local_var_188(_: Any): match_arg_540 = param_155.prise_en_charge if match_arg_540.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_540.value local_var_190 = False elif match_arg_540.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_540.value local_var_190 = False elif match_arg_540.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_540.value local_var_190 = True elif match_arg_540.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_540.value local_var_190 = False elif match_arg_540.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_540.value local_var_190 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=188, start_column=5, end_line=188, end_column=60, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_190): return VersementAllocations(VersementAllocations_Code.Normal, Unit()) else: raise EmptyError def local_var_180(_: Any): match_arg_541 = param_155.prise_en_charge if match_arg_541.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_541.value local_var_182 = False elif match_arg_541.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_541.value local_var_182 = True elif match_arg_541.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_541.value local_var_182 = False elif match_arg_541.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_541.value local_var_182 = False elif match_arg_541.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_541.value local_var_182 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=208, start_column=5, end_line=208, end_column=69, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_182): return VersementAllocations(VersementAllocations_Code.Normal, Unit()) else: raise EmptyError def local_var_172(_: Any): match_arg_542 = param_155.prise_en_charge if match_arg_542.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_542.value local_var_174 = True elif match_arg_542.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_542.value local_var_174 = False elif match_arg_542.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_542.value local_var_174 = False elif match_arg_542.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_542.value local_var_174 = False elif match_arg_542.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_542.value local_var_174 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=218, start_column=5, end_line=218, end_column=70, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_174): return VersementAllocations(VersementAllocations_Code.Normal, Unit()) else: raise EmptyError def local_var_164(_: Any): match_arg_543 = param_155.prise_en_charge if match_arg_543.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_543.value local_var_166 = False elif match_arg_543.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_543.value local_var_166 = False elif match_arg_543.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_543.value local_var_166 = False elif match_arg_543.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_543.value local_var_166 = False elif match_arg_543.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_543.value local_var_166 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=258, start_column=5, end_line=259, end_column=56, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_166): return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, Unit()) else: raise EmptyError def local_var_156(_: Any): match_arg_544 = param_155.prise_en_charge if match_arg_544.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: _ = match_arg_544.value local_var_158 = False elif match_arg_544.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: _ = match_arg_544.value local_var_158 = False elif match_arg_544.code == PriseEnCharge_Code.EffectiveEtPermanente: _ = match_arg_544.value local_var_158 = False elif match_arg_544.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: _ = match_arg_544.value local_var_158 = True elif match_arg_544.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: _ = match_arg_544.value local_var_158 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=269, start_column=5, end_line=270, end_column=48, law_headings=["Article L521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), local_var_158): return VersementAllocations(VersementAllocations_Code.Normal, Unit()) else: raise EmptyError def local_var_196(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, end_column=20, law_headings=["Prologue"]), True) def local_var_198(_: Any): raise EmptyError return handle_default([local_var_156, local_var_164, local_var_172, local_var_180, local_var_188], local_var_196, local_var_198) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, end_column=20, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, end_column=20, law_headings=["Prologue"])) versement_153 = log_variable_definition(["AllocationsFamiliales", "versement"], local_var_154) try: local_var_201 = integer_of_string("3") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=151, start_column=11, end_line=151, end_column=32, law_headings=["Prologue"])) nombre_enfants_l521_1_200 = log_variable_definition(["AllocationsFamiliales", "nombre_enfants_l521_1"], local_var_201) try: local_var_203 = integer_of_string("3") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=153, start_column=11, end_line=153, end_column=41, law_headings=["Prologue"])) nombre_enfants_alinea_2_l521_3_202 = log_variable_definition(["AllocationsFamiliales", "nombre_enfants_alinéa_2_l521_3"], local_var_203) result_204 = log_end_call(["AllocationsFamiliales", "version_avril_2008", "AllocationFamilialesAvril2008"], log_begin_call(["AllocationsFamiliales", "version_avril_2008", "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, AllocationFamilialesAvril2008In())) version_avril_2008_dot_age_minimum_alinea_1_l521_3_205 = result_204.age_minimum_alinea_1_l521_3_out try: local_var_207 = log_variable_definition(["AllocationsFamiliales", "prestations_familiales.date_courante"], date_courante_103) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=70, start_column=10, end_line=70, end_column=23, law_headings=["Prologue"])) prestations_familiales_dot_date_courante_206 = local_var_207 try: local_var_209 = log_variable_definition(["AllocationsFamiliales", "prestations_familiales.prestation_courante"], ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, Unit())) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=71, start_column=10, end_line=71, end_column=29, law_headings=["Prologue"])) prestations_familiales_dot_prestation_courante_208 = local_var_209 try: local_var_211 = log_variable_definition(["AllocationsFamiliales", "prestations_familiales.résidence"], residence_102) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=72, start_column=10, end_line=72, end_column=19, law_headings=["Prologue"])) prestations_familiales_dot_residence_210 = local_var_211 result_212 = log_end_call(["AllocationsFamiliales", "prestations_familiales", "PrestationsFamiliales"], log_begin_call(["AllocationsFamiliales", "prestations_familiales", "PrestationsFamiliales"], prestations_familiales, PrestationsFamilialesIn(date_courante_in=prestations_familiales_dot_date_courante_206, prestation_courante_in=prestations_familiales_dot_prestation_courante_208, residence_in=prestations_familiales_dot_residence_210))) prestations_familiales_dot_droit_ouvert_213 = result_212.droit_ouvert_out prestations_familiales_dot_conditions_hors_age_214 = result_212.conditions_hors_age_out prestations_familiales_dot_age_l512_3_2_215 = result_212.age_l512_3_2_out prestations_familiales_dot_regime_outre_mer_l751_1_216 = result_212.regime_outre_mer_l751_1_out prestations_familiales_dot_base_mensuelle_217 = result_212.base_mensuelle_out try: local_var_219 = log_variable_definition(["AllocationsFamiliales", "enfant_le_plus_âgé.enfants"], enfants_a_charge_104) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=84, start_column=10, end_line=84, end_column=17, law_headings=["Prologue"])) enfant_le_plus_age_dot_enfants_218 = local_var_219 result_220 = log_end_call(["AllocationsFamiliales", "enfant_le_plus_âgé", "EnfantLePlusÂgé"], log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", "EnfantLePlusÂgé"], enfant_le_plus_age, EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants_218))) enfant_le_plus_age_dot_le_plus_age_221 = result_220.le_plus_age_out try: def local_var_223(param_224: Enfant): try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", start_line=83, start_column=19, end_line=83, end_column=69, law_headings=["Article R521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets en Conseil d'Etat", "Code de la sécurité sociale"]), ((param_224.date_de_naissance + duration_of_numbers(11, 0, 0)) <= date_of_numbers(2008, 4, 30))): return version_avril_2008_dot_age_minimum_alinea_1_l521_3_205 else: raise EmptyError except EmptyError: return integer_of_string("14") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=152, start_column=11, end_line=152, end_column=38, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=152, start_column=11, end_line=152, end_column=38, law_headings=["Prologue"])) age_minimum_alinea_1_l521_3_222 = log_variable_definition(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3"], local_var_223) try: def local_var_227(enfant_228: Any): return log_end_call(["PrestationsFamiliales", "droit_ouvert"], log_variable_definition(["PrestationsFamiliales", "droit_ouvert", "output"], log_begin_call(["PrestationsFamiliales", "droit_ouvert"], prestations_familiales_dot_droit_ouvert_213, log_variable_definition(["PrestationsFamiliales", "droit_ouvert", "input"], enfant_228)))) local_var_226 = list_filter(local_var_227, enfants_a_charge_104) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=100, start_column=11, end_line=100, end_column=61, law_headings=["Prologue"])) enfants_a_charge_droit_ouvert_prestation_familiale_225 = log_variable_definition(["AllocationsFamiliales", "enfants_à_charge_droit_ouvert_prestation_familiale"], local_var_226) try: def local_var_230(param_231: Enfant): try: return (enfant_le_plus_age_dot_le_plus_age_221 == param_231) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=154, start_column=11, end_line=154, end_column=33, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=154, start_column=11, end_line=154, end_column=33, law_headings=["Prologue"])) est_enfant_le_plus_age_229 = log_variable_definition(["AllocationsFamiliales", "est_enfant_le_plus_âgé"], local_var_230) try: def local_var_240(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=94, start_column=5, end_line=94, end_column=69, law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2018, 1, 1)) and (date_courante_103 <= date_of_numbers(2018, 12, 31)))): return (money_of_cents_string("7877000") + (money_of_cents_string("562800") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_238(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=127, start_column=5, end_line=127, end_column=69, law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2019, 1, 1)) and (date_courante_103 <= date_of_numbers(2019, 12, 31)))): return (money_of_cents_string("7955800") + (money_of_cents_string("568400") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_236(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=160, start_column=5, end_line=160, end_column=69, law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2020, 1, 1)) and (date_courante_103 <= date_of_numbers(2020, 12, 31)))): return (money_of_cents_string("8083100") + (money_of_cents_string("577500") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_234(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=196, start_column=5, end_line=196, end_column=69, law_headings=["Article 1", "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2021, 1, 1)) and (date_courante_103 <= date_of_numbers(2021, 12, 31)))): return (money_of_cents_string("8155800") + (money_of_cents_string("582700") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_242(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=156, start_column=11, end_line=156, end_column=28, law_headings=["Prologue"]), True) def local_var_244(_: Any): return (money_of_cents_string("7830000") + (money_of_cents_string("559500") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) local_var_233 = handle_default([local_var_234, local_var_236, local_var_238, local_var_240], local_var_242, local_var_244) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=156, start_column=11, end_line=156, end_column=28, law_headings=["Prologue"])) plafond__i_i_d521_3_232 = log_variable_definition(["AllocationsFamiliales", "plafond_II_d521_3"], local_var_233) try: def local_var_254(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=87, start_column=5, end_line=87, end_column=69, law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2018, 1, 1)) and (date_courante_103 <= date_of_numbers(2018, 12, 31)))): return (money_of_cents_string("5628600") + (money_of_cents_string("562800") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_252(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=120, start_column=5, end_line=120, end_column=69, law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2019, 1, 1)) and (date_courante_103 <= date_of_numbers(2019, 12, 31)))): return (money_of_cents_string("5684900") + (money_of_cents_string("568400") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_250(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=153, start_column=5, end_line=153, end_column=69, law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2020, 1, 1)) and (date_courante_103 <= date_of_numbers(2020, 12, 31)))): return (money_of_cents_string("5775900") + (money_of_cents_string("577500") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_248(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=180, start_column=5, end_line=180, end_column=69, law_headings=["Article 1", "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", "Montant des plafonds de ressources", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2021, 1, 1)) and (date_courante_103 <= date_of_numbers(2021, 12, 31)))): return (money_of_cents_string("5827900") + (money_of_cents_string("582700") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) else: raise EmptyError def local_var_256(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=155, start_column=11, end_line=155, end_column=27, law_headings=["Prologue"]), True) def local_var_258(_: Any): return (money_of_cents_string("5595000") + (money_of_cents_string("559500") * decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) local_var_247 = handle_default([local_var_248, local_var_250, local_var_252, local_var_254], local_var_256, local_var_258) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=155, start_column=11, end_line=155, end_column=27, law_headings=["Prologue"])) plafond__i_d521_3_246 = log_variable_definition(["AllocationsFamiliales", "plafond_I_d521_3"], local_var_247) try: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=426, start_column=5, end_line=427, end_column=71, law_headings=["Article L755-12", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", "Livre 7 : Régimes divers - Dispositions diverses", "Partie législative", "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")))): local_var_261 = False else: raise EmptyError except EmptyError: local_var_261 = True except EmptyError: local_var_261 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=139, start_column=11, end_line=139, end_column=34, law_headings=["Prologue"])) droit_ouvert_complement_260 = log_variable_definition(["AllocationsFamiliales", "droit_ouvert_complément"], local_var_261) try: def local_var_263(param_264: Enfant): try: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=420, start_column=6, end_line=421, end_column=72, law_headings=["Article L755-12", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", "Livre 7 : Régimes divers - Dispositions diverses", "Partie législative", "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")))): return False else: raise EmptyError except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=119, start_column=5, end_line=125, end_column=59, law_headings=["Article L521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_104) >= nombre_enfants_alinea_2_l521_3_202) and ((param_264.age == prestations_familiales_dot_age_l512_3_2_215) and (param_264.a_deja_ouvert_droit_aux_allocations_familiales and log_end_call(["PrestationsFamiliales", "conditions_hors_âge"], log_variable_definition(["PrestationsFamiliales", "conditions_hors_âge", "output"], log_begin_call(["PrestationsFamiliales", "conditions_hors_âge"], prestations_familiales_dot_conditions_hors_age_214, log_variable_definition(["PrestationsFamiliales", "conditions_hors_âge", "input"], param_264)))))))): return True else: raise EmptyError except EmptyError: return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=127, start_column=11, end_line=127, end_column=35, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=127, start_column=11, end_line=127, end_column=35, law_headings=["Prologue"])) droit_ouvert_forfaitaire_262 = log_variable_definition(["AllocationsFamiliales", "droit_ouvert_forfaitaire"], local_var_263) try: if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("3")): local_var_266 = ((prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0463")) * decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - integer_of_string("3")))) else: local_var_266 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=124, start_column=11, end_line=124, end_column=64, law_headings=["Prologue"])) montant_initial_base_quatrieme_enfant_et_plus_mayotte_265 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_quatrième_enfant_et_plus_mayotte"], local_var_266) try: def local_var_287(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=584, start_column=5, end_line=584, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2011, 1, 1)) and (date_courante_103 <= date_of_numbers(2011, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0463")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_285(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=591, start_column=5, end_line=591, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2012, 1, 1)) and (date_courante_103 <= date_of_numbers(2012, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0539")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_283(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=598, start_column=5, end_line=598, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2013, 1, 1)) and (date_courante_103 <= date_of_numbers(2013, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.075")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_281(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=605, start_column=5, end_line=605, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2014, 1, 1)) and (date_courante_103 <= date_of_numbers(2014, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.069")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_279(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=612, start_column=5, end_line=612, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2015, 1, 1)) and (date_courante_103 <= date_of_numbers(2015, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0766")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_277(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=619, start_column=5, end_line=619, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2016, 1, 1)) and (date_courante_103 <= date_of_numbers(2016, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0842")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_275(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=626, start_column=5, end_line=626, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2017, 1, 1)) and (date_courante_103 <= date_of_numbers(2017, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0918")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_273(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=633, start_column=5, end_line=633, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2018, 1, 1)) and (date_courante_103 <= date_of_numbers(2018, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1089")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_271(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=640, start_column=5, end_line=640, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2019, 1, 1)) and (date_courante_103 <= date_of_numbers(2019, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1259")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_269(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=647, start_column=5, end_line=647, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2020, 1, 1)) and (date_courante_103 <= date_of_numbers(2020, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.143")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_289(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=123, start_column=11, end_line=123, end_column=56, law_headings=["Prologue"]), True) def local_var_291(_: Any): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.16")) else: return money_of_cents_string("0") local_var_268 = handle_default([local_var_269, local_var_271, local_var_273, local_var_275, local_var_277, local_var_279, local_var_281, local_var_283, local_var_285, local_var_287], local_var_289, local_var_291) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=123, start_column=11, end_line=123, end_column=56, law_headings=["Prologue"])) montant_initial_base_troisieme_enfant_mayotte_267 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_troisième_enfant_mayotte"], local_var_268) try: def local_var_313(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=513, start_column=5, end_line=513, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2011, 1, 1)) and (date_courante_103 <= date_of_numbers(2011, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.232")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_311(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=520, start_column=5, end_line=520, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2012, 1, 1)) and (date_courante_103 <= date_of_numbers(2012, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2379")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_309(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=527, start_column=5, end_line=527, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2013, 1, 1)) and (date_courante_103 <= date_of_numbers(2013, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2437")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_307(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=534, start_column=5, end_line=534, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2014, 1, 1)) and (date_courante_103 <= date_of_numbers(2014, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2496")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_305(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=541, start_column=5, end_line=541, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2015, 1, 1)) and (date_courante_103 <= date_of_numbers(2015, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2555")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_303(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=548, start_column=5, end_line=548, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2016, 1, 1)) and (date_courante_103 <= date_of_numbers(2016, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.273")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_301(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=555, start_column=5, end_line=555, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2017, 1, 1)) and (date_courante_103 <= date_of_numbers(2017, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2672")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_299(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=562, start_column=5, end_line=562, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2018, 1, 1)) and (date_courante_103 <= date_of_numbers(2018, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.284")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_297(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=569, start_column=5, end_line=569, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2019, 1, 1)) and (date_courante_103 <= date_of_numbers(2019, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.2936")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_295(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=576, start_column=5, end_line=576, end_column=69, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2020, 1, 1)) and (date_courante_103 <= date_of_numbers(2020, 12, 31)))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.3068")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_315(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=122, start_column=11, end_line=122, end_column=55, law_headings=["Prologue"]), True) def local_var_317(_: Any): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.32")) else: return money_of_cents_string("0") local_var_294 = handle_default([local_var_295, local_var_297, local_var_299, local_var_301, local_var_303, local_var_305, local_var_307, local_var_309, local_var_311, local_var_313], local_var_315, local_var_317) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=122, start_column=11, end_line=122, end_column=55, law_headings=["Prologue"])) montant_initial_base_deuxieme_enfant_mayotte_293 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_deuxième_enfant_mayotte"], local_var_294) try: def local_var_341(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=425, start_column=5, end_line=426, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2011, 1, 1)) and ((date_courante_103 <= date_of_numbers(2011, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.145")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_339(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=433, start_column=5, end_line=434, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2012, 1, 1)) and ((date_courante_103 <= date_of_numbers(2012, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1393")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_337(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=441, start_column=5, end_line=442, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2013, 1, 1)) and ((date_courante_103 <= date_of_numbers(2013, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1335")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_335(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=449, start_column=5, end_line=450, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2014, 1, 1)) and ((date_courante_103 <= date_of_numbers(2014, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1278")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_333(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=457, start_column=5, end_line=458, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2015, 1, 1)) and ((date_courante_103 <= date_of_numbers(2015, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.122")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_331(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=465, start_column=5, end_line=466, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2016, 1, 1)) and ((date_courante_103 <= date_of_numbers(2016, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1163")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_329(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=473, start_column=5, end_line=474, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2017, 1, 1)) and ((date_courante_103 <= date_of_numbers(2017, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.115")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_327(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=481, start_column=5, end_line=482, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2018, 1, 1)) and ((date_courante_103 <= date_of_numbers(2018, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0976")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_325(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=489, start_column=5, end_line=490, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2019, 1, 1)) and ((date_courante_103 <= date_of_numbers(2019, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0847")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_323(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=497, start_column=5, end_line=498, end_column=53, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((date_courante_103 >= date_of_numbers(2020, 1, 1)) and ((date_courante_103 <= date_of_numbers(2020, 12, 31)) and not avait_enfant_a_charge_avant_1er_janvier_2012_105))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0717")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_321(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=505, start_column=5, end_line=505, end_column=49, law_headings=["Annexe", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_105): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return money_of_cents_string("5728") else: return money_of_cents_string("0") else: raise EmptyError def local_var_343(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=121, start_column=11, end_line=121, end_column=54, law_headings=["Prologue"]), True) def local_var_345(_: Any): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("0")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0588")) else: return money_of_cents_string("0") local_var_320 = handle_default([local_var_321, local_var_323, local_var_325, local_var_327, local_var_329, local_var_331, local_var_333, local_var_335, local_var_337, local_var_339, local_var_341], local_var_343, local_var_345) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=121, start_column=11, end_line=121, end_column=54, law_headings=["Prologue"])) montant_initial_base_premier_enfant_mayotte_319 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_premier_enfant_mayotte"], local_var_320) try: local_var_348 = decimal_of_integer(list_length( enfants_a_charge_droit_ouvert_prestation_familiale_225)) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=115, start_column=11, end_line=115, end_column=31, law_headings=["Prologue"])) nombre_total_enfants_347 = log_variable_definition(["AllocationsFamiliales", "nombre_total_enfants"], local_var_348) try: def local_var_351(acc_352: Decimal, enfant_353: Any): match_arg_545 = log_end_call(["AllocationsFamiliales", "prise_en_compte"], log_variable_definition(["AllocationsFamiliales", "prise_en_compte", "output"], log_begin_call(["AllocationsFamiliales", "prise_en_compte"], prise_en_compte_106, log_variable_definition(["AllocationsFamiliales", "prise_en_compte", "input"], enfant_353)))) if match_arg_545.code == PriseEnCompte_Code.Complete: _ = match_arg_545.value local_var_354 = decimal_of_string("1.") elif match_arg_545.code == PriseEnCompte_Code.Partagee: _ = match_arg_545.value local_var_354 = decimal_of_string("0.5") elif match_arg_545.code == PriseEnCompte_Code.Zero: _ = match_arg_545.value local_var_354 = decimal_of_string("0.") return (acc_352 + local_var_354) local_var_350 = list_fold_left(local_var_351, decimal_of_string("0."), enfants_a_charge_droit_ouvert_prestation_familiale_225) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=114, start_column=11, end_line=114, end_column=31, law_headings=["Prologue"])) nombre_moyen_enfants_349 = log_variable_definition(["AllocationsFamiliales", "nombre_moyen_enfants"], local_var_350) try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=359, start_column=5, end_line=360, end_column=71, law_headings=["Article D755-5", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")))): local_var_359 = (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0588")) else: raise EmptyError except EmptyError: local_var_359 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=110, start_column=11, end_line=110, end_column=46, law_headings=["Prologue"])) montant_initial_base_premier_enfant_358 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_premier_enfant"], local_var_359) try: try: def local_var_364(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=406, start_column=5, end_line=407, end_column=72, law_headings=["Article L755-12", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", "Livre 7 : Régimes divers - Dispositions diverses", "Partie législative", "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= integer_of_string("1")))): return True else: raise EmptyError def local_var_362(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=344, start_column=5, end_line=345, end_column=72, law_headings=["Article 7", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), ((residence_102 == Collectivite(Collectivite_Code.Mayotte, Unit())) and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= integer_of_string("1")))): return True else: raise EmptyError def local_var_366(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=108, start_column=11, end_line=108, end_column=28, law_headings=["Prologue"]), True) def local_var_368(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=101, start_column=5, end_line=101, end_column=70, law_headings=["Article L521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= integer_of_string("2"))): return True else: raise EmptyError local_var_361 = handle_default([local_var_362, local_var_364], local_var_366, local_var_368) except EmptyError: local_var_361 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=108, start_column=11, end_line=108, end_column=28, law_headings=["Prologue"])) droit_ouvert_base_360 = log_variable_definition(["AllocationsFamiliales", "droit_ouvert_base"], local_var_361) try: def local_var_371(param_372: Enfant): try: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=313, start_column=5, end_line=315, end_column=58, law_headings=["Article L521-3", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= nombre_enfants_alinea_2_l521_3_202) and (param_372.age >= log_end_call(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3"], log_variable_definition(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3", "output"], log_begin_call(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3"], age_minimum_alinea_1_l521_3_222, log_variable_definition(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3", "input"], param_372))))))): return True else: raise EmptyError except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", start_line=299, start_column=5, end_line=300, end_column=58, law_headings=["Article L521-3", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie législative", "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", "est_enfant_le_plus_âgé"], log_variable_definition(["AllocationsFamiliales", "est_enfant_le_plus_âgé", "output"], log_begin_call(["AllocationsFamiliales", "est_enfant_le_plus_âgé"], est_enfant_le_plus_age_229, log_variable_definition(["AllocationsFamiliales", "est_enfant_le_plus_âgé", "input"], param_372)))) and (param_372.age >= log_end_call(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3"], log_variable_definition(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3", "output"], log_begin_call(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3"], age_minimum_alinea_1_l521_3_222, log_variable_definition(["AllocationsFamiliales", "âge_minimum_alinéa_1_l521_3", "input"], param_372))))))): return True else: raise EmptyError except EmptyError: return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=132, start_column=11, end_line=132, end_column=34, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=132, start_column=11, end_line=132, end_column=34, law_headings=["Prologue"])) droit_ouvert_majoration_370 = log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration"], local_var_371) try: def local_var_374(param_375: Money): try: def local_var_378(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=162, start_column=5, end_line=163, end_column=68, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= (plafond__i_d521_3_246 + (param_375 * decimal_of_string("12.")))))): return ((plafond__i_d521_3_246 + ((param_375 * decimal_of_string("12.")) - ressources_menage_101)) * (decimal_of_string("1.") / decimal_of_string("12."))) else: raise EmptyError def local_var_376(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=170, start_column=5, end_line=171, end_column=68, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_i_d521_3_232) and (ressources_menage_101 <= (plafond__i_i_d521_3_232 + (param_375 * decimal_of_string("12.")))))): return ((plafond__i_i_d521_3_232 + ((param_375 * decimal_of_string("12.")) - ressources_menage_101)) * (decimal_of_string("1.") / decimal_of_string("12."))) else: raise EmptyError def local_var_380(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=141, start_column=11, end_line=141, end_column=31, law_headings=["Prologue"]), True) def local_var_382(_: Any): return money_of_cents_string("0") return handle_default([local_var_376, local_var_378], local_var_380, local_var_382) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=141, start_column=11, end_line=141, end_column=31, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=141, start_column=11, end_line=141, end_column=31, law_headings=["Prologue"])) complement_degressif_373 = log_variable_definition(["AllocationsFamiliales", "complément_dégressif"], local_var_374) try: def local_var_390(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=215, start_column=5, end_line=215, end_column=43, law_headings=["Article D521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 <= plafond__i_d521_3_246)): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.20234")) else: raise EmptyError def local_var_388(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=229, start_column=5, end_line=230, end_column=46, law_headings=["Article D521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= plafond__i_i_d521_3_232))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1117")) else: raise EmptyError def local_var_386(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=243, start_column=5, end_line=243, end_column=43, law_headings=["Article D521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 > plafond__i_i_d521_3_232)): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0559")) else: raise EmptyError def local_var_392(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=47, law_headings=["Prologue"]), True) def local_var_394(_: Any): raise EmptyError local_var_385 = handle_default([local_var_386, local_var_388, local_var_390], local_var_392, local_var_394) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=47, law_headings=["Prologue"])) montant_verse_forfaitaire_par_enfant_384 = log_variable_definition(["AllocationsFamiliales", "montant_versé_forfaitaire_par_enfant"], local_var_385) try: def local_var_402(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=35, start_column=3, end_line=35, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 <= plafond__i_d521_3_246)): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return ((prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.41")) * decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError def local_var_400(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=74, start_column=3, end_line=75, end_column=44, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= plafond__i_i_d521_3_232))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return ((prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.205")) * decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError def local_var_398(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=113, start_column=3, end_line=113, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 > plafond__i_i_d521_3_232)): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("2")): return ((prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.1025")) * decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError def local_var_404(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=112, start_column=11, end_line=112, end_column=56, law_headings=["Prologue"]), True) def local_var_406(_: Any): raise EmptyError local_var_397 = handle_default([local_var_398, local_var_400, local_var_402], local_var_404, local_var_406) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=112, start_column=11, end_line=112, end_column=56, law_headings=["Prologue"])) montant_initial_base_troisieme_enfant_et_plus_396 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_troisième_enfant_et_plus"], local_var_397) try: def local_var_414(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=35, start_column=3, end_line=35, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 <= plafond__i_d521_3_246)): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.32")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_412(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=74, start_column=3, end_line=75, end_column=44, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= plafond__i_i_d521_3_232))): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.16")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_410(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=113, start_column=3, end_line=113, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (ressources_menage_101 > plafond__i_i_d521_3_232)): if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > integer_of_string("1")): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.08")) else: return money_of_cents_string("0") else: raise EmptyError def local_var_416(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=111, start_column=11, end_line=111, end_column=47, law_headings=["Prologue"]), True) def local_var_418(_: Any): raise EmptyError local_var_409 = handle_default([local_var_410, local_var_412, local_var_414], local_var_416, local_var_418) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=111, start_column=11, end_line=111, end_column=47, law_headings=["Prologue"])) montant_initial_base_deuxieme_enfant_408 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_deuxième_enfant"], local_var_409) try: if (nombre_total_enfants_347 == decimal_of_string("0.")): local_var_421 = decimal_of_string("0.") else: local_var_421 = (nombre_moyen_enfants_349 / nombre_total_enfants_347) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=113, start_column=11, end_line=113, end_column=38, law_headings=["Prologue"])) rapport_enfants_total_moyen_420 = log_variable_definition(["AllocationsFamiliales", "rapport_enfants_total_moyen"], local_var_421) try: def local_var_423(param_424: Enfant): try: def local_var_431(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=55, start_column=3, end_line=55, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 <= plafond__i_d521_3_246) and log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_424)))))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.16")) else: raise EmptyError def local_var_429(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=95, start_column=3, end_line=96, end_column=44, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= plafond__i_i_d521_3_232)) and log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_424)))))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.08")) else: raise EmptyError def local_var_427(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=132, start_column=3, end_line=132, end_column=41, law_headings=["Article D521-1", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_i_d521_3_232) and log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_424)))))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.04")) else: raise EmptyError def local_var_425(_: Any): if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", start_line=27, start_column=5, end_line=27, end_column=44, law_headings=["Règles diverses", "Épilogue", "Décrets divers"]), not log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_424))))): return money_of_cents_string("0") else: raise EmptyError def local_var_433(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=47, law_headings=["Prologue"]), True) def local_var_435(_: Any): raise EmptyError return handle_default([local_var_425, local_var_427, local_var_429, local_var_431], local_var_433, local_var_435) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=47, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=47, law_headings=["Prologue"])) montant_initial_metropole_majoration_422 = log_variable_definition(["AllocationsFamiliales", "montant_initial_métropole_majoration"], local_var_423) try: def local_var_439(acc_440: Integer, enfant_441: Any): if log_end_call(["AllocationsFamiliales", "droit_ouvert_forfaitaire"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_forfaitaire", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_forfaitaire"], droit_ouvert_forfaitaire_262, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_forfaitaire", "input"], enfant_441)))): return (acc_440 + integer_of_string("1")) else: return acc_440 local_var_438 = (montant_verse_forfaitaire_par_enfant_384 * decimal_of_integer(list_fold_left(local_var_439, integer_of_string("0"), enfants_a_charge_104))) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=129, start_column=11, end_line=129, end_column=36, law_headings=["Prologue"])) montant_verse_forfaitaire_437 = log_variable_definition(["AllocationsFamiliales", "montant_versé_forfaitaire"], local_var_438) try: def local_var_446(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=350, start_column=5, end_line=351, end_column=69, law_headings=["Article D755-5", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")))): return montant_initial_base_premier_enfant_358 else: raise EmptyError def local_var_444(_: Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", start_line=335, start_column=5, end_line=335, end_column=24, law_headings=["Article 7", "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", "Dispositions spéciales relatives à Mayotte", "Décrets divers"]), (residence_102 == Collectivite(Collectivite_Code.Mayotte, Unit()))): return (montant_initial_base_premier_enfant_mayotte_319 + (montant_initial_base_deuxieme_enfant_mayotte_293 + (montant_initial_base_troisieme_enfant_mayotte_267 + montant_initial_base_quatrieme_enfant_et_plus_mayotte_265))) else: raise EmptyError def local_var_448(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=109, start_column=11, end_line=109, end_column=31, law_headings=["Prologue"]), True) def local_var_450(_: Any): return (montant_initial_base_deuxieme_enfant_408 + montant_initial_base_troisieme_enfant_et_plus_396) local_var_443 = handle_default([local_var_444, local_var_446], local_var_448, local_var_450) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=109, start_column=11, end_line=109, end_column=31, law_headings=["Prologue"])) montant_initial_base_442 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base"], local_var_443) try: def local_var_453(param_454: Enfant): try: def local_var_457(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=373, start_column=5, end_line=376, end_column=42, law_headings=["Article D755-5", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_454)))) and (prestations_familiales_dot_regime_outre_mer_l751_1_216 and ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")) and ((param_454.age >= integer_of_string("11")) and (param_454.age < integer_of_string("16"))))))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0369")) else: raise EmptyError def local_var_455(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=382, start_column=5, end_line=385, end_column=23, law_headings=["Article D755-5", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", "droit_ouvert_majoration"], log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "output"], log_begin_call(["AllocationsFamiliales", "droit_ouvert_majoration"], droit_ouvert_majoration_370, log_variable_definition(["AllocationsFamiliales", "droit_ouvert_majoration", "input"], param_454)))) and (prestations_familiales_dot_regime_outre_mer_l751_1_216 and ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == integer_of_string("1")) and (param_454.age >= integer_of_string("16")))))): return (prestations_familiales_dot_base_mensuelle_217 * decimal_of_string("0.0567")) else: raise EmptyError def local_var_459(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=134, start_column=11, end_line=134, end_column=37, law_headings=["Prologue"]), True) def local_var_461(_: Any): return log_end_call(["AllocationsFamiliales", "montant_initial_métropole_majoration"], log_variable_definition(["AllocationsFamiliales", "montant_initial_métropole_majoration", "output"], log_begin_call(["AllocationsFamiliales", "montant_initial_métropole_majoration"], montant_initial_metropole_majoration_422, log_variable_definition(["AllocationsFamiliales", "montant_initial_métropole_majoration", "input"], param_454)))) return handle_default([local_var_455, local_var_457], local_var_459, local_var_461) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=134, start_column=11, end_line=134, end_column=37, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=134, start_column=11, end_line=134, end_column=37, law_headings=["Prologue"])) montant_initial_majoration_452 = log_variable_definition(["AllocationsFamiliales", "montant_initial_majoration"], local_var_453) try: def local_var_467(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=262, start_column=5, end_line=264, end_column=42, law_headings=["Article D521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_d521_3_246) and (ressources_menage_101 <= (plafond__i_d521_3_246 + (montant_verse_forfaitaire_437 * decimal_of_string("12.")))))): return ((plafond__i_d521_3_246 + ((montant_verse_forfaitaire_437 * decimal_of_string("12.")) - ressources_menage_101)) * (decimal_of_string("1.") / decimal_of_string("12."))) else: raise EmptyError def local_var_465(_: Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", start_line=272, start_column=5, end_line=274, end_column=41, law_headings=["Article D521-2", "Chapitre 1er : Allocations familiales", "Titre 2 : Prestations générales d'entretien", "Livre 5 : Prestations familiales et prestations assimilées", "Partie réglementaire - Décrets simples", "Code de la sécurité sociale"]), ((ressources_menage_101 > plafond__i_i_d521_3_232) and (ressources_menage_101 <= (plafond__i_i_d521_3_232 + (montant_verse_forfaitaire_437 * decimal_of_string("12.")))))): return ((plafond__i_i_d521_3_232 + ((montant_verse_forfaitaire_437 * decimal_of_string("12.")) - ressources_menage_101)) * (decimal_of_string("1.") / decimal_of_string("12."))) else: raise EmptyError def local_var_469(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=143, start_column=11, end_line=143, end_column=52, law_headings=["Prologue"]), True) def local_var_471(_: Any): return money_of_cents_string("0") local_var_464 = handle_default([local_var_465, local_var_467], local_var_469, local_var_471) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=143, start_column=11, end_line=143, end_column=52, law_headings=["Prologue"])) montant_verse_complement_pour_forfaitaire_463 = log_variable_definition(["AllocationsFamiliales", "montant_versé_complément_pour_forfaitaire"], local_var_464) try: local_var_474 = (montant_initial_base_442 * rapport_enfants_total_moyen_420) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=116, start_column=11, end_line=116, end_column=43, law_headings=["Prologue"])) montant_avec_garde_alternee_base_473 = log_variable_definition(["AllocationsFamiliales", "montant_avec_garde_alternée_base"], local_var_474) try: def local_var_476(param_477: Enfant): try: match_arg_546 = log_end_call(["AllocationsFamiliales", "prise_en_compte"], log_variable_definition(["AllocationsFamiliales", "prise_en_compte", "output"], log_begin_call(["AllocationsFamiliales", "prise_en_compte"], prise_en_compte_106, log_variable_definition(["AllocationsFamiliales", "prise_en_compte", "input"], param_477)))) if match_arg_546.code == PriseEnCompte_Code.Complete: _ = match_arg_546.value local_var_478 = decimal_of_string("1.") elif match_arg_546.code == PriseEnCompte_Code.Partagee: _ = match_arg_546.value local_var_478 = decimal_of_string("0.5") elif match_arg_546.code == PriseEnCompte_Code.Zero: _ = match_arg_546.value local_var_478 = decimal_of_string("0.") return (log_end_call(["AllocationsFamiliales", "montant_initial_majoration"], log_variable_definition(["AllocationsFamiliales", "montant_initial_majoration", "output"], log_begin_call(["AllocationsFamiliales", "montant_initial_majoration"], montant_initial_majoration_452, log_variable_definition(["AllocationsFamiliales", "montant_initial_majoration", "input"], param_477)))) * local_var_478) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=135, start_column=11, end_line=135, end_column=49, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=135, start_column=11, end_line=135, end_column=49, law_headings=["Prologue"])) montant_avec_garde_alternee_majoration_475 = log_variable_definition(["AllocationsFamiliales", "montant_avec_garde_alternée_majoration"], local_var_476) try: if droit_ouvert_base_360: local_var_483 = montant_avec_garde_alternee_base_473 else: local_var_483 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=117, start_column=11, end_line=117, end_column=29, law_headings=["Prologue"])) montant_verse_base_482 = log_variable_definition(["AllocationsFamiliales", "montant_versé_base"], local_var_483) try: if droit_ouvert_base_360: def local_var_486(acc_487: Money, enfant_488: Any): return (acc_487 + log_end_call(["AllocationsFamiliales", "montant_avec_garde_alternée_majoration"], log_variable_definition(["AllocationsFamiliales", "montant_avec_garde_alternée_majoration", "output"], log_begin_call(["AllocationsFamiliales", "montant_avec_garde_alternée_majoration"], montant_avec_garde_alternee_majoration_475, log_variable_definition(["AllocationsFamiliales", "montant_avec_garde_alternée_majoration", "input"], enfant_488))))) local_var_485 = list_fold_left(local_var_486, money_of_cents_string("0"), enfants_a_charge_104) else: local_var_485 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=136, start_column=11, end_line=136, end_column=35, law_headings=["Prologue"])) montant_verse_majoration_484 = log_variable_definition(["AllocationsFamiliales", "montant_versé_majoration"], local_var_485) try: local_var_490 = (montant_verse_base_482 + montant_verse_majoration_484) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=140, start_column=11, end_line=140, end_column=58, law_headings=["Prologue"])) montant_base_complement_pour_base_et_majoration_489 = log_variable_definition(["AllocationsFamiliales", "montant_base_complément_pour_base_et_majoration"], local_var_490) try: if droit_ouvert_complement_260: local_var_492 = log_end_call(["AllocationsFamiliales", "complément_dégressif"], log_variable_definition(["AllocationsFamiliales", "complément_dégressif", "output"], log_begin_call(["AllocationsFamiliales", "complément_dégressif"], complement_degressif_373, log_variable_definition(["AllocationsFamiliales", "complément_dégressif", "input"], montant_base_complement_pour_base_et_majoration_489)))) else: local_var_492 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=142, start_column=11, end_line=142, end_column=59, law_headings=["Prologue"])) montant_verse_complement_pour_base_et_majoration_491 = log_variable_definition(["AllocationsFamiliales", "montant_versé_complément_pour_base_et_majoration"], local_var_492) try: if droit_ouvert_base_360: local_var_494 = (montant_verse_base_482 + (montant_verse_majoration_484 + (montant_verse_forfaitaire_437 + (montant_verse_complement_pour_base_et_majoration_491 + montant_verse_complement_pour_forfaitaire_463)))) else: local_var_494 = money_of_cents_string("0") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=105, start_column=10, end_line=105, end_column=23, law_headings=["Prologue"])) montant_verse_493 = log_variable_definition(["AllocationsFamiliales", "montant_versé"], local_var_494) assert (personne_charge_effective_permanente_est_parent_99 or (not personne_charge_effective_permanente_est_parent_99 and personne_charge_effective_permanente_remplit_titre__i_100)) return AllocationsFamilialesOut(montant_verse_out=montant_verse_493) def interface_allocations_familiales(interface_allocations_familiales_in_495: InterfaceAllocationsFamilialesIn): i_date_courante_496 = interface_allocations_familiales_in_495.i_date_courante_in i_enfants_497 = interface_allocations_familiales_in_495.i_enfants_in i_ressources_menage_498 = interface_allocations_familiales_in_495.i_ressources_menage_in i_residence_499 = interface_allocations_familiales_in_495.i_residence_in i_personne_charge_effective_permanente_est_parent_500 = interface_allocations_familiales_in_495.i_personne_charge_effective_permanente_est_parent_in i_personne_charge_effective_permanente_remplit_titre__i_501 = interface_allocations_familiales_in_495.i_personne_charge_effective_permanente_remplit_titre_I_in i_avait_enfant_a_charge_avant_1er_janvier_2012_502 = interface_allocations_familiales_in_495.i_avait_enfant_a_charge_avant_1er_janvier_2012_in try: def local_var_505(enfant_506: Any): if ((enfant_506.d_date_de_naissance + duration_of_numbers(3, 0, 0)) >= i_date_courante_496): local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, Unit()) else: if ((enfant_506.d_date_de_naissance + duration_of_numbers(16, 0, 0)) >= i_date_courante_496): local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, Unit()) else: local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, Unit()) return Enfant(identifiant=enfant_506.d_identifiant, obligation_scolaire=local_var_507, remuneration_mensuelle=enfant_506.d_remuneration_mensuelle, date_de_naissance=enfant_506.d_date_de_naissance, age=year_of_date((date_of_numbers(0, 1, 1) + (i_date_courante_496 - enfant_506.d_date_de_naissance))), prise_en_charge=enfant_506.d_prise_en_charge, a_deja_ouvert_droit_aux_allocations_familiales=enfant_506.d_a_deja_ouvert_droit_aux_allocations_familiales) local_var_504 = list_map(local_var_505, i_enfants_497) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", start_line=74, start_column=11, end_line=74, end_column=27, law_headings=["Interface du programme", "Épilogue", "Décrets divers"])) enfants_a_charge_503 = log_variable_definition(["InterfaceAllocationsFamiliales", "enfants_à_charge"], local_var_504) try: try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", start_line=90, start_column=20, end_line=90, end_column=69, law_headings=["Interface du programme", "Épilogue", "Décrets divers"]), i_personne_charge_effective_permanente_est_parent_500): local_var_510 = True else: raise EmptyError except EmptyError: local_var_510 = False local_var_509 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.personne_charge_effective_permanente_est_parent"], local_var_510) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=90, start_column=10, end_line=90, end_column=57, law_headings=["Prologue"])) allocations_familiales_dot_personne_charge_effective_permanente_est_parent_508 = local_var_509 try: try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", start_line=93, start_column=20, end_line=93, end_column=74, law_headings=["Interface du programme", "Épilogue", "Décrets divers"]), i_personne_charge_effective_permanente_remplit_titre__i_501): local_var_513 = True else: raise EmptyError except EmptyError: local_var_513 = False local_var_512 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], local_var_513) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=91, start_column=10, end_line=91, end_column=62, law_headings=["Prologue"])) allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_511 = local_var_512 try: local_var_515 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.ressources_ménage"], i_ressources_menage_498) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=92, start_column=10, end_line=92, end_column=27, law_headings=["Prologue"])) allocations_familiales_dot_ressources_menage_514 = local_var_515 try: local_var_517 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.résidence"], i_residence_499) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=93, start_column=10, end_line=93, end_column=19, law_headings=["Prologue"])) allocations_familiales_dot_residence_516 = local_var_517 try: local_var_519 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.date_courante"], i_date_courante_496) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=96, start_column=10, end_line=96, end_column=23, law_headings=["Prologue"])) allocations_familiales_dot_date_courante_518 = local_var_519 try: local_var_521 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.enfants_à_charge"], enfants_a_charge_503) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=99, start_column=10, end_line=99, end_column=26, law_headings=["Prologue"])) allocations_familiales_dot_enfants_a_charge_520 = local_var_521 try: try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", start_line=96, start_column=20, end_line=96, end_column=66, law_headings=["Interface du programme", "Épilogue", "Décrets divers"]), i_avait_enfant_a_charge_avant_1er_janvier_2012_502): local_var_524 = True else: raise EmptyError except EmptyError: local_var_524 = False local_var_523 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_524) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=120, start_column=10, end_line=120, end_column=54, law_headings=["Prologue"])) allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_522 = local_var_523 result_525 = log_end_call(["InterfaceAllocationsFamiliales", "allocations_familiales", "AllocationsFamiliales"], log_begin_call(["InterfaceAllocationsFamiliales", "allocations_familiales", "AllocationsFamiliales"], allocations_familiales, AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent_508, personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_511, ressources_menage_in=allocations_familiales_dot_ressources_menage_514, residence_in=allocations_familiales_dot_residence_516, date_courante_in=allocations_familiales_dot_date_courante_518, enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge_520, avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_522))) allocations_familiales_dot_montant_verse_526 = result_525.montant_verse_out try: local_var_528 = allocations_familiales_dot_montant_verse_526 except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", start_line=78, start_column=10, end_line=78, end_column=25, law_headings=["Interface du programme", "Épilogue", "Décrets divers"])) i_montant_verse_527 = log_variable_definition(["InterfaceAllocationsFamiliales", "i_montant_versé"], local_var_528) return InterfaceAllocationsFamilialesOut(i_montant_verse_out=i_montant_verse_527)
79.095514
388
0.422289
20,158
273,275
5.302808
0.042167
0.036896
0.022985
0.030058
0.874474
0.822637
0.755337
0.708337
0.676072
0.65724
0
0.063907
0.523023
273,275
3,454
389
79.118413
0.755827
0.000238
0
0.613143
1
0.00465
0.121764
0.037115
0
0
0
0
0.00031
1
0.069746
false
0.00031
0.00093
0.021079
0.17018
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
1
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
7
c40f28a6828681872445666077421184fc7325c0
13,575
py
Python
test/knxip_tests/routing_indication_test.py
marvin-w/xknx
9f8b80fa0906a345c7def519ac3c92c955990a26
[ "MIT" ]
null
null
null
test/knxip_tests/routing_indication_test.py
marvin-w/xknx
9f8b80fa0906a345c7def519ac3c92c955990a26
[ "MIT" ]
1
2019-01-06T11:40:16.000Z
2019-01-06T11:40:16.000Z
test/knxip_tests/routing_indication_test.py
marvin-w/xknx
9f8b80fa0906a345c7def519ac3c92c955990a26
[ "MIT" ]
null
null
null
"""Unit test for KNX/IP RountingIndication objects.""" import asyncio import time import unittest from xknx import XKNX from xknx.dpt import DPTArray, DPTBinary, DPTTemperature, DPTTime from xknx.knxip import CEMIFrame, KNXIPFrame, KNXIPServiceType, RoutingIndication from xknx.telegram import GroupAddress, PhysicalAddress, Telegram, TelegramType class Test_KNXIP(unittest.TestCase): """Class for KNX/IP RoutingIndication test.""" # pylint: disable=too-many-public-methods,invalid-name def setUp(self): """Set up test class.""" self.loop = asyncio.new_event_loop() asyncio.set_event_loop(self.loop) def tearDown(self): """Tear down test class.""" self.loop.close() def test_from_knx(self): """Test parsing and streaming CEMIFrame KNX/IP packet (payload=0xf0).""" raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x12, 0x29, 0x00, 0xBC, 0xD0, 0x12, 0x02, 0x01, 0x51, 0x02, 0x00, 0x40, 0xF0, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) self.assertTrue(isinstance(knxipframe.body, RoutingIndication)) self.assertTrue(isinstance(knxipframe.body.cemi, CEMIFrame)) self.assertEqual(knxipframe.body.cemi.src_addr, PhysicalAddress("1.2.2")) self.assertEqual(knxipframe.body.cemi.dst_addr, GroupAddress(337)) self.assertEqual(len(knxipframe.body.cemi.payload.value), 1) self.assertEqual(knxipframe.body.cemi.payload.value[0], 0xF0) def test_from_knx_to_knx(self): """Test parsing and streaming CEMIFrame KNX/IP.""" raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x12, 0x29, 0x00, 0xBC, 0xD0, 0x12, 0x02, 0x01, 0x51, 0x02, 0x00, 0x40, 0xF0, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) knxipframe.normalize() self.assertEqual(knxipframe.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe.to_knx(), list(raw)) def test_telegram_set(self): """Test parsing and streaming CEMIFrame KNX/IP packet with DPTArray/DPTTime as payload.""" xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe.body.cemi.src_addr = PhysicalAddress("1.2.2") telegram = Telegram( group_address=GroupAddress(337), payload=DPTArray(DPTTime().to_knx(time.strptime("13:23:42", "%H:%M:%S"))), ) knxipframe.body.cemi.telegram = telegram knxipframe.body.cemi.set_hops(5) knxipframe.normalize() raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x14, 0x29, 0x00, 0xBC, 0xD0, 0x12, 0x02, 0x01, 0x51, 0x04, 0x00, 0x80, 13, 23, 42, ) self.assertEqual(knxipframe.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe.to_knx(), list(raw)) def test_telegram_get(self): """Test parsing and streaming CEMIFrame KNX/IP packet, group read.""" raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x12, 0x29, 0x00, 0xBC, 0xD0, 0x12, 0x02, 0x01, 0x51, 0x02, 0x00, 0x40, 0xF0, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual(telegram.group_address, GroupAddress(337)) self.assertEqual(len(telegram.payload.value), 1) self.assertEqual(telegram.payload.value[0], 0xF0) # # End-tox-End tests: # # - parsing KNX telegram and check the result # - reassembling scond KNXIPFrame # - comparing both # def test_EndTOEnd_group_write_binary_on(self): """Test parsing and streaming CEMIFrame KNX/IP packet, switch on light in my kitchen.""" # Switch on Kitchen-L1 raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x11, 0x29, 0x00, 0xBC, 0xD0, 0xFF, 0xF9, 0x01, 0x49, 0x01, 0x00, 0x81, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual(telegram, Telegram(GroupAddress("329"), payload=DPTBinary(1))) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("15.15.249") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_EndTOEnd_group_write_binary_off(self): """Test parsing and streaming CEMIFrame KNX/IP packet, switch off light in my kitchen.""" # Switch off Kitchen-L1 raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x11, 0x29, 0x00, 0xBC, 0xD0, 0xFF, 0xF9, 0x01, 0x49, 0x01, 0x00, 0x80, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual(telegram, Telegram(GroupAddress("329"), payload=DPTBinary(0))) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("15.15.249") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_EndTOEnd_group_write_1byte(self): """Test parsing and streaming CEMIFrame KNX/IP packet, dimm light in my kitchen.""" # Dimm Kitchen L1 to 0x65 raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x12, 0x29, 0x00, 0xBC, 0xD0, 0xFF, 0xF9, 0x01, 0x4B, 0x02, 0x00, 0x80, 0x65, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual( telegram, Telegram(GroupAddress("331"), payload=DPTArray(0x65)) ) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("15.15.249") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_EndTOEnd_group_write_2bytes(self): """Test parsing and streaming CEMIFrame KNX/IP packet, setting value of thermostat.""" # Incoming Temperature from thermostat raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x13, 0x29, 0x00, 0xBC, 0xD0, 0x14, 0x02, 0x08, 0x01, 0x03, 0x00, 0x80, 0x07, 0xC1, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual( telegram, Telegram( GroupAddress("2049"), payload=DPTArray(DPTTemperature().to_knx(19.85)) ), ) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("1.4.2") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_EndTOEnd_group_read(self): """Test parsing and streaming CEMIFrame KNX/IP packet, group read.""" # State request raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x11, 0x29, 0x00, 0xBC, 0xD0, 0xFF, 0xF9, 0x01, 0xB8, 0x01, 0x00, 0x00, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual( telegram, Telegram(GroupAddress("440"), TelegramType.GROUP_READ) ) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("15.15.249") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_EndTOEnd_group_response(self): """Test parsing and streaming CEMIFrame KNX/IP packet, group response.""" # Incoming state raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x11, 0x29, 0x00, 0xBC, 0xD0, 0x13, 0x01, 0x01, 0x88, 0x01, 0x00, 0x41, ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.from_knx(raw) telegram = knxipframe.body.cemi.telegram self.assertEqual( telegram, Telegram( GroupAddress("392"), TelegramType.GROUP_RESPONSE, payload=DPTBinary(1) ), ) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.body.cemi.src_addr = PhysicalAddress("1.3.1") knxipframe2.body.cemi.telegram = telegram knxipframe2.body.cemi.set_hops(5) knxipframe2.normalize() self.assertEqual(knxipframe2.header.to_knx(), list(raw[0:6])) self.assertEqual(knxipframe2.body.to_knx(), list(raw[6:])) self.assertEqual(knxipframe2.to_knx(), list(raw)) def test_maximum_apci(self): """Test parsing and streaming CEMIFrame KNX/IP packet, testing maximum APCI.""" telegram = Telegram( group_address=GroupAddress(337), payload=DPTBinary(DPTBinary.APCI_MAX_VALUE) ) xknx = XKNX(loop=self.loop) knxipframe = KNXIPFrame(xknx) knxipframe.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe.body.cemi.src_addr = PhysicalAddress("1.3.1") knxipframe.body.cemi.telegram = telegram knxipframe.body.cemi.set_hops(5) knxipframe.normalize() raw = ( 0x06, 0x10, 0x05, 0x30, 0x00, 0x11, 0x29, 0x00, 0xBC, 0xD0, 0x13, 0x01, 0x01, 0x51, 0x01, 0x00, 0xBF, ) self.assertEqual(knxipframe.to_knx(), list(raw)) knxipframe2 = KNXIPFrame(xknx) knxipframe2.init(KNXIPServiceType.ROUTING_INDICATION) knxipframe2.from_knx(knxipframe.to_knx()) self.assertEqual(knxipframe2.body.cemi.telegram, telegram)
29.068522
98
0.53989
1,321
13,575
5.462528
0.130961
0.08107
0.031181
0.041574
0.812084
0.758731
0.750416
0.729767
0.724778
0.667822
0
0.084101
0.360589
13,575
466
99
29.130901
0.747235
0.09046
0
0.795918
0
0
0.007832
0
0
0
0.063958
0
0.104592
1
0.033163
false
0
0.017857
0
0.053571
0
0
0
0
null
0
0
0
1
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
7
c42a957f427a25683fc8418cd294963fa789959f
5,031
py
Python
pcl/__init__.py
conica-cui/python-pcl
b54e80e7da94ac9e2279b95fdac597f1de7145d7
[ "BSD-3-Clause" ]
1,705
2015-01-08T08:25:12.000Z
2022-03-31T07:02:55.000Z
pcl/__init__.py
Sh4zKh4n/python-pcl
1d83d2d7ce9ce2c22ff5855249459bfc22025000
[ "BSD-3-Clause" ]
331
2015-01-03T12:31:01.000Z
2022-03-31T21:00:32.000Z
pcl/__init__.py
Sh4zKh4n/python-pcl
1d83d2d7ce9ce2c22ff5855249459bfc22025000
[ "BSD-3-Clause" ]
666
2015-01-15T03:42:49.000Z
2022-03-25T13:48:33.000Z
# XXX do a more specific import! from ._pcl import * # from .pcl_visualization import * # from .pcl_grabber import * import sys def load(path, format=None): """Load pointcloud from path. Currently supports PCD and PLY files. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud() try: loader = getattr(p, "_from_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if loader(_encode(path)): raise IOError("error while loading pointcloud from %r (format=%r)" % (path, format)) return p def load_XYZI(path, format=None): """Load pointcloud from path. Currently supports PCD and PLY files. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZI() try: loader = getattr(p, "_from_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if loader(_encode(path)): raise IOError("error while loading pointcloud from %r (format=%r)" % (path, format)) return p def load_XYZRGB(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZRGB() try: loader = getattr(p, "_from_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if loader(_encode(path)): raise IOError("error while loading pointcloud from %r (format=%r)" % (path, format)) return p def load_XYZRGBA(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZRGBA() try: loader = getattr(p, "_from_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if loader(_encode(path)): raise IOError("error while loading pointcloud from %r (format=%r)" % (path, format)) return p def load_PointWithViewpoint(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointWithViewpoint() try: loader = getattr(p, "_from_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if loader(_encode(path)): raise IOError("error while loading pointcloud from %r (format=%r)" % (path, format)) return p def save(cloud, path, format=None, binary=False): """Save pointcloud to file. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) try: dumper = getattr(cloud, "_to_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if dumper(_encode(path), binary): raise IOError("error while saving pointcloud to %r (format=%r)" % (path, format)) def save_XYZRGBA(cloud, path, format=None, binary=False): """Save pointcloud to file. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) try: dumper = getattr(cloud, "_to_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if dumper(_encode(path), binary): raise IOError("error while saving pointcloud to %r (format=%r)" % (path, format)) def save_PointNormal(cloud, path, format=None, binary=False): """ Save pointcloud to file. Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) try: dumper = getattr(cloud, "_to_%s_file" % format) except AttributeError: raise ValueError("unknown file format %s" % format) if dumper(_encode(path), binary): raise IOError("error while saving pointcloud to %r (format=%r)" % (path, format)) def _encode(path): # Encode path for use in C++. if isinstance(path, bytes): return path else: return path.encode(sys.getfilesystemencoding()) def _infer_format(path, format): if format is not None: return format.lower() for candidate in ["pcd", "ply", "obj"]: if path.endswith("." + candidate): return candidate raise ValueError("Could not determine file format from pathname %s" % path)
30.676829
79
0.626118
621
5,031
4.971014
0.128824
0.080985
0.043732
0.061224
0.841594
0.841594
0.841594
0.841594
0.841594
0.841594
0
0
0.26456
5,031
163
80
30.865031
0.834054
0.023455
0
0.71875
0
0
0.189614
0
0
0
0
0
0
0
null
null
0
0.020833
null
null
0
0
0
0
null
0
0
0
1
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
1
0
0
0
0
0
0
0
0
8
c43039ea1dc0ad2b2617a367520e82f8cebfbaeb
129
py
Python
__init__.py
adamkglaser/pco-python
b2747666d8f09daec5dd8faa7a22ea1cb80079df
[ "MIT" ]
1
2021-03-21T09:30:19.000Z
2021-03-21T09:30:19.000Z
__init__.py
adamkglaser/pco-python
b2747666d8f09daec5dd8faa7a22ea1cb80079df
[ "MIT" ]
null
null
null
__init__.py
adamkglaser/pco-python
b2747666d8f09daec5dd8faa7a22ea1cb80079df
[ "MIT" ]
1
2021-01-21T00:54:16.000Z
2021-01-21T00:54:16.000Z
# -*- coding: utf-8 -*- """ @author: ziegler """ from hardware.pco.camera import camera from hardware.pco.camera import Camera
14.333333
38
0.689922
17
129
5.235294
0.588235
0.269663
0.337079
0.47191
0.741573
0.741573
0
0
0
0
0
0.009091
0.147287
129
8
39
16.125
0.8
0.302326
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
1
0
1
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
8
c44711d37ff87b7d39c6e3faa00f0f40d9161cb1
127
py
Python
posts/admin.py
ashwin-bitsathy/django---ecommerce
49ebb518ed5831639d560c27f2313f983fe27e86
[ "BSD-3-Clause" ]
null
null
null
posts/admin.py
ashwin-bitsathy/django---ecommerce
49ebb518ed5831639d560c27f2313f983fe27e86
[ "BSD-3-Clause" ]
null
null
null
posts/admin.py
ashwin-bitsathy/django---ecommerce
49ebb518ed5831639d560c27f2313f983fe27e86
[ "BSD-3-Clause" ]
null
null
null
from django.contrib import admin from .models import Post,Posted admin.site.register(Posted) admin.site.register(Post)
18.142857
33
0.771654
18
127
5.444444
0.555556
0.22449
0.306122
0.469388
0
0
0
0
0
0
0
0
0.141732
127
7
34
18.142857
0.899083
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
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
7
c46491be72ce2e1853282d36d4c92d1aca7952ae
113
py
Python
tests/test_curlio.py
weinerjm/decurl
365aa85739c4352766acca70e6b16c34a2ba418f
[ "Apache-2.0" ]
null
null
null
tests/test_curlio.py
weinerjm/decurl
365aa85739c4352766acca70e6b16c34a2ba418f
[ "Apache-2.0" ]
5
2016-06-16T22:02:40.000Z
2016-06-23T16:41:19.000Z
tests/test_curlio.py
weinerjm/decurl
365aa85739c4352766acca70e6b16c34a2ba418f
[ "Apache-2.0" ]
null
null
null
import sure import context import decurl.curlio as curlio def test_write(): pass def test_read(): pass
11.3
30
0.725664
17
113
4.705882
0.647059
0.175
0
0
0
0
0
0
0
0
0
0
0.212389
113
9
31
12.555556
0.898876
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.285714
true
0.285714
0.428571
0
0.714286
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
1
1
0
1
0
0
7
673aab4a15e84bdb1b9d4347d490473145d8c9ec
1,846
py
Python
test-runner/module_tests/test_connect_disconnect.py
gregga/iot-sdks-e2e-fx
02d0ce0823f0190ef26ccfbf3fd3ba7ccde8d6cb
[ "MIT" ]
null
null
null
test-runner/module_tests/test_connect_disconnect.py
gregga/iot-sdks-e2e-fx
02d0ce0823f0190ef26ccfbf3fd3ba7ccde8d6cb
[ "MIT" ]
1
2021-06-01T23:42:31.000Z
2021-06-01T23:42:31.000Z
test-runner/module_tests/test_connect_disconnect.py
gregga/my-iot-sdks-e2e-fx
f043aff93b415e214136110ed52c15e581892b42
[ "MIT" ]
null
null
null
#!/usr/bin/env python # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for # full license information. import pytest import connections @pytest.mark.testgroup_edgehub_module_client @pytest.mark.testgroup_iothub_module_client def test_module_client_connect_disconnect(): module_client = connections.connect_test_module_client() module_client.disconnect() @pytest.mark.testgroup_edgehub_module_client @pytest.mark.testgroup_iothub_module_client @pytest.mark.supportsTwin def test_module_client_connect_enable_twin_disconnect(): module_client = connections.connect_test_module_client() module_client.enable_twin() module_client.disconnect() @pytest.mark.testgroup_edgehub_module_client @pytest.mark.testgroup_iothub_module_client @pytest.mark.receivesMethodCalls def test_module_client_connect_enable_methods_disconnect(): module_client = connections.connect_test_module_client() module_client.enable_methods() module_client.disconnect() @pytest.mark.testgroup_edgehub_module_client @pytest.mark.receivesInputMessages def test_module_client_connect_enable_input_messages_disconnect(): module_client = connections.connect_test_module_client() module_client.enable_input_messages() module_client.disconnect() @pytest.mark.testgroup_edgehub_module_client @pytest.mark.module_under_test_has_device_wrapper def test_device_client_connect_disconnect(): device_client = connections.connect_leaf_device_client() device_client.disconnect() @pytest.mark.testgroup_edgehub_module_client @pytest.mark.module_under_test_has_device_wrapper def test_device_client_connect_enable_methods_disconnect(): device_client = connections.connect_leaf_device_client() device_client.enable_methods() device_client.disconnect()
32.385965
74
0.842362
231
1,846
6.25974
0.207792
0.232365
0.118257
0.121715
0.800138
0.768326
0.701936
0.701936
0.701936
0.701936
0
0
0.088299
1,846
56
75
32.964286
0.85918
0.089382
0
0.605263
0
0
0
0
0
0
0
0
0
1
0.157895
false
0
0.052632
0
0.210526
0
0
0
0
null
1
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
7
674305a6b2ee28c3fb7d23a0a8df1fd37ae18399
769
py
Python
python_programs/operator_overloading.py
abhayanigam/Learn_Python_Programming
801e3fff2b1fe35e4c93f4ced649516c519eb8f9
[ "MIT" ]
1
2021-08-28T15:10:26.000Z
2021-08-28T15:10:26.000Z
python_programs/operator_overloading.py
abhayanigam/Learn_Python_Programming
801e3fff2b1fe35e4c93f4ced649516c519eb8f9
[ "MIT" ]
null
null
null
python_programs/operator_overloading.py
abhayanigam/Learn_Python_Programming
801e3fff2b1fe35e4c93f4ced649516c519eb8f9
[ "MIT" ]
null
null
null
#for addition class number(): def __init__(self,num): self.num = num def __add__(self,num2): return(self.num + num2.num) n = number(2) n2 = number(2) sum = n + n2 print(sum) #--------------------------------------------------------------------------- #For Substraction class number(): def __init__(self,num): self.num = num def __sub__(self,num2): return(self.num - num2.num) n = number(2) n2 = number(2) sub = n - n2 print(sub) #--------------------------------------------------------------------------- #For Multiplication class number(): def __init__(self,num): self.num = num def __mul__(self,num2): return(self.num * num2.num) n = number(2) n2 = number(3) mul = n * n2 print(mul)
17.477273
76
0.477243
93
769
3.688172
0.225806
0.183673
0.122449
0.157434
0.723032
0.723032
0.723032
0.723032
0.723032
0.723032
0
0.029703
0.211964
769
44
77
17.477273
0.536304
0.254876
0
0.518519
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0
0.111111
0.333333
0.111111
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
1
0
0
0
1
0
0
0
7
67cbbdfca0a4d449a654f4359685c82907a5ac15
11,807
py
Python
server/core/tests/test_favorite_thing.py
omobosteven/favorite-things
c5fdf307f9a0c5d2ab659d0cc826f0f7201df141
[ "MIT" ]
null
null
null
server/core/tests/test_favorite_thing.py
omobosteven/favorite-things
c5fdf307f9a0c5d2ab659d0cc826f0f7201df141
[ "MIT" ]
15
2019-12-04T23:16:58.000Z
2022-02-27T05:06:03.000Z
server/core/tests/test_favorite_thing.py
omobosteven/favorite-things
c5fdf307f9a0c5d2ab659d0cc826f0f7201df141
[ "MIT" ]
1
2019-07-25T20:35:24.000Z
2019-07-25T20:35:24.000Z
from django.urls import reverse from rest_framework import status from .base import BaseViewTest from rest_framework import serializers class FavoriteThingTest(BaseViewTest): def test_unauthenticated_user_category(self): """ Ensure that an authenticated user can't create favorite thing """ data = {'title': 'test', 'ranking': 1, 'category': 1} response = self.client.post(reverse('favorite-thing'), data) print(response) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) def test_favorite_thing_category_user(self): """ Ensure that category is associated with or belongs to user """ self.login_client('test@test.com', 'pass1234') data = {'title': 'test', 'ranking': 1, 'category': self.category_phone.name} response = self.client.post(reverse('favorite-thing'), data) print(response.data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data['message'], 'Category unavailable - object not found') def test_favorite_thing_invalid_metadata(self): """ Ensure that users enters valid JSON type for metadata """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'metadata': 'beans', 'ranking': 4, 'category': self.default_category_food.name} response = self.client.post(reverse('favorite-thing'), data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertRaises(serializers.ValidationError) def test_favorite_thing_first_ranking(self): """ Ensures that ranking is ordered when creating first favorite thing """ self.login_client('test@test.com', 'pass1234') data = {'title': 'web', 'ranking': 400, 'category': self.default_category_places.name} response = self.client.post(reverse('favorite-thing'), data) self.assertEqual(response.data['ranking'], 1) def test_user_create_favorite_thing(self): """ Ensure that user can create favorite things """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'metadata': {'type': 'roasted'}, 'ranking': 4, 'category': self.default_category_food.name} response = self.client.post(reverse('favorite-thing'), data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response.data['title'], 'chicken') self.assertEqual(response.data['ranking'], 4) def test_favorite_thing_last_ranking(self): """ Ensures that ranking is ordered when creating new favorite thing """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'metadata': {'type': 'roasted'}, 'ranking': 400, 'category': self.default_category_food.name} response = self.client.post(reverse('favorite-thing'), data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response.data['ranking'], 4) def test_favorite_thing_duplicate(self): """ Ensure that duplicate favorite thing are not created """ self.login_client('test@test.com', 'pass1234') data = {'title': 'bread', 'ranking': 2, 'category': self.default_category_food.name} response = self.client.post(reverse('favorite-thing'), data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertRaises(serializers.ValidationError) def test_favorite_thing_ranking_reordering(self): """ Ensures that ranking is re_ordered when creating new favorite thing with existing ranking """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'metadata': {'type': 'roasted'}, 'ranking': 2, 'category': self.default_category_food.name} response = self.client.post(reverse('favorite-thing'), data) response_list = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response_list.data[0]['ranking'], 1) self.assertEqual(response.data['ranking'], 2) self.assertEqual(response_list.data[1]['title'], 'chicken') self.assertEqual(response_list.data[-2]['ranking'], 3) self.assertEqual(response_list.data[-1]['ranking'], 4) def test_list_user_favorite_things_category(self): """ Ensure that user get a list of favorite things in a category """ self.login_client('test@test.com', 'pass1234') response = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(len(response.data), 3) def test_list_user_favorite_things(self): """ Ensure that user get a list of the favorite things """ self.login_client('test@test.com', 'pass1234') response = self.client.get(reverse('favorite-thing')) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(len(response.data), 5) def test_detail_favorite_things(self): """ Ensure that use can view a favorite thing detail """ self.login_client('test@test.com', 'pass1234') response = self.client.get( reverse('favorite-thing-detail', None, {self.user1_favorite_1.pk})) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data['title'], 'rice') def test_detail_favorite_things_not_user(self): """ Ensure user cannot view detail of another users favorite things """ self.login_client('test@test.com', 'pass1234') response = self.client.get( reverse('favorite-thing-detail', None, {self.user2_favorite_1.pk})) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'Not found.') def test_favorite_things_update(self): """ Ensure user can update a favorite thing """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'ranking': 1, 'category': self.default_category_food.name} response = self.client.put( reverse('favorite-thing-detail', None, {self.user1_favorite_1.pk}), data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data['title'], 'chicken') def test_favorite_things_update_not_user(self): """ Ensure user cannot update a favorite thing not created """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'ranking': 1, 'category': self.default_category_food.name} response = self.client.put( reverse('favorite-thing-detail', None, {self.user2_favorite_1.pk}), data) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], 'Not found.') def test_favorite_things_update_category_not_user(self): """ Ensure user cannot update a favorite thing to a category not created """ self.login_client('test@test.com', 'pass1234') data = {'title': 'chicken', 'ranking': 1, 'category': self.category_phone .name} response = self.client.put( reverse('favorite-thing-detail', None, {self.user1_favorite_1.pk}), data) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['message'], 'Category unavailable - object not found') def test_favorite_things_update_reorder_ranking(self): """ Ensure ranking is reordered when ranking is updated with a ranking greater than instance """ self.login_client('test@test.com', 'pass1234') data = {'ranking': 2} response = self.client.patch( reverse('favorite-thing-detail', None, {self.user1_favorite_1.pk}), data) response_list = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) print(response_list.data) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data['ranking'], 2) self.assertEqual(response_list.data[1]['title'], self.user1_favorite_1.title) self.assertEqual(response_list.data[-1]['ranking'], 3) self.assertEqual(response_list.data[0]['ranking'], 1) def test_favorite_things_update_reorder_ranking_less(self): """ Ensure ranking is reordered when ranking is updated with a ranking less than instance """ self.login_client('test@test.com', 'pass1234') data = {'ranking': 1} response = self.client.patch( reverse('favorite-thing-detail', None, {self.user1_favorite_3.pk}), data) response_list = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) self.assertEqual(response.data['ranking'], 1) self.assertEqual(response_list.data[0]['title'], self.user1_favorite_3.title) def test_favorite_things_update_reorder_ranking_sequence(self): """ Ensure ranking is reordered sequentially when ranking is updated with a ranking greater than last instance """ self.login_client('test@test.com', 'pass1234') data = {'ranking': 10} response = self.client.patch( reverse('favorite-thing-detail', None, {self.user1_favorite_2.pk}), data) response_list = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) self.assertEqual(response.data['ranking'], 3) self.assertEqual(response_list.data[-1]['ranking'], 3) def test_favorite_things_update_duplicate(self): """ Ensure that duplicate favorite thing are not created """ self.login_client('test@test.com', 'pass1234') data = {'title': 'beans', 'ranking': 2} response = self.client.patch( reverse('favorite-thing-detail', None, {self.user1_favorite_1.pk}), data) print(response.data) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertRaises(serializers.ValidationError) def test_favorite_things_delete(self): """ Ensure that favorite thing is deleted and reordered """ self.login_client('test@test.com', 'pass1234') response = self.client.delete( reverse('favorite-thing-detail', None, {self.user1_favorite_2.pk})) response_list = self.client.get( reverse('favorite-things-category', None, {self.default_category_food.pk})) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) self.assertEqual(response_list.data[-1]['ranking'], 2)
43.72963
76
0.62861
1,333
11,807
5.390848
0.102776
0.089758
0.131227
0.050237
0.879349
0.849847
0.813665
0.787225
0.765795
0.724882
0
0.022388
0.250953
11,807
269
77
43.892193
0.79014
0.107479
0
0.661111
0
0
0.154206
0.035241
0
0
0
0
0.255556
1
0.111111
false
0.105556
0.022222
0
0.138889
0.022222
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
1
0
0
0
0
0
7
db2ca8b8dd0c70be195157b507bd746619d1334c
9,875
py
Python
pydsm/NTFdesign/tests/test_NTFdesign_minmax.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
pydsm/NTFdesign/tests/test_NTFdesign_minmax.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
pydsm/NTFdesign/tests/test_NTFdesign_minmax.py
EnjoyLifeFund/macHighSierra-py36-pkgs
5668b5785296b314ea1321057420bcd077dba9ea
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright (c) 2013, Sergio Callegari # All rights reserved. # This file is part of PyDSM. # PyDSM is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # PyDSM is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with PyDSM. If not, see <http://www.gnu.org/licenses/>. from __future__ import division, print_function from numpy.testing import TestCase, run_module_suite, dec import numpy as np from pydsm.NTFdesign import ntf_fir_minmax from nose.plugins.skip import SkipTest __all__ = ["TestSynthesizeNTFminmax"] class TestSynthesizeNTFminmax(TestCase): def setUp(self): pass def test_LP8_tinoco(self): try: import cvxpy_tinoco # analysis:ignore except: raise SkipTest("Modeler 'cvxpy_old' not installed") z, p, k = ntf_fir_minmax(order=8, show_progress=False, modeler='cvxpy_old') e_k = 1 e_z = [990.349427225477e-003 + 69.0500612157020e-003j, 990.349427225477e-003 - 69.0500612157020e-003j, 166.532844346146e-003 + 591.251073811726e-003j, 166.532844346146e-003 - 591.251073811726e-003j, -259.915617496087e-003 + 503.342225950477e-003j, -259.915617496087e-003 - 503.342225950477e-003j, -512.031157651993e-003 + 194.699627385223e-003j, -512.031157651993e-003 - 194.699627385223e-003j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=2e-4) def test_BP8_tinoco(self): try: import cvxpy_tinoco # analysis:ignore except: raise SkipTest("Modeler 'cvxpy_old' not installed") z, p, k = ntf_fir_minmax(order=8, osr=32, f0=0.2, show_progress=False, modeler='cvxpy_old') e_k = 1 e_z = [2.94348009789963e-01 + 9.14543800193135e-01j, 2.94348009789963e-01 - 9.14543800193135e-01j, 6.76745367518838e-01 + 0.00000000000000e+00j, 2.46816733211163e-01 + 5.50000475735513e-01j, 2.46816733211163e-01 - 5.50000475735513e-01j, -4.58884378359569e-01 + 4.10643263860101e-01j, -4.58884378359569e-01 - 4.10643263860101e-01j, -5.91022020183929e-01 + 0.00000000000000e+00j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=2e-4) def test_MB16_tinoco(self): try: import cvxpy_tinoco # analysis:ignore except: raise SkipTest("Modeler 'cvxpy_old' not installed") z, p, k = ntf_fir_minmax(order=8, osr=64, f0=[0.1, 0.2], show_progress=False, modeler='cvxpy_old') e_k = 1 e_z = [7.201593591543093e-01 + 4.847692940420519e-01j, 7.201593591543093e-01 - 4.847692940420519e-01j, 2.503311061929155e-01 + 8.210993460982702e-01j, 2.503311061929155e-01 - 8.210993460982702e-01j, -4.140998358546186e-01 + 4.504982522544850e-01j, -4.140998358546186e-01 - 4.504982522544850e-01j, -5.755598430642412e-01, -1.159555247895333e-01] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=1e-3, atol=3e-2) def test_LP8_picos(self): try: import picos # analysis:ignore except: raise SkipTest("Modeler 'picos' not installed") z, p, k = ntf_fir_minmax(order=8, show_progress=False, modeler='picos') e_k = 1 e_z = [990.349427225477e-003 + 69.0500612157020e-003j, 990.349427225477e-003 - 69.0500612157020e-003j, 166.532844346146e-003 + 591.251073811726e-003j, 166.532844346146e-003 - 591.251073811726e-003j, -259.915617496087e-003 + 503.342225950477e-003j, -259.915617496087e-003 - 503.342225950477e-003j, -512.031157651993e-003 + 194.699627385223e-003j, -512.031157651993e-003 - 194.699627385223e-003j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=1e-3) def test_BP8_picos(self): try: import picos # analysis:ignore except: raise SkipTest("Modeler 'picos' not installed") z, p, k = ntf_fir_minmax(order=8, osr=32, f0=0.2, show_progress=False, modeler='picos') e_k = 1 e_z = [2.94348009789963e-01 + 9.14543800193135e-01j, 2.94348009789963e-01 - 9.14543800193135e-01j, 6.76745367518838e-01 + 0.00000000000000e+00j, 2.46816733211163e-01 + 5.50000475735513e-01j, 2.46816733211163e-01 - 5.50000475735513e-01j, -4.58884378359569e-01 + 4.10643263860101e-01j, -4.58884378359569e-01 - 4.10643263860101e-01j, -5.91022020183929e-01 + 0.00000000000000e+00j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=2e-4) def test_MB16_picos(self): try: import picos # analysis:ignore except: raise SkipTest("Modeler 'picos' not installed") z, p, k = ntf_fir_minmax(order=8, osr=64, f0=[0.1, 0.2], show_progress=False, modeler='picos') e_k = 1 e_z = [7.201593591543093e-01 + 4.847692940420519e-01j, 7.201593591543093e-01 - 4.847692940420519e-01j, 2.503311061929155e-01 + 8.210993460982702e-01j, 2.503311061929155e-01 - 8.210993460982702e-01j, -4.140998358546186e-01 + 4.504982522544850e-01j, -4.140998358546186e-01 - 4.504982522544850e-01j, -5.755598430642412e-01, -1.159555247895333e-01] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=1e-3, atol=3e-2) @dec.slow def test_LP8_cvxpy(self): try: import cvxpy # analysis:ignore except: raise SkipTest("Modeler 'cvxpy' not installed") z, p, k = ntf_fir_minmax(order=8, show_progress=False, modeler='cvxpy') e_k = 1 e_z = [990.349427225477e-003 + 69.0500612157020e-003j, 990.349427225477e-003 - 69.0500612157020e-003j, 166.532844346146e-003 + 591.251073811726e-003j, 166.532844346146e-003 - 591.251073811726e-003j, -259.915617496087e-003 + 503.342225950477e-003j, -259.915617496087e-003 - 503.342225950477e-003j, -512.031157651993e-003 + 194.699627385223e-003j, -512.031157651993e-003 - 194.699627385223e-003j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=1e-3) @dec.slow def test_BP8_cvxpy(self): try: import cvxpy # analysis:ignore except: raise SkipTest("Modeler 'cvxpy' not installed") z, p, k = ntf_fir_minmax(order=8, osr=32, f0=0.2, show_progress=False, modeler='cvxpy') e_k = 1 e_z = [2.94348009789963e-01 + 9.14543800193135e-01j, 2.94348009789963e-01 - 9.14543800193135e-01j, 6.76745367518838e-01 + 0.00000000000000e+00j, 2.46816733211163e-01 + 5.50000475735513e-01j, 2.46816733211163e-01 - 5.50000475735513e-01j, -4.58884378359569e-01 + 4.10643263860101e-01j, -4.58884378359569e-01 - 4.10643263860101e-01j, -5.91022020183929e-01 + 0.00000000000000e+00j] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=2e-4) @dec.slow def test_MB16_cvxpy(self): try: import cvxpy # analysis:ignore except: raise SkipTest("Modeler 'cvxpy' not installed") z, p, k = ntf_fir_minmax(order=8, osr=64, f0=[0.1, 0.2], show_progress=False, modeler='cvxpy') e_k = 1 e_z = [7.201593591543093e-01 + 4.847692940420519e-01j, 7.201593591543093e-01 - 4.847692940420519e-01j, 2.503311061929155e-01 + 8.210993460982702e-01j, 2.503311061929155e-01 - 8.210993460982702e-01j, -4.140998358546186e-01 + 4.504982522544850e-01j, -4.140998358546186e-01 - 4.504982522544850e-01j, -5.755598430642412e-01, -1.159555247895333e-01] e_z = np.sort(e_z) z = np.sort(z) np.testing.assert_allclose(k, e_k, rtol=1e-6) np.testing.assert_allclose(z, e_z, rtol=1e-3, atol=3e-2) if __name__ == '__main__': run_module_suite()
42.200855
78
0.588253
1,224
9,875
4.624183
0.155229
0.012721
0.022261
0.073145
0.855477
0.850883
0.840989
0.840989
0.840989
0.840989
0
0.371937
0.305722
9,875
233
79
42.381974
0.453617
0.085063
0
0.892857
0
0
0.040062
0.002552
0
0
0
0
0.091837
1
0.05102
false
0.005102
0.071429
0
0.127551
0.005102
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
c005a60f389a5e9d4cb562f1a8ec10fed9ff93cf
21,474
py
Python
dataset.py
ndkgit339/FastSpeech2-filled_pause_speech_synthesis
dc8742704df20be325570f3c497f36815e0d72f2
[ "MIT" ]
null
null
null
dataset.py
ndkgit339/FastSpeech2-filled_pause_speech_synthesis
dc8742704df20be325570f3c497f36815e0d72f2
[ "MIT" ]
null
null
null
dataset.py
ndkgit339/FastSpeech2-filled_pause_speech_synthesis
dc8742704df20be325570f3c497f36815e0d72f2
[ "MIT" ]
null
null
null
import json import math import os import numpy as np from torch.utils.data import Dataset from text import symbols, text_to_sequence from utils.tools import pad_1D, pad_2D def convert_lab_available(lab): if lab == "sil": lab = "" elif lab == "A": lab = "a" elif lab == "I": lab = "i" elif lab == "U": lab = "u" elif lab == "E": lab = "e" elif lab == "O": lab = "o" elif lab == "cl": lab = "q" elif lab == "pau": lab = "sp" elif lab == "v": lab = "b" return lab class Dataset(Dataset): def __init__( self, filename, preprocess_config, train_config, sort=False, drop_last=False ): self.dataset_name = preprocess_config["dataset"] self.preprocessed_path = preprocess_config["path"]["preprocessed_path"] self.cleaners = preprocess_config["preprocessing"]["text"]["text_cleaners"] self.batch_size = train_config["optimizer"]["batch_size"] self.symbol_to_id = {s: i for i, s in enumerate(symbols)} self.use_accent = preprocess_config["preprocessing"]["accent"]["use_accent"] self.accent_to_id = {'0':0, '[':1, ']':2, '#':3} # Use fp tag self.preprocess_use_fp_tag = preprocess_config["preprocessing"]["use_fp_tag"] self.train_use_fp_tag = train_config["use_fp_tag"] if self.train_use_fp_tag: self.basename, self.speaker, self.text, self.raw_text, self.fp_tag = \ self.process_meta(filename) else: self.basename, self.speaker, self.text, self.raw_text = self.process_meta( filename) with open(os.path.join(self.preprocessed_path, "speakers.json")) as f: self.speaker_map = json.load(f) self.sort = sort self.drop_last = drop_last def __len__(self): return len(self.text) def __getitem__(self, idx): basename = self.basename[idx] speaker = self.speaker[idx] speaker_id = self.speaker_map[speaker] raw_text = self.raw_text[idx] phone = np.array([self.symbol_to_id[t] for t in self.text[idx].replace("{", "").replace("}", "").split()]) if self.use_accent: with open(os.path.join(self.preprocessed_path, "accent",basename+ '.accent')) as f: accent = f.read() accent = [self.accent_to_id[t] for t in accent] accent = np.array(accent[:len(phone)]) mel_path = os.path.join( self.preprocessed_path, "mel", "{}-mel-{}.npy".format(speaker, basename), ) mel = np.load(mel_path) pitch_path = os.path.join( self.preprocessed_path, "pitch", "{}-pitch-{}.npy".format(speaker, basename), ) pitch = np.load(pitch_path) energy_path = os.path.join( self.preprocessed_path, "energy", "{}-energy-{}.npy".format(speaker, basename), ) energy = np.load(energy_path) duration_path = os.path.join( self.preprocessed_path, "duration", "{}-duration-{}.npy".format(speaker, basename), ) duration = np.load(duration_path) sample = { "id": basename, "speaker": speaker_id, "text": phone, "raw_text": raw_text, "mel": mel, "pitch": pitch, "energy": energy, "duration": duration, } if self.use_accent: sample["accent"] = accent if self.train_use_fp_tag: fp_tag = np.array( [int(f) for f in self.fp_tag[idx].split(" ")]) sample["fp_tag"] = fp_tag return sample def process_meta(self, filename): with open( os.path.join(self.preprocessed_path, filename), "r", encoding="utf-8" ) as f: name = [] speaker = [] text = [] raw_text = [] fp_tag = [] for line in f.readlines(): if self.preprocess_use_fp_tag: n, s, t, r, f = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) fp_tag.append(f) else: n, s, t, r = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) if self.train_use_fp_tag: return name, speaker, text, raw_text, fp_tag else: return name, speaker, text, raw_text def reprocess(self, data, idxs): ids = [data[idx]["id"] for idx in idxs] speakers = [data[idx]["speaker"] for idx in idxs] texts = [data[idx]["text"] for idx in idxs] raw_texts = [data[idx]["raw_text"] for idx in idxs] mels = [data[idx]["mel"] for idx in idxs] pitches = [data[idx]["pitch"] for idx in idxs] energies = [data[idx]["energy"] for idx in idxs] durations = [data[idx]["duration"] for idx in idxs] if self.use_accent: accents = [data[idx]["accent"] for idx in idxs] text_lens = np.array([text.shape[0] for text in texts]) mel_lens = np.array([mel.shape[0] for mel in mels]) speakers = np.array(speakers) texts = pad_1D(texts) mels = pad_2D(mels) pitches = pad_1D(pitches) energies = pad_1D(energies) durations = pad_1D(durations) if self.train_use_fp_tag: fp_tags = pad_1D([data[idx]["fp_tag"] for idx in idxs]) fp_tags = np.expand_dims(fp_tags, axis=2) if self.use_accent: accents = pad_1D(accents) return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, accents, fp_tags ) else: return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, fp_tags ) else: if self.use_accent: accents = pad_1D(accents) return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, accents ) else: return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations ) def collate_fn(self, data): data_size = len(data) if self.sort: len_arr = np.array([d["text"].shape[0] for d in data]) idx_arr = np.argsort(-len_arr) else: idx_arr = np.arange(data_size) tail = idx_arr[len(idx_arr) - (len(idx_arr) % self.batch_size) :] idx_arr = idx_arr[: len(idx_arr) - (len(idx_arr) % self.batch_size)] idx_arr = idx_arr.reshape((-1, self.batch_size)).tolist() if not self.drop_last and len(tail) > 0: idx_arr += [tail.tolist()] output = list() for idx in idx_arr: output.append(self.reprocess(data, idx)) return output class DatasetForTest(Dataset): def __init__( self, filename, preprocess_config, train_config, sort=False, drop_last=False ): self.dataset_name = preprocess_config["dataset"] self.preprocessed_path = preprocess_config["path"]["preprocessed_path"] self.cleaners = preprocess_config["preprocessing"]["text"]["text_cleaners"] self.batch_size = train_config["optimizer"]["batch_size"] self.symbol_to_id = {s: i for i, s in enumerate(symbols)} self.use_accent = preprocess_config["preprocessing"]["accent"]["use_accent"] self.accent_to_id = {'0':0, '[':1, ']':2, '#':3} self.preprocess_with_tag = preprocess_config["preprocessing"]["with_tag"] self.with_tag = train_config["with_tag"] if self.with_tag: self.basename, self.speaker, self.text, self.raw_text, self.filler_tag = self.process_meta( filename ) else: self.basename, self.speaker, self.text, self.raw_text = self.process_meta( filename ) with open(os.path.join(self.preprocessed_path, "speakers.json")) as f: self.speaker_map = json.load(f) def __len__(self): return len(self.text) def __getitem__(self, idx): basename = self.basename[idx] speaker = self.speaker[idx] speaker_id = self.speaker_map[speaker] raw_text = self.raw_text[idx] phone = np.array([self.symbol_to_id[t] for t in self.text[idx].replace("{", "").replace("}", "").split()]) if self.use_accent: with open(os.path.join(self.preprocessed_path, "accent",basename+ '.accent')) as f: accent = f.read() accent = [self.accent_to_id[t] for t in accent] #### Matsunaga #### # assert len(phone) == len(accent) accent = np.array(accent[:len(phone)]) mel_path = os.path.join( self.preprocessed_path, "mel", "{}-mel-{}.npy".format(speaker, basename), ) mel = np.load(mel_path) pitch_path = os.path.join( self.preprocessed_path, "pitch", "{}-pitch-{}.npy".format(speaker, basename), ) pitch = np.load(pitch_path) energy_path = os.path.join( self.preprocessed_path, "energy", "{}-energy-{}.npy".format(speaker, basename), ) energy = np.load(energy_path) duration_path = os.path.join( self.preprocessed_path, "duration", "{}-duration-{}.npy".format(speaker, basename), ) duration = np.load(duration_path) sample = { "id": basename, "speaker": speaker_id, "text": phone, "raw_text": raw_text, "mel": mel, "pitch": pitch, "energy": energy, "duration": duration, } if self.use_accent: sample["accent"] = accent if self.with_tag: filler_tag = np.array([int(f) for f in self.filler_tag[idx].split(" ")]) sample["f_tag"] = filler_tag return sample def process_meta(self, filename): with open( os.path.join(self.preprocessed_path, filename), "r", encoding="utf-8" ) as f: name = [] speaker = [] text = [] raw_text = [] filler_tag = [] for line in f.readlines(): if self.preprocess_with_tag: n, s, t, r, f = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) filler_tag.append(f) else: n, s, t, r = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) if self.with_tag: return name, speaker, text, raw_text, filler_tag else: return name, speaker, text, raw_text def collate_fn(self, data): ids = [d["id"] for d in data] speakers = [d["speaker"] for d in data] texts = [d["text"] for d in data] raw_texts = [d["raw_text"] for d in data] mels = [d["mel"] for d in data] pitches = [d["pitch"] for d in data] energies = [d["energy"] for d in data] durations = [d["duration"] for d in data] if self.use_accent: accents = [d["accent"] for d in data] text_lens = np.array([text.shape[0] for text in texts]) mel_lens = np.array([mel.shape[0] for mel in mels]) speakers = np.array(speakers) texts = pad_1D(texts) mels = pad_2D(mels) pitches = pad_1D(pitches) energies = pad_1D(energies) durations = pad_1D(durations) if self.with_tag: filler_tags = pad_1D([d["f_tag"] for d in data]) filler_tags = np.expand_dims(filler_tags, axis=2) if self.with_tag: if self.use_accent: accents = pad_1D(accents) return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, accents, filler_tags ) else: return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, filler_tags ) else: if self.use_accent: accents = pad_1D(accents) return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, accents, ) else: return ( ids, raw_texts, speakers, texts, text_lens, max(text_lens), mels, mel_lens, max(mel_lens), pitches, energies, durations, ) class TextDataset(Dataset): def __init__(self, filepath, preprocess_config, train_config): self.cleaners = preprocess_config["preprocessing"]["text"]["text_cleaners"] self.preprocessed_path = preprocess_config["path"]["preprocessed_path"] self.symbol_to_id = {s: i for i, s in enumerate(symbols)} self.preprocess_use_fp_tag = preprocess_config["preprocessing"]["use_fp_tag"] self.train_use_fp_tag = train_config["use_fp_tag"] if self.train_use_fp_tag: self.basename, self.speaker, self.text, self.raw_text, self.fp_tag = \ self.process_meta(filepath) else: self.basename, self.speaker, self.text, self.raw_text = \ self.process_meta(filepath) with open( os.path.join( preprocess_config["path"]["preprocessed_path"], "speakers.json" ) ) as f: self.speaker_map = json.load(f) self.use_accent = preprocess_config["preprocessing"]["accent"]["use_accent"] self.accent_to_id = {'0':0, '[':1, ']':2, '#':3} def __len__(self): return len(self.text) def __getitem__(self, idx): basename = self.basename[idx] speaker = self.speaker[idx] speaker_id = self.speaker_map[speaker] raw_text = self.raw_text[idx] phone = np.array([self.symbol_to_id[convert_lab_available(t)] for t in self.text[idx].replace("{", "").replace("}", "").split()]) accent = None if self.use_accent: with open(os.path.join(self.preprocessed_path, "accent",basename+ '.accent')) as f: accent = f.read() accent = [self.accent_to_id[t] for t in accent] accent = np.array(accent[:len(phone)]) if self.train_use_fp_tag: fp_tag = np.array([int(f) for f in self.fp_tag[idx].split(" ")]) assert len(phone) == len(fp_tag), \ "phone length {}, ftag length {}, should be equal".format( len(phone), len(fp_tag)) return (basename, speaker_id, phone, raw_text, accent, fp_tag) else: return (basename, speaker_id, phone, raw_text, accent) def process_meta(self, filename): with open(filename, "r", encoding="utf-8") as f: name = [] speaker = [] text = [] raw_text = [] fp_tag = [] for line in f.readlines(): if self.preprocess_use_fp_tag: n, s, t, r, f = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) fp_tag.append(f) assert len(t.split(" ")) == len(f.split(" ")) else: n, s, t, r = line.strip("\n").split("|") name.append(n) speaker.append(s) text.append(t) raw_text.append(r) if self.train_use_fp_tag: return name, speaker, text, raw_text, fp_tag else: return name, speaker, text, raw_text def collate_fn(self, data): ids = [d[0] for d in data] speakers = np.array([d[1] for d in data]) texts = [d[2] for d in data] raw_texts = [d[3] for d in data] text_lens = np.array([text.shape[0] for text in texts]) if self.use_accent: accents = pad_1D([d[4] for d in data]) texts = pad_1D(texts) if self.train_use_fp_tag: fp_tags = pad_1D([d[5] for d in data]) fp_tags = np.expand_dims(fp_tags, axis=2) if self.use_accent: return ids, raw_texts, speakers, texts, text_lens, max(text_lens), accents, fp_tags else: return ids, raw_texts, speakers, texts, text_lens, max(text_lens), fp_tags else: if self.use_accent: return ids, raw_texts, speakers, texts, text_lens, max(text_lens), accents else: return ids, raw_texts, speakers, texts, text_lens, max(text_lens), accents if __name__ == "__main__": # Test import torch import yaml from torch.utils.data import DataLoader from utils.utils import to_device device = torch.device("cuda" if torch.cuda.is_available() else "cpu") preprocess_config = yaml.load( open("./config/LJSpeech/preprocess.yaml", "r"), Loader=yaml.FullLoader ) train_config = yaml.load( open("./config/LJSpeech/train.yaml", "r"), Loader=yaml.FullLoader ) train_dataset = Dataset( "train.txt", preprocess_config, train_config, sort=True, drop_last=True ) val_dataset = Dataset( "val.txt", preprocess_config, train_config, sort=False, drop_last=False ) train_loader = DataLoader( train_dataset, batch_size=train_config["optimizer"]["batch_size"] * 4, shuffle=True, collate_fn=train_dataset.collate_fn, ) val_loader = DataLoader( val_dataset, batch_size=train_config["optimizer"]["batch_size"], shuffle=False, collate_fn=val_dataset.collate_fn, ) n_batch = 0 for batchs in train_loader: for batch in batchs: to_device(batch, device) n_batch += 1 print( "Training set with size {} is composed of {} batches.".format( len(train_dataset), n_batch ) ) n_batch = 0 for batchs in val_loader: for batch in batchs: to_device(batch, device) n_batch += 1 print( "Validation set with size {} is composed of {} batches.".format( len(val_dataset), n_batch ) )
33.870662
137
0.491106
2,379
21,474
4.23119
0.074401
0.018379
0.0151
0.016889
0.816908
0.783529
0.760779
0.74548
0.728393
0.698391
0
0.004706
0.396386
21,474
633
138
33.924171
0.771872
0.002748
0
0.706503
0
0
0.058216
0.00285
0
0
0
0
0.003515
1
0.029877
false
0
0.019332
0.005272
0.101933
0.003515
0
0
0
null
0
0
0
1
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
7
c0317880888301aafc02476c76489682b900f43b
5,222
py
Python
my_bookshelf/my_bookshelf/web_app/forms.py
vhadzhiev/my_bookshelf
0265e44616a027b406bc1914232ed00ed0b85b57
[ "MIT" ]
null
null
null
my_bookshelf/my_bookshelf/web_app/forms.py
vhadzhiev/my_bookshelf
0265e44616a027b406bc1914232ed00ed0b85b57
[ "MIT" ]
null
null
null
my_bookshelf/my_bookshelf/web_app/forms.py
vhadzhiev/my_bookshelf
0265e44616a027b406bc1914232ed00ed0b85b57
[ "MIT" ]
null
null
null
from django import forms from django.core.exceptions import ValidationError from my_bookshelf.web_app.models import Book, Bookshelf BOOK_ISBN_EXCEPTION_MESSAGE = 'You have already added a book with this ISBN.' BOOKSHELF_TITLE_EXCEPTION_MESSAGE = 'You have already created a bookshelf with this title.' class BookCreateForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') super().__init__(*args, **kwargs) def clean_isbn(self): isbn = self.cleaned_data['isbn'] try: Book.objects.get(isbn=isbn, user_id=self.user.id) except Book.DoesNotExist: pass else: raise ValidationError(BOOK_ISBN_EXCEPTION_MESSAGE) return isbn class Meta: model = Book exclude = ('user',) widgets = { 'title': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s title', }, ), 'author': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s author', }, ), 'isbn': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s ISBN', }, ), 'summary': forms.Textarea( attrs={ 'placeholder': 'Enter book\'s summary', 'rows': 10, }, ), } class BookEditForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') self.isbn = kwargs.pop('isbn') super().__init__(*args, **kwargs) def clean_isbn(self): isbn = self.isbn new_isbn = self.cleaned_data['isbn'] if new_isbn != isbn: try: Book.objects.get(isbn=new_isbn, user_id=self.user.id) except Book.DoesNotExist: pass else: raise ValidationError(BOOK_ISBN_EXCEPTION_MESSAGE) return new_isbn class Meta: model = Book exclude = ('user',) widgets = { 'title': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s title', }, ), 'author': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s author', }, ), 'isbn': forms.TextInput( attrs={ 'placeholder': 'Enter book\'s ISBN', }, ), 'summary': forms.Textarea( attrs={ 'placeholder': 'Enter book\'s summary', 'rows': 10, }, ), } class BookshelfCreateForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') super().__init__(*args, **kwargs) if self.user: self.fields['books'].queryset = Book.objects.filter(user_id=self.user.id).order_by('-date_added') def clean_title(self): title = self.cleaned_data['title'] try: Bookshelf.objects.get(title=title, user_id=self.user.id) except Bookshelf.DoesNotExist: pass else: raise ValidationError(BOOKSHELF_TITLE_EXCEPTION_MESSAGE) return title class Meta: model = Bookshelf exclude = ('user',) widgets = { 'title': forms.TextInput( attrs={ 'placeholder': 'Enter bookshelf\'s title', }, ), 'description': forms.Textarea( attrs={ 'placeholder': 'Enter bookshelf\'s description', 'rows': 5, }, ), 'books': forms.CheckboxSelectMultiple(), } class BookshelfEditForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') self.title = kwargs.pop('title') super().__init__(*args, **kwargs) if self.user: self.fields['books'].queryset = Book.objects.filter(user_id=self.user.id).order_by('-date_added') def clean_title(self): title = self.title new_title = self.cleaned_data['title'] if new_title != title: try: Bookshelf.objects.get(title=new_title, user_id=self.user.id) except Bookshelf.DoesNotExist: pass else: raise ValidationError(BOOKSHELF_TITLE_EXCEPTION_MESSAGE) return new_title class Meta: model = Bookshelf exclude = ('user',) widgets = { 'title': forms.TextInput( attrs={ 'placeholder': 'Enter bookshelf\'s title', }, ), 'description': forms.Textarea( attrs={ 'placeholder': 'Enter bookshelf\'s description', 'rows': 5, }, ), 'books': forms.CheckboxSelectMultiple(), }
30.011494
109
0.492915
467
5,222
5.344754
0.167024
0.038462
0.100962
0.096154
0.863782
0.811699
0.766026
0.766026
0.766026
0.766026
0
0.001896
0.39391
5,222
173
110
30.184971
0.78673
0
0
0.718954
0
0
0.110111
0
0
0
0
0
0
1
0.052288
false
0.026144
0.019608
0
0.150327
0
0
0
0
null
0
0
0
1
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
7
fbe82365ff544c26d65f850dea16098fdbfa45d8
2,466
py
Python
src/dynamic_programming/python/can_sum/tests/test_can_sum.py
djeada/GraphAlgorithms
0961303ec20430f90053a4efb9074185f96dfddc
[ "MIT" ]
2
2021-05-31T13:01:33.000Z
2021-12-20T19:48:18.000Z
src/dynamic_programming/python/can_sum/tests/test_can_sum.py
djeada/GraphAlgorithms
0961303ec20430f90053a4efb9074185f96dfddc
[ "MIT" ]
null
null
null
src/dynamic_programming/python/can_sum/tests/test_can_sum.py
djeada/GraphAlgorithms
0961303ec20430f90053a4efb9074185f96dfddc
[ "MIT" ]
null
null
null
import unittest import os import sys file_dir = os.path.dirname(os.path.dirname(__file__)) sys.path.append(file_dir + "/src") from can_sum import can_sum_basic, can_sum_memo, can_sum_table class TestCanSumBasic(unittest.TestCase): def test_negative_1(self): numbers = [2, 2, 4] target = 7 result = False self.assertEqual(can_sum_basic(target, numbers), result) def test_negative_2(self): numbers = [3, 5, 9, 10] target = 1 result = False self.assertEqual(can_sum_basic(target, numbers), result) def test_positive_1(self): numbers = [3, 3, 8, 9, 11] target = 20 result = True self.assertEqual(can_sum_basic(target, numbers), result) def test_positive_2(self): numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] target = 25 result = True self.assertEqual(can_sum_basic(target, numbers), result) class TestCanSumMemo(unittest.TestCase): def test_negative_1(self): numbers = [2, 2, 4] target = 7 result = False self.assertEqual(can_sum_memo(target, numbers), result) def test_negative_2(self): numbers = [3, 5, 9, 10] target = 1 result = False self.assertEqual(can_sum_memo(target, numbers), result) def test_positive_1(self): numbers = [3, 3, 8, 9, 11] target = 20 result = True self.assertEqual(can_sum_memo(target, numbers), result) def test_positive_2(self): numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] target = 25 result = True self.assertEqual(can_sum_memo(target, numbers), result) class TestCanSumTab(unittest.TestCase): def test_negative_1(self): numbers = [2, 2, 4] target = 7 result = False self.assertEqual(can_sum_table(target, numbers), result) def test_negative_2(self): numbers = [3, 5, 9, 10] target = 1 result = False self.assertEqual(can_sum_table(target, numbers), result) def test_positive_1(self): numbers = [3, 3, 8, 9, 11] target = 20 result = True self.assertEqual(can_sum_table(target, numbers), result) def test_positive_2(self): numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] target = 25 result = True self.assertEqual(can_sum_table(target, numbers), result) if __name__ == "__main__": unittest.main()
26.804348
64
0.602595
333
2,466
4.255255
0.144144
0.067749
0.152435
0.177841
0.846154
0.846154
0.846154
0.846154
0.846154
0.846154
0
0.059693
0.286699
2,466
91
65
27.098901
0.745878
0
0
0.84507
0
0
0.004866
0
0
0
0
0
0.169014
1
0.169014
false
0
0.056338
0
0.267606
0
0
0
0
null
0
0
1
1
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
8
2222b5565b2caccabd1d150862357a8abccfb62b
2,050
py
Python
loudml/requests.py
toni-moreno/loudml
0252b6792393fc46f2dc9c1da25dd89fc27a5fa4
[ "Apache-2.0" ]
245
2018-01-30T08:11:53.000Z
2022-03-26T07:17:42.000Z
loudml/requests.py
robcowart/loudml
0008baef02259a8ae81dd210d3f91a51ffc9ed9f
[ "Apache-2.0" ]
620
2018-01-28T22:58:24.000Z
2022-03-13T13:40:42.000Z
loudml/requests.py
robcowart/loudml
0008baef02259a8ae81dd210d3f91a51ffc9ed9f
[ "Apache-2.0" ]
97
2018-03-06T14:44:26.000Z
2022-03-24T01:57:31.000Z
from loudml import errors import requests from urllib.parse import urlencode DEFAULT_REQUEST_TIMEOUT = 5 def perform_request( base_url, method, url, session, params=None, body=None, timeout=None, ignore=(), headers=None ): url = base_url + url if params: url = '%s?%s' % (url, urlencode(params or {})) request = requests.Request( method=method, headers=headers, url=url, json=body) prepared_request = session.prepare_request(request) settings = session.merge_environment_settings( prepared_request.url, {}, None, None, None) send_kwargs = {'timeout': timeout} send_kwargs.update(settings) try: response = session.send(prepared_request, **send_kwargs) except Exception as e: if isinstance(e, requests.exceptions.SSLError): raise errors.SSLError('N/A', str(e), e) if isinstance(e, requests.Timeout): raise errors.ConnectionTimeout('TIMEOUT', str(e), e) raise errors.ConnectionError('N/A', str(e), e) return response def perform_data_request( base_url, method, url, session, params=None, body=None, timeout=None, ignore=(), headers=None ): url = base_url + url if params: url = '%s?%s' % (url, urlencode(params or {})) request = requests.Request( method=method, headers=headers, url=url, data=body) prepared_request = session.prepare_request(request) settings = session.merge_environment_settings( prepared_request.url, {}, None, None, None) send_kwargs = {'timeout': timeout} send_kwargs.update(settings) try: response = session.send(prepared_request, **send_kwargs) except Exception as e: if isinstance(e, requests.exceptions.SSLError): raise errors.SSLError('N/A', str(e), e) if isinstance(e, requests.Timeout): raise errors.ConnectionTimeout('TIMEOUT', str(e), e) raise errors.ConnectionError('N/A', str(e), e) return response
27.333333
64
0.642439
244
2,050
5.286885
0.213115
0.069767
0.023256
0.043411
0.906977
0.906977
0.906977
0.906977
0.906977
0.906977
0
0.000642
0.240488
2,050
74
65
27.702703
0.827874
0
0
0.875
0
0
0.02439
0
0
0
0
0
0
1
0.03125
false
0
0.046875
0
0.109375
0
0
0
0
null
0
0
0
1
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
7
225b16762aa833988553456abd3808031ee740b6
504,474
py
Python
jobs/autotest/many_code.py
abudnik/prun
643a6bf49249e220f08317b8a4739570faf7b2ae
[ "Apache-2.0" ]
20
2015-05-14T19:44:01.000Z
2018-04-14T15:25:08.000Z
jobs/autotest/many_code.py
abudnik/prun
643a6bf49249e220f08317b8a4739570faf7b2ae
[ "Apache-2.0" ]
11
2015-04-15T19:51:06.000Z
2017-01-03T14:57:49.000Z
jobs/autotest/many_code.py
abudnik/prun
643a6bf49249e220f08317b8a4739570faf7b2ae
[ "Apache-2.0" ]
7
2015-05-08T12:44:38.000Z
2021-12-10T18:00:01.000Z
''' 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890 ''' print( "Hello, Python!" ) print( "taskId:%d, numTasks:%d" % (taskId, numTasks) )
70.952743
70
0.985841
7,114
504,474
69.908771
0.000984
1.999513
2.998848
3.997901
0.999897
0.999897
0.999897
0.999897
0.999897
0.999897
0
0.999847
0.01411
504,474
7,109
71
70.962723
0.000103
0.99982
0
0
0
0
0.433735
0
0
1
0
0
0
1
0
true
0
0
0
0
1
0
0
1
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
0
1
1
0
0
0
0
0
0
null
1
0
0
0
0
0
1
0
0
0
0
1
0
16
3f5f90abf54d806b90b45562e111d597c288ba54
149
py
Python
ipython/startup/import_random.py
dycw/dotfiles2
9e23c4989e9813080da3658a8f98dbb1e03776f2
[ "MIT" ]
null
null
null
ipython/startup/import_random.py
dycw/dotfiles2
9e23c4989e9813080da3658a8f98dbb1e03776f2
[ "MIT" ]
null
null
null
ipython/startup/import_random.py
dycw/dotfiles2
9e23c4989e9813080da3658a8f98dbb1e03776f2
[ "MIT" ]
null
null
null
import random # noqa: F401 from random import choice # noqa: F401 from random import sample # noqa: F401 from random import shuffle # noqa: F401
29.8
40
0.744966
22
149
5.045455
0.363636
0.288288
0.324324
0.486486
0.648649
0
0
0
0
0
0
0.10084
0.201342
149
4
41
37.25
0.831933
0.288591
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
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
8
58b1edb1925d5cb0922b9a539ddad41e1f847174
24,266
py
Python
common/RedfishLogo.py
edtanous/Redfish-Service-Validator
147b289f700875ffa0a6f347827cfeec7648d5db
[ "CNRI-Python", "Linux-OpenIB" ]
22
2017-08-23T16:47:35.000Z
2022-03-21T09:35:42.000Z
common/RedfishLogo.py
edtanous/Redfish-Service-Validator
147b289f700875ffa0a6f347827cfeec7648d5db
[ "CNRI-Python", "Linux-OpenIB" ]
404
2017-03-09T05:23:50.000Z
2022-03-30T03:13:52.000Z
common/RedfishLogo.py
edtanous/Redfish-Service-Validator
147b289f700875ffa0a6f347827cfeec7648d5db
[ "CNRI-Python", "Linux-OpenIB" ]
27
2017-03-06T17:33:56.000Z
2022-03-30T21:03:25.000Z
# Copyright Notice: # Copyright 2018-2019 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Service-Validator/blob/master/LICENSE.md """ Redfish Logo File : RedfishLogo.py Brief : This file contains the Base64 encoded image data for the Redfish Logo """ logo = "R0lGODlhLAHTAHAAACH5BAEAAPwALAAAAAAsAdMAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAj/APcJHEiwoMGDCBMqXMiwocOF52C9gnXuocWLGDNq3Mixo8ePIENqbJeqZCpwtl65E8mypcuXMGPKnLmvHiyTqWDZ2vkqFc2fQIMKHUr0YK9UPWHdzMYLpa2SFYtKnUq1qtWB7lJ9e6rK1jdVr2yhzAbWFqyVV/fRc4c2rdu3cBty3alN7M2wtsy9Aovy1S2r9MyWpBi3sOG3JO+CqyWWcU6xgnVCTtVu6q3JqtiZpXe4s+eg9JTaqlUWsi1tSJ2+olYLZdPB9Ya622mu19NX53hFtPW5t2+WR3eeRmp6Z05ek2Eh75sq5V+gT83pfo2bFy92t7IR+829u8WszReD/+tZl/G38SVd3wyPnNrJ221hEuvZPLe5m7CG1a4Nrrn3/wAWlNJeOKnS3E5OPaUTSv29Ms16NzHn30v1NHdfKgZiWFJeuuV1WypRBShib+eEl1Iq2hj4ijatOQXOXeaYVlKGYfESI2olbQechbZEhJSK2vRizi21tYPfOTvFN+KSboUWVlgJxigcglQmCE5TMTbVVHFNTcTZR1nl1YuN19lnjn5j1kbmOcLkdk4tzzEpZ1VPCedUa4wx6NVoVDbF2JQu7rSllFeq0otHsNSyHzi9MHplL0LaIqR959zipo1CvjjMnJzKdqBXKNVSF4J/WoncVlUi56GHV4qlJYOp6P+I0VG8hGPjLZhKF+ml0wmZq5CQbhlbp8TGJFFxCxbXGJV7mhZojE5B66qHMeoFTjQWhXalmtIN2RSa0tmHq5vA6mrOfue8smmx7IZ0VGsnsibeifThNa8t2SQ6rS1N3cTsqqJ5yMtNhzZ0lJQSqaIUkTYmPFFY9tmYkk7TnQNsLf4q2e7GD7kjEUrr9WSWcapMY2DJn46WoSouMtdTq96u1xxy901TkkoKgTcMOBnilEptMpfknqS53WISRRXzYqB7jfLG8dNy4eUYgaqYx1Wegr0Ca05IncoThns5u5SBKMWIX2NxElTPiT/zsuGVL1qYnq/+Soceaq8kLXJJvLT/s1PBUAdOEDHp6YRjXalMI9w36e201WO1YPgNLA+6ZovNOpWUZdzNieyazRLzgpqO2KYraUm39AfLfqLXV1K5XGHXOIqXlrw6VLqVaMuwgj+9tkmOm6U1V1uBbKJx7ymOPKEYiyUylWGZUzJtKXVF/YZqmdWtgTEi1WjDM3PfI3W96O53Tm1KDEs7SoOo385gAd47u8HhPd5pf96mE8YbwrsaXgjaC5TstBOTVYtK5tiQrYymuKI1qD85kZL0DkSNV/CnF0lJYCr00yEMhStSESzXdEoCrvfx7Evz4xQ9JoInAxVHPG8TC9kCSLkqnUhV0bpNqwQmGH7ZZWbg6J4q/wY2s/HxTXW40s1erpS48vGLZ6lIn90MVK7y6YaE+wFWO0SWwjkZzSs6WQ9PXiSqp7Bmf8Rxyl2QlRM9JQhDCPRQKrIxrZepqnoXEsv3XNigc0kqgxjK1W0sVhskIYV99gEW7gipyOao4i30IMa6uugQwp1kIou5SVcmNxqnuBBeQ0NVNtpIqgfaYhfUQw9klrOTuv2QQzECy4W0kSuoPCUVYzrHhcAxDBcC6ym0jBEIVXGpcgXSTW3qBTtukhunVcVJidsJRzIBADEYQAydqpdwwkKWV0zuRVB6xcs6eTRx5kRrWNOknmQEi7JNS4O0aZ/CBPOYy/1BJxPRXPskk/8hJq5mNGK8VPde4bcsDqkkiARWbo7pTKlEIxy2GEaJutIfFFpEDDfYx3aIAQA5HcUkdVlRSi53oFowZlQbOo3KbuIeF5qGMdPIW5/AAUEfQouJXSEUfWyWHrMlDico6cUoeToYEJrEZjmt2OWGyMj9YFFI6SPJSYxUFGxpdBrDaEc75mESA/nhkRZRRkYBkAkDZGISmRiRMoijDbzghY7HGlV5wGiWxQQQUM5qpYtYaUNBQYZBr3IWzVblokhFCjLnUipik3ZYXprrl1ciVyH1KAxYTAVfvWjHMLJKjIL2IhzD8MtD0LqPFShDDGnFpnf0sY+HpkJUzQsLLCaXJ33/6Us8CyoVAbcCLz7dSU+MkZblgiioHYIDVwJz1K2EySjpcIhIvkJSU3yVxehqqR25nE5t2CGkhJ6pkG3aWYiEItSsahYdmtWsO9Kr1YgooyFn3YcB0GDafWT0PySRrdZmy1988cR5L7qfTjhJxt9OqUX/wqtwWLmcLbnmgMiRrg9plqUeIcluEbYFdnTFqA5dsJA2upTFapU0yYY3G2kDymxuwd6smlernGWvLVJ8kHrEoLT7QMNZ09obq9bEXxPxr2z/m5IX/RdrdOzkn+A14OLodjHmcOcTXQXYaUmYSO/sUV6uhKss0Wy5vPjehce0rV5JJ2no6luv2FTd+8gq/yiX0ap6XdwOdNDZxe4wb0Qm2VqDoOG++5jEjbtjtObRcciHNjIdMbaVusxVjXpdlpX+KhwpVXqVOcyyO6fTqgtLKi8x0qWWIxZZ61xYN7kUE4jJ9avtAkuZypyxUPQRDY+x487naEeus3qOYawXxlqVZHt3p5BMxOAGMVDtb9whTtkeWiL5SlSi7neaII90cvlkEUpQFVvI9NY8WGuMvlDVqnIXl5VGpjJyJLbgbU3Jh6c+rK20m6oSbwmR/DkLUSCaXidCtHx3xi6k2pFngkuUF0aTn4hYKxCuoOgVGKNaV/crqp4YqHgyk1nVqMTT/aGkQDGM3IxSusMZUe+WPv/DFdzWowq/5aZnGVpdhjVUC0K2r0DNHZPDgYUchb+EtcsYyDCaw+uP+iyz6kU5sFGOE4uKyJLarMsoYZGNfDqolUnZkL5yUsO9PGgrEIopZG7yoESpyCsGgkVb11NuFDWuR/lsp0Qi2KO7lMVug5G7zaDboPRgCkI8MZBuhIE3zfkNHLyDiY8FEpoNwRiKkAELNXx9vgy1o7PgeQVEIaiTEf3OZHF/mIFY5DywmH1DbyfLgZhjONRT9GtVSind8wJH5AnGnRvKUji6doukQLCZRsONrl5mm5KEw1++Qo2Gz3GO8WSmF5rkBdNwNpQv+iu9zNTsPEpEmWGQfegtT2//TgjeDmX0h8WxAtBRzBmWwSymrZ1rvUjnOBzWgDE1fzrnifAp9tEMjZ1xM0Bu8x7Khy8H0i8sYx0oYTKv8R5tZCOqkyV59Bp5gR/hEja9wjfcZw7cR2M04THNMQ8Rkl7cQ3lDRxntYCBZZTOdJVE5QWfBRw8b4nSeMXSoUBZKwTiqEG2k0RwhFTmbJBniVDX4VEF/FU1udDbGgyrO0xy1QA3ttBz+oicTtGU6hGW34SG5AUF+gxzesx8WaBu5ITIXRjaXYkDAohk+MROJ13C2wD5adRMsllU9kVkuhiEvplV/gILEoEHrRQzz0B/gAB5G4nOHsRbugCQxJRF4kyg43lJ1I3MzRVY9JkJ2O8EYAnSJH9ccxRNDYlE4qRFAqvAN68YcfiUyoaYgHdYqgYRlOdFM6XIcHAg+sMBdRNRhQ1KHYGiIiicQQ7c+wCYycmYg4YBdWoVQd1YSBXcU65NVs5ETa5UK7rB9sECDvSFUYoQxPbgTh6YK5eGIT6E4mJgTZXQ5HzMle5Esz+MUjyFAg+Uvf9U+rgFFrYIcoPMon/gzQ9IfqnAuQhIh1mEr6ZJUsfiGmKKBZjFraiFGEpVZxIAaACdVvLBeWYVQndVZUkV5+UWR7fBFMrhB62V+Df8VF4tXEFKVL1oDFizUTjdjZPxzIHQ0Q4txdnsyHtNQKum4FbzwFQfyIEf4HleCHKMEPV3xKkghXa1Sh3JEMYViIdTlL0hSkJeCIimhMTRxC+szgnQmjJrFTJuFXXgIY712SFnFjJRnfifBVSAyD531UXz2G9FAjokyGPkChHjBSfAHMrc0UnMXKLfUTl8DQD2RZBgSXHu5JXnhQvthO1yWE/3IL7bCjxt2Sx2GLzkFXfIYZvdRFrnhHrhEE9HAcAIxH+AAlriEXbumfOnVILnWKMgIbAZicFLVa6Z5C2vVFblmJK84kr8RDvtFOWChITkxOdK2jeOBHjB3EvryQ3b/JUM8ZTKkhBTCWRbzeHuI6TMb8iqumQrWUYHYyZ3VEmZDaR8OdzQ0IZoDAQs36DPGiHRymF620DMa8obYRZGvSQyjhJ0Ep0E+Aw70UCIAMjHYZnr5YhYY1xPo1EpVR3VUZyf6EjakMjESMW1jh5LnOCjVU1ytxIgLUorIARa69D3awKHtZEW6cR9aI0gDWhlDgUHDcBoTCg69Rpub1VbFaF4Do3aYdHnsFRHrU3B+oxR1wSj9NjI6cQ6S5A66EaDiZKD+lSjNM1umIXXFQW5WoyfFwyx6ckd7RWV2AmGgllwkxmXdIqbS5Y8R5i25kV2MhBLWGBPEsDq5RpvAhqO7/6ZZM/piwzAPLZZe5oVnlDcPvuaMlPdr60UPBDcPswEgoYEv0mag7QRx+OSk+1NXbsUs+dNJBERA1Rkog6UlVCYloLo5g9UoYmgd5iIpidVcNDNmBoVBt4CeIFGSNZE6w9ALt8pd2NWQeZpedFqWBWeCxmhnPCpncias7pAM6ZUMf6hZgDgMgdGLAlEP0JAQ1ToQxIAktwCtEOFW/RUWdUFgDxpgTzZ2f9Vby6KlzCItrAQtrGQbWvhE3zOmEmM3x1Ut3zM+aWKq2mVdukQYs0oQQbcPXShRutae7ECjuzajeGqwLtaaxfqnwfaVF6lewMYWl8enyqBV67WoMCGrVv8pdN8JC7RKEBOxaOA4ZOgURnaFMffzJ1CiW6UkFtHCGOVwcu1qU0+EofVoK1OmK+PTYZgSlG5CLdSFcKxTRaoSsh0RGJaia8PQNxI1tb1mDuzjsMbYb8DGXnYYsXKGkX7Ko3nGpzGWZ/TAa0CRHwnxl2DTMxVRsqaDSbLFaDyRWyybTgjmOICJrpqorjM1ZXvFKB5iG1FGM82lctOlJZGZakl7QbqxYfv6WFLCEkbCJrlhjLrRDmeysA5rMVCLp2J5q+zVghYrrDzaWYi6pxSJseW3Vb3ggS5xDn8AVgfBcjE1I/lJGQhRIcKZGqeXOOtBeqPUMz45QMFpL/snnXj/oVOh6CECdDLUg4Ds4Z3CqXmmxi8mITGNQiAz8gq+Yil/mUW39GYbQQwKMnGXK7omkacX0lU94muapCGwkFm5yX0t54zQhxN+QZHxKZ06YSRMyxEDWxP7oAxLwZux4Q6oUEFcgx+DkQp/kBCU87zEQXUq8sAfF78Esiz0QUoGqCIG4pN21bZP1HsrQx/UchfH4bMNzDU/w4oVhJvg88DR5CZA+IrTgVQ3yBnXWsAKsQz6wDsIcjQ40Z43c5oSZXcd3Dco1xM2ow0uZjSWN7Y3AxYZ4mu3xL0TMhO3QFQhO7tcY3FTVxImw5sNFxbn8T/wNzz5SE96UhInNRhhgyo3/0FutyQlNgNBlpPHmlGFTZkvc0S4NxFMQvSiqjMRDcQvgqe5uqkcb2IgT/gK3NU9tahZooURwzANXYkizsh9mgVBu0cZUgsVW9WROSGCJ4Go9OA260MMNaWC4kcZazEPqAEOycA97qAPRvKmLAEeVowKbSgQWWFOKLMeU9cTqIAQ6XIsYjTIjMBJG9JNfCIYdUE5OjFKo8J5q1Iasgclm7hunygZgYQfWnITijIu6cF9uJEapqY5lUl3UKE6qYYiYVaaqYAKAWwQanerhvSGyhRap+l4r2OMCIV05pgV/fiVhChVmWWRYNmMWvUUt0APN9iVvMgS+pDFArSGBmFGP/9icQQCIanwXgZBOCCzjYPRPIzTHIqxbZl4P1BkL2GTIDbzQhhSco9pPBYULTXUKsr3YMTRnUhyEySWQKogDJp5S9hVHYMENPVxJvsEC7JqFIMhftPAYuVzFAltJJoFFRLFfS42DLtHUASjVQ29QdhltScolhgysQ3ykbYQDi4RmtGAQh+FH3PH0QURfCWTFDYD0tA5XlgBrhF3SROKKnC0Ip3TSsMJPcfzMlgDoTRlHADEjwekOgqYF0lRzrJ4OgnYfDaSnQsFIuYQmbJISObIaccxKTfRPQ2lD0HHWub7cePTz1arTO/ZtV7d1fdbtS8YIX+qjHgmVZhXIvmxVe7/YDTVWBK8LBKNpyIIylMIwbZt68IdbJXMpl+FCTYBFo4n8norvTiBx8Y17RRfMTw4RDZb0jXqQUrTZYFhVtO1QXvcKSaKnAq2IkSoahsxlRuYMki6ESGWe4I9Mhjkuw+uopvvK1X+bJoJ+9W9RBkzWtBapdwMDboktLVtXZbjl3QWArstYTQ3gzlQyDXKPHHBCSEVdBMHrlFaA66+K3bNsyF4M83WnD/8mE7Hs5eUFoof95iNEjmrIzDWTDPknN8uJF26dHdXhEv7wRUg5prz61zHYR8AeRwv8iUeU0jDgDdwCNy3PUqeq0yz+T6vuTNIgcq/GpvCilCXxw7jR3kk/xXMLgEeLXwXHWyNH0l10tnXJQPGek0QuvMkpmdxjZHjlrht7sfBPukY9TSTAvjjPlRTNDNDgzKF0gHfXggi7MYLaEjfOYeBZqIgk3WUmTWAY2JAEjVjKcHPfQOV2KUgq4mHuoqrWOSC/VhwEcJszeHhKIh0Jzionny2RvKWIREN9UBrNfGXDuLAmkQgm0KrGkIgD/LRt2vG+8BAwil3P0LEKBGcMeeEDurjPVh1ThyFvTVOV7IX3ZQhO3Gmd4FcEJR2qeAeAXmQJ4EpBLLR9VHb8Zk39gE2fQ4i9ougr5NF54MbmcUz9EEjeZprpEyHNKIhLHZL9I4iFetrr7nnG/9C5y3BfQIfnGSswsSEEJZE7xvNcgmRdXO0cZaZdSzkfN0uUs2ZhQnSVjHn8vP4GNf50fLCYIMcOhJR7eKkXFoWNkVbdSdDz0mrOuTCjw7CF1HbvgZCRxYzyd53EmiS9XanHNj14NyXWWJPwStiXnPnwGGL61yLH/kMEo1XEjhid/lixSgZ6IKeOCwfwwi1u5LaLBizaAHWZHnFICdFs/9S833ll1Tol1ZGLVSWrwyyKwoYMQzDHzYSLrlS+dqlXWvKam4iWWJvtRZz9bmJalbbnlBLmwzrq8fKXgfbYr86uu2AEj8h4tYNFkSvknEvjQlh+ypsEkw7MOCUg/sjGtr/SEbTpo2tJBx44m3r9Pw7cbPTUo+WI4FTBqrSxTAcAjsS49+saqqPpZldplAV82qZWzHcxSanPvp9k0vCgJpiT5uhj7kNm7ViL7oGa4ddu7Wlm2cA4Y6XrXr7DB5EmFDhQob73KWCqOpVKlgSU1mElerVRImvMtZCqC8hPVjTIkIM19BgNlsbbdWCZYulNlvgXn2LaSsmOJg1Y36zhbOmLaLgiNYaCvSlUV5GiZorGnWgUXBNbZm7BRVq04HmBoZrmrVm015XeYHlJdZcL15Qz6U15/Vtr7Vyeb292xbv23a8er0FPMxrO7q9+p6jK1ixuXOCGxvmRbjx5GG92A07/9eOsOZhm9t17tXZnWF3nTtrhnVO5WrWIWGhUpUqW8RX00q+UjVbG25YuCdmdLeanrtz54Kv1ik0GzhYSF+1JPrzlc2ksJQSDRoT6VKiSqlij0q0a9SqRQeOtXXOFtirY7dypduV6zmv4OjaKuw2rzmwgPP6R8wczP6LLL+/CiNMwHOEQUwywx7EzLMHNTMswso+o4xCzSg0LbNe3OkrltZGXK0X2mKraDaKNJJIlYxq6y03j1IhkbV6NorpuZaYs0UbpFgCaqfmckpqOvKGckqqocoxD5yqqOLKrLGebK+t9Gzxq7y3wKoKrF7sGwivrPICR7C78GMnLwIBY/C/xP/eWquvwwZs8C/HIsNMGMLYgWyzyxozZ7PTOsts0HZKK02zRE2DpZ0aH0UIGog0gmii32LjyFJKM6LIt1RsgZSh55rThtMha3nOoo52lGlSioZ6qdVXYTVqo1eggrUll3BtyihYchqoqd4qmm68Hj2K6SxemhJmt5joO3Mgj/Dz6ktbXNztKrYAgwmWuhDU6RWwDouMF49qQQyzsj51sczJwv21FgyHYW5YbQit7NdhzSHmsw1hASfUUG+5SDYXU9GmYBZTocY3ai6KDWGIYMkmI1AFPqgliptb8bmZZFNYlWlewrThiF8COCOJfIS1llRMUgW78rKJTRWjoHJq0iv/jYrY1fZchajhtuhSJeIny2LHlmliq2otcICO7Sq+XBUMQY5SKZMxywiG6F4+zZnUpEo1i0js2AyzBWiIbhkmHIhgntjfW2ApCGMSH6q0YNxYrG1TjaYxZKJsPE1471Rusdul5yZa+hVqdGopap8m6hEimS2vdeJUkDIKqItwy8aqzH0DzxyVazNv4vIS9jZtmwdyOZWtMM3IL6/YiUVzbU2nKC5eVM4LRYgWBGzviQ7UM23bPm0w7VcC5NoyiAoEO5XGXralneuxnicjWC5jh3XUHLWbRFtQuYhmgxf+bcVpfDOJ2BY9mqjjZSAlRqPeZEJx71qC1IhNkLK05kSN/2WOWxzTLkKkWkgugFhKG0WehrX2cMocTMPSBZ+DFajgRifMO8sFD3eOStniYVfBigUzoo34WCw+JEwFXSZWvb9EhlPnsNha1BO1pzXqTFjDTGcmgpiL+KsdFmtHbBqDIYocMRXhME07LHex8rXGRHr73MJotrwVvQhTsnnR53LTm0mRbzXRMAgvJiaTD2Znc/FaIFJiAhHmPBApEtkJBSfinbQZZTaq4AVQbAKwyE1lIFhT46eoIpGn1GR4lKtSbOqjCq9oBCxjAqLl1sILpvWFLrhZS0sQY5LDfOkVkRle1cBmmBx2BomWMZEqkqYR7bEyk6nwTNoalREBHWoYFP85ThVZE0FMFbNjX8wNi2jmGzyCTiMesc0rEgaI56GxIfq4hTQ1Qg2YDI4nxMIawGBkHUd+inQ6sQlFrlPHn4TnWjqCVVM0WROm1PEpiaxSBHnXuk9+allO82Bb8kIXF65lNlfJyhXrQp8rVu1rf7EYoAbUDl1uhnKTkWIM3QaLKCIRIh0yUaMgYpjPpEaYI+JU4Yz5x/apjFIWMdn75tewTmGqYpViGz2U4Q5llOVFz5kYPM+1TOhYDidIuUgtEkZBo0BkO7HCnlO8MxGaJClnRoLgkx6YloO254O/GxlXwME09QyNjm9Jj1sm0rReUI5cFxnoXSDyrcRUT4d3OVD/A7/xoIxkDTPDS1s21OXEMkEkl03kJTF0UreTIkdvsVnmilrUNc11yrLeqw3thrW33sxoRa4aXEtogiKleoQlv6JjTWYEubFi7TdAQao2VCFI1TKSVkTRiHmmJLmbiYdpXbmIliZ4jrWahZOf8ko4rvKq/djOYsrqa34kSSDD2s5qMSNeudrBOuIlzBaYaczxwMbRJSLxbJwh4SvmkdpgNlYl9MibRYJmqfhx8TdiW6r+9Oub2dwGYTPqSHMm+CtpbmSZzHFOUPDYrZcBDCmxIwpvXSdHp1DOKZyL3K26Ax4PbmVKkPQV8yBIkd+ROCs2AWTT0jLXsqrHK9FlTESt/6QRNr3lYaqkUwCrNickNmaFe4olOwimig39EmsZ5YwTYUGSw7l3RJCFMjPrZ5GrLfVg3sNI2eg3rE7tr8HGW1m3wPEH26BqWCzJlFEa+EyXNvV9nf2Imh2ZG5nF6mnPSRLOHvidqjCtLLz71LEQVk6ncMp2Y8JNVcSCGHZEDS8TxA4sGrat9CTyW3UZRmzwqkPBOC+IkCbKUjszRZ5NIzTeG0rUoNJeJzcEvqaCiPpatJuCkdGLs6mf+gQXI9BdbWOWitiLhvUNoOKROgiGrE5gwqKlWe45XBRZcMPzm6CQR2W4ckpT/VlPLGHuZz2b52cnpQ0r0YVr+ymLXP35lv+nRVtnDK3LRf7CoPwEt2qBWSEsMxoycGivfq56hWYi6KpSqabVrYHhZE31PtpILL7A3k2LaHZr7/VmN6YlVsXeXFoCWxwmpRoVThxME9UOO1fSjBdPsFMLo7AsV0TB6jeC5auhWGUq5rk5T6p6pWUxZ+dfgkt7ygMVutRnSn6xinkAdKZK+ydBu4OMYPiTPX1/qbdBxEy2bzGv4tREPUs+OEopxXAqP/ZlDtsm3475G9zAxLQ13TKyRlWxxfUIJjAh9o7qvrhBJmnu3MEwOrezTu4Qnlaiww7Oco6foecTKmDxCrXaYxfA1AUra6ph5TPflmH8Rxh12fSDJuMXxDz/hh2Amfe85FQoQ1WoMYwyeNhbwzAxgqwkHTGZ4aScPshi9r8SYbjF6eeswW32184qcI6gQyrVNj87naMnkgjJZyRVnypPoorin6SVJ7XlFm3pkla+FJcxzYet9DlxCCu90LvAaaE6XOhfGKND+nSGMY4hnvZOv3rVeygz/8cQ7dGMQsmMfwkY2bubgZOslzqmhYEytYOfzuoIF6GfTmmYYdmYiukWt2MjUpmOUumJaWGJDqyFPyiEP9iCQqiCQmDBQkjBFoTBFyyERWDBRdgCGgyDGbxBG9RBGhSDGTSEReACRqBBRpjBH1yEHzRCRgiDIGQEJywEIpTCKAyDRWAEOjFYhCRcBEOQQiusQkZgQikMgy5kQi8kQzC0wiyUQiLEwjXUQjBEQziEQzFYwzFkBEkgjCT8i1dgLAT/rBF6gCG+EZ4syoibgsDc8yLQ6Y2bkgnjewW66zi6c5ZG5ECYsIlaQZmX0IZFAIBO9MRPBMVQFMVRJMVSNMVTRMVUVMVVZMUwaIcV2IIwgAGO8kO7qYfj0ojZsI34ob2JkSnC0Z9oEjY80p+NQD44w4m425/e+Kb/uruY8JEt68QDOIAAoEZrrMZr1EZqzEZrxEZvzMZwBMdx7MZyNEdyLEdyVMduXMd2TMdyFIBOFIN5pMd6tEd7RIN7nEc0iAEA2IJeCIMYoMNDqsXy0YdwyJTK8o1EXJ5EXJHi+5uFpLuaoazNehmFScYv0hueCJk/6MQH0IEcUIAcEEmShIAZ/yjJHDhJHUiAHNABkCxJGoBJCMgBmaSBkgxJmnzJkHyAm9TJB5gBlnRJoHzJoQzKlixKmRxKHZiBnxzKpyzKlwzKB1hKlazKn5zKHAgAAGg1TQAAKuCFLSDCGygYVECcgrRFhJwU75mvYqqNGaEYYryNiJmGBvKs4uMInFigt3ORCLIN1HqVpdoNbSiETpyBBKBKxJyBB0iAxXTMloTMHIjMlgTKBGjMB0hMyZTMyzzMw8wBxjxMoGRMyRTNxpzMzVxMyfRMxTTNx3TNyTxM05TN0FzNz1zMrYQGJ8sEAKiCcxCDMNiCKpCgDyIGtCyfeuiF/JKvMGLLhFGFBhochf9byBnxiMGknf5Csxf5hgVbCuw5p5boRNtsScfUTMp0TNE8z/MkycrUTNEsz8+0zdQkT6B8T/TMTPvUzNQ0z8ykzPdsSfgEUKr0T83cSsZShn3IzWXQBzQ60Nw8UAQtiNysh9w8iN1UAQ2JjdOgqE+hB+MsH0Asic9pSL4BNvrxDW2iCI3DLAmES2SphYcBzHrRSzIaNKXiRACIzNFEzAGFTfuMTf98zPLsTMykTdDUUR5VTR89Us5c0sV0T8uMzcWUzQF9ANw0CGVgxVB80En4SgKEDQ65M/w4CJEwzofwiF74kA5djXpwooJZpoZ804ybHzjrsokcnKSyDuqMOKX/ujsDoh+jKEwAEFL0PE3FXNL3RFIlpUr8NE8kLVTSTM/SdNT6XM8ZSE0e1YFOrBsszdJPfNDdpALtGTVcIqmQcgejKE4PNQgFdJWY2Dp3IFOFSM619BQ6hURazYg3q0CKeJFJ/I01iwnreJEIyonm6MT9PE/GtEwdVdLJVNLNhNTKrE3OPE1JfVRkVVL9TEwpVU3LhMzKtM/I3MoH5VQACABrlAEEmAF1RQAESNd2ddd27cQtBQAVmAwYwpce8hdbOMuQqEWVqqxJ+YO15NdhgNWDaIcJUsTPqcDeaBiM65TdqKNseNHc2piJwbVTYZpkO61jHdAxIAMyAAKQJYMc/yAD/bxW/xTNNFAD9dzP+oTMBCiGbGVMZY1NxMTZZbXMASVJlBRQzSTJ8fRRCNDUKx1Fa1zUpKRKmpxXgwBVUTUy1oMhIzqiYTAIaypITuGshWmcnhEb/bmFv7iFN6OIX3xYmuKyLqNO1EKWjGQJzBFWili2IQFPQZ3MBNAE1lAGSlhW/bRN95TSvDVUIOVPoN2H8/xWYliGZaCHZVAGx62Hx23cx43cZUiDy0wANWgNODBU9bTSfeDUCSWGSbiBTwwAdSXUxWzafdjN3oyQjyKpivoMw+ghVd0HEgK+ibhASmlAimxVzalOtcUjYdSfmyqz9JG73JKYIamfdJIm5//4SJfN2xGJBsJ9zMoszhwI0hydVsnM28v1z1QlETUYTZRsjctNTfssWtDtRIXQBBXwxABoT81cXQtdkM+4iOzBjL7yjGEgmDNVVXrIL05hH5ixlTFau5uyNbiMH74EGouTLF9riYKJtphZtohRBY8EgEhNADh4FGLY2ZfF3Csd3G/12281CE0I4c28nxpRYSlNg9ZoWWl1z8/lVIbwSk9kT8RcXS4N1eIYhvxylQoR1R6aB4Rs4autxfwRHu+xDeArmGkoBLNNyNsoRF5zRNYxvu3cCIZ5xEY0UY0YTJ/omOgl1OndB5JU4xxgWTRGCEiFTL89COvd4c2cXmJ40s//1ARNUIY93uMk9mNi0ARQIAbtTUwdOIiQdEk1VuT6PM8CNVqubAgY8MRGrd8uvRB6wWKSiiIT6bfPoAk0IlOslb0JWh8q8z2J66ITPRj6qUuHVUZjlLuNycTn4FOS4w5bVjlYCM8cxduD2FGclVIEyAHxNYj2TF/PPIhNIGYR/tvFRICDiIYVbkwEUFacjeFj9lZv1dEZ+IE5LtxIFedxjeTVEANPLM9OVFMuFYMN4eQNQa8AjCINbZQx7cOwUwb18ZuVckguo7tHrDgEiruKqZhhO5UMPBZlgwVnGRKhAJgbhU0EoARgzs9wbUmEiIYfZVI3JtQkjdSJpuhClc/M/53j/rTN+S1p9SzfbIUAAwCATe3EGxADNMgEhihdABAA+gWAT/XHzZiQJQoiQUmyfvmMzpibe65FrtHah0EmYFORZZrTjMW45HM7H7k4kGPe/TmtB7O7mBjB3ujl9vxlg6Dmit5MhFBhZGZMY1ZhZ/7WBEiIRD3PSSjpbjXkzhyDkB5Ubs3jBLBhUYwBq02IFehEB1BdAGjh3XRFICtqCdmQJSJADe2M9UiIWA27elCeL8qU3KspLF6m6ozlMzM+DswWqx4SNANBQmoJnIBo/wTpfUBdDi5PuK7rEI7mhIjjOq5MzUUIOJjWwiXpY3bZJwWCgzhhR47ZxczUl47kUf80ZmjoxAA4yUvmggyJEMOA7MoYlERJMn/phVoIDmioB1KWvYw6mKV6kdxbnkc80cu6KeQ7xoJOvr3Tux1JMLyDxkBV6w4GZpoF2uDeBzWwZpSkTIUgA8Ne1O11gHtO68j87dcmTR59gLw2CCMVZ/wUzb8uRTFAiHPe4AfoYQBY7Al556DWDF8gqaIGke2mqH41TqUxu73pr4UZRiujVc96LDMzHEyhiVKJHMvp8VpNBY/lTARAYya9cMgk03r4T8gkg4UIYXHOAYWghyUtXATg7TQGykg1XOEuXEZ9z/UtV1K8AYSI7hy4ZCqICQ1xopgxomtpVcoYjYIxWHaABVb/q0V6qB8EKiaH/K+X2giJgNFMWZmuiSAYsb1XQKpfhI4pqw0NZtQjp9n0HOt9UNbPrPQ37msWhnIf9WU0Ls9wlUwK34dtztnuzVFyZt9TLHOD8HCiBQA1BdXYEBRXKZPPOHTZ+g30mpRXSJT1IghVPQcM5ghcCzZFXFG6A6MVMtHh5VWkkohBEiOKIYoD2w6PJdQs516axfKDGIM4Hut68GCDoAfWjNYpPwhQv/DyzHKPVlJENgiWZdkxUAN6TwMyyNaWhORVP0W6XnUcuGQxMIlb/42M2LrM6KvOmIchM+q5ytAVn5heEGWDoFDZ04dbowiRecRjv0htIiNipLuK/2GaQP84uKSYpFqq5ECRlNHvu0VjBKjWdT8I8k3N2wZd2tbmZwbKB90Hlj2IH8hRIbVMf9dybHXMb2YN0VRSDUfFB+1EBAhxMcgIw9Dd7gGiz1CiKHqZZMio7dEMYoAhejCd9kLqVts35gQ+iuGNLjLERBQttouNb8iW+umWxXkV55CI7agFIi/PcS914D7uizYIvk1MnFeGSj/8zmVMhBD8fWjrbnVZv5/UxleJjhbN5YbpVGz1fjzXnXZaEX+ae6nadpiIrXOlGGoHdBjVQzmLzqB1QtEIg21x2z30+ekiSmE7MtKmlWlYaOoUnXjib8rILw5RaKwFQwhPHz3y7v+t4/88CDhQ15bMcs5Fd7L2TzTm2+pfhmaGz3CFcCS3T1JXicYUT3EFAAod81MsiHM+gBAPA+8yoiC++owSkNOAiH7RUIhAFE4KOIMFiHm2UrnbZ/AgwoQKFzJMSA8WtVSvqL1S9SpVNliwVKWCle0VrIodX10E+WrgtJAVbXmsBStVKlsmbWmDSdMlyFosXwEAkCPBjAdBEVA6mCDBzxxClyZFmuDBQUpKg6o5OOaosoOajk6FevDB0YPRZjht2jTNQbNll+r4+tSs0KlIl86A0LOeQWU99/Lt2xPNvkx8swYGIGagrXPterVr9zLcsMYvbzU+Rwxmu8iZ22GO3Gv/mqrGw9wN7HhQ375oDVezVtgLZsXYFrONtOgxle2UIDO+BAnTJc5pJ8GdDNlRpq1pqbTVYm6r59ygZDUdRCC3aVDsOQ6mAfoAwbK0YMcgRCA9QVWDW2eAT/v0PHY47pPSdUreIFmyS72X7Z8jAACE6eUXgT3FsA8aPQFImGBh1ETZMOcMM0xNtrQjIUcSeoabaMRk1tmFEhHjTmOI0eNHL62puOJBL32EG0kvwViTiy9xRJxxqmTUETUugQNjSLZkYwtF09gCDks22SITdGrJZ9BR2b33gFD+HfRDUgMcVM9+4RmkxnsJIHQUWNQZNMZ+SvWX3j45SEcXXT+kpRR2/0xN+eZdeRW45z6TDGaQYFu8ZOFimV0EYTs/EjrPOTB51lg7HI2WGUftzDPMQ6mEMw9HqdDDIqiruQOTRBzd1pFEMPp2kUWongRbpy/B8g0sMrnUEXCyKqfKHz3RF1QCRUF5nVNS/vSAmfvo8BRSBylTLFpG/fSGVtaRRa1BcAAF11DJqmVsswaBRdavVbr5gFkAQqPnngQiyNenfQJQhXKZMSZZKuBENkxpGskISzskbkjQZqQmCVMv84gUU6gNLxQObDX5Vmqpr2hTEUcVKSdTTRzRxpFMxCEZsUu0wqRjrwDAyV6yUaLrX1kCeLmPdUhtpx5XYCH0UwJ4GXTuVP8HEcNsnWSxqea3VJIx38pwOoXuAwD6PGC7fe0jxp+FUaGKvooxNoxNEeJLairURCaMwJylslmEMp4MTjseup1Kig7bvU89F4XkkUa67b2bxTnNGhJxHNvS3N6wNLdkrdocjiRLtfT0JrDJWtc05egKzVUC3taX7LPR7rNVlUGJ5Z1aPz3ZJrBdNXXfPpm/We4MSalrEDFV97XCPn0xCEAYmSkWoWaQfg2phJCOdu++AW8GqfIkOn/hYrDEe3fDjcY2UuAX/713RiB9P/hJr4CTq/m1FHdSLeAU0tPLTa1+1NPg8jyzDmD95O1aYho1M1wSQJg2Ye47wmoTzJoip5//3ak+PyHXe+wCgKnpji8H8h2gAMCFxgjjaxL64KOSp5kJPW9faZuUh4bhocy4IxkCU4bzbHEL7NmtN98zCd9wGDjFecRWGqGVTGABDiEWh1bf2AmTADC7oxzQP+PS31GStQxr6UxaxercQWb2LOwI0D2yE8rREmgfKx6rXF2pHVJutw+qVRANgsman4LXC68Nr45su9CjqKfCxtxrhSaE1ApZOA93RIYe7hCGLQpCw1C54xUpWU5FsmERHNIKJELiocVg4b2S8dBHJ2HJkYTICPjBBwEt60/t4nIU0bXpWOzJoneMtZAzvoxNYCrg0QoYlLYwMCmy649QJEjBCvZk/x8rwGBhtnBHDRWKhCAUTWaIF7DmjTBtKyRGZK4Zt8iQCBaLdNhAdJhD7wFOI+Yr3+HIyRJauURIQtKJTngCgOi87IA1ow9/cjDA0XFllwfJRANn4ICZGWQZsdyP6DRxz/4kYBLuKWACYEdPMcJlQeyqYAzeyBcvxdEd5+BFoYShPDyyjZDUK6HzPORHEsHQhZZaIQznQY+4zcND5/hmwzIlkfCFpFXeC8mO/mVJWjHHNkB0SY5S4atYHmV+zKJfUNJQjIRsZU0HARMtw8WdgGr1WQl8QBi/+JMFIvCgmUtdntZIzAAR6HdV0FehGHOLWkGGeow5R60Sucdz3IIltf+CKwohJxoStfAcS2IMId0xjxniNHu4GQlMPgabnopEkhsLUi1IVSvzychjKZtLU5KlCWIogxigUAZBEUK6pjyAGPNZC1kQ4lXa+Q8/dqpSsOaEOaRINAe0pFwD/wOAdam1gmJIkF9+t7W1Fao0MdkMY14DE7PxkWykUsVMI+NcxhCDHcRglMEUS0h63LSx4JQIRTqyN9wMKRXTUN96X9Gc2DzScTKZJJJgsdQ3YRFUPPtVAogbu5U5BS2o6U7RvgPAOyXFAWEEMH14WVaKNk1qF62aRpEZqJrAtTQPaiY7TNUR0TQqFeaYI8TWNhpbWCRD0JTuoGh6Idea12Gjig3/33Y0scj1lG8w0YhEZLIjx53kfSoDbrJYo4z/PnBbtd0ibMHiv7HcFo3IsorTeJas+gA3AaJLSurMtTI1snFPuSsQYeIY49I4Jl+aCceNhpGSZJRIFYnMzDwQNo+XTKPNvRivdBMVk5nSoxe2qDH2BmKbV2GkxxnJyMYGMjiJ2Fdvi5OnfxBQlXqgJiHL0IQmcoAAok0Jac6CormcQh0wUc6V6NHKV2FHS9chRRNw0AREU4cUCBhgghcuUIaTm8Ew/AgyjUpYjPcVE4FwKDM0ulRmXnLXVIzmIoqB1DRWHBNCwqK8iL4bPWiDw5g4Eleb7ciQPlk25HzjRn818qwTUTDqowiA3vKm31R8aS6ezfusSNHPPmCmSlHTL7j8KThwwQVVVMMnoEGx6D7OvKcbVC3Nhkk2Hmti7BG24xYSMelA9EXYi0AGU9GmW2K5udh8Gf/62zjljMVO5psh7oYjPppVqYDIqlroxMi61B9Y7NSU+u3Hyq0DpnR+C6cEN/xcYi0WulL5dF0/QAdpvRoajjuJrMfAMGI47teznnWwi8FngdpYZJJ3EQtJMzI/AliJOtK8l1xbMxmiM6YmRBrMuNy8KlGFychd1Iqws1atWueNWEKcyf0cgg/8+a90TVvaObCArF3i5V8WJqXbrz9qdNbXbyAGGoNKMIDR5GL2VSHkbeYWJFGpoiDVSLo1ZoXWjltjCLnncPQd0e6ISE+FE8SSbBYnuDpcbwo3yiM3funNP7quMW9WAv+2LFP3zxezv/SrH0TADjO9QRp5DsSupJn/95I0pNCPzTynAm3cHAbd388oW1yv9zWWtN5MwhHmDGlWLR6ikADJRTQJ0Ukf0z1f0wydGYmRv7kS9TUNRUXgT3weTvmJGCDELcCVtRXPvkAMwExIo3BNLwwRh7xfm5mDSbVDYthf79FDaYAGTAhHkMygcrTPSXRKRKRMDiiAUuiA6zgffSwgrf1gEJaFEAod1NCJ0P1gdiRgEQ5h/DBF1QEIooEfQjRSL7wEXPVChHhIOOVeO1wE2ahCLaRNYyBMOyQDX7EgG56DbfDGOhHO3kTOOgVREikIAABIAOghH+ZhH+5hHgaiHgoiIf5hIR7iICYiIi5iIiqiIzIiIQIA/wyswAFMYgwcwArAwCVq4gHEgCbGACh6YieKoifGAIBcoEI0SmKIzfOMIKJkRjgcyQhuhsB8VwZqF+mxIQviyEl8RCcBB3P00HDohH6t1Z6oAF8g414oY08wozE+Y184YwVJ4zHuBQwACDRWDTICBkPIEB994whRU3axUDRJTzu4IO/pojruwzCQIZENEVHxWH4RY/ogCTjc45HYIz7eoz7yYz7+oz4eiS2Yw5Hwgj2awz0SJEIipEEuZDiYw0OCwzkw5DmAA0JOpESagzlM5EZqZC905ERyZDtoZEiG5EeOpGJsJPWYg10lii34zDoahGN4EEoNDzTd0TRtk/XEZP9MQgwOIUc2NEeuiAwotVOtDMmR6ERSLsnhMOWSQM5TDuSSGCQvCCQ4VCVBTiWSZCVBGpYt8AJBVmVVjiBVjuVA9gIvhAMv3AIvVOVHndiJ8UIvqGUvfORHgqVdwmVe8sJH7eWF1AJj8eQ+xKLwcNPxjIZmpBDuacYKCmZMPsQ5FU6t8ND51ErJ1OERpdOStJMtHBE+diZTZiZU2qNAliZpUmVfUeWSKORXDiQ4kOVA3oJGtuVVDiRYftRH2QJZWiRY9mZf6qU58KVw4mZe2uVHJQosKBJPukO3pR03fVAz5V7zGBpMOmZMqmL5tASRMQ5vcFYdbpYQgeb5bCaS6IT/PZqnUkKOQa5ma14l5CBJBmJle8rQVRrkRy5JXyFJWgZnLDKlQt6loZmDbMrmXQpnYgynXMKlheQlv3yUS1hnLN7CMABWTg4DOgwDd0mGclqnY9IIxYTMRQhHp0jEyJCKcuCGU/7Ij0HlwsBGVPJCLXQK5BCkdXWEPY7oybTm3IBMcLoNDHbbWZpDp3ylgMKljLzCXhoWqQzDiSlpjVqnPsACKnTK8ewdZjhGYHIoh9KDe5mKUkqMbbSYTmTMesXEEdkIjAgkbagXSsTEkbDK2tVm2YAECcYEL8iK+DgSLBjkjzVHqjipv4hhcKLlyeRLgvKlzKnCoJ6YosEEXIIN/4pqg4wcmnWOyo8xZgymwlx1mpZ26j5IV74oTouZg/mURgCGJ5KogvDVREzQhlMOyjfY4x/AAkFGkqKtp6m650oQR77Y5o+8gjkMCkSCJUfwKa3ipauOIEyQYGLEJW60T0e8ZRYqBy9gBl9KGjv0AjtQCEx0aokFjIy0wx9km6eWq0G4YEwQEbk1pU1MaqVZEkmkW0d4piM5JUosCcgkh5sapEUQ5FXCgvANinveqsC2ZbVyDYu9QlqCpRZWpdxdxFUGKEcQpEXw5UfCxERKCly6l3GWhqfqgyowRkVMaJaaa7lyhk7AhOMI0Y8YycWQ4ePERn4dSb4uybJG5XGQ5v/bkSZuiOX5qAKtoqh9lkaw9ipZFutAZANavmZsTORACmlMfCRcXuty3OVHyWW1psL4sYPHIWk7gFRFeFO5eqXjbKjJmmxy9AbyKdqtlCqSXIR9CaTMHsmzRuVFHBGuBpmcGirkkOjaheWvhoPe8CcvuCo4WASBFq02JOgcwS1eDmc4FWdIwkS2fhRubOQc2QIqmG2nVufZfu4+WCoR2Wyr1mxvDOObxsR47ipoouh7KppVdoRq0kjCbqXNqsKd7utVJp5EBGdirF1utuWg4CZeEmRKAGeCcsRHTqhEDANYDsMrpCPoTu/0quKQqCgJngRzkKDjtM+STMQnkWBm0m3/qaqm3jqs6lalsEJsgCasOdgE4cKEw+7pROZubW6kMETEWdon1dIv454YZmys1n6UNuQi9R6wyULmeh3OjRDjSKToin6vjTIlbuyCaQbZU+4qn9povgqoGCaSonzU4WptciDsBuumggorgSKrRUircL4v3ZyY4NpZYyKwDX+u2tjExRRqDGbw28LsU5KKGOZsaUbEwHYWqxhqo5KNclqqEIPlGD6WRg4oOwxvW25k/1osFn8UR2SrOUDqTiaEatwwGWspxECOJunNcpgnU6roUo7MS3DYi9rscEhlzNkGe/KipiwE7EpkX+HfvqJlcJ7D4M5RW4pwRwCnXTqKkXJu/xk/cqe24ysc0fjOLGhq5VOycWmWpme6ZlXWZn2ypr9+5RA5skHUg/de8dTi5rAKqEF+7VseKG4y6V3qJTuMn1dCsi5/LjgYgn2NZ/sQIziIpia/rkDWQlbi6nt+ch77LCzUDWtkoXuCpWxS5dIKMlrS5dQq8okVJ1i+ginvsjg7Jj2QRMhYZVP+VRuT51NasGk6pXyuJyhjZa3UH2tEKZII8sIapAjL5VUKw1VeLV8NcvHipjAQcsmOs0JrKWcsCRApnkNn8iYbM676qzKTcmv6K8A4DF5dZTXX7wgKw0PyJYG+prQqssUSx0KvtMlCTGhG9ESzcS2IpWlWJUar5v9VDqtMJHSouN7VjqChAShBvzBI8eVBI+grtANLL3W5cuknEZl1hSfOCsfrDrFFRCWadoQ92w2XpqlGFulGxMQWL7FF2CVgMjVan+xHyMRjLYxVZlaaFuTJSFKIfmVvYGyN5bBugoMw3DUKoy+MuNeeJmdaF3bnLsnG2KOl3Ve+kOhmJh7F9mqaulw9CGsv5J+hfqRl06jWGrZnd6qlrvPN5utxECSN2DSv0i1B2J87LG7TbrYVE6TYfjZtc+j5jKfauhNxWATk3O1THmzIqGMGmo/9Hm2+qGAi1bZycyhpzEraTjQGkyrQgnJJbDVrL24vuGpcStLh8PRyf7c6OsZx3Motb3/vVfett/FkX4HMIufLO4A3fFtnaUBOZk7wyDjOLghRp+pDhQRnsKZ3fAf4OjZ0ejrSJ/GCxLCEUpdrI2kEOAg4hDum4pRmsfatpkY4hmc4QryD6urNMU+D52q4iAu46wnkESHpiKe4hquE+aj/uItreIi/uIzPOI3XuI3fOI7nuI7vOI/3uI//OJAHuRgLOZEzxBgPuUIcuctx6j4weZE/uZbGOJTruDJUuZUrmRiEouhlQu9ZeWlN+Y7jQF8YsLPsSVY4uZLfTV8kGZi7XJq3xhi/OYdiTdYkRJlZjUGkgSeSR6d5X6gsAzK1uf0RkxhwOegi117s00FUjWrQ+V7gVKALet913VpJwuc6ek8oury0Czv6haFjjz5EuqR/G6Wv1YGYLKJnukLAgF+ggTJAwyQcSKr3BBd8k6iPeo0d0zOeerlieoAohKcrhJ/0BSpiD6DXOa4jGqtDo0OV66wr+p0vxJ1rusOMebK7/1yp98QNTMLWZTmf9LqoS1xPFHtCZBg30lCoI/u1N9YB9MWnH8Ss98S7c+izJ4S4G0ZDQAMxZIKUV7u6r/s3ZTsANHu5+8UNgLu6B9u891403DrA05DAL7xB6DpfOLuolxnBs6HDP/zdUHxPZDxC+DoAIHyiFzxfSDxlbzzHO8yy74UbMESw+Vqn1jtC3DvKu5y1r3zA9wXIw7tfMERWyLlstcYyoIacz4yvp5bNoztDFH1CQEOkp9Zp4E1q6PxCRDxDDHvFt0YmZALYZUIuUvtC7LvWzTvNl/nJ342XEEMafD2ZL7q6K0MmTMLXvQGNqYaTW71BCHzPG4Rf8PpCZP+Cx/dFDIi9Qoi8gRCGr39K1omewMdA6GU5jYmB6Dl+QqCGPsjAnpz7lgQ64mt7v1u9wL+8QsQ75yNEPayVkukOYNT75xOIoQ++sFcQsP/JvRcIm+u9QbR72jtLJgg89/3TMwZ9Xgh/Bc09Br1+sO9Dr239QSg/X/AOQlhNzJu57icE8FfQwStE9evO2xujwGcF9Pe+wMsWgRhA9ucizz/j9SNEyxujtJ9/oXM7xfmFCtQ+gcTADYBiu4QHQIQBMJBgQYOZ9u1bYTBhwhsGYzTcl4mgAWUS6xk0KGZSpkliNA68KJFkSZMnUaZUuZJlS5cvW8YIOXPgCmgmA2hEWJL/osE0EntuLAky5EViaDoSJXjD46RJaIglNMCwocaSygCIMTkTjcmHBrvCFDuWbFmzZyXKpKlRq8mgBEe6tVpV58lJRUliLbizpFqCEiGajEsyZNSTbNEmVryYsUu/a8XwNfkYQFiUlA3v02jZpFK4JIkZnHRyYUHABuu53JzSM4AbjWHHln32AEONEVPqNa1S98Cwd6mihKaRHsm3ACRLnLo7IV6Wc1Eexz2benXrJCnvCx04ukEYmoZpyjSefHnurdumLP1ZYm/kJ7M3BA5x8OHgJ91Pv76fP2MYVFsDYLSTAlyLpoQoS64zg5Yx7iD7mGuOpgEhHEg/kzIq6ML+njjsEKb49lmuoPoa+srAExFEbaXj6tuOIAqxu09Cmm4gUbOCXktpuIIM8NDHH1mqLcKQ4DvRSKlkPIlF0B40ScSBvDKQsxkHSg8/7oDMUssUI3SRoA33MbFKNBpBAykxkCLTzI/SRIpLgm5Sacn2RCsyQozEvI0wHFXK8MstAQXyvzsDnHIfLgyyMSaDMkOptfqOU5BKKFmjyUqhdMQy/9BN+QOxIcoAaHQfNOokK8GV8myxyb6SdAtUAOIyKEeU8uPU1v2E/KskIiXyEoAeVxIjhvpI1XAljSBdlaQnAXDpuPcmnfVKY2+tdjZPG3r2Qo1EvWqpXqEjENm8Si1pPUpbOi49TFPS1Np3FRtU16EQ+zTcrcrVc9pEmdzrJGbzisFKjMCi69vc3IVX4bKwVY7bhtwTySRfJXao3n7HBbcgGNO6Tykb3aNQVt4SXtjkl3JFF1+D4tznVaaUqccjZn0jOKRMLlJGmTxHdNDflXWNuNuMbyRoYKABAPPkpVVqGCiNVjjNyIQLnBpWcje2c96QYnCDGE0KlHogaQUzCHxYptFeSV6Vo2Q34hPJNtjIR30mSNIQ77N6oEbZ3dfCtAFPyek9ldX7aInOPbBY9hryleOGEtfYyORGVqnkwAO/t0KCUmuoah4VlWhxrhOi++mfd5URmlf5JfxvhKnFXPbqiBF2IzQ6b2kSMQ0QI3TqlEGDshjQ+H32xAICADs="
1,733.285714
23,941
0.972719
585
24,266
40.348718
0.977778
0.000932
0
0
0
0
0
0
0
0
0
0.128463
0.002019
24,266
13
23,942
1,866.615385
0.846224
0.012693
0
0
0
1
0.999332
0.999332
0
1
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
7
58cfe7a9f936a057d52925d1bc6a7fdcc22aa712
4,872
py
Python
trunk/swen610/toolshare/forms/forms_user.py
leon486/toolshare
13f6ab1afb96a5f8294c121ff6916a1fcab5c2bc
[ "MIT" ]
null
null
null
trunk/swen610/toolshare/forms/forms_user.py
leon486/toolshare
13f6ab1afb96a5f8294c121ff6916a1fcab5c2bc
[ "MIT" ]
null
null
null
trunk/swen610/toolshare/forms/forms_user.py
leon486/toolshare
13f6ab1afb96a5f8294c121ff6916a1fcab5c2bc
[ "MIT" ]
null
null
null
from django import forms from toolshare.models.user import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, UserChangeForm from toolshare.utils import has_numbers, is_valid_name import re class UserRegistrationForm(UserCreationForm): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True) email = forms.CharField(required=True) zipcode = forms.CharField(required=True) class Meta: model = User exclude = ['password','groups','user_permissions','is_staff','is_active','is_superuser','last_login','date_joined','share_zone'] def __init__(self, *args, **kwargs): super(UserRegistrationForm, self).__init__(*args, **kwargs) def clean(self): cleaned_data = super(UserRegistrationForm, self).clean() first_name = cleaned_data.get("first_name") last_name = cleaned_data.get("last_name") zipcode = cleaned_data.get("zipcode") pickup_location = cleaned_data.get("pickup_location") if first_name and first_name.strip() == '': msg = 'This field is required.' self._errors["first_name"] = self.error_class([msg]) del cleaned_data["first_name"] if last_name and last_name.strip() == '': msg = 'This field is required.' self._errors["last_name"] = self.error_class([msg]) del cleaned_data["last_name"] if first_name and not is_valid_name(first_name): msg = 'This field does not allow numbers and special-characters' self._errors["first_name"] = self.error_class([msg]) del cleaned_data["first_name"] if last_name and not is_valid_name(last_name): msg = 'This field does not allow numbers and special-characters' self._errors["last_name"] = self.error_class([msg]) del cleaned_data["last_name"] if zipcode and not re.search(r'^(\d{5}|\d{5}\-\d{4})$', zipcode): msg = 'The zip-code should follow the format XXXXX or XXXXX-XXXX: (e.g., 12345 and 12345-6789)' self._errors["zipcode"] = self.error_class([msg]) del cleaned_data["zipcode"] if pickup_location and pickup_location.strip() == '': msg = 'This field is required.' self._errors["pickup_location"] = self.error_class([msg]) del cleaned_data["pickup_location"] return cleaned_data class ChangeUserPreferencesForm(forms.ModelForm): class Meta: model = User fields = ['email_remainder_freq', 'pickup_location'] exclude = ['share_zone'] class ChangeUserForm(forms.ModelForm): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True) email = forms.CharField(required=True) zipcode = forms.CharField(required=True) class Meta: model = User exclude = ['username','password','groups','user_permissions','is_staff','is_active','is_superuser','last_login','date_joined','share_zone'] def __init__(self, *args, **kwargs): super(ChangeUserForm, self).__init__(*args, **kwargs) def clean(self): cleaned_data = super(ChangeUserForm, self).clean() first_name = cleaned_data.get("first_name") last_name = cleaned_data.get("last_name") zipcode = cleaned_data.get("zipcode") pickup_location = cleaned_data.get("pickup_location") if first_name and first_name.strip() == '': msg = 'This field is required.' self._errors["first_name"] = self.error_class([msg]) del cleaned_data["first_name"] if last_name and last_name.strip() == '': msg = 'This field is required.' self._errors["last_name"] = self.error_class([msg]) del cleaned_data["last_name"] if first_name and not is_valid_name(first_name): msg = 'This field does not allow numbers and special-characters' self._errors["first_name"] = self.error_class([msg]) del cleaned_data["first_name"] if last_name and not is_valid_name(last_name): msg = 'This field does not allow numbers and special-characters' self._errors["last_name"] = self.error_class([msg]) del cleaned_data["last_name"] if zipcode and not re.search(r'^(\d{5}|\d{5}\-\d{4})$', zipcode): msg = 'The zip-code should follow the format XXXXX or XXXXX-XXXX: (e.g., 12345 and 12345-6789)' self._errors["zipcode"] = self.error_class([msg]) del cleaned_data["zipcode"] if pickup_location and pickup_location.strip() == '': msg = 'This field is required.' self._errors["pickup_location"] = self.error_class([msg]) del cleaned_data["pickup_location"] return cleaned_data
42
147
0.642857
607
4,872
4.914333
0.15486
0.088502
0.056319
0.068388
0.848139
0.848139
0.848139
0.848139
0.848139
0.848139
0
0.009125
0.235222
4,872
115
148
42.365217
0.791465
0
0
0.826087
0
0.021739
0.232964
0.009031
0
0
0
0
0
1
0.043478
false
0.021739
0.054348
0
0.271739
0
0
0
0
null
0
0
0
1
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
7
7a0ee4ec3827c99e895f7241f69b269e7a08f4ce
31,505
py
Python
PySide2/QtXml.py
arjun-namdeo/py_stubs
605bb167e239978f5417f3f1fc1f5c12e2a243cc
[ "MIT" ]
null
null
null
PySide2/QtXml.py
arjun-namdeo/py_stubs
605bb167e239978f5417f3f1fc1f5c12e2a243cc
[ "MIT" ]
null
null
null
PySide2/QtXml.py
arjun-namdeo/py_stubs
605bb167e239978f5417f3f1fc1f5c12e2a243cc
[ "MIT" ]
null
null
null
class _Object(object): __dict__ = None class QXmlDeclHandler(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def attributeDecl(*args, **kwargs): pass def errorString(*args, **kwargs): pass def externalEntityDecl(*args, **kwargs): pass def internalEntityDecl(*args, **kwargs): pass __new__ = None class QXmlLocator(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def columnNumber(*args, **kwargs): pass def lineNumber(*args, **kwargs): pass __new__ = None class QDomImplementation(_Object): def __copy__(*args, **kwargs): pass def __eq__(*args, **kwargs): """ x.__eq__(y) <==> x==y """ pass def __ge__(*args, **kwargs): """ x.__ge__(y) <==> x>=y """ pass def __gt__(*args, **kwargs): """ x.__gt__(y) <==> x>y """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __le__(*args, **kwargs): """ x.__le__(y) <==> x<=y """ pass def __lt__(*args, **kwargs): """ x.__lt__(y) <==> x<y """ pass def __ne__(*args, **kwargs): """ x.__ne__(y) <==> x!=y """ pass def createDocument(*args, **kwargs): pass def createDocumentType(*args, **kwargs): pass def hasFeature(*args, **kwargs): pass def isNull(*args, **kwargs): pass def invalidDataPolicy(*args, **kwargs): pass def setInvalidDataPolicy(*args, **kwargs): pass AcceptInvalidChars = None DropInvalidChars = None InvalidDataPolicy = None ReturnNullNode = None __new__ = None class QXmlParseException(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def columnNumber(*args, **kwargs): pass def lineNumber(*args, **kwargs): pass def message(*args, **kwargs): pass def publicId(*args, **kwargs): pass def systemId(*args, **kwargs): pass __new__ = None class QDomNode(_Object): def __copy__(*args, **kwargs): pass def __eq__(*args, **kwargs): """ x.__eq__(y) <==> x==y """ pass def __ge__(*args, **kwargs): """ x.__ge__(y) <==> x>=y """ pass def __gt__(*args, **kwargs): """ x.__gt__(y) <==> x>y """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __le__(*args, **kwargs): """ x.__le__(y) <==> x<=y """ pass def __lshift__(*args, **kwargs): """ x.__lshift__(y) <==> x<<y """ pass def __lt__(*args, **kwargs): """ x.__lt__(y) <==> x<y """ pass def __ne__(*args, **kwargs): """ x.__ne__(y) <==> x!=y """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def __rlshift__(*args, **kwargs): """ x.__rlshift__(y) <==> y<<x """ pass def appendChild(*args, **kwargs): pass def attributes(*args, **kwargs): pass def childNodes(*args, **kwargs): pass def clear(*args, **kwargs): pass def cloneNode(*args, **kwargs): pass def columnNumber(*args, **kwargs): pass def firstChild(*args, **kwargs): pass def firstChildElement(*args, **kwargs): pass def hasAttributes(*args, **kwargs): pass def hasChildNodes(*args, **kwargs): pass def insertAfter(*args, **kwargs): pass def insertBefore(*args, **kwargs): pass def isAttr(*args, **kwargs): pass def isCDATASection(*args, **kwargs): pass def isCharacterData(*args, **kwargs): pass def isComment(*args, **kwargs): pass def isDocument(*args, **kwargs): pass def isDocumentFragment(*args, **kwargs): pass def isDocumentType(*args, **kwargs): pass def isElement(*args, **kwargs): pass def isEntity(*args, **kwargs): pass def isEntityReference(*args, **kwargs): pass def isNotation(*args, **kwargs): pass def isNull(*args, **kwargs): pass def isProcessingInstruction(*args, **kwargs): pass def isSupported(*args, **kwargs): pass def isText(*args, **kwargs): pass def lastChild(*args, **kwargs): pass def lastChildElement(*args, **kwargs): pass def lineNumber(*args, **kwargs): pass def localName(*args, **kwargs): pass def namedItem(*args, **kwargs): pass def namespaceURI(*args, **kwargs): pass def nextSibling(*args, **kwargs): pass def nextSiblingElement(*args, **kwargs): pass def nodeName(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def nodeValue(*args, **kwargs): pass def normalize(*args, **kwargs): pass def ownerDocument(*args, **kwargs): pass def parentNode(*args, **kwargs): pass def prefix(*args, **kwargs): pass def previousSibling(*args, **kwargs): pass def previousSiblingElement(*args, **kwargs): pass def removeChild(*args, **kwargs): pass def replaceChild(*args, **kwargs): pass def save(*args, **kwargs): pass def setNodeValue(*args, **kwargs): pass def setPrefix(*args, **kwargs): pass def toAttr(*args, **kwargs): pass def toCDATASection(*args, **kwargs): pass def toCharacterData(*args, **kwargs): pass def toComment(*args, **kwargs): pass def toDocument(*args, **kwargs): pass def toDocumentFragment(*args, **kwargs): pass def toDocumentType(*args, **kwargs): pass def toElement(*args, **kwargs): pass def toEntity(*args, **kwargs): pass def toEntityReference(*args, **kwargs): pass def toNotation(*args, **kwargs): pass def toProcessingInstruction(*args, **kwargs): pass def toText(*args, **kwargs): pass AttributeNode = None BaseNode = None CDATASectionNode = None CharacterDataNode = None CommentNode = None DocumentFragmentNode = None DocumentNode = None DocumentTypeNode = None ElementNode = None EncodingFromDocument = None EncodingFromTextStream = None EncodingPolicy = None EntityNode = None EntityReferenceNode = None NodeType = None NotationNode = None ProcessingInstructionNode = None TextNode = None __new__ = None class QXmlErrorHandler(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def error(*args, **kwargs): pass def errorString(*args, **kwargs): pass def fatalError(*args, **kwargs): pass def warning(*args, **kwargs): pass __new__ = None class QXmlDTDHandler(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def errorString(*args, **kwargs): pass def notationDecl(*args, **kwargs): pass def unparsedEntityDecl(*args, **kwargs): pass __new__ = None class QXmlContentHandler(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def characters(*args, **kwargs): pass def endDocument(*args, **kwargs): pass def endElement(*args, **kwargs): pass def endPrefixMapping(*args, **kwargs): pass def errorString(*args, **kwargs): pass def ignorableWhitespace(*args, **kwargs): pass def processingInstruction(*args, **kwargs): pass def setDocumentLocator(*args, **kwargs): pass def skippedEntity(*args, **kwargs): pass def startDocument(*args, **kwargs): pass def startElement(*args, **kwargs): pass def startPrefixMapping(*args, **kwargs): pass __new__ = None class QXmlEntityResolver(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def errorString(*args, **kwargs): pass def resolveEntity(*args, **kwargs): pass __new__ = None class QXmlLexicalHandler(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def comment(*args, **kwargs): pass def endCDATA(*args, **kwargs): pass def endDTD(*args, **kwargs): pass def endEntity(*args, **kwargs): pass def errorString(*args, **kwargs): pass def startCDATA(*args, **kwargs): pass def startDTD(*args, **kwargs): pass def startEntity(*args, **kwargs): pass __new__ = None class QXmlNamespaceSupport(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def popContext(*args, **kwargs): pass def prefix(*args, **kwargs): pass def prefixes(*args, **kwargs): pass def processName(*args, **kwargs): pass def pushContext(*args, **kwargs): pass def reset(*args, **kwargs): pass def setPrefix(*args, **kwargs): pass def splitName(*args, **kwargs): pass def uri(*args, **kwargs): pass __new__ = None class QDomNodeList(_Object): def __copy__(*args, **kwargs): pass def __eq__(*args, **kwargs): """ x.__eq__(y) <==> x==y """ pass def __ge__(*args, **kwargs): """ x.__ge__(y) <==> x>=y """ pass def __gt__(*args, **kwargs): """ x.__gt__(y) <==> x>y """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __le__(*args, **kwargs): """ x.__le__(y) <==> x<=y """ pass def __lt__(*args, **kwargs): """ x.__lt__(y) <==> x<y """ pass def __ne__(*args, **kwargs): """ x.__ne__(y) <==> x!=y """ pass def at(*args, **kwargs): pass def count(*args, **kwargs): pass def isEmpty(*args, **kwargs): pass def item(*args, **kwargs): pass def length(*args, **kwargs): pass def size(*args, **kwargs): pass __new__ = None class QDomNamedNodeMap(_Object): def __copy__(*args, **kwargs): pass def __eq__(*args, **kwargs): """ x.__eq__(y) <==> x==y """ pass def __ge__(*args, **kwargs): """ x.__ge__(y) <==> x>=y """ pass def __gt__(*args, **kwargs): """ x.__gt__(y) <==> x>y """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __le__(*args, **kwargs): """ x.__le__(y) <==> x<=y """ pass def __lt__(*args, **kwargs): """ x.__lt__(y) <==> x<y """ pass def __ne__(*args, **kwargs): """ x.__ne__(y) <==> x!=y """ pass def contains(*args, **kwargs): pass def count(*args, **kwargs): pass def isEmpty(*args, **kwargs): pass def item(*args, **kwargs): pass def length(*args, **kwargs): pass def namedItem(*args, **kwargs): pass def namedItemNS(*args, **kwargs): pass def removeNamedItem(*args, **kwargs): pass def removeNamedItemNS(*args, **kwargs): pass def setNamedItem(*args, **kwargs): pass def setNamedItemNS(*args, **kwargs): pass def size(*args, **kwargs): pass __new__ = None class QXmlAttributes(_Object): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def append(*args, **kwargs): pass def clear(*args, **kwargs): pass def count(*args, **kwargs): pass def index(*args, **kwargs): pass def length(*args, **kwargs): pass def localName(*args, **kwargs): pass def qName(*args, **kwargs): pass def type(*args, **kwargs): pass def uri(*args, **kwargs): pass def value(*args, **kwargs): pass __new__ = None class QXmlReader(_Object): def DTDHandler(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def contentHandler(*args, **kwargs): pass def declHandler(*args, **kwargs): pass def entityResolver(*args, **kwargs): pass def errorHandler(*args, **kwargs): pass def feature(*args, **kwargs): pass def hasFeature(*args, **kwargs): pass def hasProperty(*args, **kwargs): pass def lexicalHandler(*args, **kwargs): pass def parse(*args, **kwargs): pass def property(*args, **kwargs): pass def setContentHandler(*args, **kwargs): pass def setDTDHandler(*args, **kwargs): pass def setDeclHandler(*args, **kwargs): pass def setEntityResolver(*args, **kwargs): pass def setErrorHandler(*args, **kwargs): pass def setFeature(*args, **kwargs): pass def setLexicalHandler(*args, **kwargs): pass def setProperty(*args, **kwargs): pass __new__ = None class QXmlInputSource(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def data(*args, **kwargs): pass def fetchData(*args, **kwargs): pass def fromRawData(*args, **kwargs): pass def next(*args, **kwargs): pass def reset(*args, **kwargs): pass def setData(*args, **kwargs): pass __new__ = None class QDomEntity(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass def notationName(*args, **kwargs): pass def publicId(*args, **kwargs): pass def systemId(*args, **kwargs): pass __new__ = None class QDomElement(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def attribute(*args, **kwargs): pass def attributeNS(*args, **kwargs): pass def attributeNode(*args, **kwargs): pass def attributeNodeNS(*args, **kwargs): pass def attributes(*args, **kwargs): pass def elementsByTagName(*args, **kwargs): pass def elementsByTagNameNS(*args, **kwargs): pass def hasAttribute(*args, **kwargs): pass def hasAttributeNS(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def removeAttribute(*args, **kwargs): pass def removeAttributeNS(*args, **kwargs): pass def removeAttributeNode(*args, **kwargs): pass def setAttribute(*args, **kwargs): pass def setAttributeNS(*args, **kwargs): pass def setAttributeNode(*args, **kwargs): pass def setAttributeNodeNS(*args, **kwargs): pass def setTagName(*args, **kwargs): pass def tagName(*args, **kwargs): pass def text(*args, **kwargs): pass __new__ = None class QDomDocumentFragment(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass __new__ = None class QDomNotation(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass def publicId(*args, **kwargs): pass def systemId(*args, **kwargs): pass __new__ = None class QDomAttr(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def name(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def ownerElement(*args, **kwargs): pass def setValue(*args, **kwargs): pass def specified(*args, **kwargs): pass def value(*args, **kwargs): pass __new__ = None class QDomCharacterData(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def appendData(*args, **kwargs): pass def data(*args, **kwargs): pass def deleteData(*args, **kwargs): pass def insertData(*args, **kwargs): pass def length(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def replaceData(*args, **kwargs): pass def setData(*args, **kwargs): pass def substringData(*args, **kwargs): pass __new__ = None class QDomEntityReference(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass __new__ = None class QXmlSimpleReader(QXmlReader): def DTDHandler(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def contentHandler(*args, **kwargs): pass def declHandler(*args, **kwargs): pass def entityResolver(*args, **kwargs): pass def errorHandler(*args, **kwargs): pass def feature(*args, **kwargs): pass def hasFeature(*args, **kwargs): pass def hasProperty(*args, **kwargs): pass def lexicalHandler(*args, **kwargs): pass def parse(*args, **kwargs): pass def parseContinue(*args, **kwargs): pass def property(*args, **kwargs): pass def setContentHandler(*args, **kwargs): pass def setDTDHandler(*args, **kwargs): pass def setDeclHandler(*args, **kwargs): pass def setEntityResolver(*args, **kwargs): pass def setErrorHandler(*args, **kwargs): pass def setFeature(*args, **kwargs): pass def setLexicalHandler(*args, **kwargs): pass def setProperty(*args, **kwargs): pass __new__ = None class QDomDocument(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def createAttribute(*args, **kwargs): pass def createAttributeNS(*args, **kwargs): pass def createCDATASection(*args, **kwargs): pass def createComment(*args, **kwargs): pass def createDocumentFragment(*args, **kwargs): pass def createElement(*args, **kwargs): pass def createElementNS(*args, **kwargs): pass def createEntityReference(*args, **kwargs): pass def createProcessingInstruction(*args, **kwargs): pass def createTextNode(*args, **kwargs): pass def doctype(*args, **kwargs): pass def documentElement(*args, **kwargs): pass def elementById(*args, **kwargs): pass def elementsByTagName(*args, **kwargs): pass def elementsByTagNameNS(*args, **kwargs): pass def implementation(*args, **kwargs): pass def importNode(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def setContent(*args, **kwargs): pass def toByteArray(*args, **kwargs): pass def toString(*args, **kwargs): pass __new__ = None class QDomProcessingInstruction(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def data(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def setData(*args, **kwargs): pass def target(*args, **kwargs): pass __new__ = None class QDomDocumentType(QDomNode): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def entities(*args, **kwargs): pass def internalSubset(*args, **kwargs): pass def name(*args, **kwargs): pass def nodeType(*args, **kwargs): pass def notations(*args, **kwargs): pass def publicId(*args, **kwargs): pass def systemId(*args, **kwargs): pass __new__ = None class QXmlDefaultHandler(QXmlContentHandler, QXmlErrorHandler, QXmlDTDHandler, QXmlEntityResolver, QXmlLexicalHandler, QXmlDeclHandler): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def attributeDecl(*args, **kwargs): pass def characters(*args, **kwargs): pass def comment(*args, **kwargs): pass def endCDATA(*args, **kwargs): pass def endDTD(*args, **kwargs): pass def endDocument(*args, **kwargs): pass def endElement(*args, **kwargs): pass def endEntity(*args, **kwargs): pass def endPrefixMapping(*args, **kwargs): pass def error(*args, **kwargs): pass def errorString(*args, **kwargs): pass def externalEntityDecl(*args, **kwargs): pass def fatalError(*args, **kwargs): pass def ignorableWhitespace(*args, **kwargs): pass def internalEntityDecl(*args, **kwargs): pass def notationDecl(*args, **kwargs): pass def processingInstruction(*args, **kwargs): pass def resolveEntity(*args, **kwargs): pass def setDocumentLocator(*args, **kwargs): pass def skippedEntity(*args, **kwargs): pass def startCDATA(*args, **kwargs): pass def startDTD(*args, **kwargs): pass def startDocument(*args, **kwargs): pass def startElement(*args, **kwargs): pass def startEntity(*args, **kwargs): pass def startPrefixMapping(*args, **kwargs): pass def unparsedEntityDecl(*args, **kwargs): pass def warning(*args, **kwargs): pass __new__ = None class QDomComment(QDomCharacterData): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass __new__ = None class QDomText(QDomCharacterData): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass def splitText(*args, **kwargs): pass __new__ = None class QDomCDATASection(QDomText): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def nodeType(*args, **kwargs): pass __new__ = None
15.53501
136
0.449516
2,640
31,505
5.067045
0.104167
0.289303
0.330717
0.362189
0.691635
0.691635
0.67474
0.665396
0.640353
0.536667
0
0.000772
0.42406
31,505
2,027
137
15.542674
0.736456
0.092588
0
0.788372
0
0
0
0
0
0
0
0
0
1
0.45
false
0.45
0.001163
0
0.551163
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
7
befee15b4af2810352c1a586660692225e78713b
134
py
Python
pdr_python_sdk/demo/spl/__init__.py
yintao-110/pandora-python-sdk.v2
c08aa61c047acb833760b037f2cc8910e7aafab8
[ "Apache-2.0" ]
4
2021-01-04T01:46:05.000Z
2022-02-08T05:05:13.000Z
pdr_python_sdk/demo/spl/__init__.py
yintao-110/pandora-python-sdk.v2
c08aa61c047acb833760b037f2cc8910e7aafab8
[ "Apache-2.0" ]
35
2020-12-29T07:35:40.000Z
2022-02-09T08:54:00.000Z
pdr_python_sdk/demo/spl/__init__.py
yintao-110/pandora-python-sdk.v2
c08aa61c047acb833760b037f2cc8910e7aafab8
[ "Apache-2.0" ]
14
2020-12-28T13:20:20.000Z
2021-07-21T08:53:54.000Z
from .batch_foobar import * from .chunk_foobar import * from .streaming_replacehello import * from .generating_generatehello import *
26.8
39
0.820896
16
134
6.625
0.5625
0.283019
0.301887
0
0
0
0
0
0
0
0
0
0.119403
134
4
40
33.5
0.898305
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
1
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
7
830cff274dc1a9d8e92543282df855a751a5f3ae
8,584
py
Python
scripts/addons/MeshDataTransfer/operators.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
2
2020-04-16T22:12:40.000Z
2022-01-22T17:18:45.000Z
scripts/addons/MeshDataTransfer/operators.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
null
null
null
scripts/addons/MeshDataTransfer/operators.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
2
2019-05-16T04:01:09.000Z
2020-08-25T11:42:26.000Z
import bpy from .mesh_data_transfer import MeshDataTransfer class TransferShapeData(bpy.types.Operator): """Tooltip""" bl_idname = "object.transfer_shape_data" bl_label = "Simple Object Operator" bl_options = {'REGISTER','UNDO'} @classmethod def poll(cls, context): sample_space = context.object.mesh_data_transfer_object.mesh_object_space return context.active_object is not None \ and context.active_object.mesh_data_transfer_object.mesh_source is not None\ and sample_space != "TOPOLOGY" and bpy.context.object.mode == "OBJECT" def execute(self, context): active = context.active_object active_prop = context.object.mesh_data_transfer_object deformed_source = active_prop.transfer_modified_source # sc_prop = context.scene.mesh_data_transfer_global as_shape_key = active_prop.transfer_shape_as_key snap_to_closest = active_prop.snap_to_closest_shape source = active.mesh_data_transfer_object.mesh_source mask_vertex_group = active_prop.vertex_group_filter invert_mask = active_prop.invert_vertex_group_filter # target_prop = target.mesh_data_transfer_global world_space = False uv_space = False search_method = active_prop.search_method sample_space = active_prop.mesh_object_space if sample_space == 'UVS': uv_space = True if sample_space == 'LOCAL': world_space = False if sample_space == 'WORLD': world_space = True transfer_data = MeshDataTransfer(target=active, source =source, world_space=world_space, deformed_source=deformed_source,invert_vertex_group = invert_mask, uv_space=uv_space, search_method=search_method, vertex_group=mask_vertex_group, snap_to_closest=snap_to_closest) transferred = transfer_data.transfer_vertex_position(as_shape_key=as_shape_key) transfer_data.free() if not transferred: self.report({'INFO'}, 'Unable to perform the operation.') return{'CANCELLED'} return {'FINISHED'} class TransferShapeKeyData(bpy.types.Operator): """Tooltip""" bl_idname = "object.transfer_shape_key_data" bl_label = "Simple Object Operator" bl_options = {'REGISTER','UNDO'} @classmethod def poll(cls, context): sample_space = context.object.mesh_data_transfer_object.mesh_object_space return context.active_object is not None \ and context.active_object.mesh_data_transfer_object.mesh_source is not None\ and sample_space != "TOPOLOGY" and bpy.context.object.mode == "OBJECT" def execute(self, context): active = context.active_object active_prop = context.object.mesh_data_transfer_object deformed_source = active_prop.transfer_modified_source # sc_prop = context.scene.mesh_data_transfer_global as_shape_key = active_prop.transfer_shape_as_key source = active.mesh_data_transfer_object.mesh_source mask_vertex_group = active_prop.vertex_group_filter invert_mask = active_prop.invert_vertex_group_filter snap_to_closest = active_prop.snap_to_closest_shapekey # target_prop = target.mesh_data_transfer_global exclude_muted_shapekeys = active_prop.exclude_muted_shapekeys transfer_drivers = active_prop.transfer_shapekeys_drivers world_space = False uv_space = False search_method = active_prop.search_method sample_space = active_prop.mesh_object_space if sample_space == 'UVS': uv_space = True if sample_space == 'LOCAL': world_space = False if sample_space == 'WORLD': world_space = True transfer_data = MeshDataTransfer(target=active, source =source, world_space=world_space, uv_space=uv_space,deformed_source= deformed_source , invert_vertex_group= invert_mask, search_method=search_method, vertex_group=mask_vertex_group, exclude_muted_shapekeys = exclude_muted_shapekeys, snap_to_closest=snap_to_closest, transfer_drivers= transfer_drivers) transferred = transfer_data.transfer_shape_keys() transfer_data.free() if not transferred: self.report({'INFO'}, 'Unable to perform the operation.') return{'CANCELLED'} return {'FINISHED'} class TransferVertexGroupsData(bpy.types.Operator): """Tooltip""" bl_idname = "object.transfer_vertex_groups_data" bl_label = "Simple Object Operator" bl_options = {'REGISTER','UNDO'} @classmethod def poll(cls, context): sample_space = context.object.mesh_data_transfer_object.mesh_object_space return context.active_object is not None \ and context.active_object.mesh_data_transfer_object.mesh_source is not None \ and sample_space != "TOPOLOGY" and bpy.context.object.mode == "OBJECT" def execute(self, context): active = context.active_object active_prop = context.object.mesh_data_transfer_object # sc_prop = context.scene.mesh_data_transfer_global as_shape_key = active_prop.transfer_shape_as_key source = active.mesh_data_transfer_object.mesh_source mask_vertex_group = active_prop.vertex_group_filter invert_mask = active_prop.invert_vertex_group_filter exclude_locked_groups = active_prop.exclude_locked_groups # target_prop = target.mesh_data_transfer_global world_space = False uv_space = False search_method = active_prop.search_method sample_space = active_prop.mesh_object_space if sample_space == 'UVS': uv_space = True if sample_space == 'LOCAL': world_space = False if sample_space == 'WORLD': world_space = True transfer_data = MeshDataTransfer(target=active, source =source, world_space=world_space, invert_vertex_group = invert_mask, uv_space=uv_space, search_method=search_method, vertex_group=mask_vertex_group, exclude_locked_groups= exclude_locked_groups) transferred = transfer_data.transfer_vertex_groups() transfer_data.free() if not transferred: self.report({'INFO'}, 'Unable to perform the operation.') return{'CANCELLED'} return {'FINISHED'} class TransferUVData(bpy.types.Operator): """Tooltip""" bl_idname = "object.transfer_uv_data" bl_label = "Simple Object Operator" bl_options = {'REGISTER','UNDO'} @classmethod def poll(cls, context): return context.active_object is not None \ and context.active_object.mesh_data_transfer_object.mesh_source is not None \ and bpy.context.object.mode == "OBJECT" def execute(self, context): active = context.active_object active_prop = context.object.mesh_data_transfer_object # sc_prop = context.scene.mesh_data_transfer_global as_shape_key = active_prop.transfer_shape_as_key source = active.mesh_data_transfer_object.mesh_source # target_prop = target.mesh_data_transfer_global mask_vertex_group = active_prop.vertex_group_filter invert_mask = active_prop.invert_vertex_group_filter world_space = False topology = False search_method = active_prop.search_method sample_space = active_prop.mesh_object_space if sample_space == 'UVS': uv_space = True if sample_space == 'LOCAL': world_space = False if sample_space == 'WORLD': world_space = True if sample_space == 'TOPOLOGY': topology = True #transfer_uvs(active, target, world_space) transfer_data = MeshDataTransfer(target=active, source =source, world_space=world_space, invert_vertex_group = invert_mask, search_method=search_method, topology=topology, vertex_group=mask_vertex_group) transfer_data.transfer_uvs() transfer_data.free() return {'FINISHED'}
40.300469
123
0.662395
982
8,584
5.395112
0.088595
0.058513
0.07248
0.062288
0.880332
0.859003
0.849188
0.834843
0.804266
0.780861
0
0
0.268639
8,584
212
124
40.490566
0.843899
0.053705
0
0.774194
0
0
0.064739
0.013961
0
0
0
0
0
1
0.051613
false
0
0.012903
0.006452
0.219355
0
0
0
0
null
0
0
0
1
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
7
55d2653adb586c04e4afd39d7c81d68072c1c000
1,108
py
Python
hwt/hdl/types/bitVal_opReduce.py
mgielda/hwt
e6c699fb154f93ac03523bfe40a3d4fc1912d28b
[ "MIT" ]
null
null
null
hwt/hdl/types/bitVal_opReduce.py
mgielda/hwt
e6c699fb154f93ac03523bfe40a3d4fc1912d28b
[ "MIT" ]
null
null
null
hwt/hdl/types/bitVal_opReduce.py
mgielda/hwt
e6c699fb154f93ac03523bfe40a3d4fc1912d28b
[ "MIT" ]
null
null
null
from hwt.doc_markers import internal @internal def tryReduceAnd(sig, val): """ Return sig and val reduced by & operator or None if it is not possible to statically reduce expression """ m = sig._dtype.all_mask() if val._isFullVld(): v = val.val if v == m: return sig elif v == 0: return val @internal def tryReduceOr(sig, val): """ Return sig and val reduced by | operator or None if it is not possible to statically reduce expression """ m = sig._dtype.all_mask() if not val.vldMask: return val if val._isFullVld(): v = val.val if v == m: return val elif v == 0: return sig @internal def tryReduceXor(sig, val): """ Return sig and val reduced by ^ operator or None if it is not possible to statically reduce expression """ m = sig._dtype.all_mask() if not val.vldMask: return val if val._isFullVld(): v = val.val if v == m: return ~sig elif v == 0: return sig
21.307692
57
0.558664
150
1,108
4.06
0.246667
0.103448
0.059113
0.073892
0.827586
0.79803
0.79803
0.79803
0.79803
0.79803
0
0.004213
0.357401
1,108
51
58
21.72549
0.851124
0.277978
0
0.84375
0
0
0
0
0
0
0
0
0
1
0.09375
false
0
0.03125
0
0.375
0
0
0
0
null
0
0
0
1
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
7
3615ab16be9525e630a31a7fd8e9b085460474a3
6,240
py
Python
tests/fee_distribution_test.py
vfurci200/module9_loan
6239cc9e03bcfb1371b14d7967e490f3ee11b26a
[ "MIT" ]
null
null
null
tests/fee_distribution_test.py
vfurci200/module9_loan
6239cc9e03bcfb1371b14d7967e490f3ee11b26a
[ "MIT" ]
null
null
null
tests/fee_distribution_test.py
vfurci200/module9_loan
6239cc9e03bcfb1371b14d7967e490f3ee11b26a
[ "MIT" ]
null
null
null
from brownie import accounts, Bank, chain import pytest def test_fees_distributed__upon_repayment_standard(bank, chain): bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.deposit( "20 ether", {'from': accounts[3],'amount': "20 ether"}) bank.borrow( "10 ether", {'from': accounts[1]}) balance0 = accounts[0].balance(); balance3 = accounts[3].balance(); # sleep for 1 second chain.sleep(10) #Sleeping does not mine a new block. Contract view functions that rely on block.timestamp will be unaffected until you perform a transaction or call chain.mine. chain.mine(1) fee = bank.get_fee_accumulated_on_loan(0, {'from': accounts[1]}) assert fee > 0 bank.repay_full_loan(0, {'from': accounts[1], 'amount': "15 ether" }) earned = bank.get_accumulated_earnings({'from': accounts[0]}) assert earned>0 bank.withdraw_fees({'from': accounts[0]}) bank.withdraw_fees({'from': accounts[3]}) a = (balance0 + (fee*0.6)) b = (balance3 + (fee*0.4)) assert accounts[0].balance() == a assert accounts[3].balance() == b @pytest.mark.xfail def test_fees_distributed_upon_repayment_v2(bank, chain): bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.borrow( "10 ether", {'from': accounts[1]}) bank.deposit( "20 ether", {'from': accounts[3],'amount': "20 ether"}) # bank.borrow( "20 ether", {'from': accounts[2]}) balance0 = accounts[0].balance(); balance3 = accounts[3].balance(); # sleep for 1 second chain.sleep(10) #Sleeping does not mine a new block. Contract view functions that rely on block.timestamp will be unaffected until you perform a transaction or call chain.mine. chain.mine(1) fee = bank.get_fee_accumulated_on_loan(0, {'from': accounts[1]}) assert fee > 0 bank.repay_full_loan(0, {'from': accounts[1], 'amount': "15 ether" }) earned = bank.get_accumulated_earnings({'from': accounts[0]}) assert earned>0 # should fail here bank.deposit( "20 ether", {'from': accounts[3],'amount': "20 ether"}) bank.withdraw_fees({'from': accounts[0]}) bank.withdraw_fees({'from': accounts[3]}) a = (balance0 + (fee*0.6)) b = (balance3 + (fee*0.4)) assert accounts[0].balance() == a assert accounts[3].balance() == b def test_fees_distributed__second_deposit_after_borrow(bank, chain): bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.borrow( "10 ether", {'from': accounts[1]}) bank.deposit( "20 ether", {'from': accounts[3],'amount': "20 ether"}) # bank.borrow( "20 ether", {'from': accounts[2]}) balance0 = accounts[0].balance(); balance3 = accounts[3].balance(); # sleep for 1 second chain.sleep(10) #Sleeping does not mine a new block. Contract view functions that rely on block.timestamp will be unaffected until you perform a transaction or call chain.mine. chain.mine(1) fee = bank.get_fee_accumulated_on_loan(0, {'from': accounts[1]}) assert fee > 0 bank.repay_full_loan(0, {'from': accounts[1], 'amount': "15 ether" }) earned = bank.get_accumulated_earnings({'from': accounts[0]}) assert earned>0 bank.withdraw_fees({'from': accounts[0]}) # bank.withdraw_fees({'from': accounts[3]}) a = (balance0 + (fee*0.6)) b = (balance3 + (fee*0.4)) assert accounts[0].balance() == a assert accounts[3].balance() == balance3 bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.borrow( "20 ether", {'from': accounts[1]}) chain.sleep(10) chain.mine(1) fee2 = bank.get_fee_accumulated_on_loan(1, {'from': accounts[1]}) bank.repay_full_loan(1, {'from': accounts[1], 'amount': "25 ether" }) bank.withdraw_fees({'from': accounts[0]}) bank.withdraw_fees({'from': accounts[3]}) a2 = (balance0 + (fee*0.6)) - 30000000000000000000 + (fee2*0.75) b2 = (balance3 + (fee*0.4))+ (fee2*0.25) assert accounts[3].balance() == b2 assert accounts[0].balance() == a2 def test_fees_distributed__fees_not_withdrawn_until_second_loan_repaid(bank, chain): bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.borrow( "10 ether", {'from': accounts[1]}) bank.deposit( "20 ether", {'from': accounts[3],'amount': "20 ether"}) # bank.borrow( "20 ether", {'from': accounts[2]}) balance0 = accounts[0].balance(); balance3 = accounts[3].balance(); # sleep for 1 second chain.sleep(10) #Sleeping does not mine a new block. Contract view functions that rely on block.timestamp will be unaffected until you perform a transaction or call chain.mine. chain.mine(1) fee = bank.get_fee_accumulated_on_loan(0, {'from': accounts[1]}) assert fee > 0 bank.repay_full_loan(0, {'from': accounts[1], 'amount': "15 ether" }) earned = bank.get_accumulated_earnings({'from': accounts[0]}) assert earned>0 bank.withdraw_fees({'from': accounts[0]}) # bank.withdraw_fees({'from': accounts[3]}) a = (balance0 + (fee*0.6)) b = (balance3 + (fee*0.4)) assert accounts[0].balance() == a assert accounts[3].balance() == balance3 bank.deposit( "30 ether", {'from': accounts[0],'amount': "30 ether"}) bank.borrow( "20 ether", {'from': accounts[1]}) chain.sleep(10) chain.mine(1) fee2 = bank.get_fee_accumulated_on_loan(1, {'from': accounts[1]}) bank.repay_full_loan(1, {'from': accounts[1], 'amount': "25 ether" }) bank.withdraw_fees({'from': accounts[0]}) bank.withdraw("60 ether",{'from': accounts[0]}) bank.withdraw_fees({'from': accounts[3]}) a2 = (balance0 + (fee*0.6)) + 30000000000000000000 + (fee2*0.75) b2 = (balance3 + (fee*0.4))+ (fee2*0.25) assert accounts[3].balance() == b2 assert accounts[0].balance() == a2
49.92
168
0.602244
821
6,240
4.47503
0.102314
0.160044
0.097169
0.065324
0.94638
0.94638
0.927327
0.927327
0.921884
0.921884
0
0.062657
0.232692
6,240
124
169
50.322581
0.704678
0.153205
0
0.902913
0
0
0.105902
0
0
0
0
0
0.194175
1
0.038835
false
0
0.019417
0
0.058252
0
0
0
0
null
0
0
0
1
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
7
3645c9e4736f9a39b0465d257f6b8cd785aefa2c
127
py
Python
Generate Colours/Generate RGB Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
Generate Colours/Generate RGB Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
Generate Colours/Generate RGB Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
from random import randint def get_rgb(): return '{}, {}, {}'.format(randint(0, 255), randint(0, 255), randint(0, 255))
21.166667
82
0.614173
18
127
4.277778
0.611111
0.311688
0.428571
0.467532
0.428571
0.428571
0
0
0
0
0
0.114286
0.173228
127
5
83
25.4
0.619048
0
0
0
0
0
0.07874
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.333333
1
0
1
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
1
1
0
1
1
1
0
0
10
3658c2857e898183308d80ba65fa7c0fca91c116
115
py
Python
robosuite-extra/robosuite_extra/push_env/__init__.py
eugval/sim2real_dynamics_simulation
2ed175803faa38792f6becc2dc91f44ae71ed9c2
[ "MIT" ]
16
2020-07-28T14:35:44.000Z
2021-11-28T01:50:51.000Z
robosuite-extra/robosuite_extra/push_env/__init__.py
eugval/sim2real_dynamics_simulation
2ed175803faa38792f6becc2dc91f44ae71ed9c2
[ "MIT" ]
1
2020-11-26T07:58:30.000Z
2020-12-01T04:40:28.000Z
robosuite-extra/robosuite_extra/push_env/__init__.py
eugval/sim2real_dynamics_simulation
2ed175803faa38792f6becc2dc91f44ae71ed9c2
[ "MIT" ]
2
2020-10-18T01:38:49.000Z
2021-12-31T10:56:41.000Z
from robosuite_extra.push_env.push_task import PushTask from robosuite_extra.push_env.sawyer_push import SawyerPush
57.5
59
0.904348
18
115
5.444444
0.555556
0.265306
0.367347
0.44898
0.510204
0
0
0
0
0
0
0
0.06087
115
2
59
57.5
0.907407
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
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
7
3673dcbf9ec8793d74f4f7f98b8e87e7ef1eb3ad
21,739
py
Python
tests/dhcpv6/kea_only/HA/test_ha_sync.py
shawnmullaney/forge
aaaef0a0645f73d24666aab6a400f3604e753aac
[ "0BSD" ]
null
null
null
tests/dhcpv6/kea_only/HA/test_ha_sync.py
shawnmullaney/forge
aaaef0a0645f73d24666aab6a400f3604e753aac
[ "0BSD" ]
null
null
null
tests/dhcpv6/kea_only/HA/test_ha_sync.py
shawnmullaney/forge
aaaef0a0645f73d24666aab6a400f3604e753aac
[ "0BSD" ]
null
null
null
"""Kea HA syncing""" # pylint: disable=invalid-name,line-too-long import random import pytest from forge_cfg import world import srv_msg import misc import srv_control @pytest.mark.v6 @pytest.mark.hook @pytest.mark.HA @pytest.mark.HA_state @pytest.mark.disabled def test_v6_hooks_HA_page_size_sync_mulitple_NA(): # HA SERVER 1 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.config_srv_prefix('2001:db8:2::', '0', '48', '91') srv_control.config_srv_id('LLT', '00:01:00:02:52:7b:a8:f0:08:00:27:58:f1:e8') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server1"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '2') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role":"primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role":"standby","auto-failover":true}') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # HA SERVER 2 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.config_srv_prefix('2001:db8:2::', '0', '48', '91') srv_control.config_srv_id('LLT', '00:01:00:02:52:7b:a8:f0:08:00:27:58:99:99') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS_2)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL2') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server2"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '2') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role": "primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role": "standby","auto-failover":true}') srv_control.build_and_send_config_files_dest_addr('SSH', 'config-file', '$(MGMT_ADDRESS_2)') srv_control.remote_start_srv('DHCP', 'started', '$(MGMT_ADDRESS_2)') misc.test_procedure() srv_msg.forge_sleep('2', 'seconds') tmp = world.f_cfg.show_packets_from world.f_cfg.show_packets_from = "" duid = "00:03:00:01:ff:ff:ff:ff:ff:0" test_range = 5 for each in range(9): ia_1 = random.randint(1, 9009) misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', duid + str(each)) srv_msg.client_does_include('Client', None, 'client-id') for each_ia in range(test_range): srv_msg.client_sets_value('Client', 'ia_id', ia_1 + each_ia) srv_msg.client_does_include('Client', None, 'IA-NA') for each_pd in range(test_range): srv_msg.client_sets_value('Client', 'ia_pd', ia_1 + each_pd) srv_msg.client_does_include('Client', None, 'IA-PD') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', duid + str(each)) srv_msg.client_does_include('Client', None, 'client-id') for each_ia in range(test_range): srv_msg.client_sets_value('Client', 'ia_id', ia_1 + each_ia) srv_msg.client_does_include('Client', None, 'IA-NA') for each_pd in range(test_range): srv_msg.client_sets_value('Client', 'ia_pd', ia_1 + each_pd) srv_msg.client_does_include('Client', None, 'IA-PD') srv_msg.client_copy_option('server-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', None, '2') srv_msg.response_check_option_content('Response', '2', None, 'duid', '00:01:00:02:52:7b:a8:f0:08:00:27:58:f1:e8') srv_msg.forge_sleep('2', 'seconds') world.f_cfg.show_packets_from = tmp srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease ' 'for address 2001:db8:2::aa0:0:0 and lease type IA_PD') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'DHCPSRV_MEMFILE_UPDATE_ADDR6 updating IPv6 lease for address 2001:db8:2::aa0:0:0') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log-CTRL2', None, 'Bulk apply of 10 IPv6 leases completed.') srv_control.start_srv('DHCP', 'stopped') srv_msg.forge_sleep('2', 'seconds') tmp = world.f_cfg.show_packets_from world.f_cfg.show_packets_from = "" duid = "00:03:00:01:ff:ff:ff:ff:00:0" for each in range(9): ia_1 = random.randint(1, 9009) misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', duid + str(each)) srv_msg.client_does_include('Client', None, 'client-id') for each_ia in range(test_range): srv_msg.client_sets_value('Client', 'ia_id', ia_1 + each_ia) srv_msg.client_does_include('Client', None, 'IA-NA') for each_pd in range(test_range): srv_msg.client_sets_value('Client', 'ia_pd', ia_1 + each_pd) srv_msg.client_does_include('Client', None, 'IA-PD') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', duid + str(each)) srv_msg.client_does_include('Client', None, 'client-id') for each_ia in range(test_range): srv_msg.client_sets_value('Client', 'ia_id', ia_1 + each_ia) srv_msg.client_does_include('Client', None, 'IA-NA') for each_pd in range(test_range): srv_msg.client_sets_value('Client', 'ia_pd', ia_1 + each_pd) srv_msg.client_does_include('Client', None, 'IA-PD') srv_msg.client_copy_option('server-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', None, '2') srv_msg.response_check_option_content('Response', '2', None, 'duid', '00:01:00:02:52:7b:a8:f0:08:00:27:58:99:99') srv_control.start_srv('DHCP', 'started') srv_msg.forge_sleep('4', 'seconds') # now we should have 180 leases in HEA server 1 @pytest.mark.v6 @pytest.mark.hook @pytest.mark.HA @pytest.mark.HA_state @pytest.mark.disabled def test_v6_hooks_HA_page_size_sync(): # HA SERVER 1 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel() srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server1"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '10') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role":"primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role":"standby","auto-failover":true}') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # HA SERVER 2 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS_2)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL2') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server2"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '10') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role": "primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role": "standby","auto-failover":true}') srv_control.build_and_send_config_files_dest_addr('SSH', 'config-file', '$(MGMT_ADDRESS_2)') misc.test_procedure() srv_msg.forge_sleep('3', 'seconds') srv_msg.loops('SOLICIT', 'REPLY', '100') srv_control.remote_start_srv('DHCP', 'started', '$(MGMT_ADDRESS_2)') srv_msg.forge_sleep('10', 'seconds') misc.pass_criteria() srv_msg.log_contains('DHCPSRV_MEMFILE_GET_PAGE6 obtaining at most 10 IPv6 leases starting from address 2001:db8:1::5b') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'HA_LEASES_SYNC_LEASE_PAGE_RECEIVED received 10 leases from server1') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address 2001:db8:1::65 and lease type IA_NA') @pytest.mark.v6 @pytest.mark.hook @pytest.mark.HA @pytest.mark.HA_state @pytest.mark.disabled def test_v6_hooks_HA_page_size_sync_2(): # HA SERVER 1 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server1"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '10') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role":"primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role":"standby","auto-failover":true}') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # HA SERVER 2 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS_2)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL2') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server2"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('sync-page-limit', '15') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role": "primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role": "standby","auto-failover":true}') srv_control.build_and_send_config_files_dest_addr('SSH', 'config-file', '$(MGMT_ADDRESS_2)') misc.test_procedure() srv_msg.forge_sleep('3', 'seconds') # create leases in HA 1 srv_msg.loops('SOLICIT', 'REPLY', '100') srv_control.remote_start_srv('DHCP', 'started', '$(MGMT_ADDRESS_2)') # sync HA 2 with HA 1 srv_msg.forge_sleep('10', 'seconds') misc.pass_criteria() srv_msg.log_contains('DHCPSRV_MEMFILE_GET_PAGE6 obtaining at most 15 IPv6 leases starting from address 2001:db8:1::5') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'HA_LEASES_SYNC_LEASE_PAGE_RECEIVED received 15 leases from server1') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address 2001:db8:1::65 and lease type IA_NA') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', 'NOT ', 'DHCPSRV_MEMFILE_GET_PAGE6 obtaining at most 10 IPv6 leases starting from address 2001:') srv_msg.log_doesnt_contain('HA_LEASES_SYNC_LEASE_PAGE_RECEIVED received 10 leases from') srv_msg.remote_log_includes_line('$(MGMT_ADDRESS_2)', '$(SOFTWARE_INSTALL_DIR)/var/log/kea.log', None, 'HA_SYNC_SUCCESSFUL lease database synchronization with server1 completed successfully') # stop HA ! srv_control.start_srv('DHCP', 'stopped') misc.test_procedure() srv_msg.forge_sleep('3', 'seconds') # create leases in HA 2 srv_msg.loops('SOLICIT', 'REPLY', '100') srv_control.clear_leases('logs') srv_control.start_srv('DHCP', 'started') srv_msg.forge_sleep('10', 'seconds') misc.pass_criteria() srv_msg.log_contains('DHCPSRV_MEMFILE_ADD_ADDR6 adding IPv6 lease with address 2001:db8:1::c9') @pytest.mark.v6 @pytest.mark.hook @pytest.mark.HA @pytest.mark.HA_state @pytest.mark.disabled def test_v6_hooks_HA_page_size_sync_large(): # This is to big to be run in forge setup, run manually, if by mistake someone will start it - uncomment lines at the bottom # HA SERVER 1 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS)') srv_control.configure_loggers('kea-dhcp6.dhcpsrv', 'DEBUG', '99') srv_control.configure_loggers('kea-dhcp6.ha-hooks', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server1"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role":"primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role":"standby","auto-failover":true}') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # HA SERVER 2 misc.test_setup() srv_control.config_srv_subnet('2001:db8:1::/64', '2001:db8:1::1-2001:db8:1::ffff') srv_control.open_control_channel() srv_control.agent_control_channel('$(MGMT_ADDRESS_2)') srv_control.configure_loggers('kea-dhcp6', 'DEBUG', '99') srv_control.configure_loggers('kea-ctrl-agent', 'DEBUG', '99', 'kea.log-CTRL2') srv_control.add_hooks('libdhcp_lease_cmds.so') srv_control.add_ha_hook('libdhcp_ha.so') srv_control.add_parameter_to_ha_hook('this-server-name', '"server2"') srv_control.add_parameter_to_ha_hook('mode', '"hot-standby"') srv_control.add_parameter_to_ha_hook('heartbeat-delay', '1000') srv_control.add_parameter_to_ha_hook('max-response-delay', '1001') srv_control.add_parameter_to_ha_hook('max-unacked-clients', '0') srv_control.add_parameter_to_ha_hook('max-ack-delay', '0') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server1","url":"http://$(MGMT_ADDRESS):8000/","role": "primary","auto-failover":true}') srv_control.add_parameter_to_ha_hook('peers', '{"name":"server2","url":"http://$(MGMT_ADDRESS_2):8000/","role": "standby","auto-failover":true}') srv_control.build_and_send_config_files_dest_addr('SSH', 'config-file', '$(MGMT_ADDRESS_2)') srv_control.remote_start_srv('DHCP', 'started', '$(MGMT_ADDRESS_2)') srv_msg.forge_sleep('3', 'seconds') # UNCOMMENT: # Exchange messages SOLICIT - REPLY 200000 times. srv_control.start_srv('DHCP', 'started') # UNCOMMENT: # Sleep for 3000 seconds.
46.750538
140
0.645384
3,006
21,739
4.313706
0.078177
0.12339
0.086219
0.118763
0.950104
0.950104
0.939307
0.939307
0.933369
0.933369
0
0.043843
0.205759
21,739
464
141
46.851293
0.70717
0.022586
0
0.893983
0
0.057307
0.317659
0.072465
0
0
0
0
0
1
0.011461
false
0.020057
0.017192
0
0.028653
0
0
0
0
null
0
0
0
1
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
7
36af4bac21dcb433be5aaff189718fe84a6e068c
10,326
py
Python
cities_light/migrations/0001_initial.py
b-dev/django-cities-light
b42d3363dfabd662c9d0878b15b0dde748fec38e
[ "MIT" ]
null
null
null
cities_light/migrations/0001_initial.py
b-dev/django-cities-light
b42d3363dfabd662c9d0878b15b0dde748fec38e
[ "MIT" ]
null
null
null
cities_light/migrations/0001_initial.py
b-dev/django-cities-light
b42d3363dfabd662c9d0878b15b0dde748fec38e
[ "MIT" ]
null
null
null
# Generated by Django 2.2.3 on 2019-09-10 07:15 import autoslug.fields import cities_light.abstract_models import cities_light.validators from django.db import migrations, models import django.db.models.deletion import hvad.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='City', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name_ascii', models.CharField(blank=True, db_index=True, max_length=200)), ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name_ascii')), ('geoname_id', models.IntegerField(blank=True, null=True, unique=True)), ('alternate_names', models.TextField(blank=True, default='', null=True)), ('state', models.SmallIntegerField(choices=[(-1, 'Deleted'), (0, 'Draft'), (1, 'Published'), (2, 'For Review'), (3, 'Expired'), (4, 'Cancelled')], default=1, verbose_name='Publish state')), ('default_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Default language')), ('search_names', cities_light.abstract_models.ToSearchTextField(blank=True, default='', max_length=4000)), ('latitude', models.DecimalField(blank=True, decimal_places=5, max_digits=8, null=True)), ('longitude', models.DecimalField(blank=True, decimal_places=5, max_digits=8, null=True)), ('population', models.BigIntegerField(blank=True, db_index=True, null=True)), ('feature_code', models.CharField(blank=True, db_index=True, max_length=10, null=True)), ('timezone', models.CharField(blank=True, db_index=True, max_length=40, null=True, validators=[cities_light.validators.timezone_validator])), ('allow_translate', models.BooleanField(default=True, verbose_name='Allow Translate')), ], options={ 'verbose_name_plural': 'cities', 'abstract': False, }, ), migrations.CreateModel( name='Country', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name_ascii', models.CharField(blank=True, db_index=True, max_length=200)), ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name_ascii')), ('geoname_id', models.IntegerField(blank=True, null=True, unique=True)), ('alternate_names', models.TextField(blank=True, default='', null=True)), ('state', models.SmallIntegerField(choices=[(-1, 'Deleted'), (0, 'Draft'), (1, 'Published'), (2, 'For Review'), (3, 'Expired'), (4, 'Cancelled')], default=1, verbose_name='Publish state')), ('default_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Default language')), ('code2', models.CharField(blank=True, max_length=2, null=True, unique=True)), ('code3', models.CharField(blank=True, max_length=3, null=True, unique=True)), ('continent', models.CharField(choices=[('OC', 'Oceania'), ('EU', 'Europe'), ('AF', 'Africa'), ('NA', 'North America'), ('AN', 'Antarctica'), ('SA', 'South America'), ('AS', 'Asia')], db_index=True, max_length=2)), ('tld', models.CharField(blank=True, db_index=True, max_length=5)), ('phone', models.CharField(blank=True, max_length=20, null=True)), ('allow_translate', models.BooleanField(default=True, verbose_name='Allow Translate')), ], options={ 'verbose_name_plural': 'countries', 'abstract': False, }, ), migrations.CreateModel( name='Region', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name_ascii', models.CharField(blank=True, db_index=True, max_length=200)), ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name_ascii')), ('geoname_id', models.IntegerField(blank=True, null=True, unique=True)), ('alternate_names', models.TextField(blank=True, default='', null=True)), ('state', models.SmallIntegerField(choices=[(-1, 'Deleted'), (0, 'Draft'), (1, 'Published'), (2, 'For Review'), (3, 'Expired'), (4, 'Cancelled')], default=1, verbose_name='Publish state')), ('default_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Default language')), ('geoname_code', models.CharField(blank=True, db_index=True, max_length=50, null=True)), ('allow_translate', models.BooleanField(default=True, verbose_name='Allow Translate')), ], options={ 'verbose_name': 'region/state', 'verbose_name_plural': 'regions/states', 'abstract': False, }, ), migrations.CreateModel( name='RegionTranslation', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('display_name', models.CharField(max_length=200)), ('source_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Source language')), ('is_auto_translated', models.BooleanField(default=False, verbose_name='Auto Translated')), ('language_code', models.CharField(db_index=True, max_length=15)), ('master', hvad.fields.MasterKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='cities_light.Region')), ], options={ 'db_table': 'cities_light_region_translation', 'db_tablespace': '', 'abstract': False, 'managed': True, 'default_permissions': (), 'unique_together': {('language_code', 'master')}, }, ), migrations.AddField( model_name='region', name='_hvad_query', field=hvad.fields.SingleTranslationObject('cities_light.Region', 'cities_light.RegionTranslation'), ), migrations.AddField( model_name='region', name='country', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cities_light.Country'), ), migrations.CreateModel( name='CountryTranslation', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('source_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Source language')), ('is_auto_translated', models.BooleanField(default=False, verbose_name='Auto Translated')), ('language_code', models.CharField(db_index=True, max_length=15)), ('master', hvad.fields.MasterKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='cities_light.Country')), ], options={ 'db_table': 'cities_light_country_translation', 'db_tablespace': '', 'abstract': False, 'managed': True, 'default_permissions': (), 'unique_together': {('language_code', 'master')}, }, ), migrations.AddField( model_name='country', name='_hvad_query', field=hvad.fields.SingleTranslationObject('cities_light.Country', 'cities_light.CountryTranslation'), ), migrations.CreateModel( name='CityTranslation', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(db_index=True, max_length=200)), ('display_name', models.CharField(max_length=200)), ('source_language', models.CharField(choices=[('en', 'English')], default='en', max_length=2, verbose_name='Source language')), ('is_auto_translated', models.BooleanField(default=False, verbose_name='Auto Translated')), ('language_code', models.CharField(db_index=True, max_length=15)), ('master', hvad.fields.MasterKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='cities_light.City')), ], options={ 'db_table': 'cities_light_city_translation', 'db_tablespace': '', 'abstract': False, 'managed': True, 'default_permissions': (), 'unique_together': {('language_code', 'master')}, }, ), migrations.AddField( model_name='city', name='_hvad_query', field=hvad.fields.SingleTranslationObject('cities_light.City', 'cities_light.CityTranslation'), ), migrations.AddField( model_name='city', name='country', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cities_light.Country'), ), migrations.AddField( model_name='city', name='region', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cities_light.Region'), ), migrations.AlterUniqueTogether( name='region', unique_together={('country', 'slug')}, ), migrations.AlterUniqueTogether( name='city', unique_together={('region', 'slug')}, ), ]
57.049724
230
0.589289
1,026
10,326
5.748538
0.151072
0.039674
0.033062
0.028484
0.80468
0.765853
0.732282
0.730417
0.730417
0.683961
0
0.012241
0.256343
10,326
180
231
57.366667
0.755828
0.004358
0
0.682081
1
0
0.198657
0.017609
0
0
0
0
0
1
0
false
0
0.034682
0
0.057803
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
36f346823874f0f3500f93028fa05ceeccfb17f1
2,602
py
Python
02_DSA/homework/soonbee/stack/test_stack.py
dudaji/dcc
3069f1ea51fca71b58742aa642cd4f76ea4de944
[ "MIT" ]
null
null
null
02_DSA/homework/soonbee/stack/test_stack.py
dudaji/dcc
3069f1ea51fca71b58742aa642cd4f76ea4de944
[ "MIT" ]
1
2019-03-05T08:35:05.000Z
2019-03-05T08:37:58.000Z
02_DSA/homework/soonbee/stack/test_stack.py
dudaji/dcc
3069f1ea51fca71b58742aa642cd4f76ea4de944
[ "MIT" ]
null
null
null
import unittest from stack import SimpleStack, ArrayStack, LinkedListStack class TestSimpleStack(unittest.TestCase): def setUp(self): self.st = SimpleStack() def tearDown(self): del self.st # default feature test - push, pop, peek def test_01(self): self.st.push(1) self.st.push(2) self.st.push(3) self.assertEqual(self.st.peek(), 3) self.assertEqual(self.st.pop(), 3) self.assertEqual(self.st.peek(), 2) self.assertEqual(self.st.pop(), 2) self.assertEqual(self.st.peek(), 1) self.assertEqual(self.st.pop(), 1) # raise error when pop with empty stack def test_02(self): with self.assertRaises(IndexError) as cm: self.st.pop() self.assertEqual("stack is empty", str(cm.exception)) # test check empty def test_03(self): self.assertTrue(self.st.is_empty()) class TestArrayStack(unittest.TestCase): def setUp(self): self.st = ArrayStack() def tearDown(self): del self.st # default feature test - push, pop, peek def test_01(self): self.st.push(1) self.st.push(2) self.st.push(3) self.assertEqual(self.st.peek(), 3) self.assertEqual(self.st.pop(), 3) self.assertEqual(self.st.peek(), 2) self.assertEqual(self.st.pop(), 2) self.assertEqual(self.st.peek(), 1) self.assertEqual(self.st.pop(), 1) # raise error when pop with empty stack def test_02(self): with self.assertRaises(IndexError) as cm: self.st.pop() self.assertEqual("stack is empty", str(cm.exception)) # test check empty def test_03(self): self.assertTrue(self.st.is_empty()) # test expand def test_04(self): self.assertEqual(len(self.st._array), 10) for i in range(11): self.st.push(i) self.assertEqual(len(self.st._array), 20) class TestLinkedListStack(unittest.TestCase): def setUp(self): self.st = LinkedListStack() def tearDown(self): del self.st # default feature test - push, pop, peek def test_01(self): self.st.push(1) self.st.push(2) self.st.push(3) self.assertEqual(self.st.peek(), 3) self.assertEqual(self.st.pop(), 3) self.assertEqual(self.st.peek(), 2) self.assertEqual(self.st.pop(), 2) self.assertEqual(self.st.peek(), 1) self.assertEqual(self.st.pop(), 1) # raise error when pop with empty stack def test_02(self): with self.assertRaises(IndexError) as cm: self.st.pop() self.assertEqual("stack is empty", str(cm.exception)) # test check empty def test_03(self): self.assertTrue(self.st.is_empty()) if __name__ == "__main__": unittest.main()
25.019231
58
0.661799
387
2,602
4.390181
0.152455
0.148323
0.201295
0.222484
0.860506
0.860506
0.826368
0.766333
0.766333
0.766333
0
0.025226
0.192544
2,602
103
59
25.262136
0.783436
0.112606
0
0.791667
0
0
0.021768
0
0
0
0
0
0.402778
1
0.222222
false
0
0.027778
0
0.291667
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
11
7fdfdd7bc80aeaee62e7cc6f048c7e1a9213970d
159
py
Python
fastapi/dependencies/is_ajax.py
mvx24/code
4f712d4ac9e90927da3518b9f87deeb3cc72e690
[ "MIT" ]
null
null
null
fastapi/dependencies/is_ajax.py
mvx24/code
4f712d4ac9e90927da3518b9f87deeb3cc72e690
[ "MIT" ]
8
2019-12-11T07:18:36.000Z
2021-08-31T17:08:14.000Z
fastapi/dependencies/is_ajax.py
mvx24/code
4f712d4ac9e90927da3518b9f87deeb3cc72e690
[ "MIT" ]
null
null
null
from fastapi import Header def is_ajax(x_requested_with: str = Header(None)): return x_requested_with == "XMLHttpRequest" or x_requested_with == "fetch"
26.5
78
0.761006
23
159
4.956522
0.695652
0.263158
0.368421
0
0
0
0
0
0
0
0
0
0.144654
159
5
79
31.8
0.838235
0
0
0
0
0
0.119497
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
1
0
0
1
1
1
0
0
8
185989228ba8e1e09001522daca6ce572d0c5203
41,679
py
Python
src/ai/heuristic_player_test.py
cpatrasciuc/schnapsen-card-game
e5131ae91c71d341968d682fd625aff3f97cc516
[ "BSD-3-Clause" ]
null
null
null
src/ai/heuristic_player_test.py
cpatrasciuc/schnapsen-card-game
e5131ae91c71d341968d682fd625aff3f97cc516
[ "BSD-3-Clause" ]
18
2021-06-03T01:54:51.000Z
2022-03-30T06:12:08.000Z
src/ai/heuristic_player_test.py
cpatrasciuc/schnapsen-card-game
e5131ae91c71d341968d682fd625aff3f97cc516
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2021 Cristian Patrasciuc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import pprint import unittest from typing import Any, Dict, Tuple, List from ai.heuristic_player import HeuristicPlayer, HeuristicPlayerOptions from ai.test_utils import card_list_from_string from model.card import Card from model.game_state import GameState, Trick from model.player_action import ExchangeTrumpCardAction, PlayCardAction, \ PlayerAction, AnnounceMarriageAction, CloseTheTalonAction from model.player_id import PlayerId from model.player_pair import PlayerPair from model.suit import Suit logging.basicConfig(level="DEBUG") def _trick_from_string_tuple(string_tuple: Tuple[str, str]) -> Trick: return PlayerPair(Card.from_string(string_tuple[0]), Card.from_string(string_tuple[1])) def _game_view_from_dict(fields: Dict[str, Any]) -> GameState: cards_in_hand = fields["cards_in_hand"] fields["cards_in_hand"] = PlayerPair(card_list_from_string(cards_in_hand[0]), card_list_from_string(cards_in_hand[1])) trump_card = fields.get("trump_card", None) fields["trump_card"] = \ Card.from_string(trump_card) if trump_card is not None else None fields["talon"] = card_list_from_string(fields.get("talon", [])) won_tricks = fields.get("won_tricks", ([], [])) fields["won_tricks"] = PlayerPair( [_trick_from_string_tuple(str_tuple) for str_tuple in won_tricks[0]], [_trick_from_string_tuple(str_tuple) for str_tuple in won_tricks[1]]) marriage_suits = fields.get("marriage_suits", None) if marriage_suits is not None: fields["marriage_suits"] = PlayerPair(*marriage_suits) trick_points = fields.get("trick_points", None) if trick_points is not None: fields["trick_points"] = PlayerPair(*trick_points) else: trick_points = PlayerPair(0, 0) for player in PlayerId: if len(fields["won_tricks"][player]) > 0 and \ fields.get("marriage_suits", None) is not None: for suit in fields["marriage_suits"][player]: trick_points[player] += 40 if suit == fields["trump"] else 20 for trick in fields["won_tricks"][player]: trick_points[player] += trick.one.card_value + trick.two.card_value fields["trick_points"] = trick_points trick = fields.get("current_trick", None) if trick is not None: fields["current_trick"] = PlayerPair( Card.from_string(trick[0]) if trick[0] is not None else None, Card.from_string(trick[1]) if trick[1] is not None else None) game_view = GameState(**fields) logging.debug("HeuristicPlayerTest: Using game view: %s", pprint.pformat(str(game_view))) return game_view def _is_valid_game_view(game_view: GameState) -> bool: if len(game_view.cards_in_hand.one) != len(game_view.cards_in_hand.two): return False cards_set = game_view.cards_in_hand.one + game_view.cards_in_hand.two + \ game_view.talon + [game_view.trump_card] + \ [trick.one for trick in game_view.won_tricks.one] + \ [trick.two for trick in game_view.won_tricks.one] + \ [trick.one for trick in game_view.won_tricks.two] + \ [trick.two for trick in game_view.won_tricks.two] cards_set = {card for card in cards_set if card is not None} num_missing_cards = 20 - len(cards_set) hidden_cards = len([card for card in game_view.talon if card is None]) + \ len([card for card in game_view.cards_in_hand.two if card is None]) return num_missing_cards == hidden_cards def _get_player(**kwargs): params = { "priority_discard": False, "can_close_talon": False, "save_marriages": False, "trump_for_marriage": False, "avoid_direct_loss": False, "trump_control": False } params.update(**kwargs) options = HeuristicPlayerOptions(**params) player = HeuristicPlayer(PlayerId.ONE, options) return player class HeuristicPlayerTest(unittest.TestCase): """Test for HeuristicPlayer with all options set to False.""" def _run_test_cases(self, test_cases: List[Dict[str, Any]]) -> None: player = _get_player() for i, test_case in enumerate(test_cases): expected_action = test_case["expected_action"] test_case.pop("expected_action") game_view = _game_view_from_dict(test_case) self.assertTrue(_is_valid_game_view(game_view), msg=f"TestCase {i}: {test_case}") actual_action = player.request_next_action(game_view) if isinstance(expected_action, PlayerAction): self.assertEqual(expected_action, actual_action, msg=f"TestCase {i}: {test_case}") else: self.assertIn(actual_action, expected_action, msg=f"TestCase {i}: {test_case}") def test_generic_on_lead_do_not_follow_suit(self): self._run_test_cases([ # Exchanges trump when possible. { "cards_in_hand": (["qd", "kc", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": ExchangeTrumpCardAction(PlayerId.ONE) }, # Play a high trump card if it will secure the win. { "cards_in_hand": (["tc", "ks", "ac", "jh", "ad"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None], "won_tricks": ([("qc", "ah")], []), "marriage_suits": ([Suit.CLUBS], []), "expected_action": { PlayCardAction(PlayerId.ONE, Card.from_string("ac")), PlayCardAction(PlayerId.ONE, Card.from_string("tc")), } }, # Play a high non trump card if it will secure the lead. { "cards_in_hand": (["ks", "qd", "td", "jh", "ad"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None], "won_tricks": ([("qc", "ah"), ("kc", "jd")], [("tc", "ac")]), "marriage_suits": ([Suit.CLUBS], []), "expected_action": { PlayCardAction(PlayerId.ONE, Card.from_string("ad")), PlayCardAction(PlayerId.ONE, Card.from_string("td")), } }, # Play a high trump card if it will secure the lead. Take into account the # marriage in hand. { "cards_in_hand": (["kd", "qd", "ah", "jd", "ad"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "jh", "talon": [None, None, None, None, None], "won_tricks": ([("qc", "as")], [("kc", "tc")]), "marriage_suits": ([Suit.CLUBS], []), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ah")) }, # Announce the marriage with queen. { "cards_in_hand": (["qd", "kc", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.DIAMONDS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": AnnounceMarriageAction(PlayerId.ONE, Card.from_string("qc")) }, # Announce the marriage with king. { "cards_in_hand": (["qd", "kc", "jc", "ac", "qc"], [None, None, None, None, None]), "trump": Suit.DIAMONDS, "trump_card": "ad", "talon": [None, None, None, None, None, None, None], "won_tricks": ([("tc", "js")], []), "expected_action": AnnounceMarriageAction(PlayerId.ONE, Card.from_string("kc")) }, # Discard the smallest non-trump card. { "cards_in_hand": (["qh", "qd", "ac", "qs", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": { PlayCardAction(PlayerId.ONE, Card.from_string("qd")), PlayCardAction(PlayerId.ONE, Card.from_string("qs")), } }, ]) def test_generic_on_lead_follow_suit(self): self._run_test_cases([ # Play a non-trump card with the maximum win probability. { "cards_in_hand": (["qd", "qs", "kh", "ah"], [None, None, None, "th"]), "trump": Suit.SPADES, "trump_card": "ks", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qc")], []), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ah")), }, # Play a trump card with the maximum win probability. { "cards_in_hand": (["qd", "qs", "ks", "th"], [None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "jh", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qc")], []), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("th")), }, # If we have a marriage pair among the cards with the max winning # probability, announce it with the king. { "cards_in_hand": (["qd", "qs", "ks", "ts"], [None, None, None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qc")], []), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": AnnounceMarriageAction(PlayerId.ONE, Card.from_string("ks")), }, # If we don't have any chance to win the next trick and we have a # marriage, announce it. { "cards_in_hand": (["qd", "qs", "ks", "ts"], ["as", "ad", None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qc")], []), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": AnnounceMarriageAction(PlayerId.ONE, Card.from_string("ks")), }, # Discard the smallest non-trump card. { "cards_in_hand": (["ts", "qs", "th", "jd"], ["as", "ah", "ad", None]), "trump": Suit.SPADES, "trump_card": "ks", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qd")], []), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jd")), }, # Discard the smallest trump card. { "cards_in_hand": (["ts", "qs"], ["as", None]), "trump": Suit.SPADES, "trump_card": "ks", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qd")], [("tc", "ac"), ("jh", "jc")]), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qs")), }, ]) def test_generic_not_on_lead_do_not_follow_suit(self): self._run_test_cases([ # Win with the Queen, keep the Ace for the not-yet-played Ten. { "cards_in_hand": (["qd", "ad", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qd")) }, # If the Ten and King are already played, win with the Ace. { "cards_in_hand": (["qd", "ad", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None], "won_tricks": ([], [("kd", "td")]), "current_trick": (None, "jd"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ad")) }, # Win with the Ten, even if the King is not yet played. { "cards_in_hand": (["qd", "td", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("td")) }, # Don't give up the Ten even if it's the only same-suit card we have. { "cards_in_hand": (["qh", "td", "jh", "js", "qs"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "ad"), "expected_action": { PlayCardAction(PlayerId.ONE, Card.from_string("jh")), PlayCardAction(PlayerId.ONE, Card.from_string("js")), } }, # Break a marriage to win a Jack (options.save_marriage is False). { "cards_in_hand": (["qd", "kd", "ad", "js", "qs"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("kd")) }, # Opponent played a trump card that cannot be won; discard the smallest # card. { "cards_in_hand": (["qd", "kd", "ad", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "tc"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("js")) }, # Win a Ten with the same suit Ace. { "cards_in_hand": (["qd", "ks", "ah", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ah")) }, # Win a Ten with a trump-card if we don't have the same-suit Ace, even if # that means breaking the marriage. { "cards_in_hand": (["qd", "ks", "kc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("kc")) }, # Win a Ten with the trump Queen. Save the trump Ace for the trump Ten. { "cards_in_hand": (["qd", "jc", "qc", "js", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "tc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qc")) }, # Win a Ten with the trump Ace if we don't have the same-suit Ace; don't # save the trump Ace for the trump Ten, if that means breaking the trump # marriage. { "cards_in_hand": (["qd", "ks", "kc", "ac", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, # Win a Ten with the trump Jack if we don't have the same-suit Ace; don't # use the highest adjacent card if that means breaking the trump marriage. { "cards_in_hand": (["qd", "ks", "kc", "jc", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jc")) }, # Win a Ten with the trump Ace. Don't save the trump Ace for the trump Ten # if we can exchange the trump card to get the trump marriage. { "cards_in_hand": (["qd", "jc", "qc", "jd", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "kc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, { "cards_in_hand": (["qd", "jc", "kc", "jd", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "qc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, # If this is the last chance to win a trick and be on-lead to exchange the # trump card and announce the trump marriage, use a trump regardless of # what the opponent played. { "cards_in_hand": (["qd", "jc", "qc", "ad", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "kc", "talon": [None, None, None], "won_tricks": ([("kd", "jd")], [("jh", "qh"), ("kh", "ah")]), "current_trick": (None, "js"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, # If it's not the last chance to win a trick and be on-lead to exchange # the trump card and announce the trump marriage, do not use a trump yet. { "cards_in_hand": (["qd", "jc", "qc", "jd", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "kc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "js"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jd")) }, # Trump if that gets us the win right now. { "cards_in_hand": (["qd", "jh", "qh", "jd", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None], "won_tricks": ([("qc", "ad")], [("kc", "tc")]), "marriage_suits": ([Suit.CLUBS], []), "current_trick": (None, "js"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, # Trump if that gets us the win after one more trick. { "cards_in_hand": (["qd", "jh", "qh", "tc", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None], "won_tricks": ([("qc", "jd")], []), "marriage_suits": ([Suit.CLUBS], []), "current_trick": (None, "js"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("tc")) }, # Discard the smallest card. { "cards_in_hand": (["qd", "jh", "qh", "tc", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "js"), "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jh")) }, ]) def test_generic_not_on_lead_follow_suit(self): self._run_test_cases([ # Win with the Queen, keep the Ace for the not-yet-played Ten. { "cards_in_hand": (["qd", "ad", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qd")) }, # If the Ten and King are already played, win with the Ace. { "cards_in_hand": (["qd", "ad", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None], "won_tricks": ([], [("kd", "td")]), "current_trick": (None, "jd"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ad")) }, # Win with the Ten, even if the King is not yet played. { "cards_in_hand": (["qd", "td", "jc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("td")) }, # Give up the Ten if it's the only same-suit card we have and we must # follow suit. { "cards_in_hand": (["qh", "td", "jh", "js", "qs"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "ad"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("td")) }, # Avoid breaking the marriage to win a Jack. { "cards_in_hand": (["qd", "kd", "ad", "js", "qs"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ad")) }, # Discard the smallest card. { "cards_in_hand": (["qd", "jh", "qh", "th", "ah"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "js"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jh")) }, # Use a trump-card even if that means breaking the marriage. { "cards_in_hand": (["qd", "ks", "kc", "js", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jh"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("kc")) }, # Use the trump Queen. Save the trump Ace for the trump Ten. { "cards_in_hand": (["qd", "jc", "qc", "js", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "tc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jh"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qc")) }, # Use the trump Ace; don't save the trump Ace for the trump Ten, if that # means breaking the trump marriage. { "cards_in_hand": (["qd", "ks", "kc", "ac", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "jc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jh"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("ac")) }, # Use the trump Jack; don't use the highest adjacent card if that means # breaking the trump marriage. { "cards_in_hand": (["qd", "ks", "kc", "jc", "qc"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jh"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("jc")) }, # The talon is closed so we cannot exchange the trump card to get the # trump marriage. Use the trump Queen and save the Ace for the trump Ten. { "cards_in_hand": (["qd", "jc", "qc", "jd", "ac"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "kc", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": PlayCardAction(PlayerId.ONE, Card.from_string("qc")) }, ]) class HeuristicPlayerOptionsTest(unittest.TestCase): """Tests for the HeuristicPlayer options.""" def _run_test_cases_with_option(self, option_name: str, option_values: List[Any], test_cases: List[Dict[str, Any]]) -> None: players = [] for option_value in option_values: kwargs = {option_name: option_value} if option_name == "avoid_direct_loss": kwargs["priority_discard"] = True players.append(_get_player(**kwargs)) for i, test_case in enumerate(test_cases): expected_actions = test_case["expected_action"] test_case.pop("expected_action") game_view = _game_view_from_dict(test_case) self.assertTrue(_is_valid_game_view(game_view), msg=f"TestCase {i}: {test_case}") for player, expected_action in zip(players, expected_actions): actual_action = player.request_next_action(game_view) if isinstance(expected_action, PlayerAction): self.assertEqual(expected_action, actual_action, msg=f"TestCase {i}: {test_case}") else: self.assertIn(actual_action, expected_action, msg=f"TestCase {i}: {test_case}") def test_can_close_talon(self): self._run_test_cases_with_option("can_close_talon", [False, True], [ # The talon is already closed. Discard the smallest trump card. { "cards_in_hand": (["ts", "qs"], ["as", None]), "trump": Suit.SPADES, "trump_card": "ks", "talon": [None, None, None, None, None, None, None, None, None], "won_tricks": ([("qh", "qd")], [("tc", "ac"), ("jh", "jc")]), "player_that_closed_the_talon": PlayerId.ONE, "opponent_points_when_talon_was_closed": 0, "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qs")), PlayCardAction(PlayerId.ONE, Card.from_string("qs")), ] }, # There is a high chance the opponent has a Heart or a Club. { "cards_in_hand": (["qh", "ah", "ad", "kc", "kd"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "as", "talon": [None], "won_tricks": ([("qs", "ac"), ("ks", "jd")], [("tc", "js"), ("jh", "jc")]), "marriage_suits": ([Suit.SPADES], []), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qh")), CloseTheTalonAction(PlayerId.ONE), ] }, # There is a small chance to win if we close the talon. { "cards_in_hand": (["qh", "qd", "ac", "ks", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qd")), PlayCardAction(PlayerId.ONE, Card.from_string("qd")), ] }, # Make sure the player computes the winning probabilities as if suits must # be followed. { "cards_in_hand": (["qc", "ts", "ah", "as", "ad"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None], "won_tricks": ([("td", "kd"), ("qd", "jc")], [("jh", "kh")]), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qc")), CloseTheTalonAction(PlayerId.ONE), ] }, ]) def test_save_marriages(self): self._run_test_cases_with_option("save_marriages", [False, True], [ # Do not break a marriage to win a Jack. { "cards_in_hand": (["qd", "kd", "ad", "js", "qs"], [None, None, None, None, None]), "trump": Suit.CLUBS, "trump_card": "ac", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("kd")), PlayCardAction(PlayerId.ONE, Card.from_string("js")), ] }, ]) def test_priority_discard(self): self._run_test_cases_with_option("priority_discard", [False, True], [ # Discard a card from an exhausted suit. { "cards_in_hand": (["jd", "qd", "ac", "ks", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None], "won_tricks": ([("qs", "js")], [("ts", "as")]), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jd")), PlayCardAction(PlayerId.ONE, Card.from_string("ks")), ] }, # Discard a jack with ten protection. { "cards_in_hand": (["jd", "jc", "td", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jd")), PlayCardAction(PlayerId.ONE, Card.from_string("jc")), ] }, # Discard a jack with no ten protection. { "cards_in_hand": (["ks", "jd", "td", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None], "won_tricks": ([("qs", "js")], [("ts", "th")]), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jd")), PlayCardAction(PlayerId.ONE, Card.from_string("jd")), ] }, # Discard a Queen/King without marriage chances. { "cards_in_hand": (["ks", "qd", "td", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None], "won_tricks": ([("qs", "js")], [("ts", "th")]), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qd")), PlayCardAction(PlayerId.ONE, Card.from_string("ks")), ] }, # Discard a Queen/King with marriage chances. { "cards_in_hand": (["ks", "qs", "kd", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qs")), PlayCardAction(PlayerId.ONE, Card.from_string("kd")), ] }, # Discard a Queen/King for a marriage. { "cards_in_hand": (["ks", "qs", "ad", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "th"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qs")), PlayCardAction(PlayerId.ONE, Card.from_string("qs")), ] }, # Discard a non-trump card. { "cards_in_hand": (["jh", "qh", "th", "ac", "ad"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "ks"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("ad")), PlayCardAction(PlayerId.ONE, Card.from_string("ad")), ] }, ]) def test_trump_for_marriage(self): self._run_test_cases_with_option("trump_for_marriage", [False, True], [ # Trump to take the lead and announce a non-trump marriage. { "cards_in_hand": (["ks", "qs", "th", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qs")), PlayCardAction(PlayerId.ONE, Card.from_string("th")), ] }, # We have the trump marriage, but we cannot trump since we don't have a # third trump card to use. { "cards_in_hand": (["kh", "qh", "ts", "ac", "tc"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("ts")), PlayCardAction(PlayerId.ONE, Card.from_string("ts")), ] }, # Use trump Ace to take the lead and announce the trump marriage. { "cards_in_hand": (["kh", "qh", "ts", "ac", "ah"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "th", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "jd"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("ts")), PlayCardAction(PlayerId.ONE, Card.from_string("ah")), ] }, ]) def test_avoid_direct_loss(self): self._run_test_cases_with_option("avoid_direct_loss", [False, True], [ # Play a trump card instead of discarding the smallest non trump card. { "cards_in_hand": (["jh", "td", "th", "kh", "ad"], [None, None, None, None, None]), "trump": Suit.HEARTS, "trump_card": "ah", "talon": [None], "won_tricks": ([], [("kd", "tc"), ("js", "qs"), ("ts", "as"), ("jc", "ac")]), "current_trick": (None, "qc"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("td")), PlayCardAction(PlayerId.ONE, Card.from_string("jh")), ] }, # Play the smallest card instead of discarding a card from an exhausted # suit. { "cards_in_hand": (["jh", "td", "th", "tc", "ad"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "as", "talon": [None], "won_tricks": ([], [("jc", "qc"), ("kc", "ts"), ("ac", "js"), ("jd", "kh")]), "marriage_suits": ([], [Suit.HEARTS]), "current_trick": (None, "ks"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("tc")), PlayCardAction(PlayerId.ONE, Card.from_string("jh")), ] }, # There is no direct loss; discard a small card. { "cards_in_hand": (["jh", "td", "ts", "tc", "ad"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "as", "talon": [None, None, None, None, None, None, None, None, None], "current_trick": (None, "kh"), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jh")), PlayCardAction(PlayerId.ONE, Card.from_string("jh")), ] }, ]) def test_trump_control(self): self._run_test_cases_with_option("trump_control", [False, True], [ # No trumps after one trick. Play a high card. { "cards_in_hand": (["jh", "jd", "th", "kc", "qd"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "as", "talon": [None, None, None, None, None, None, None], "won_tricks": ([("qc", "jc")], []), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jh")), PlayCardAction(PlayerId.ONE, Card.from_string("th")), ] }, # There is no need to trump control; discard a small card. { "cards_in_hand": (["jh", "ts", "ks", "tc", "ad"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "as", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jh")), PlayCardAction(PlayerId.ONE, Card.from_string("jh")), ] }, # The opponent has more trumps than us, but we cannot play a high card # since the opponent might trump it and win the game. { "cards_in_hand": (["qh", "td", "th", "tc", "ah"], ["qs", None, None, None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None, None, None], "won_tricks": ([], [("ad", "ks"), ("qc", "qd")]), "marriage_suits": ([], [Suit.SPADES]), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qh")), PlayCardAction(PlayerId.ONE, Card.from_string("qh")), ] }, # No trump control since there are no more trumps. { "cards_in_hand": (["qh", "td", "th", "ts", "as"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None, None, None], "won_tricks": ([("ks", "ad"), ("qs", "qd")], []), "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("qh")), PlayCardAction(PlayerId.ONE, Card.from_string("qh")), ] }, # No trump control since we have no high cards. { "cards_in_hand": (["qh", "jd", "jh", "ks", "jc"], [None, None, None, None, None]), "trump": Suit.SPADES, "trump_card": "js", "talon": [None, None, None, None, None, None, None, None, None], "expected_action": [ PlayCardAction(PlayerId.ONE, Card.from_string("jh")), PlayCardAction(PlayerId.ONE, Card.from_string("jh")), ] }, ])
42.399797
80
0.544351
4,952
41,679
4.398223
0.053716
0.249036
0.305234
0.316621
0.796878
0.781772
0.758402
0.724151
0.705188
0.671488
0
0.001383
0.288587
41,679
982
81
42.442974
0.733162
0.1078
0
0.593533
0
0
0.191485
0.031546
0
0
0
0
0.006928
1
0.018476
false
0
0.013857
0.001155
0.040416
0.002309
0
0
0
null
1
1
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
8
a16e89b38ecc92231e175c110260b96d12520a19
22,360
py
Python
tests/test_read_pbox_json.py
swenkel/pdq_evaluation
97e1e31c4e48bc40eafa9b9c6e2ef9d9b90bb869
[ "BSD-3-Clause" ]
34
2019-04-17T15:36:53.000Z
2022-03-26T16:56:23.000Z
tests/test_read_pbox_json.py
swenkel/pdq_evaluation
97e1e31c4e48bc40eafa9b9c6e2ef9d9b90bb869
[ "BSD-3-Clause" ]
5
2020-07-20T13:58:40.000Z
2021-04-08T23:32:43.000Z
tests/test_read_pbox_json.py
swenkel/pdq_evaluation
97e1e31c4e48bc40eafa9b9c6e2ef9d9b90bb869
[ "BSD-3-Clause" ]
7
2019-07-29T14:51:31.000Z
2021-02-13T07:41:08.000Z
import unittest import numpy as np from data_holders import BBoxDetInst, PBoxDetInst, GroundTruthInstance import os import shutil import json import read_files class TestReadPBoxJson(unittest.TestCase): def setUp(self): self.det_files_root = '/tmp/pdq_utest_read_files/' if not os.path.isdir(self.det_files_root): os.makedirs(self.det_files_root) self.default_det_dict = {'bbox': [750, 750, 1250, 1250], "label_probs": [0, 1, 0]} self.default_covar = [[1000, 0], [0, 1000]] self.defaul_det_classes = ['background', 'square', 'cross'] self.default_img_names = ['square.jpg'] self.default_gt_classes = ['none', 'square', 'cross', 'diamond'] self.default_gt_class_ids_dict = {'none': 0, 'square': 1, 'cross': 2, 'diamond': 3} def tearDown(self): if os.path.isdir(self.det_files_root): shutil.rmtree(self.det_files_root) def test_single_pbox(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_two_pboxes_one_img(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict, self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 2) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertIsInstance(img_dets[1], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) self.assertTrue(np.allclose(img_dets[1].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[1].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[1].class_list), self.default_det_dict['label_probs']) def test_two_pboxes_two_imgs(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict], [self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 2) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_empty_img(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict], []] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 2) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 0) def test_single_pbox_w_extra_gt_label(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name, self.default_gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = [0, 1, 0, 0] self.assertListEqual(list(img_dets[0].class_list), expected_label_probs) def test_single_pbox_w_rearranged_gt_label(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) gt_class_ids_dict = {'none': 0, 'cross': 1, 'square': 2} detections = read_files.read_pbox_json(det_file_name, gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = [0, 0, 1] self.assertListEqual(list(img_dets[0].class_list), expected_label_probs) def test_single_pbox_w_fewer_gt_labels(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) gt_class_ids_dict = {'square': 0, 'cross': 1} detections = read_files.read_pbox_json(det_file_name, gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = [1, 0] self.assertListEqual(list(img_dets[0].class_list), expected_label_probs) def test_single_pbox_w_gt_label_id_skipped(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) gt_class_ids_dict = {'square': 1, 'cross': 4} detections = read_files.read_pbox_json(det_file_name, gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = [0, 1, 0, 0, 0] self.assertListEqual(list(img_dets[0].class_list), expected_label_probs) def test_single_pbox_w_synonym_label_id(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) self.default_det_dict.update({'label_probs': [0.3, 0.7, 0]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) gt_class_ids_dict = {'none': 0, 'cross': 1, 'square': 2} detections = read_files.read_pbox_json(det_file_name, gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = np.array([0.3, 0.0, 0.7]) self.assertTrue(np.allclose(img_dets[0].class_list, expected_label_probs)) def test_single_pbox_w_non_gt_class(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) self.default_det_dict.update({'label_probs': [0, 0.7, 0.3]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) gt_class_ids_dict = {'none': 0, 'diamond': 1, 'square': 2} detections = read_files.read_pbox_json(det_file_name, gt_class_ids_dict) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) expected_label_probs = np.array([0.0, 0.0, 0.7]) self.assertTrue(np.allclose(img_dets[0].class_list, expected_label_probs)) def test_single_bbox(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_single_bbox_0_covar_in_file(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_single_bbox_set_covar_0(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_single_bbox_set_covar_0_base_covar_non_zero(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name, override_cov=0) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_single_pbox_set_covar(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names det_data['detections'] = [[self.default_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name, override_cov=200) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [[[200, 0], [0, 200]], [[200, 0], [0, 200]]])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) def test_one_pbox_one_bbox_one_img(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names # Create one bbox detection and one pbox detection box_det_dict = self.default_det_dict.copy() self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict, box_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 1) self.assertIsInstance(detections, read_files.BoxLoader) img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 2) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertIsInstance(img_dets[1], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertTrue(np.allclose(img_dets[1].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) self.assertListEqual(list(img_dets[1].class_list), self.default_det_dict['label_probs']) def test_one_pbox_one_bbox_diff_imgs(self): # Create detection.json file det_data = {} det_data['classes'] = self.defaul_det_classes det_data['img_names'] = self.default_img_names # Create one bbox detection and one pbox detection box_det_dict = self.default_det_dict.copy() self.default_det_dict.update({'covars': [self.default_covar, self.default_covar]}) det_data['detections'] = [[self.default_det_dict], [box_det_dict]] det_file_name = os.path.join(self.det_files_root, 'det_file.json') with open(det_file_name, 'w') as f: json.dump(det_data, f) detections = read_files.read_pbox_json(det_file_name) self.assertEqual(len(detections), 2) self.assertIsInstance(detections, read_files.BoxLoader) # Image 1 img_iterator = iter(detections) img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], PBoxDetInst) self.assertTrue(np.allclose(img_dets[0].covs, [self.default_covar, self.default_covar])) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs']) # Image 2 img_dets = next(img_iterator) self.assertEqual(len(img_dets), 1) self.assertIsInstance(img_dets[0], BBoxDetInst) self.assertTrue(np.allclose(img_dets[0].box, self.default_det_dict['bbox'])) self.assertListEqual(list(img_dets[0].class_list), self.default_det_dict['label_probs'])
43.333333
100
0.678936
3,069
22,360
4.63115
0.038123
0.116091
0.072891
0.093717
0.953071
0.949272
0.946106
0.939844
0.93907
0.93907
0
0.012685
0.196154
22,360
515
101
43.417476
0.778068
0.025581
0
0.830645
0
0
0.056061
0.001195
0
0
0
0
0.354839
1
0.051075
false
0
0.018817
0
0.072581
0
0
0
0
null
0
0
0
1
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
7
a1fa52a5e7e3eb0297f159d2fbadb323b43037a7
177
py
Python
testsuite/N81x_py3.py
danielpatrickdotdev/pep8-naming
884f3c40880fcc4c4e3f83e0006f7ec4113213fe
[ "MIT" ]
335
2015-12-18T00:05:05.000Z
2022-03-30T09:40:56.000Z
testsuite/N81x_py3.py
DalavanCloud/pep8-naming
6fc2dc694c729403360f10e2545c6602b9a53727
[ "MIT" ]
118
2015-12-17T03:42:54.000Z
2022-02-05T15:25:48.000Z
testsuite/N81x_py3.py
DalavanCloud/pep8-naming
6fc2dc694c729403360f10e2545c6602b9a53727
[ "MIT" ]
64
2015-12-28T11:46:52.000Z
2022-03-23T09:45:42.000Z
# python_version >= '3' #: Okay import good as γ #: Okay from mod import good as γ #: Okay import GOOD as Γ #: Okay from mod import GOOD as Γ #: Okay from mod import GOOD as Γ1
14.75
26
0.689266
34
177
3.558824
0.323529
0.413223
0.495868
0.429752
0.867769
0.867769
0.867769
0.867769
0.867769
0.867769
0
0.014599
0.225989
177
11
27
16.090909
0.868613
0.288136
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
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
1
0
1
0
1
0
0
12
b81a2117394077b1943771d20f48422326412917
446
py
Python
problems/p006.py
tshralper/tabula-rasa_project-euler
3eb924ae4a38d877098f6b8f8e1118f8ae3514e2
[ "MIT" ]
3
2018-08-15T18:50:35.000Z
2018-08-15T19:04:46.000Z
problems/p006.py
tshralper/tabula-rasa_project-euler
3eb924ae4a38d877098f6b8f8e1118f8ae3514e2
[ "MIT" ]
null
null
null
problems/p006.py
tshralper/tabula-rasa_project-euler
3eb924ae4a38d877098f6b8f8e1118f8ae3514e2
[ "MIT" ]
1
2018-08-15T18:50:46.000Z
2018-08-15T18:50:46.000Z
#The sum of the squares of the first ten natural numbers is, # #1^2 + 2^2 + ... + 10^2 = 385 #The square of the sum of the first ten natural numbers is, # #(1 + 2 + ... + 10)^2 = 55^2 = 3025 #Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640. # #Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
49.555556
133
0.704036
86
446
3.662791
0.290698
0.15873
0.101587
0.139683
0.838095
0.784127
0.784127
0.784127
0.612698
0.501587
0
0.094017
0.213004
446
9
134
49.555556
0.80057
0.961883
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
7
1a017ffa5619963fb1c5f77a182edb62fc155c8b
157
py
Python
newcomers_guide/link_regular_expression.py
pg-irc/pathways-backend
05a8c4e750523d2d081b030a248c5444d1ed7992
[ "BSD-3-Clause" ]
12
2017-08-30T18:21:00.000Z
2021-12-09T04:04:17.000Z
newcomers_guide/link_regular_expression.py
pg-irc/pathways-backend
05a8c4e750523d2d081b030a248c5444d1ed7992
[ "BSD-3-Clause" ]
424
2017-08-08T18:32:14.000Z
2022-03-30T21:42:51.000Z
newcomers_guide/link_regular_expression.py
pg-irc/pathways-backend
05a8c4e750523d2d081b030a248c5444d1ed7992
[ "BSD-3-Clause" ]
7
2017-09-29T21:14:37.000Z
2019-12-30T21:07:37.000Z
url_regular_expression = r'(https?://[a-zA-Z0-9\.\?\&\#\+\/\_\-\=\(\)\@]*[a-zA-Z0-9/])' email_regular_expression = r'([a-zA-Z]+@[^@\s]+\.[^@\s]+[a-zA-Z])'
31.4
87
0.484076
25
157
2.84
0.48
0.169014
0.507042
0.169014
0
0
0
0
0
0
0
0.026846
0.050955
157
4
88
39.25
0.449664
0
0
0
0
0.5
0.608974
0.608974
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
1a1d6402b6cb90b72726665dbbb81d46d85971c7
10,487
py
Python
src/collectors/mongodb/test/testmongodb.py
matt-ullmer/Diamond
6ea198f3ebe58473467c6dc38b20e683c278192c
[ "MIT" ]
2
2015-03-13T05:46:54.000Z
2015-11-05T15:54:28.000Z
src/collectors/mongodb/test/testmongodb.py
matt-ullmer/Diamond
6ea198f3ebe58473467c6dc38b20e683c278192c
[ "MIT" ]
1
2019-01-31T01:00:14.000Z
2019-01-31T01:00:14.000Z
src/collectors/mongodb/test/testmongodb.py
matt-ullmer/Diamond
6ea198f3ebe58473467c6dc38b20e683c278192c
[ "MIT" ]
2
2019-01-30T23:51:03.000Z
2020-02-04T19:27:26.000Z
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from test import run_only from mock import MagicMock from mock import patch from mock import call from diamond.collector import Collector from mongodb import MongoDBCollector ################################################################################ def run_only_if_pymongo_is_available(func): try: import pymongo except ImportError: pymongo = None pred = lambda: pymongo is not None return run_only(func, pred) class TestMongoDBCollector(CollectorTestCase): def setUp(self): config = get_collector_config('MongoDBCollector', { 'host': 'localhost:27017', 'databases': '^db', }) self.collector = MongoDBCollector(config, None) self.connection = MagicMock() def test_import(self): self.assertTrue(MongoDBCollector) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_nested_keys_for_server_stats(self, publish_mock, connector_mock): data = {'more_keys': {'nested_key': 1}, 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection.db.command.assert_called_once_with('serverStatus') self.assertPublishedMany(publish_mock, { 'more_keys.nested_key': 1, 'key': 2 }) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_nested_keys_for_db_stats(self, publish_mock, connector_mock): data = {'db_keys': {'db_nested_key': 1}, 'dbkey': 2, 'dbstring': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection['db1'].command.assert_called_once_with('dbStats') metrics = { 'db_keys.db_nested_key': 1, 'dbkey': 2 } self.setDocExample(collector=self.collector.__class__.__name__, metrics=metrics, defaultpath=self.collector.config['path']) self.assertPublishedMany(publish_mock, metrics) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_stats_with_long_type(self, publish_mock, connector_mock): data = {'more_keys': long(1), 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection.db.command.assert_called_once_with('serverStatus') self.assertPublishedMany(publish_mock, { 'more_keys': 1, 'key': 2 }) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_ignore_unneeded_databases(self, publish_mock, connector_mock): self._annotate_connection(connector_mock, {}) self.collector.collect() assert call('baddb') not in self.connection.__getitem__.call_args_list @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_ignore_unneeded_collections(self, publish_mock, connector_mock): data = {'more_keys': long(1), 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.connection['db1'].collection_names.return_value = ['collection1', 'tmp.mr.tmp1'] self.connection['db1'].command.return_value = {'key': 2, 'string': 'str'} self.collector.collect() self.connection.db.command.assert_called_once_with('serverStatus') self.connection['db1'].collection_names.assert_called_once_with() self.connection['db1'].command.assert_any_call('dbStats') self.connection['db1'].command.assert_any_call('collstats', 'collection1') assert call('collstats', 'tmp.mr.tmp1') not in self.connection['db1'].command.call_args_list # NOQA metrics = { 'databases.db1.collection1.key': 2, } self.assertPublishedMany(publish_mock, metrics) def _annotate_connection(self, connector_mock, data): connector_mock.return_value = self.connection self.connection.db.command.return_value = data self.connection.database_names.return_value = ['db1', 'baddb'] class TestMongoMultiHostDBCollector(CollectorTestCase): def setUp(self): config = get_collector_config('MongoDBCollector', { 'hosts': ['localhost:27017', 'localhost:27057'], 'databases': '^db', }) self.collector = MongoDBCollector(config, None) self.connection = MagicMock() def test_import(self): self.assertTrue(MongoDBCollector) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_nested_keys_for_server_stats(self, publish_mock, connector_mock): data = {'more_keys': {'nested_key': 1}, 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection.db.command.assert_called_with('serverStatus') self.assertPublishedMany(publish_mock, { 'localhost_27017.more_keys.nested_key': 1, 'localhost_27057.more_keys.nested_key': 1, 'localhost_27017.key': 2, 'localhost_27057.key': 2 }) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_nested_keys_for_db_stats(self, publish_mock, connector_mock): data = {'db_keys': {'db_nested_key': 1}, 'dbkey': 2, 'dbstring': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection['db1'].command.assert_called_with('dbStats') metrics = { 'localhost_27017.db_keys.db_nested_key': 1, 'localhost_27057.db_keys.db_nested_key': 1, 'localhost_27017.dbkey': 2, 'localhost_27057.dbkey': 2 } self.setDocExample(collector=self.collector.__class__.__name__, metrics=metrics, defaultpath=self.collector.config['path']) self.assertPublishedMany(publish_mock, metrics) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_publish_stats_with_long_type(self, publish_mock, connector_mock): data = {'more_keys': long(1), 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.collector.collect() self.connection.db.command.assert_called_with('serverStatus') self.assertPublishedMany(publish_mock, { 'localhost_27017.more_keys': 1, 'localhost_27057.more_keys': 1, 'localhost_27017.key': 2, 'localhost_27057.key': 2 }) @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_ignore_unneeded_databases(self, publish_mock, connector_mock): self._annotate_connection(connector_mock, {}) self.collector.collect() assert call('baddb') not in self.connection.__getitem__.call_args_list @run_only_if_pymongo_is_available @patch('pymongo.Connection') @patch.object(Collector, 'publish') def test_should_ignore_unneeded_collections(self, publish_mock, connector_mock): data = {'more_keys': long(1), 'key': 2, 'string': 'str'} self._annotate_connection(connector_mock, data) self.connection['db1'].collection_names.return_value = ['collection1', 'tmp.mr.tmp1'] self.connection['db1'].command.return_value = {'key': 2, 'string': 'str'} self.collector.collect() self.connection.db.command.assert_called_with('serverStatus') self.connection['db1'].collection_names.assert_called_with() self.connection['db1'].command.assert_any_call('dbStats') self.connection['db1'].command.assert_any_call('collstats', 'collection1') assert call('collstats', 'tmp.mr.tmp1') not in self.connection['db1'].command.call_args_list # NOQA metrics = { 'localhost_27017.databases.db1.collection1.key': 2, 'localhost_27057.databases.db1.collection1.key': 2, } self.assertPublishedMany(publish_mock, metrics) def _annotate_connection(self, connector_mock, data): connector_mock.return_value = self.connection self.connection.db.command.return_value = data self.connection.database_names.return_value = ['db1', 'baddb'] ################################################################################ if __name__ == "__main__": unittest.main()
39.424812
108
0.570897
1,005
10,487
5.636816
0.106468
0.074139
0.054016
0.031068
0.896911
0.884025
0.872904
0.861783
0.858605
0.820124
0
0.021303
0.306189
10,487
265
109
39.573585
0.757284
0.003719
0
0.784689
0
0
0.137593
0.037044
0
0
0
0
0.133971
1
0.08134
false
0
0.062201
0
0.157895
0
0
0
0
null
0
0
0
1
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
7
c50fd59927da1d53a27e1e317c3ff12e44a2de97
23,329
py
Python
tests_tc/unit/broker/test_broker_trading_runs.py
tom3c/qstrader
015f0e52f2879c160f372306b0c0bd2d4e843ab4
[ "MIT" ]
null
null
null
tests_tc/unit/broker/test_broker_trading_runs.py
tom3c/qstrader
015f0e52f2879c160f372306b0c0bd2d4e843ab4
[ "MIT" ]
null
null
null
tests_tc/unit/broker/test_broker_trading_runs.py
tom3c/qstrader
015f0e52f2879c160f372306b0c0bd2d4e843ab4
[ "MIT" ]
null
null
null
import sys sys.path.append('T:\Projects_Code\_My_Work\_Strategy_Analysis\qstrader') import pandas as pd import pytest import pytz from qstrader.asset.universe_mc.static_mc import StaticUniverse_MC from qstrader.broker.simulated_broker_mc import SimulatedBroker_MC from qstrader.asset.asset_mc.equity_mc import Equity_MC from qstrader.asset.asset_mc.cash_mc import Cash_MC from qstrader.asset.universe_mc.static_mc import StaticUniverse_MC from qstrader.data.backtest_data_handler import BacktestDataHandler from qstrader.data.daily_bar_equity_csv import CSVDailyBarEquityDataSource from qstrader.data.daily_bar_fx_csv import CSVDailyBarFxDataSource import uuid from qstrader.execution.order_mc import Order_MC #import test_broker_helper as tbh - ********At some point get these working******** csv_dir = 'T:/Projects_Code/_My_Work/_Strategy_Analysis/qstrader/tests_tc/unit/broker/data' equity_assets = [('AS51', 'AUD'), ('NKY', 'JPY'), ('DAX', 'EUR'), ('IBEX', 'EUR'), ('UKX', 'GBP'), ('SPX', 'USD'), ('CCMP', 'USD')] stock_list = ['AS51', 'NKY', 'DAX', 'IBEX','UKX','SPX','CCMP'] currency_list = ['AUD','JPY','EUR','GBP'] def get_order_mc(order_type, dt, asset, quantity, commission, currency, auto_fx): order_id = uuid.uuid4().hex return Order_MC( order_type, dt, asset, quantity, commission, currency, auto_fx, order_id, ) class ExchangeMock(object): def is_open_at_datetime(self, dt): return True def test_broker_trading_run_auto_fx(): start_dt = pd.Timestamp('2020-10-02 21:00:00', tz=pytz.UTC) universe = StaticUniverse_MC(equity_assets) data_source_equity = CSVDailyBarEquityDataSource(csv_dir, Equity_MC, csv_symbols=stock_list) data_source_fx = CSVDailyBarFxDataSource(csv_dir, Cash_MC, csv_symbols=currency_list) data_handler = BacktestDataHandler(universe, data_sources=[data_source_equity, data_source_fx]) exchange_mock = ExchangeMock() sbwp = SimulatedBroker_MC(start_dt, universe, exchange_mock, data_handler) sbwp.create_portfolio(portfolio_id=1234, name="My Portfolio #1") sbwp.subscribe_funds_to_account(7500000.0) sbwp.subscribe_funds_to_portfolio("1234", 7500000.00) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'AS51', 90, 0.0, 'AUD', True) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'DAX', 80, 0.0, 'EUR', True) order3 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'IBEX', 5, 0.0, 'EUR', True) order4 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'SPX', 1000, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.submit_order("1234", order3) sbwp.submit_order("1234", order4) sbwp.update(pd.Timestamp('2020-10-05 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.get_position('AS51') == 90 assert port.get_position('DAX') == 80 assert port.get_position('IBEX') == 5 assert port.get_position('SPX') == 1000 assert port.get_mv_local('AS51') == 535680.00 assert round(port.get_mv_local('DAX'),4) == 1020381.60 assert port.get_mv_local('IBEX') == 33318.00 assert port.get_mv_local('SPX') == 3341210.00 assert round(port.get_mv_base('AS51'),4) == 384671.8080 assert port.get_mv_base('DAX') == 1202315.63928 assert port.get_mv_base('IBEX') == 39258.5994 assert port.get_mv_base('SPX') == 3341210.00 assert port.get_position('AUD') == 0.0 assert port.total_cash_value_local('AUD') == 0.0 assert port.get_position('JPY') == 0.0 assert port.total_cash_value_local('JPY') == 0.0 assert port.get_position('EUR') == 0.0 assert port.total_cash_value_local('EUR') == 0.0 assert port.get_position('GBP') == 0.0 assert port.total_cash_value_local('GBP') == 0.0 assert round(port.get_position('USD'),4) == 2532543.9533 assert round(port.total_cash_value_local('USD'),4) == 2532543.9533 assert round(port.total_cash_value_base,4) == 2532543.9533 assert port.total_market_value_local('AUD') == 535680.00 assert port.total_market_value_local('JPY') == 0.0 assert port.total_market_value_local('EUR') == 1053699.6 assert port.total_market_value_local('GBP') == 0.0 assert port.total_market_value_local('USD') == 3341210.00 # assert port.total_market_value_base('AUD') == 384671.8080 # assert port.total_market_value_base('JPY') == 0.0 # assert port.total_market_value_base('EUR') == 1241574.23868 # assert port.total_market_value_base('GBP') == 0.0 # assert port.total_market_value_base('USD') == 3341210.00 assert port.total_market_value_base == 4967456.04668 assert port.total_equity_base == 7500000.0 order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-08 14:30:00', tz=pytz.UTC), 'CCMP', 200, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-08 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-12 14:30:00', tz=pytz.UTC), 'NKY', 50, 0.0, 'JPY', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-12 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-14 14:30:00', tz=pytz.UTC), 'IBEX', -5, 0.0, 'EUR', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-14 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'DAX', -5, 0.0, 'EUR', True) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'CCMP', 20, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-16 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-19 14:30:00', tz=pytz.UTC), 'NKY', -50, 0.0, 'JPY', True) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-19 14:30:00', tz=pytz.UTC), 'DAX', -15, 0.0, 'EUR', True) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-19 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-20 14:30:00', tz=pytz.UTC), 'SPX', 100, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-20 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-21 14:30:00', tz=pytz.UTC), 'IBEX', 5, 0.0, 'EUR', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-21 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-22 14:30:00', tz=pytz.UTC), 'DAX', -5, 0.0, 'EUR', True) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-22 14:30:00', tz=pytz.UTC), 'UKX', 10, 0.0, 'GBP', True) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-22 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-23 14:30:00', tz=pytz.UTC), 'UKX', 10, 0.0, 'GBP', True) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-23 14:30:00', tz=pytz.UTC), 'CCMP', -220, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-23 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-27 14:30:00', tz=pytz.UTC), 'UKX', 5, 0.0, 'GBP', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-27 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-28 14:30:00', tz=pytz.UTC), 'SPX', -1100, 0.0, 'USD', True) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-28 21:00:00', tz=pytz.UTC)) sbwp.update(pd.Timestamp('2020-10-29 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.get_position('AS51') == 90 assert port.get_position('NKY') == 0.0 assert port.get_position('DAX') == 55 assert port.get_position('IBEX') == 5 assert port.get_position('UKX') == 25 assert port.get_position('SPX') == 0.0 assert port.get_position('CCMP') == 0.0 assert port.get_mv_local('AS51') == 555030.00 assert port.get_mv_local('NKY') == 0.00 assert port.get_mv_local('DAX') == 676687.55 assert port.get_mv_local('IBEX') == 33989.50 assert port.get_mv_local('UKX') == 146507.00 assert port.get_mv_local('SPX') == 0.0 assert port.get_mv_local('CCMP') == 0.0 assert port.get_mv_base('AS51') == 390130.587 assert port.get_mv_base('NKY') == 0.00 assert port.get_mv_base('DAX') == 789965.04587 assert port.get_mv_base('IBEX') == 39679.3423 assert round(port.get_mv_base('UKX'),4) == 189433.5510 assert port.get_mv_base('SPX') == 0.0 assert port.get_mv_base('CCMP') == 0.0 assert port.get_position('AUD') == 0.0 assert port.total_cash_value_local('AUD') == 0.0 assert port.get_position('JPY') == 0.0 assert port.total_cash_value_local('JPY') == 0.0 assert port.get_position('EUR') == 0.0 assert port.total_cash_value_local('EUR') == 0.0 assert port.get_position('GBP') == 0.0 assert port.total_cash_value_local('GBP') == 0.0 assert round(port.get_position('USD'),4) == 6255589.0422 assert round(port.total_cash_value_local('USD'),4) == 6255589.0422 assert round(port.total_cash_value_base,4) == 6255589.0422 assert port.total_market_value_local('AUD') == 555030.00 assert port.total_market_value_local('JPY') == 0.0 assert port.total_market_value_local('EUR') == 710677.05 assert port.total_market_value_local('GBP') == 146507 assert port.total_market_value_local('USD') == 0.0 # assert port.total_market_value_base('AUD') == 384671.8080 # assert port.total_market_value_base('JPY') == 0.0 # assert port.total_market_value_base('EUR') == 1241574.23868 # assert port.total_market_value_base('GBP') == 0.0 # assert port.total_market_value_base('USD') == 3341210.00 assert port.total_market_value_base == 1409208.52617 assert round(port.total_equity_base,4) == 7664797.5684 def test_broker_trading_run(): start_dt = pd.Timestamp('2020-10-02 21:00:00', tz=pytz.UTC) universe = StaticUniverse_MC(equity_assets) data_source_equity = CSVDailyBarEquityDataSource(csv_dir, Equity_MC, csv_symbols=stock_list) data_source_fx = CSVDailyBarFxDataSource(csv_dir, Cash_MC, csv_symbols=currency_list) data_handler = BacktestDataHandler(universe, data_sources=[data_source_equity, data_source_fx]) exchange_mock = ExchangeMock() sbwp = SimulatedBroker_MC(start_dt, universe, exchange_mock, data_handler) sbwp.create_portfolio(portfolio_id=1234, name="My Portfolio #1") sbwp.subscribe_funds_to_account(14000000.0) sbwp.subscribe_funds_to_portfolio("1234", 14000000.00) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'AUD', 1000000, 0.0, 'USD', False) fx_order2 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'EUR', 3000000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'AS51', 90, 0.0, 'AUD', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'DAX', 80, 0.0, 'EUR', False) order3 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'IBEX', 5, 0.0, 'EUR', False) order4 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-05 14:30:00', tz=pytz.UTC), 'SPX', 1000, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", fx_order2) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.submit_order("1234", order3) sbwp.submit_order("1234", order4) sbwp.update(pd.Timestamp('2020-10-05 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.get_position('AS51') == 90 assert port.get_position('NKY') == 0.0 assert port.get_position('DAX') == 80 assert port.get_position('IBEX') == 5 assert port.get_position('UKX') == 0 assert port.get_position('SPX') == 1000 assert port.get_position('CCMP') == 0.0 assert port.get_mv_local('AS51') == 535680.0 assert port.get_mv_local('NKY') == 0.00 assert round(port.get_mv_local('DAX'),4) == 1020381.6 assert port.get_mv_local('IBEX') == 33318 assert port.get_mv_local('UKX') == 0.0 assert port.get_mv_local('SPX') == 3341210.0 assert port.get_mv_local('CCMP') == 0.0 assert round(port.get_mv_base('AS51'),4) == 384671.8080 assert port.get_mv_base('NKY') == 0.00 assert port.get_mv_base('DAX') == 1202315.63928 assert port.get_mv_base('IBEX') == 39258.5994 assert round(port.get_mv_base('UKX'),4) == 0.0 assert port.get_mv_base('SPX') == 3341210.0 assert port.get_mv_base('CCMP') == 0.0 assert port.get_position('AUD') == 464320.0 assert port.total_cash_value_local('AUD') == 464320.0 assert port.get_position('JPY') == 0.0 assert port.total_cash_value_local('JPY') == 0.0 assert port.get_position('EUR') == 1946300.4 assert port.total_cash_value_local('EUR') == 1946300.4 assert port.get_position('GBP') == 0.0 assert port.total_cash_value_local('GBP') == 0.0 assert round(port.get_position('USD'),4) == 6405790.0000 assert round(port.total_cash_value_local('USD'),4) == 6405790.0000 assert round(port.total_cash_value_base,4) == 9032543.9533 assert port.total_market_value_local('AUD') == 535680.0 assert port.total_market_value_local('JPY') == 0.0 assert port.total_market_value_local('EUR') == 1053699.6 assert port.total_market_value_local('GBP') == 0.0 assert port.total_market_value_local('USD') == 3341210.0 assert port.total_market_value_base == 4967456.04668 assert port.total_equity_base == 14000000.0 fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-06 14:30:00', tz=pytz.UTC), 'EUR', -400000, 0.0, 'GBP', False) sbwp.submit_order("1234", fx_order1) sbwp.update(pd.Timestamp('2020-10-06 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-08 14:30:00', tz=pytz.UTC), 'AUD', 2000000, 0.0, 'EUR', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-08 14:30:00', tz=pytz.UTC), 'AS51', 150, 0.0, 'AUD', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-08 14:30:00', tz=pytz.UTC), 'CCMP', 200, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-08 21:00:00', tz=pytz.UTC)) sbwp.update(pd.Timestamp('2020-10-09 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.get_position('AS51') == 240 assert port.get_position('NKY') == 0.0 assert port.get_position('DAX') == 80 assert port.get_position('IBEX') == 5 assert port.get_position('UKX') == 0 assert port.get_position('SPX') == 1000 assert port.get_position('CCMP') == 200.0 assert port.get_mv_local('AS51') == 1425984 assert port.get_mv_local('NKY') == 0.00 assert round(port.get_mv_local('DAX'),4) == 1028717.6 assert port.get_mv_local('IBEX') == 34300.5 assert port.get_mv_local('UKX') == 0.0 assert port.get_mv_local('SPX') == 3408740 assert port.get_mv_local('CCMP') == 2262906 assert round(port.get_mv_base('AS51'),4) == 1032412.416 assert port.get_mv_base('NKY') == 0.00 assert round(port.get_mv_base('DAX'),5) == 1216561.43376 assert port.get_mv_base('IBEX') == 40563.7713 assert round(port.get_mv_base('UKX'),4) == 0.0 assert port.get_mv_base('SPX') == 3408740.0 assert port.get_mv_base('CCMP') == 2262906.0 assert port.get_position('AUD') == 1595595.0 assert port.total_cash_value_local('AUD') == 1595595.0 assert port.get_position('JPY') == 0.0 assert port.total_cash_value_local('JPY') == 0.0 assert round(port.get_position('EUR'),5) == 327659.35910 assert round(port.total_cash_value_local('EUR'),5) == 327659.35910 assert port.get_position('GBP') == 364381.6473876252 assert port.total_cash_value_local('GBP') == 364381.6473876252 assert round(port.get_position('USD'),4) == 4171968.0 assert round(port.total_cash_value_local('USD'),4) == 4171968.0 assert port.total_market_value_local('AUD') == 1425984.0 assert port.total_market_value_local('JPY') == 0.0 assert port.total_market_value_local('EUR') == 1063018.1 assert port.total_market_value_local('GBP') == 0.0 assert port.total_market_value_local('USD') == 5671646.0 assert port.total_cash_value_base == 6189676.653600446 assert port.total_market_value_base == 7961183.621060001 assert port.total_equity_base == 14150860.274660446 fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-12 14:30:00', tz=pytz.UTC), 'JPY', 300000000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-12 14:30:00', tz=pytz.UTC), 'NKY', 500, 0.0, 'JPY', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-12 21:00:00', tz=pytz.UTC)) assert port.total_cash_value_base == 6074850.634027748 assert port.total_market_value_base == 8041006.35157856 assert port.total_equity_base == 14115856.985606309 fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-13 14:30:00', tz=pytz.UTC), 'AUD', -400000, 0.0, 'USD', False) fx_order2 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-13 14:30:00', tz=pytz.UTC), 'EUR', 750000, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", fx_order2) sbwp.update(pd.Timestamp('2020-10-13 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-14 14:30:00', tz=pytz.UTC), 'IBEX', -5, 0.0, 'EUR', False) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-14 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'GBP', 1250000, 0.0, 'JPY', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'DAX', -5, 0.0, 'EUR', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'UKX', 70, 0.0, 'GBP', False) order3 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-16 14:30:00', tz=pytz.UTC), 'CCMP', 20, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.submit_order("1234", order3) sbwp.update(pd.Timestamp('2020-10-16 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-19 14:30:00', tz=pytz.UTC), 'AUD', -600000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-19 14:30:00', tz=pytz.UTC), 'NKY', -500, 0.0, 'JPY', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-19 14:30:00', tz=pytz.UTC), 'DAX', -15, 0.0, 'EUR', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-19 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-20 14:30:00', tz=pytz.UTC), 'JPY', -30000000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-20 14:30:00', tz=pytz.UTC), 'SPX', 100, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-20 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-21 14:30:00', tz=pytz.UTC), 'JPY', -20000000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-21 14:30:00', tz=pytz.UTC), 'IBEX', 5, 0.0, 'EUR', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-21 21:00:00', tz=pytz.UTC)) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-22 14:30:00', tz=pytz.UTC), 'DAX', -5, 0.0, 'EUR', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-22 14:30:00', tz=pytz.UTC), 'UKX', 10, 0.0, 'GBP', False) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-22 21:00:00', tz=pytz.UTC)) assert round(port.total_cash_value_base,7) == 5376812.3354881 assert port.total_market_value_base == 8981217.14899 assert port.total_equity_base == 14358029.484478105 fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-23 14:30:00', tz=pytz.UTC), 'EUR', 150000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-23 14:30:00', tz=pytz.UTC), 'UKX', 10, 0.0, 'GBP', False) order2 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-23 14:30:00', tz=pytz.UTC), 'CCMP', -220, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.submit_order("1234", order2) sbwp.update(pd.Timestamp('2020-10-23 21:00:00', tz=pytz.UTC)) fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-26 14:30:00', tz=pytz.UTC), 'GBP', -1000000, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.update(pd.Timestamp('2020-10-26 21:00:00', tz=pytz.UTC)) assert round(port.total_cash_value_base,7) == 7829046.3614988 assert port.total_market_value_base == 6401704.0579699995 assert port.total_equity_base == 14230750.41946882 order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-27 14:30:00', tz=pytz.UTC), 'UKX', 5, 0.0, 'GBP', False) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-27 21:00:00', tz=pytz.UTC)) assert round(port.total_cash_value_base,7) == 7792774.8370998 assert port.total_market_value_base == 6403909.93138 assert port.total_equity_base == 14196684.768479826 fx_order1 = get_order_mc('FX_ORDER', pd.Timestamp('2020-10-28 14:30:00', tz=pytz.UTC), 'EUR', -1500000, 0.0, 'USD', False) order1 = get_order_mc('STOCK_ORDER', pd.Timestamp('2020-10-28 14:30:00', tz=pytz.UTC), 'SPX', -1100, 0.0, 'USD', False) sbwp.submit_order("1234", fx_order1) sbwp.submit_order("1234", order1) sbwp.update(pd.Timestamp('2020-10-28 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.total_cash_value_base == 11591837.370012645 assert port.total_market_value_base == 2606107.291765 assert port.total_equity_base == 14197944.661777645 sbwp.update(pd.Timestamp('2020-10-29 21:00:00', tz=pytz.UTC)) port = sbwp.portfolios["1234"] assert port.total_cash_value_base == 11588119.450463153 assert port.total_market_value_base == 2589840.11397 assert port.total_equity_base == 14177959.564433154
47.034274
131
0.680998
3,784
23,329
4.000529
0.075581
0.097767
0.085216
0.096578
0.907848
0.87931
0.846941
0.797728
0.781543
0.766614
0
0.159122
0.146856
23,329
496
132
47.034274
0.601467
0.027176
0
0.484932
0
0
0.152273
0.005819
0
0
0
0
0.452055
1
0.010959
false
0
0.038356
0.00274
0.057534
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
1
0
0
0
0
0
0
0
0
0
7
c526b785b24f6d4b0703a312de21e69398aa2c6d
33,270
py
Python
tests/test_logparser.py
lexionai/python-crfsuite
fe281bce12bbcaf954811982cefd3e7813555b7e
[ "MIT" ]
622
2016-12-18T08:19:50.000Z
2022-02-28T20:58:01.000Z
tests/test_logparser.py
lexionai/python-crfsuite
fe281bce12bbcaf954811982cefd3e7813555b7e
[ "MIT" ]
102
2016-12-17T02:26:44.000Z
2022-03-23T13:06:52.000Z
tests/test_logparser.py
lexionai/python-crfsuite
fe281bce12bbcaf954811982cefd3e7813555b7e
[ "MIT" ]
207
2016-12-20T23:37:30.000Z
2022-02-21T06:16:32.000Z
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function from pycrfsuite._logparser import TrainLogParser def _apply_parser(parser, log): for line in log: event = parser.feed(line) if event and event != 'featgen_progress': print(parser.last_log, end='') print('============== ' + event) log1 = [ 'Holdout group: 2\n', '\n', 'Feature generation\n', 'type: CRF1d\n', 'feature.minfreq: 0.000000\n', 'feature.possible_states: 0\n', 'feature.possible_transitions: 1\n', '0', '.', '.', '.', '.', '1', '.', '.', '.', '.', '2', '.', '.', '.', '.', '3', '.', '.', '.', '.', '4', '.', '.', '.', '.', '5', '.', '.', '.', '.', '6', '.', '.', '.', '.', '7', '.', '.', '.', '.', '8', '.', '.', '.', '.', '9', '.', '.', '.', '.', '10', '\n', 'Number of features: 3948\n', 'Seconds required: 0.022\n', '\n', 'L-BFGS optimization\n', 'c1: 1.000000\n', 'c2: 0.001000\n', 'num_memories: 6\n', 'max_iterations: 5\n', 'epsilon: 0.000010\n', 'stop: 10\n', 'delta: 0.000010\n', 'linesearch: MoreThuente\n', 'linesearch.max_iterations: 20\n', '\n', '***** Iteration #1 *****\n', 'Loss: 1450.519004\n', 'Feature norm: 1.000000\n', 'Error norm: 713.784994\n', 'Active features: 1794\n', 'Line search trials: 1\n', 'Line search step: 0.000228\n', 'Seconds required for this iteration: 0.008\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000)\n', ' O: (306, 339, 306) (0.9027, 1.0000, 0.9488)\n', ' B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000)\n', ' B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000)\n', ' I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000)\n', ' B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000)\n', ' I-MISC: (0, 0, 0) (******, ******, ******)\n', 'Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426)\n', 'Item accuracy: 306 / 339 (0.9027)\n', 'Instance accuracy: 3 / 10 (0.3000)\n', '\n', '***** Iteration #2 *****\n', 'Loss: 1363.687719\n', 'Feature norm: 1.178396\n', 'Error norm: 370.827506\n', 'Active features: 1540\n', 'Line search trials: 1\n', 'Line search step: 1.000000\n', 'Seconds required for this iteration: 0.004\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000)\n', ' O: (306, 339, 306) (0.9027, 1.0000, 0.9488)\n', ' B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000)\n', ' B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000)\n', ' I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000)\n', ' B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000)\n', ' I-MISC: (0, 0, 0) (******, ******, ******)\n', 'Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426)\n', 'Item accuracy: 306 / 339 (0.9027)\n', 'Instance accuracy: 3 / 10 (0.3000)\n', '\n', '***** Iteration #3 *****\n', 'Loss: 1309.171814\n', 'Feature norm: 1.266322\n', 'Error norm: 368.739493\n', 'Active features: 1308\n', 'Line search trials: 1\n', 'Line search step: 1.000000\n', 'Seconds required for this iteration: 0.003\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000)\n', ' O: (306, 339, 306) (0.9027, 1.0000, 0.9488)\n', ' B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000)\n', ' B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000)\n', ' I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000)\n', ' B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000)\n', ' I-MISC: (0, 0, 0) (******, ******, ******)\n', 'Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426)\n', 'Item accuracy: 306 / 339 (0.9027)\n', 'Instance accuracy: 3 / 10 (0.3000)\n', '\n', '***** Iteration #4 *****\n', 'Loss: 1019.561634\n', 'Feature norm: 1.929814\n', 'Error norm: 202.976154\n', 'Active features: 1127\n', 'Line search trials: 1\n', 'Line search step: 1.000000\n', 'Seconds required for this iteration: 0.003\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000)\n', ' O: (306, 339, 306) (0.9027, 1.0000, 0.9488)\n', ' B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000)\n', ' B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000)\n', ' I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000)\n', ' B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000)\n', ' I-MISC: (0, 0, 0) (******, ******, ******)\n', 'Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426)\n', 'Item accuracy: 306 / 339 (0.9027)\n', 'Instance accuracy: 3 / 10 (0.3000)\n', '\n', '***** Iteration #5 *****\n', 'Loss: 782.637378\n', 'Feature norm: 3.539391\n', 'Error norm: 121.725020\n', 'Active features: 1035\n', 'Line search trials: 1\n', 'Line search step: 1.000000\n', 'Seconds required for this iteration: 0.003\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (2, 5, 6) (0.4000, 0.3333, 0.3636)\n', ' O: (305, 318, 306) (0.9591, 0.9967, 0.9776)\n', ' B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000)\n', ' B-PER: (2, 4, 3) (0.5000, 0.6667, 0.5714)\n', ' I-PER: (4, 12, 4) (0.3333, 1.0000, 0.5000)\n', ' B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000)\n', ' I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000)\n', ' I-MISC: (0, 0, 0) (******, ******, ******)\n', 'Macro-average precision, recall, F1: (0.243606, 0.332970, 0.268070)\n', 'Item accuracy: 313 / 339 (0.9233)\n', 'Instance accuracy: 3 / 10 (0.3000)\n', '\n', 'L-BFGS terminated with the maximum number of iterations\n', 'Total seconds required for training: 0.022\n', '\n', 'Storing the model\n', 'Number of active features: 1035 (3948)\n', 'Number of active attributes: 507 (3350)\n', 'Number of active labels: 9 (9)\n', 'Writing labels\n', 'Writing attributes\n', 'Writing feature references for transitions\n', 'Writing feature references for attributes\n', 'Seconds required: 0.003\n', '\n' ] log2 = [ 'Feature generation\n', # featgen_start 'type: CRF1d\n', 'feature.minfreq: 0.000000\n', 'feature.possible_states: 0\n', 'feature.possible_transitions: 1\n', '0', '.', '.', '.', '.', # featgen_progress '1', '.', '.', '.', '.', '2', '.', '.', '.', '.', '3', '.', '.', '.', '.', '4', '.', '.', '.', '.', '5', '.', '.', '.', '.', '6', '.', '.', '.', '.', '7', '.', '.', '.', '.', '8', '.', '.', '.', '.', '9', '.', '.', '.', '.', '10', '\n', 'Number of features: 4379\n', 'Seconds required: 0.021\n', # featgen_end '\n', 'Averaged perceptron\n', 'max_iterations: 5\n', 'epsilon: 0.000000\n', '\n', '***** Iteration #1 *****\n', # iteration 'Loss: 16.359638\n', 'Feature norm: 112.848688\n', 'Seconds required for this iteration: 0.005\n', # iteration end '\n', '***** Iteration #2 *****\n', 'Loss: 12.449970\n', 'Feature norm: 126.174821\n', 'Seconds required for this iteration: 0.004\n', '\n', '***** Iteration #3 *****\n', 'Loss: 9.451751\n', 'Feature norm: 145.482678\n', 'Seconds required for this iteration: 0.003\n', '\n', '***** Iteration #4 *****\n', 'Loss: 8.652287\n', 'Feature norm: 155.495167\n', 'Seconds required for this iteration: 0.003\n', '\n', '***** Iteration #5 *****\n', 'Loss: 7.442703\n', 'Feature norm: 166.818487\n', 'Seconds required for this iteration: 0.002\n', '\n', 'Total seconds required for training: 0.017\n', # optimization_end '\n', 'Storing the model\n', # storing_start 'Number of active features: 2265 (4379)\n', 'Number of active attributes: 1299 (3350)\n', 'Number of active labels: 9 (9)\n', 'Writing labels\n', 'Writing attributes\n', 'Writing feature references for transitions\n', 'Writing feature references for attributes\n', 'Seconds required: 0.007\n', # storing_end '\n' # end ] log3 = [ 'Holdout group: 2\n', '\n', 'Feature generation\n', 'type: CRF1d\n', 'feature.minfreq: 0.000000\n', 'feature.possible_states: 0\n', 'feature.possible_transitions: 1\n', '0', '.', '.', '.', '.', '1', '.', '.', '.', '.', '2', '.', '.', '.', '.', '3', '.', '.', '.', '.', '4', '.', '.', '.', '.', '5', '.', '.', '.', '.', '6', '.', '.', '.', '.', '7', '.', '.', '.', '.', '8', '.', '.', '.', '.', '9', '.', '.', '.', '.', '10', '\n', 'Number of features: 96180\n', 'Seconds required: 1.263\n', '\n', 'Stochastic Gradient Descent (SGD)\n', 'c2: 1.000000\n', 'max_iterations: 5\n', 'period: 10\n', 'delta: 0.000001\n', '\n', 'Calibrating the learning rate (eta)\n', 'calibration.eta: 0.100000\n', 'calibration.rate: 2.000000\n', 'calibration.samples: 1000\n', 'calibration.candidates: 10\n', 'calibration.max_trials: 20\n', 'Initial loss: 69781.655352\n', 'Trial #1 (eta = 0.100000): ', '12808.890280\n', 'Trial #2 (eta = 0.200000): ', '26716.801091\n', 'Trial #3 (eta = 0.400000): ', '51219.321368\n', 'Trial #4 (eta = 0.800000): ', '104398.795416 (worse)\n', 'Trial #5 (eta = 0.050000): ', '7804.492475\n', 'Trial #6 (eta = 0.025000): ', '6419.964967\n', 'Trial #7 (eta = 0.012500): ', '6989.552193\n', 'Trial #8 (eta = 0.006250): ', '8303.107921\n', 'Trial #9 (eta = 0.003125): ', '9934.052819\n', 'Trial #10 (eta = 0.001563): ', '11782.234687\n', 'Trial #11 (eta = 0.000781): ', '13777.708878\n', 'Trial #12 (eta = 0.000391): ', '15891.422697\n', 'Trial #13 (eta = 0.000195): ', '18174.499245\n', 'Trial #14 (eta = 0.000098): ', '20955.855446\n', 'Best learning rate (eta): 0.025000\n', 'Seconds required: 0.858\n', '\n', '***** Epoch #1 *****\n', 'Loss: 36862.915596\n', 'Feature L2-norm: 24.717729\n', 'Learning rate (eta): 0.023810\n', 'Total number of feature updates: 8323\n', 'Seconds required for this iteration: 0.462\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (778, 1193, 1084) (0.6521, 0.7177, 0.6834)\n', ' O: (45103, 45519, 45355) (0.9909, 0.9944, 0.9926)\n', ' B-ORG: (1003, 1326, 1400) (0.7564, 0.7164, 0.7359)\n', ' B-PER: (583, 764, 735) (0.7631, 0.7932, 0.7779)\n', ' I-PER: (565, 681, 634) (0.8297, 0.8912, 0.8593)\n', ' B-MISC: (76, 181, 339) (0.4199, 0.2242, 0.2923)\n', ' I-ORG: (735, 933, 1104) (0.7878, 0.6658, 0.7216)\n', ' I-LOC: (191, 455, 325) (0.4198, 0.5877, 0.4897)\n', ' I-MISC: (204, 481, 557) (0.4241, 0.3662, 0.3931)\n', 'Macro-average precision, recall, F1: (0.671525, 0.661871, 0.660646)\n', 'Item accuracy: 49238 / 51533 (0.9555)\n', 'Instance accuracy: 852 / 1517 (0.5616)\n', '\n', '***** Epoch #2 *****\n', 'Loss: 31176.026308\n', 'Feature L2-norm: 32.274598\n', 'Learning rate (eta): 0.022727\n', 'Total number of feature updates: 16646\n', 'Seconds required for this iteration: 0.466\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (708, 1018, 1084) (0.6955, 0.6531, 0.6736)\n', ' O: (45101, 45611, 45355) (0.9888, 0.9944, 0.9916)\n', ' B-ORG: (1053, 1711, 1400) (0.6154, 0.7521, 0.6770)\n', ' B-PER: (594, 777, 735) (0.7645, 0.8082, 0.7857)\n', ' I-PER: (589, 778, 634) (0.7571, 0.9290, 0.8343)\n', ' B-MISC: (94, 264, 339) (0.3561, 0.2773, 0.3118)\n', ' I-ORG: (384, 468, 1104) (0.8205, 0.3478, 0.4885)\n', ' I-LOC: (166, 285, 325) (0.5825, 0.5108, 0.5443)\n', ' I-MISC: (210, 621, 557) (0.3382, 0.3770, 0.3565)\n', 'Macro-average precision, recall, F1: (0.657608, 0.627752, 0.629257)\n', 'Item accuracy: 48899 / 51533 (0.9489)\n', 'Instance accuracy: 813 / 1517 (0.5359)\n', '\n', '***** Epoch #3 *****\n', 'Loss: 23705.719839\n', 'Feature L2-norm: 35.255014\n', 'Learning rate (eta): 0.021739\n', 'Total number of feature updates: 24969\n', 'Seconds required for this iteration: 0.472\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (808, 1210, 1084) (0.6678, 0.7454, 0.7044)\n', ' O: (45244, 45771, 45355) (0.9885, 0.9976, 0.9930)\n', ' B-ORG: (1061, 1403, 1400) (0.7562, 0.7579, 0.7570)\n', ' B-PER: (588, 728, 735) (0.8077, 0.8000, 0.8038)\n', ' I-PER: (565, 640, 634) (0.8828, 0.8912, 0.8870)\n', ' B-MISC: (86, 130, 339) (0.6615, 0.2537, 0.3667)\n', ' I-ORG: (857, 1148, 1104) (0.7465, 0.7763, 0.7611)\n', ' I-LOC: (152, 282, 325) (0.5390, 0.4677, 0.5008)\n', ' I-MISC: (170, 221, 557) (0.7692, 0.3052, 0.4370)\n', 'Macro-average precision, recall, F1: (0.757699, 0.666091, 0.690108)\n', 'Item accuracy: 49531 / 51533 (0.9612)\n', 'Instance accuracy: 889 / 1517 (0.5860)\n', '\n', '***** Epoch #4 *****\n', 'Loss: 21273.137466\n', 'Feature L2-norm: 37.985723\n', 'Learning rate (eta): 0.020833\n', 'Total number of feature updates: 33292\n', 'Seconds required for this iteration: 0.468\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (848, 1276, 1084) (0.6646, 0.7823, 0.7186)\n', ' O: (44212, 44389, 45355) (0.9960, 0.9748, 0.9853)\n', ' B-ORG: (784, 896, 1400) (0.8750, 0.5600, 0.6829)\n', ' B-PER: (582, 686, 735) (0.8484, 0.7918, 0.8191)\n', ' I-PER: (570, 647, 634) (0.8810, 0.8991, 0.8899)\n', ' B-MISC: (166, 619, 339) (0.2682, 0.4897, 0.3466)\n', ' I-ORG: (152, 155, 1104) (0.9806, 0.1377, 0.2415)\n', ' I-LOC: (138, 219, 325) (0.6301, 0.4246, 0.5074)\n', ' I-MISC: (467, 2646, 557) (0.1765, 0.8384, 0.2916)\n', 'Macro-average precision, recall, F1: (0.702269, 0.655374, 0.609212)\n', 'Item accuracy: 47919 / 51533 (0.9299)\n', 'Instance accuracy: 793 / 1517 (0.5227)\n', '\n', '***** Epoch #5 *****\n', 'Loss: 20806.661564\n', 'Feature L2-norm: 40.673070\n', 'Learning rate (eta): 0.020000\n', 'Total number of feature updates: 41615\n', 'Seconds required for this iteration: 0.460\n', 'Performance by label (#match, #model, #ref) (precision, recall, F1):\n', ' B-LOC: (689, 892, 1084) (0.7724, 0.6356, 0.6974)\n', ' O: (45171, 45556, 45355) (0.9915, 0.9959, 0.9937)\n', ' B-ORG: (1214, 1931, 1400) (0.6287, 0.8671, 0.7289)\n', ' B-PER: (529, 574, 735) (0.9216, 0.7197, 0.8083)\n', ' I-PER: (520, 553, 634) (0.9403, 0.8202, 0.8762)\n', ' B-MISC: (77, 96, 339) (0.8021, 0.2271, 0.3540)\n', ' I-ORG: (1009, 1678, 1104) (0.6013, 0.9139, 0.7254)\n', ' I-LOC: (126, 182, 325) (0.6923, 0.3877, 0.4970)\n', ' I-MISC: (57, 71, 557) (0.8028, 0.1023, 0.1815)\n', 'Macro-average precision, recall, F1: (0.794790, 0.629970, 0.651378)\n', 'Item accuracy: 49392 / 51533 (0.9585)\n', 'Instance accuracy: 885 / 1517 (0.5834)\n', '\n', 'SGD terminated with the maximum number of iterations\n', 'Loss: 20806.661564\n', 'Total seconds required for training: 3.350\n', '\n', 'Storing the model\n', 'Number of active features: 96180 (96180)\n', 'Number of active attributes: 76691 (83593)\n', 'Number of active labels: 9 (9)\n', 'Writing labels\n', 'Writing attributes\n', 'Writing feature references for transitions\n', 'Writing feature references for attributes\n', 'Seconds required: 0.329\n', '\n' ] log4 = [ 'Feature generation\n', 'type: CRF1d\n', 'feature.minfreq: 0.000000\n', 'feature.possible_states: 0\n', 'feature.possible_transitions: 0\n', '0', '.', '.', '.', '.', '1', '.', '.', '.', '.', '2', '.', '.', '.', '.', '3', '.', '.', '.', '.', '4', '.', '.', '.', '.', '5', '.', '.', '.', '.', '6', '.', '.', '.', '.', '7', '.', '.', '.', '.', '8', '.', '.', '.', '.', '9', '.', '.', '.', '.', '10', '\n', 'Number of features: 0\n', 'Seconds required: 0.001\n', '\n', 'L-BFGS optimization\n', 'c1: 0.000000\n', 'c2: 1.000000\n', 'num_memories: 6\n', 'max_iterations: 2147483647\n', 'epsilon: 0.000010\n', 'stop: 10\n', 'delta: 0.000010\n', 'linesearch: MoreThuente\n', 'linesearch.max_iterations: 20\n', '\n', 'L-BFGS terminated with error code (-1020)\n', 'Total seconds required for training: 0.000\n', '\n', 'Storing the model\n', 'Number of active features: 0 (0)\n', 'Number of active attributes: 0 (0)\n', 'Number of active labels: 0 (0)\n', 'Writing labels\n', 'Writing attributes\n', 'Writing feature references for transitions\n', 'Writing feature references for attributes\n', 'Seconds required: 0.000\n', '\n' ] def test_parser_log1(): """ >>> parser = TrainLogParser() >>> _apply_parser(parser, log1) Holdout group: 2 ============== start <BLANKLINE> Number of features: 3948 Seconds required: 0.022 ============== featgen_end <BLANKLINE> L-BFGS optimization c1: 1.000000 c2: 0.001000 num_memories: 6 max_iterations: 5 epsilon: 0.000010 stop: 10 delta: 0.000010 linesearch: MoreThuente linesearch.max_iterations: 20 <BLANKLINE> ============== prepared ***** Iteration #1 ***** Loss: 1450.519004 Feature norm: 1.000000 Error norm: 713.784994 Active features: 1794 Line search trials: 1 Line search step: 0.000228 Seconds required for this iteration: 0.008 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000) O: (306, 339, 306) (0.9027, 1.0000, 0.9488) B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000) B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000) I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000) B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000) I-MISC: (0, 0, 0) (******, ******, ******) Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426) Item accuracy: 306 / 339 (0.9027) Instance accuracy: 3 / 10 (0.3000) <BLANKLINE> ============== iteration ***** Iteration #2 ***** Loss: 1363.687719 Feature norm: 1.178396 Error norm: 370.827506 Active features: 1540 Line search trials: 1 Line search step: 1.000000 Seconds required for this iteration: 0.004 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000) O: (306, 339, 306) (0.9027, 1.0000, 0.9488) B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000) B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000) I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000) B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000) I-MISC: (0, 0, 0) (******, ******, ******) Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426) Item accuracy: 306 / 339 (0.9027) Instance accuracy: 3 / 10 (0.3000) <BLANKLINE> ============== iteration ***** Iteration #3 ***** Loss: 1309.171814 Feature norm: 1.266322 Error norm: 368.739493 Active features: 1308 Line search trials: 1 Line search step: 1.000000 Seconds required for this iteration: 0.003 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000) O: (306, 339, 306) (0.9027, 1.0000, 0.9488) B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000) B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000) I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000) B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000) I-MISC: (0, 0, 0) (******, ******, ******) Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426) Item accuracy: 306 / 339 (0.9027) Instance accuracy: 3 / 10 (0.3000) <BLANKLINE> ============== iteration ***** Iteration #4 ***** Loss: 1019.561634 Feature norm: 1.929814 Error norm: 202.976154 Active features: 1127 Line search trials: 1 Line search step: 1.000000 Seconds required for this iteration: 0.003 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (0, 0, 6) (0.0000, 0.0000, 0.0000) O: (306, 339, 306) (0.9027, 1.0000, 0.9488) B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000) B-PER: (0, 0, 3) (0.0000, 0.0000, 0.0000) I-PER: (0, 0, 4) (0.0000, 0.0000, 0.0000) B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000) I-MISC: (0, 0, 0) (******, ******, ******) Macro-average precision, recall, F1: (0.100295, 0.111111, 0.105426) Item accuracy: 306 / 339 (0.9027) Instance accuracy: 3 / 10 (0.3000) <BLANKLINE> ============== iteration ***** Iteration #5 ***** Loss: 782.637378 Feature norm: 3.539391 Error norm: 121.725020 Active features: 1035 Line search trials: 1 Line search step: 1.000000 Seconds required for this iteration: 0.003 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (2, 5, 6) (0.4000, 0.3333, 0.3636) O: (305, 318, 306) (0.9591, 0.9967, 0.9776) B-ORG: (0, 0, 9) (0.0000, 0.0000, 0.0000) B-PER: (2, 4, 3) (0.5000, 0.6667, 0.5714) I-PER: (4, 12, 4) (0.3333, 1.0000, 0.5000) B-MISC: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-ORG: (0, 0, 5) (0.0000, 0.0000, 0.0000) I-LOC: (0, 0, 1) (0.0000, 0.0000, 0.0000) I-MISC: (0, 0, 0) (******, ******, ******) Macro-average precision, recall, F1: (0.243606, 0.332970, 0.268070) Item accuracy: 313 / 339 (0.9233) Instance accuracy: 3 / 10 (0.3000) <BLANKLINE> ============== iteration L-BFGS terminated with the maximum number of iterations Total seconds required for training: 0.022 <BLANKLINE> ============== optimization_end Storing the model Number of active features: 1035 (3948) Number of active attributes: 507 (3350) Number of active labels: 9 (9) Writing labels Writing attributes Writing feature references for transitions Writing feature references for attributes Seconds required: 0.003 <BLANKLINE> ============== end >>> len(parser.iterations) 5 >>> parser.iterations[3]['active_features'] 1127 """ pass def test_parser_log2(): """ >>> parser = TrainLogParser() >>> _apply_parser(parser, log2) Feature generation ============== start <BLANKLINE> Number of features: 4379 Seconds required: 0.021 ============== featgen_end <BLANKLINE> Averaged perceptron max_iterations: 5 epsilon: 0.000000 <BLANKLINE> ============== prepared ***** Iteration #1 ***** Loss: 16.359638 Feature norm: 112.848688 Seconds required for this iteration: 0.005 <BLANKLINE> ============== iteration ***** Iteration #2 ***** Loss: 12.449970 Feature norm: 126.174821 Seconds required for this iteration: 0.004 <BLANKLINE> ============== iteration ***** Iteration #3 ***** Loss: 9.451751 Feature norm: 145.482678 Seconds required for this iteration: 0.003 <BLANKLINE> ============== iteration ***** Iteration #4 ***** Loss: 8.652287 Feature norm: 155.495167 Seconds required for this iteration: 0.003 <BLANKLINE> ============== iteration ***** Iteration #5 ***** Loss: 7.442703 Feature norm: 166.818487 Seconds required for this iteration: 0.002 <BLANKLINE> ============== iteration Total seconds required for training: 0.017 <BLANKLINE> ============== optimization_end Storing the model Number of active features: 2265 (4379) Number of active attributes: 1299 (3350) Number of active labels: 9 (9) Writing labels Writing attributes Writing feature references for transitions Writing feature references for attributes Seconds required: 0.007 <BLANKLINE> ============== end """ pass def test_parser_log3(): """ >>> parser = TrainLogParser() >>> _apply_parser(parser, log3) Holdout group: 2 ============== start <BLANKLINE> Number of features: 96180 Seconds required: 1.263 ============== featgen_end <BLANKLINE> Stochastic Gradient Descent (SGD) c2: 1.000000 max_iterations: 5 period: 10 delta: 0.000001 <BLANKLINE> Calibrating the learning rate (eta) calibration.eta: 0.100000 calibration.rate: 2.000000 calibration.samples: 1000 calibration.candidates: 10 calibration.max_trials: 20 Initial loss: 69781.655352 Trial #1 (eta = 0.100000): 12808.890280 Trial #2 (eta = 0.200000): 26716.801091 Trial #3 (eta = 0.400000): 51219.321368 Trial #4 (eta = 0.800000): 104398.795416 (worse) Trial #5 (eta = 0.050000): 7804.492475 Trial #6 (eta = 0.025000): 6419.964967 Trial #7 (eta = 0.012500): 6989.552193 Trial #8 (eta = 0.006250): 8303.107921 Trial #9 (eta = 0.003125): 9934.052819 Trial #10 (eta = 0.001563): 11782.234687 Trial #11 (eta = 0.000781): 13777.708878 Trial #12 (eta = 0.000391): 15891.422697 Trial #13 (eta = 0.000195): 18174.499245 Trial #14 (eta = 0.000098): 20955.855446 Best learning rate (eta): 0.025000 Seconds required: 0.858 <BLANKLINE> ============== prepared ***** Epoch #1 ***** Loss: 36862.915596 Feature L2-norm: 24.717729 Learning rate (eta): 0.023810 Total number of feature updates: 8323 Seconds required for this iteration: 0.462 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (778, 1193, 1084) (0.6521, 0.7177, 0.6834) O: (45103, 45519, 45355) (0.9909, 0.9944, 0.9926) B-ORG: (1003, 1326, 1400) (0.7564, 0.7164, 0.7359) B-PER: (583, 764, 735) (0.7631, 0.7932, 0.7779) I-PER: (565, 681, 634) (0.8297, 0.8912, 0.8593) B-MISC: (76, 181, 339) (0.4199, 0.2242, 0.2923) I-ORG: (735, 933, 1104) (0.7878, 0.6658, 0.7216) I-LOC: (191, 455, 325) (0.4198, 0.5877, 0.4897) I-MISC: (204, 481, 557) (0.4241, 0.3662, 0.3931) Macro-average precision, recall, F1: (0.671525, 0.661871, 0.660646) Item accuracy: 49238 / 51533 (0.9555) Instance accuracy: 852 / 1517 (0.5616) <BLANKLINE> ============== iteration ***** Epoch #2 ***** Loss: 31176.026308 Feature L2-norm: 32.274598 Learning rate (eta): 0.022727 Total number of feature updates: 16646 Seconds required for this iteration: 0.466 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (708, 1018, 1084) (0.6955, 0.6531, 0.6736) O: (45101, 45611, 45355) (0.9888, 0.9944, 0.9916) B-ORG: (1053, 1711, 1400) (0.6154, 0.7521, 0.6770) B-PER: (594, 777, 735) (0.7645, 0.8082, 0.7857) I-PER: (589, 778, 634) (0.7571, 0.9290, 0.8343) B-MISC: (94, 264, 339) (0.3561, 0.2773, 0.3118) I-ORG: (384, 468, 1104) (0.8205, 0.3478, 0.4885) I-LOC: (166, 285, 325) (0.5825, 0.5108, 0.5443) I-MISC: (210, 621, 557) (0.3382, 0.3770, 0.3565) Macro-average precision, recall, F1: (0.657608, 0.627752, 0.629257) Item accuracy: 48899 / 51533 (0.9489) Instance accuracy: 813 / 1517 (0.5359) <BLANKLINE> ============== iteration ***** Epoch #3 ***** Loss: 23705.719839 Feature L2-norm: 35.255014 Learning rate (eta): 0.021739 Total number of feature updates: 24969 Seconds required for this iteration: 0.472 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (808, 1210, 1084) (0.6678, 0.7454, 0.7044) O: (45244, 45771, 45355) (0.9885, 0.9976, 0.9930) B-ORG: (1061, 1403, 1400) (0.7562, 0.7579, 0.7570) B-PER: (588, 728, 735) (0.8077, 0.8000, 0.8038) I-PER: (565, 640, 634) (0.8828, 0.8912, 0.8870) B-MISC: (86, 130, 339) (0.6615, 0.2537, 0.3667) I-ORG: (857, 1148, 1104) (0.7465, 0.7763, 0.7611) I-LOC: (152, 282, 325) (0.5390, 0.4677, 0.5008) I-MISC: (170, 221, 557) (0.7692, 0.3052, 0.4370) Macro-average precision, recall, F1: (0.757699, 0.666091, 0.690108) Item accuracy: 49531 / 51533 (0.9612) Instance accuracy: 889 / 1517 (0.5860) <BLANKLINE> ============== iteration ***** Epoch #4 ***** Loss: 21273.137466 Feature L2-norm: 37.985723 Learning rate (eta): 0.020833 Total number of feature updates: 33292 Seconds required for this iteration: 0.468 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (848, 1276, 1084) (0.6646, 0.7823, 0.7186) O: (44212, 44389, 45355) (0.9960, 0.9748, 0.9853) B-ORG: (784, 896, 1400) (0.8750, 0.5600, 0.6829) B-PER: (582, 686, 735) (0.8484, 0.7918, 0.8191) I-PER: (570, 647, 634) (0.8810, 0.8991, 0.8899) B-MISC: (166, 619, 339) (0.2682, 0.4897, 0.3466) I-ORG: (152, 155, 1104) (0.9806, 0.1377, 0.2415) I-LOC: (138, 219, 325) (0.6301, 0.4246, 0.5074) I-MISC: (467, 2646, 557) (0.1765, 0.8384, 0.2916) Macro-average precision, recall, F1: (0.702269, 0.655374, 0.609212) Item accuracy: 47919 / 51533 (0.9299) Instance accuracy: 793 / 1517 (0.5227) <BLANKLINE> ============== iteration ***** Epoch #5 ***** Loss: 20806.661564 Feature L2-norm: 40.673070 Learning rate (eta): 0.020000 Total number of feature updates: 41615 Seconds required for this iteration: 0.460 Performance by label (#match, #model, #ref) (precision, recall, F1): B-LOC: (689, 892, 1084) (0.7724, 0.6356, 0.6974) O: (45171, 45556, 45355) (0.9915, 0.9959, 0.9937) B-ORG: (1214, 1931, 1400) (0.6287, 0.8671, 0.7289) B-PER: (529, 574, 735) (0.9216, 0.7197, 0.8083) I-PER: (520, 553, 634) (0.9403, 0.8202, 0.8762) B-MISC: (77, 96, 339) (0.8021, 0.2271, 0.3540) I-ORG: (1009, 1678, 1104) (0.6013, 0.9139, 0.7254) I-LOC: (126, 182, 325) (0.6923, 0.3877, 0.4970) I-MISC: (57, 71, 557) (0.8028, 0.1023, 0.1815) Macro-average precision, recall, F1: (0.794790, 0.629970, 0.651378) Item accuracy: 49392 / 51533 (0.9585) Instance accuracy: 885 / 1517 (0.5834) <BLANKLINE> ============== iteration SGD terminated with the maximum number of iterations Loss: 20806.661564 Total seconds required for training: 3.350 <BLANKLINE> ============== optimization_end Storing the model Number of active features: 96180 (96180) Number of active attributes: 76691 (83593) Number of active labels: 9 (9) Writing labels Writing attributes Writing feature references for transitions Writing feature references for attributes Seconds required: 0.329 <BLANKLINE> ============== end """ pass def test_parser_log4(): """ >>> parser = TrainLogParser() >>> _apply_parser(parser, log4) Feature generation ============== start <BLANKLINE> Number of features: 0 Seconds required: 0.001 ============== featgen_end <BLANKLINE> L-BFGS optimization c1: 0.000000 c2: 1.000000 num_memories: 6 max_iterations: 2147483647 epsilon: 0.000010 stop: 10 delta: 0.000010 linesearch: MoreThuente linesearch.max_iterations: 20 <BLANKLINE> L-BFGS terminated with error code (-1020) ============== prepare_error Total seconds required for training: 0.000 <BLANKLINE> ============== optimization_end Storing the model Number of active features: 0 (0) Number of active attributes: 0 (0) Number of active labels: 0 (0) Writing labels Writing attributes Writing feature references for transitions Writing feature references for attributes Seconds required: 0.000 <BLANKLINE> ============== end """ pass
37.508455
77
0.538173
4,922
33,270
3.62373
0.118854
0.053824
0.043059
0.071765
0.849238
0.792667
0.712492
0.601312
0.585277
0.5744
0
0.275579
0.241208
33,270
886
78
37.55079
0.430937
0.415209
0
0.487751
0
0.211581
0.739471
0.017455
0
0
0
0
0
1
0.011136
false
0.008909
0.004454
0
0.01559
0.006682
0
0
0
null
0
0
0
1
1
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7