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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
957d13445558ff15b8bc5d86f2288d452fe80cad | 103 | py | Python | tethys_data_models/__init__.py | tethys-ts/tethys-data-models | 2b051c71eeed8493c0f160f369884bd069437f67 | [
"Apache-2.0"
] | null | null | null | tethys_data_models/__init__.py | tethys-ts/tethys-data-models | 2b051c71eeed8493c0f160f369884bd069437f67 | [
"Apache-2.0"
] | null | null | null | tethys_data_models/__init__.py | tethys-ts/tethys-data-models | 2b051c71eeed8493c0f160f369884bd069437f67 | [
"Apache-2.0"
] | null | null | null | from tethys_data_models import permit, dataset, base
from tethys_data_models.utils import key_patterns
| 34.333333 | 52 | 0.873786 | 16 | 103 | 5.3125 | 0.6875 | 0.235294 | 0.329412 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097087 | 103 | 2 | 53 | 51.5 | 0.913978 | 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 | 1 | 0 | 0 | 8 |
95f565bbe3416e15371eb10ee9503573f63688fd | 166 | py | Python | kombu_stomp/utils.py | sp4x/kombu-stomp | 1d821d19cf0e303e5f6bc873b753b11a58d4c2ec | [
"BSD-3-Clause"
] | null | null | null | kombu_stomp/utils.py | sp4x/kombu-stomp | 1d821d19cf0e303e5f6bc873b753b11a58d4c2ec | [
"BSD-3-Clause"
] | null | null | null | kombu_stomp/utils.py | sp4x/kombu-stomp | 1d821d19cf0e303e5f6bc873b753b11a58d4c2ec | [
"BSD-3-Clause"
] | 1 | 2021-10-05T07:59:52.000Z | 2021-10-05T07:59:52.000Z | try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
try:
from unittest import mock
except ImportError:
import mock # noqa
| 16.6 | 32 | 0.716867 | 20 | 166 | 5.95 | 0.5 | 0.285714 | 0.386555 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008 | 0.246988 | 166 | 9 | 33 | 18.444444 | 0.944 | 0.054217 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
25028770fe7d3062da0e3d81b0a925c45b4d550d | 11,612 | py | Python | tests/endpoints/test_event_definition_endpoint.py | zconnect-iot/zconnect-django | 5c569f54f100e23d72e2ac4de795739ea461a431 | [
"MIT"
] | 2 | 2018-08-19T16:16:39.000Z | 2019-06-11T02:23:50.000Z | tests/endpoints/test_event_definition_endpoint.py | zconnect-iot/zconnect-django | 5c569f54f100e23d72e2ac4de795739ea461a431 | [
"MIT"
] | 2 | 2018-07-05T09:51:54.000Z | 2018-07-06T13:12:04.000Z | tests/endpoints/test_event_definition_endpoint.py | zconnect-iot/zconnect-django | 5c569f54f100e23d72e2ac4de795739ea461a431 | [
"MIT"
] | null | null | null | import pytest
from zconnect.models import EventDefinition
from zconnect.serializers import EventDefinitionSerializer
from zconnect.testutils.factories import (
DeviceEventDefinitionFactory, DeviceFactory, OrganizationFactory)
from zconnect.testutils.helpers import expect_detail, expect_list, expect_model
from zconnect.testutils.util import assert_successful_edit
class TestEventDefinitionEndpoint:
route = "/api/v3/devices/{device_id}/event_defs/{event_def_id}/"
def test_get_no_auth(self, testclient, fake_device_event_definition):
exp = expect_detail(401,"Authentication credentials were not provided.")
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.get_request_test_helper(exp, path_params=pp)
@pytest.mark.usefixtures("joeseed_login")
def test_get_authenticated(self, testclient, fake_device_event_definition):
expected = expect_model(200, fake_device_event_definition,
serializer=EventDefinitionSerializer)
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("joeseed_login")
def test_get_deleted(self, testclient, fake_device_event_definition):
fake_device_event_definition.deleted = True
fake_device_event_definition.save()
expected = expect_detail(404, "Not found.")
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.get_request_test_helper(expected, path_params=pp)
# Make sure it's still there, just marked as deleted
event_defs = EventDefinition.objects.all()
assert event_defs
assert event_defs[0].deleted == True
@pytest.mark.usefixtures("fredbloggs_login")
def test_get_wrong_user(self, testclient, fake_device_event_definition):
expected = expect_detail(404, "Not found.")
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("admin_login")
def test_get_admin(self, testclient, fake_device_event_definition):
expected = expect_model(200, fake_device_event_definition,
serializer=EventDefinitionSerializer)
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.device.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("admin_login")
def test_get_wrong_id(self, testclient, fake_device_event_definition):
expected = expect_detail(404, "Not found.")
pp = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": 123456
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("admin_login")
def test_update_admin(self, testclient, fake_device_event_definition):
params = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
assert_successful_edit(testclient,
fake_device_event_definition,
params,
"condition",
"a<b",
serializer=EventDefinitionSerializer)
@pytest.mark.usefixtures("joeseed_login")
def test_update(self, testclient, fake_device_event_definition):
params = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
assert_successful_edit(testclient,
fake_device_event_definition,
params,
"ref",
"newref",
serializer=EventDefinitionSerializer)
@pytest.mark.usefixtures("admin_login")
def test_delete_admin(self, testclient, fake_device_event_definition):
params = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.delete_request_test_helper(path_params=params)
ed = EventDefinition.objects.get(id=fake_device_event_definition.id)
assert ed.deleted == True
@pytest.mark.usefixtures("joeseed_login")
def test_delete(self, testclient, fake_device_event_definition):
params = {
"device_id": fake_device_event_definition.device.id,
"event_def_id": fake_device_event_definition.id
}
testclient.delete_request_test_helper(path_params=params)
ed = EventDefinition.objects.get(id=fake_device_event_definition.id)
assert ed.deleted == True
@pytest.mark.usefixtures("joeseed_login")
def test_put(self, testclient, fakedevice, fake_device_event_definition):
pp = {
"device_id": fakedevice.id,
"event_def_id": fake_device_event_definition.id
}
post_body = {
"enabled": False,
"ref": "test_email_ev_def:company",
"condition": "another_variable_2<another_value_2",
"actions": {"email": {"alert_text": "There is a problem again!"}},
"debounce_window": 300,
"scheduled": True,
"single_trigger": True,
}
expected = {
"status_code": 200,
"body": {**post_body, **{
"id": 1,
"created_at": None,
"updated_at": None,
"product": None,
}},
}
testclient.put_request_test_helper(post_body, expected, path_params=pp)
@pytest.mark.usefixtures("joeseed_login")
def test_patch(self, testclient, fakedevice, fake_device_event_definition):
pp = {
"device_id": fakedevice.id,
"event_def_id": fake_device_event_definition.id
}
post_body = {
"enabled": False,
"ref": "test_email_ev_def:company",
"condition": "another_variable_2<another_value_2",
"actions": {"email": {"alert_text": "There is a problem again!"}},
"debounce_window": 300,
"scheduled": True,
}
expected = {
"status_code": 200,
"body": {**post_body, **{
"id": 1,
"created_at": None,
"updated_at": None,
"product": None,
"single_trigger": False,
}},
}
testclient.patch_request_test_helper(post_body, expected,
path_params=pp)
class TestEventDefinitionsEndpoint:
route = "/api/v3/devices/{device_id}/event_defs/"
def test_get_no_auth(self, testclient, fake_device_event_definition):
expected = expect_detail(401, "Authentication credentials were not provided.")
pp = {
"device_id": fake_device_event_definition.device.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("joeseed_login")
def test_get_list(self, testclient, fake_device_event_definition):
expected = {
"status_code": 200,
"body": {
"count": 1,
"next": None,
"previous": None,
"results": [
EventDefinitionSerializer(fake_device_event_definition).data
]
}
}
pp = {
"device_id": fake_device_event_definition.device.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("joeseed_login")
def test_get_deleted(self, testclient, fake_device_event_definition):
fake_device_event_definition.deleted = True
fake_device_event_definition.save()
expected = {
"status_code": 200,
"body": {
"count": 0,
"next": None,
"previous": None,
"results": []
}
}
pp = {
"device_id": fake_device_event_definition.device.id
}
testclient.get_request_test_helper(expected, path_params=pp)
@pytest.mark.usefixtures("fredbloggs_login")
def test_get_by_reference(self, testclient, fredbloggs):
device = DeviceFactory()
event_def_1 = DeviceEventDefinitionFactory(device=device, product=None, ref="abcde")
event_def_2 = DeviceEventDefinitionFactory(device=device, product=None, ref="bcdef")
expected = expect_detail(404, "Not found.")
pp = {"device_id": device.id}
qp = {"ref": "abcde"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
group = OrganizationFactory()
device.orgs.add(group)
device.save()
# fredbloggs.orgs.add(group)
fredbloggs.add_org(group)
fredbloggs.save()
data_1 = EventDefinitionSerializer(event_def_1).data
data_2 = EventDefinitionSerializer(event_def_2).data
expected = expect_list(200, [data_1])
pp = {"device_id": device.id}
qp = {"ref": "abcde"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
expected = expect_list(200, [data_2])
qp = {"ref": "*ef"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
expected = expect_list(200, [data_2])
qp = {"ref": "bcdef"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
expected = expect_list(200, [data_1, data_2])
qp = {"ref": "*cd*"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
expected = expect_list(200, [])
qp = {"ref": "xyz"}
testclient.get_request_test_helper(expected, path_params=pp,
query_params=qp)
def test_post_event_definition(self, testclient, fakedevice, joeseed_login):
pp = {"device_id": fakedevice.id}
post_body = {
"enabled": True,
"ref": "test_email_ev_def:site",
"condition": "another_variable<another_value",
"actions": {"email": {"alert_text": "There is a problem!"}},
"debounce_window": 600,
"scheduled": False,
"single_trigger": False,
}
expected = {
"status_code": 201,
"body": {
**post_body,
"id": 1,
"created_at": None,
"updated_at": None,
"product": None,
},
}
testclient.post_request_test_helper(post_body, expected,
path_params=pp)
| 38.197368 | 92 | 0.597658 | 1,184 | 11,612 | 5.503378 | 0.124155 | 0.117403 | 0.115101 | 0.191835 | 0.817373 | 0.789134 | 0.761664 | 0.741713 | 0.714856 | 0.691222 | 0 | 0.011429 | 0.306752 | 11,612 | 303 | 93 | 38.323432 | 0.798012 | 0.006631 | 0 | 0.621622 | 0 | 0 | 0.127385 | 0.022806 | 0 | 0 | 0 | 0 | 0.027027 | 1 | 0.065637 | false | 0 | 0.023166 | 0 | 0.104247 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 7 |
2520dd7788e3d94c4a70786fcb533cc50c99f357 | 339 | py | Python | exercicios praticos/aula007.py | joseangelooliveira-br/Python3 | c0ba39768706f84f26b0616b75dd8c7971145b0e | [
"MIT"
] | null | null | null | exercicios praticos/aula007.py | joseangelooliveira-br/Python3 | c0ba39768706f84f26b0616b75dd8c7971145b0e | [
"MIT"
] | null | null | null | exercicios praticos/aula007.py | joseangelooliveira-br/Python3 | c0ba39768706f84f26b0616b75dd8c7971145b0e | [
"MIT"
] | null | null | null | nome = input('Digite seu nome:')
print('Prazer em conhece-lo {}!'.format(nome))
print('Prazer em conhece-lo {:20} !'.format(nome))
print('Prazer em conhece-lo {:>20} !'.format(nome))
print('Prazer em conhece-lo {:<20} !'.format(nome))
print('Prazer em conhece-lo {:^20} !'.format(nome))
print('Prazer em conhece-lo {:=^20} !'.format(nome)) | 48.428571 | 52 | 0.660767 | 52 | 339 | 4.307692 | 0.211538 | 0.241071 | 0.401786 | 0.455357 | 0.919643 | 0.919643 | 0.803571 | 0.803571 | 0.803571 | 0.803571 | 0 | 0.03268 | 0.097345 | 339 | 7 | 52 | 48.428571 | 0.699346 | 0 | 0 | 0 | 0 | 0 | 0.544118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.857143 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 11 |
2538ea559af5987a8bf004971d40d3cf86e86c10 | 33 | py | Python | Aulas de Python Mundo 1/Curso Python #11 - Cores no terminal - Part 3.py | ErikDMCosta/Meu-Reposit-rio-do-Curso-de-Python-Mundo-1 | 085662603d1fc1963ea25e4b08ba887adc59fecd | [
"MIT"
] | null | null | null | Aulas de Python Mundo 1/Curso Python #11 - Cores no terminal - Part 3.py | ErikDMCosta/Meu-Reposit-rio-do-Curso-de-Python-Mundo-1 | 085662603d1fc1963ea25e4b08ba887adc59fecd | [
"MIT"
] | null | null | null | Aulas de Python Mundo 1/Curso Python #11 - Cores no terminal - Part 3.py | ErikDMCosta/Meu-Reposit-rio-do-Curso-de-Python-Mundo-1 | 085662603d1fc1963ea25e4b08ba887adc59fecd | [
"MIT"
] | null | null | null | print('\033[1;31;43mOlá, Mundo!') | 33 | 33 | 0.666667 | 6 | 33 | 3.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0.030303 | 33 | 1 | 33 | 33 | 0.4375 | 0 | 0 | 0 | 0 | 0 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 8 |
25596ace90cfb2635a4c02cec3964a30bc606d41 | 92 | py | Python | recstudio/model/module/__init__.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | 1 | 2021-11-13T12:12:54.000Z | 2021-11-13T12:12:54.000Z | recstudio/model/module/__init__.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | null | null | null | recstudio/model/module/__init__.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | null | null | null | from recstudio.model.module.layers import *
from recstudio.model.module.aggregator import *
| 30.666667 | 47 | 0.826087 | 12 | 92 | 6.333333 | 0.583333 | 0.342105 | 0.473684 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 92 | 2 | 48 | 46 | 0.904762 | 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 | 1 | 0 | 0 | 8 |
2562752c938684676f8ab410292e9a29eafbf313 | 37,909 | py | Python | wflow/wflow/reservoir_Sa.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | wflow/wflow/reservoir_Sa.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | wflow/wflow/reservoir_Sa.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 04 14:52:30 2015
@author: teuser
"""
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 03 16:31:35 2014
@author: TEuser
List all function versions
"""
import pcraster as pcr
try:
from wflow.wf_DynamicFramework import *
except ImportError:
from .wf_DynamicFramework import *
from . import JarvisCoefficients
def selectSaR(i):
"""
not all functions are still in this file, the older functions can be found
(with the same numbering) in h:\My Documents\memo's\python scripts\wflow\
"""
if i == 1:
name = "agriZone_Jarvis"
elif i == 2:
name = "agriZone_Ep"
elif i == 3:
name = "agriZone_Ep_Sa"
elif i == 4:
name = "agriZone_Ep_Sa_cropG"
elif i == 5:
name = "agriZone_Ep_Sa_cropG_beta"
elif i == 6:
name = "agriZone_Ep_Sa_beta"
elif i == 7:
name = "agriZone_Ep_Sa_beta_frost"
elif i == 8:
name = "agriZone_Ep_Sa_beta_Fvar"
elif i == 9:
name = "agriZone_hourlyEp_Sa_beta_Fvar"
elif i == 10:
name = "agriZone_hourlyEp_Sa_beta_frost"
elif i == 11:
name = "agriZone_hourlyEp_Sa_beta_frostSamax"
elif i == 12:
name = "agriZone_Ep_Sa_beta_frostSamax"
elif i == 13:
name = "agriZone_Ep_Sa_beta_frostSamax_surfTemp"
return name
def agriZone_no_reservoir(self, k):
"""
This function is used when no unsaturated zone reservoir is used and only
passes fluxes from the upper reservoirs to the lower
self.Qa_[k] = 0.
self.Ea_[k] = 0.
self.Sa[k] = 0.
self.Fa_[k] = Pe
Storage in unsaturated zone = 0.
"""
self.Qa_[k] = 0.0
self.Ea_[k] = 0.0
self.Sa[k] = 0.0
self.Fa_[k] = pcr.max(self.Pe_[k], 0)
self.wbSa_[k] = (
self.Pe_[k]
- self.Ea_[k]
- self.Qa_[k]
- self.Fa_[k]
- self.Sa[k]
+ self.Sa_t[k]
)
def agriZone_Jarvis(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on Jarvis stress functions
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa
- Code for ini-file: 1
"""
self.Qa = pcr.max(self.Pe - (self.samax[k] - self.Sa_t[k]), 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
JarvisCoefficients.calcEu(
self, k, 1
) # calculation of Ea based on Jarvis stress functions
self.Ea1 = self.Eu
self.Fa1 = self.Fmin[k] + (self.Fmax[k] - self.Fmin[k]) * e ** (
-self.decF[k] * self.SuN
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Fa = (
self.Fa1
+ (self.Fa1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (self.Ea1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Ea - self.Fa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = self.Pe - self.Ea - self.Qa - self.Fa - self.Sa[k] + self.Sa_t[k]
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa
self.Fa_[k] = self.Fa
def agriZone_Ep(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa
- Code for ini-file: 2
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.Qa = pcr.max(self.Pe - (self.samax[k] - self.Sa_t[k]), 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax[k] * self.LP[k]), 1
)
self.Fa1 = self.Fmin[k] + (self.Fmax[k] - self.Fmin[k]) * e ** (
-self.decF[k] * self.SuN
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Fa = (
self.Fa1
+ (self.Fa1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (self.Ea1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Ea - self.Fa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = self.Pe - self.Ea - self.Qa - self.Fa - self.Sa[k] + self.Sa_t[k]
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa
self.Fa_[k] = self.Fa
def agriZone_Ep_Sa(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa
- Fa is based on storage in Sa
- Code for ini-file: 3
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.Qa = pcr.max(self.Pe - (self.samax[k] - self.Sa_t[k]), 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax[k] * self.LP[k]), 1
)
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Fa = (
self.Fa1
+ (self.Fa1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (self.Ea1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Ea - self.Fa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = self.Pe - self.Ea - self.Qa - self.Fa - self.Sa[k] + self.Sa_t[k]
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa
self.Fa_[k] = self.Fa
def agriZone_Ep_Sa_cropG(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa
- Fa is based on storage in Sa
- Code for ini-file: 4
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.samax2 = self.samax[k] * self.cropG
self.Qaadd = pcr.max(self.Sa_t[k] - self.samax2, 0)
self.Qa = pcr.max(self.Pe - (self.samax2 - self.Sa_t[k]), 0) + self.Qaadd
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Fa = (
self.Fa1
+ (self.Fa1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (self.Ea1 / pcr.ifthenelse(self.Fa1 + self.Ea1 > 0, self.Fa1 + self.Ea1, 1))
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qa) - self.Ea - self.Fa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = self.Pe - self.Ea - self.Qa - self.Fa - self.Sa[k] + self.Sa_t[k]
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa
self.Fa_[k] = self.Fa
def agriZone_Ep_Sa_cropG_beta(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Code for ini-file: 5
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.samax2 = self.samax[k] * self.cropG
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
def agriZone_Ep_Sa_beta(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Code for ini-file: 6
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(pcr.max(self.Sa[k] / self.samax2, 0), 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
def agriZone_hourlyEp_Sa_beta(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Code for ini-file:
"""
# JarvisCoefficients.calcEp(self,k)
# self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0),0)
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(pcr.max(self.Sa[k] / self.samax2, 0), 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
def agriZone_Ep_Sa_beta_frost(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Fa is decreased in case of frozen soil
- Code for ini-file: 7
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = self.EpHour
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.FrDur[k] = pcr.min(
self.FrDur[k]
+ (self.Tmean - 273.15) / 86400 * self.timestepsecs * self.dayDeg[k],
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Ft = pcr.min(
pcr.max(
self.FrDur[k] / (self.FrDur1[k] - self.FrDur0[k])
- self.FrDur0[k] / (self.FrDur1[k] - self.FrDur0[k]),
0,
),
1,
)
self.Fa1 = self.Ft * pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
self.Ft_[k] = self.Ft
def agriZone_hourlyEp_Sa_beta_frost(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Fa is decreased in case of frozen soil
- Code for ini-file: 10
"""
# JarvisCoefficients.calcEp(self,k)
# self.PotEvaporation = self.EpHour
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.FrDur[k] = pcr.min(
self.FrDur[k] + (self.Temperature) / 86400 * self.timestepsecs * self.dayDeg[k],
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Ft = pcr.min(
pcr.max(
self.FrDur[k] / (self.FrDur1[k] - self.FrDur0[k])
- self.FrDur0[k] / (self.FrDur1[k] - self.FrDur0[k]),
0,
),
1,
)
self.Fa1 = self.Ft * pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
self.Ft_[k] = self.Ft
def agriZone_hourlyEp_Sa_beta_frostSamax(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Fa is decreased in case of frozen soil
- Code for ini-file: 11
"""
# JarvisCoefficients.calcEp(self,k)
# self.PotEvaporation = self.EpHour
self.FrDur[k] = pcr.min(self.FrDur[k] + (self.Temperature) * self.dayDeg[k], 0)
self.Ft = pcr.min(
pcr.max(
self.FrDur[k] / (self.FrDur1[k] - self.FrDur0[k])
- self.FrDur0[k] / (self.FrDur1[k] - self.FrDur0[k]),
0.1,
),
1,
)
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea) * self.Ft
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * pcr.exp((-self.decF[k] * (1 - self.SaN))),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
self.Ft_[k] = self.Ft
def agriZone_Ep_Sa_beta_frostSamax(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Fa is decreased in case of frozen soil
- Code for ini-file: 12
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = pcr.cover(pcr.ifthenelse(self.EpHour >= 0, self.EpHour, 0), 0)
self.FrDur[k] = pcr.min(
self.FrDur[k]
+ pcr.ifthenelse(
self.Temperature > 0, self.ratFT[k] * self.Temperature, self.Temperature
)
* self.dayDeg[k],
0,
)
self.Ft = pcr.min(
pcr.max(
self.FrDur[k] / (self.FrDur1[k] - self.FrDur0[k])
- self.FrDur0[k] / (self.FrDur1[k] - self.FrDur0[k]),
self.samin[k],
),
1,
)
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea) * self.Ft
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
self.Ft_[k] = self.Ft
def agriZone_Ep_Sa_beta_frostSamax_surfTemp(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Fa is decreased in case of frozen soil
- Code for ini-file: 13
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = self.EpHour
self.FrDur[k] = pcr.min(
self.FrDur[k]
+ pcr.ifthenelse(
self.TempSurf > 0, self.ratFT[k] * self.TempSurf, self.TempSurf
)
* self.dayDeg[k],
0,
)
self.Ft = pcr.min(
pcr.max(
self.FrDur[k] / (self.FrDur1[k] - self.FrDur0[k])
- self.FrDur0[k] / (self.FrDur1[k] - self.FrDur0[k]),
self.samin[k],
),
1,
)
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea) * self.Ft
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
self.Ft_[k] = self.Ft
def agriZone_Ep_Sa_beta_Fvar(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Code for ini-file: 8
"""
JarvisCoefficients.calcEp(self, k)
self.PotEvaporation = self.EpHour
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = self.cropG * pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
def agriZone_hourlyEp_Sa_beta_Fvar(self, k):
"""
- Potential evaporation is decreased by energy used for interception evaporation
- Formula for evaporation based on LP
- Outgoing fluxes are determined based on (value in previous timestep + inflow)
and if this leads to negative storage, the outgoing fluxes are corrected to rato --> Eu is
no longer taken into account for this correction
- Qa u is determined from overflow from Sa --> incorporation of beta function
- Fa is based on storage in Sa
- Code for ini-file: 9
"""
# JarvisCoefficients.calcEp(self,k)
# self.PotEvaporation = self.EpHour
self.samax2 = self.samax[k] * pcr.scalar(self.catchArea)
self.Qaadd = pcr.max(self.Sa_t[k] + self.Pe - self.samax2, 0)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd)
self.SaN = pcr.min(self.Sa[k] / self.samax2, 1)
self.SuN = self.Su[k] / self.sumax[k]
self.Ea1 = pcr.max((self.PotEvaporation - self.Ei), 0) * pcr.min(
self.Sa[k] / (self.samax2 * self.LP[k]), 1
)
self.Qa1 = (self.Pe - self.Qaadd) * (1 - (1 - self.SaN) ** self.beta[k])
self.Fa1 = self.cropG * pcr.ifthenelse(
self.SaN > 0,
self.Fmin[k]
+ (self.Fmax[k] - self.Fmin[k]) * e ** (-self.decF[k] * (1 - self.SaN)),
0,
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Qa1 - self.Fa1 - self.Ea1
self.Sa_diff = pcr.ifthenelse(self.Sa[k] < 0, self.Sa[k], 0)
self.Qa = (
self.Qa1
+ (
self.Qa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Fa = (
self.Fa1
+ (
self.Fa1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Ea = (
self.Ea1
+ (
self.Ea1
/ pcr.ifthenelse(
self.Fa1 + self.Ea1 + self.Qa1 > 0, self.Fa1 + self.Ea1 + self.Qa1, 1
)
)
* self.Sa_diff
)
self.Sa[k] = self.Sa_t[k] + (self.Pe - self.Qaadd) - self.Ea - self.Fa - self.Qa
self.Sa[k] = pcr.ifthenelse(self.Sa[k] < 0, 0, self.Sa[k])
self.Sa_diff2 = pcr.ifthen(self.Sa[k] < 0, self.Sa[k])
self.wbSa_[k] = (
self.Pe - self.Ea - self.Qa - self.Qaadd - self.Fa - self.Sa[k] + self.Sa_t[k]
)
self.Ea_[k] = self.Ea
self.Qa_[k] = self.Qa + self.Qaadd
self.Fa_[k] = self.Fa
| 32.907118 | 95 | 0.553589 | 5,737 | 37,909 | 3.60502 | 0.033816 | 0.087999 | 0.062276 | 0.059569 | 0.960062 | 0.940721 | 0.935645 | 0.934919 | 0.933034 | 0.933034 | 0 | 0.031262 | 0.296262 | 37,909 | 1,151 | 96 | 32.935708 | 0.743984 | 0.199399 | 0 | 0.737725 | 0 | 0 | 0.010786 | 0.008115 | 0 | 0 | 0 | 0 | 0 | 1 | 0.019162 | false | 0 | 0.005988 | 0 | 0.026347 | 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 |
25666c86e7814ef0d37390ae24705de687bbc212 | 4,188 | py | Python | movies/tests/mock_data.py | avirepo/sendder_assignment | 0033b00e091c860e196851dbf925c820ec7ba0f0 | [
"Unlicense"
] | null | null | null | movies/tests/mock_data.py | avirepo/sendder_assignment | 0033b00e091c860e196851dbf925c820ec7ba0f0 | [
"Unlicense"
] | null | null | null | movies/tests/mock_data.py | avirepo/sendder_assignment | 0033b00e091c860e196851dbf925c820ec7ba0f0 | [
"Unlicense"
] | null | null | null | FILMS = [
{
"id": "2baf70d1-42bb-4437-b551-e5fed5a87abe",
"title": "Castle in the Sky",
"description": "The orphan Sheeta inherited a mysterious ",
"director": "Hayao Miyazaki",
"producer": "Isao Takahata",
"release_date": "1986",
"rt_score": "95",
"people": [
"https://ghibliapi.herokuapp.com/people/"
],
"species": [
"https://ghibliapi.herokuapp.com/species/af3910a6-429f"
"-4c74-9ad5-dfe1c4aa04f2"
],
"locations": [
"https://ghibliapi.herokuapp.com/locations/"
],
"vehicles": [
"https://ghibliapi.herokuapp.com/vehicles/"
],
"url": "https://ghibliapi.herokuapp.com/films/2baf70d1-42bb"
"-4437-b551-e5fed5a87abe"
}
]
PEOPLE = [
{
"id": "fe93adf2-2f3a-4ec4-9f68-5422f1b87c01",
"name": "Pazu",
"gender": "Male",
"age": "13",
"eye_color": "Black",
"hair_color": "Brown",
"films": [
"https://ghibliapi.herokuapp.com/films/2baf70d1-42bb"
"-4437-b551-e5fed5a87abe",
"https://ghibliapi.herokuapp.com/films/2baf70d1-42bb"
"-4437-b551-e5fed5a87abe"
],
"species": "https://ghibliapi.herokuapp.com/species"
"/af3910a6-429f-4c74-9ad5-dfe1c4aa04f2",
"url": "https://ghibliapi.herokuapp.com/people/fe93adf2"
"-2f3a-4ec4-9f68-5422f1b87c01"
},
{
"id": "598f7048-74ff-41e0-92ef-87dc1ad980a9",
"name": "Lusheeta Toel Ul Laputa",
"gender": "Female",
"age": "13",
"eye_color": "Black",
"hair_color": "Black",
"films": [
"https://ghibliapi.herokuapp.com/films/2baf70d1-42bb"
"-4437-b551-e5fed5a87abe"
],
"species": "https://ghibliapi.herokuapp.com/species"
"/af3910a6-429f-4c74-9ad5-dfe1c4aa04f2",
"url": "https://ghibliapi.herokuapp.com/people/598f7048"
"-74ff-41e0-92ef-87dc1ad980a9"
}
]
PEOPLE_FILM_MAP = {
'2baf70d1-42bb-4437-b551-e5fed5a87abe': [{
"people_id":
"598f7048-74ff-41e0-92ef-87dc1ad980a9",
"name": "Lusheeta "
"Toel Ul "
"Laputa",
"gender": "Female",
"age": "13",
"hair_color": "Black",
"species": "https://ghibliapi.herokuapp.com/species"
"/af3910a6-429f-4c74-9ad5-dfe1c4aa04f2"
},
{
"people_id": "fe93adf2-2f3a-4ec4-9f68-5422f1b87c01",
"name": "Pazu",
"gender": "Male",
"age": "13",
"hair_color": "Brown",
"species": "https://ghibliapi.herokuapp.com/species"
"/af3910a6-429f-4c74-9ad5-dfe1c4aa04f2"
}
]
}
MOVIE_DATA = [
{
'id': '2baf70d1-42bb-4437-b551-e5fed5a87abe',
'title': 'Castle in the Sky',
'description': 'The orphan Sheeta inherited a '
'mysterious ',
'director': 'Hayao Miyazaki',
'producer': 'Isao Takahata', 'release_date': '1986',
'rt_score': '95', 'people': [
"{'people_id': '598f7048-74ff-41e0-92ef-87dc1ad980a9', "
"'name': 'Lusheeta Toel Ul Laputa', 'gender': 'Female', "
"'age': '13', 'hair_color': 'Black', 'species': "
"'https://ghibliapi.herokuapp.com/species/af3910a6-429f"
"-4c74-9ad5-dfe1c4aa04f2'}",
"{'people_id': 'fe93adf2-2f3a-4ec4-9f68-5422f1b87c01', "
"'name': 'Pazu', 'gender': 'Male', 'age': '13', "
"'hair_color': 'Brown', 'species': "
"'https://ghibliapi.herokuapp.com/species/af3910a6-429f"
"-4c74-9ad5-dfe1c4aa04f2'}"
],
'species': [
'https://ghibliapi.herokuapp.com/species'
'/af3910a6-429f-4c74-9ad5-dfe1c4aa04f2'],
'locations': [
'https://ghibliapi.herokuapp.com/locations/'],
'vehicles': [
'https://ghibliapi.herokuapp.com/vehicles/'],
'url': 'https://ghibliapi.herokuapp.com/films/2baf70d1-42bb'
'-4437-b551-e5fed5a87abe'
}
]
| 34.61157 | 68 | 0.525072 | 376 | 4,188 | 5.797872 | 0.196809 | 0.12844 | 0.211009 | 0.238532 | 0.983028 | 0.938991 | 0.938991 | 0.904128 | 0.904128 | 0.904128 | 0 | 0.158254 | 0.299904 | 4,188 | 120 | 69 | 34.9 | 0.585266 | 0 | 0 | 0.350427 | 0 | 0 | 0.603152 | 0.181232 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
c2526832d8df44d37510fbde3b652ba322ab6cee | 2,599 | py | Python | tests/test_mmlab_jwt_vc.py | BasileiosKal/py-verifier | 6614bdc515f823245762c0250de429a27c39e203 | [
"MIT"
] | null | null | null | tests/test_mmlab_jwt_vc.py | BasileiosKal/py-verifier | 6614bdc515f823245762c0250de429a27c39e203 | [
"MIT"
] | null | null | null | tests/test_mmlab_jwt_vc.py | BasileiosKal/py-verifier | 6614bdc515f823245762c0250de429a27c39e203 | [
"MIT"
] | 2 | 2022-01-17T11:08:27.000Z | 2022-01-28T09:50:10.000Z | import pytest
import requests
import json
'''
Tests VCs issued by https://issuer.mmlab.edu.gr
'''
class TestJWT:
def test_valid_authorization_get(self):
token = "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2lzc3Vlci5tbWxhYi5lZHUuZ3IiLCJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vbW0uYXVlYi5nci9jb250ZXh0cy9jYXBhYmlsaXRpZXMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkNhcGFiaWxpdGllc0NyZWRlbnRpYWwiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiY2FwYWJpbGl0aWVzIjp7IkNsb3VkIHN0b3JhZ2UiOlsiRkxfUkVBRCJdfX19fQ.wlgCx4P3bhrJqBeV5e186kdfFwWCRR5goo5GRdJxSF1ui5vlEW60FedJHV_PY4SBBn3RS63-yeyfPuOuj1j9lw"
headers = {'Authorization':'Bearer ' + token, 'Accept': 'application/json'}
response = requests.get("http://localhost:9000/mmlab/jwt-vc", headers = headers)
print(response.text)
assert(response.status_code == 200)
def test_valid_authorization_with_pem_get(self):
token = "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2lzc3Vlci5tbWxhYi5lZHUuZ3IiLCJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vbW0uYXVlYi5nci9jb250ZXh0cy9jYXBhYmlsaXRpZXMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkNhcGFiaWxpdGllc0NyZWRlbnRpYWwiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiY2FwYWJpbGl0aWVzIjp7IkNsb3VkIHN0b3JhZ2UiOlsiRkxfUkVBRCJdfX19fQ.wlgCx4P3bhrJqBeV5e186kdfFwWCRR5goo5GRdJxSF1ui5vlEW60FedJHV_PY4SBBn3RS63-yeyfPuOuj1j9lw"
headers = {'Authorization':'Bearer ' + token, 'Accept': 'application/json'}
response = requests.get("http://localhost:9000/mmlab/jwt-vc-pem", headers = headers)
print(response.text)
assert(response.status_code == 200)
def test_valid_authorization_post(self):
token = "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2lzc3Vlci5tbWxhYi5lZHUuZ3IiLCJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vbW0uYXVlYi5nci9jb250ZXh0cy9jYXBhYmlsaXRpZXMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkNhcGFiaWxpdGllc0NyZWRlbnRpYWwiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiY2FwYWJpbGl0aWVzIjp7IkNsb3VkIHN0b3JhZ2UiOlsiRkxfUkVBRCJdfX19fQ.wlgCx4P3bhrJqBeV5e186kdfFwWCRR5goo5GRdJxSF1ui5vlEW60FedJHV_PY4SBBn3RS63-yeyfPuOuj1j9lw"
headers = {'Authorization':'Bearer ' + token, 'Accept': 'application/json', 'Content-Type': 'application/json'}
data = {'on': False}
response = requests.post("http://localhost:9000/mmlab/jwt-vc", headers = headers, data = json.dumps(data))
print(response.text)
assert(response.status_code == 200)
| 83.83871 | 500 | 0.839169 | 145 | 2,599 | 14.924138 | 0.358621 | 0.027726 | 0.016636 | 0.034658 | 0.908503 | 0.908503 | 0.908503 | 0.908503 | 0.869224 | 0.869224 | 0 | 0.096692 | 0.092728 | 2,599 | 30 | 501 | 86.633333 | 0.821035 | 0 | 0 | 0.478261 | 0 | 0 | 0.671384 | 0.568396 | 0 | 0 | 0 | 0 | 0.130435 | 1 | 0.130435 | false | 0 | 0.130435 | 0 | 0.304348 | 0.130435 | 0 | 0 | 1 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
c295effa0ca4ed68686d46a935f2624a53f59e17 | 2,699 | py | Python | scraper/src/tests/default_strategy/get_anchor_test.py | mikiec84/docsearch-scraper | 08aa90ee9bf91b3e5e3e0d383e4d1b4d284c56b8 | [
"MIT"
] | 1 | 2020-11-09T21:06:27.000Z | 2020-11-09T21:06:27.000Z | scraper/src/tests/default_strategy/get_anchor_test.py | mikiec84/docsearch-scraper | 08aa90ee9bf91b3e5e3e0d383e4d1b4d284c56b8 | [
"MIT"
] | 4 | 2021-03-31T19:59:26.000Z | 2022-03-02T15:02:55.000Z | scraper/src/tests/default_strategy/get_anchor_test.py | gaybro8777/docsearch-scraper | 08aa90ee9bf91b3e5e3e0d383e4d1b4d284c56b8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import lxml.html
from .abstract import get_strategy
from ...strategies.anchor import Anchor
class TestGetAnchor:
def test_name_on_heading(self):
# Given
strategy = get_strategy()
strategy.dom = lxml.html.fromstring("""
<html><body>
<h1>Foo</h1>
<h2 name="bar">Bar</h2>
<h3>Baz</h3>
</body></html>
""")
level = 'lvl1'
element = strategy.select(strategy.config.selectors['default'][level]['selector'])[0]
# When
actual = Anchor.get_anchor(element)
# Then
assert actual == 'bar'
def test_id_not_in_a_direct_parent(self):
strategy = get_strategy()
strategy.dom = lxml.html.fromstring("""
<div>
<a id="bar"></a>
<div>
<div>
<h2>Bar</h2>
</div>
</div>
</div>
""")
level = 'lvl1'
element = strategy.select(strategy.config.selectors['default'][level]['selector'])[0]
# When
actual = Anchor.get_anchor(element)
# Then
assert actual == 'bar'
def test_id_on_heading(self):
# Given
strategy = get_strategy()
strategy.dom = lxml.html.fromstring("""
<html><body>
<h1>Foo</h1>
<h2 id="bar">Bar</h2>
<h3>Baz</h3>
</body></html>
""")
level = 'lvl1'
element = strategy.select(strategy.config.selectors['default'][level]['selector'])[0]
# When
actual = Anchor.get_anchor(element)
# Then
assert actual == 'bar'
def test_anchor_in_subelement(self):
# Given
strategy = get_strategy()
strategy.dom = lxml.html.fromstring("""
<html><body>
<h1>Foo</h1>
<h2><a href="#" name="bar">Bar</a><span></span></h2>
<h3>Baz</h3>
</body></html>
""")
level = 'lvl1'
element = strategy.select(strategy.config.selectors['default'][level]['selector'])[0]
# When
actual = Anchor.get_anchor(element)
# Then
assert actual == 'bar'
def test_no_anchor(self):
# Given
strategy = get_strategy()
strategy.dom = lxml.html.fromstring("""
<html><body>
<h1>Foo</h1>
<h2>Bar</h2>
<h3>Baz</h3>
</body></html>
""")
level = 'lvl2'
element = strategy.select(strategy.config.selectors['default'][level]['selector'])[0]
# When
actual = Anchor.get_anchor(element)
# Then
assert actual is None
| 25.462264 | 93 | 0.502779 | 281 | 2,699 | 4.729537 | 0.202847 | 0.036117 | 0.071482 | 0.10158 | 0.823928 | 0.823928 | 0.823928 | 0.823928 | 0.768999 | 0.768999 | 0 | 0.020916 | 0.344572 | 2,699 | 105 | 94 | 25.704762 | 0.730356 | 0.035198 | 0 | 0.791667 | 0 | 0 | 0.332689 | 0.01391 | 0 | 0 | 0 | 0 | 0.069444 | 1 | 0.069444 | false | 0 | 0.041667 | 0 | 0.125 | 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 |
6c2a058326fe621dc5e18f3e86770d0b27c1aa28 | 5,754 | py | Python | test/test_load.py | absperf/python-req | b003f36eff3c940ec0e3d30c823508db6ea106d7 | [
"MIT"
] | null | null | null | test/test_load.py | absperf/python-req | b003f36eff3c940ec0e3d30c823508db6ea106d7 | [
"MIT"
] | null | null | null | test/test_load.py | absperf/python-req | b003f36eff3c940ec0e3d30c823508db6ea106d7 | [
"MIT"
] | null | null | null | import unittest
import ucbreq
from collections import OrderedDict
class LoadTest(unittest.TestCase):
def test_loads_default(self):
d = OrderedDict()
d['foo'] = 'bar'
d['baz'] = ['alpha', 'beta', 'gamma']
d['delta'] = 'eins'
d['zwei'] = ['drei', 'vier']
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_5|alpha\nbaz_6|beta\nbaz_7|gamma\ndelta|eins\nzwei_5|drei\nzwei_6|vier\n",
cls=OrderedDict,
))
self.assertEqual(
d,
ucbreq.loads(
"foo=bar\nbaz_1=alpha\nbaz_2=beta\nbaz_3=gamma\ndelta=eins\nzwei_1=drei\nzwei_2=vier\n",
cls=OrderedDict,
separator='=',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz,1|alpha\nbaz,2|beta\nbaz,3|gamma\ndelta|eins\nzwei,1|drei\nzwei,2|vier\n",
cls=OrderedDict,
index_separator=',',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_1|alpha\ndelta|eins\nbaz_3|gamma\nzwei_1|vier\nbaz_2|beta\nzwei|drei\n",
cls=OrderedDict,
))
def test_loads_tuple(self):
d = OrderedDict()
d['foo'] = 'bar'
d['baz'] = ('alpha', 'beta', 'gamma')
d['delta'] = 'eins'
d['zwei'] = ('drei', 'vier')
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_5|alpha\nbaz_6|beta\nbaz_7|gamma\ndelta|eins\nzwei_5|drei\nzwei_6|vier\n",
cls=OrderedDict,
list_cls=tuple,
))
self.assertEqual(
d,
ucbreq.loads(
"foo=bar\nbaz_1=alpha\nbaz_2=beta\nbaz_3=gamma\ndelta=eins\nzwei_1=drei\nzwei_2=vier\n",
cls=OrderedDict,
list_cls=tuple,
separator='=',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz,1|alpha\nbaz,2|beta\nbaz,3|gamma\ndelta|eins\nzwei,1|drei\nzwei,2|vier\n",
cls=OrderedDict,
list_cls=tuple,
index_separator=',',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_1|alpha\ndelta|eins\nbaz_3|gamma\nzwei_1|vier\nbaz_2|beta\nzwei|drei\n",
cls=OrderedDict,
list_cls=tuple,
))
def test_loads_set(self):
d = OrderedDict()
d['foo'] = 'bar'
d['baz'] = frozenset({'alpha', 'beta', 'gamma'})
d['delta'] = 'eins'
d['zwei'] = frozenset({'drei', 'vier'})
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_5|alpha\nbaz_6|beta\nbaz_7|gamma\ndelta|eins\nzwei_5|drei\nzwei_6|vier\n",
cls=OrderedDict,
list_cls=frozenset,
))
self.assertEqual(
d,
ucbreq.loads(
"foo=bar\nbaz_1=alpha\nbaz_2=beta\nbaz_3=gamma\ndelta=eins\nzwei_1=drei\nzwei_2=vier\n",
cls=OrderedDict,
list_cls=frozenset,
separator='=',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz,1|alpha\nbaz,2|beta\nbaz,3|gamma\ndelta|eins\nzwei,1|drei\nzwei,2|vier\n",
cls=OrderedDict,
list_cls=frozenset,
index_separator=',',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_1|alpha\ndelta|eins\nbaz_3|gamma\nzwei_1|vier\nbaz_2|beta\nzwei|drei\n",
cls=OrderedDict,
list_cls=frozenset,
))
def test_loads_bytes(self):
d = OrderedDict()
d[b'foo'] = b'bar'
d[b'baz'] = [b'alpha', b'beta', b'gamma']
d[b'delta'] = b'eins'
d[b'zwei'] = [b'drei', b'vier']
self.assertEqual(
d,
ucbreq.loads(
b"foo|bar\nbaz_5|alpha\nbaz_6|beta\nbaz_7|gamma\ndelta|eins\nzwei_5|drei\nzwei_6|vier\n",
cls=OrderedDict,
))
self.assertEqual(
d,
ucbreq.loads(
b"foo=bar\nbaz_1=alpha\nbaz_2=beta\nbaz_3=gamma\ndelta=eins\nzwei_1=drei\nzwei_2=vier\n",
cls=OrderedDict,
separator=b'=',
))
self.assertEqual(
d,
ucbreq.loads(
b"foo|bar\nbaz,1|alpha\nbaz,2|beta\nbaz,3|gamma\ndelta|eins\nzwei,1|drei\nzwei,2|vier\n",
cls=OrderedDict,
index_separator=b',',
))
def test_loads_unicode(self):
d = OrderedDict()
d['foo'] = 'bar'
d['baz'] = ['alpha', 'beta', 'gamma']
d['delta'] = 'eins'
d['zwei'] = ['drei', 'vier']
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz_5|alpha\nbaz_6|beta\nbaz_7|gamma\ndelta|eins\nzwei_5|drei\nzwei_6|vier\n",
cls=OrderedDict,
))
self.assertEqual(
d,
ucbreq.loads(
"foo=bar\nbaz_1=alpha\nbaz_2=beta\nbaz_3=gamma\ndelta=eins\nzwei_1=drei\nzwei_2=vier\n",
cls=OrderedDict,
separator='=',
))
self.assertEqual(
d,
ucbreq.loads(
"foo|bar\nbaz,1|alpha\nbaz,2|beta\nbaz,3|gamma\ndelta|eins\nzwei,1|drei\nzwei,2|vier\n",
cls=OrderedDict,
index_separator=',',
))
| 34.662651 | 105 | 0.480188 | 662 | 5,754 | 4.045317 | 0.070997 | 0.049291 | 0.107543 | 0.147872 | 0.901046 | 0.901046 | 0.894324 | 0.889096 | 0.868185 | 0.85773 | 0 | 0.024404 | 0.380431 | 5,754 | 165 | 106 | 34.872727 | 0.726788 | 0 | 0 | 0.8625 | 0 | 0.1125 | 0.304831 | 0.264859 | 0 | 0 | 0 | 0 | 0.1125 | 1 | 0.03125 | false | 0 | 0.01875 | 0 | 0.05625 | 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 |
6c81f4568ea1cba06574b9888b42a2d8afcaef18 | 7,456 | py | Python | todoes/forms.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | 1 | 2017-09-25T09:36:46.000Z | 2017-09-25T09:36:46.000Z | todoes/forms.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | 40 | 2015-05-29T11:25:15.000Z | 2015-08-13T10:28:17.000Z | todoes/forms.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# coding=<utf8>
#TODO: сделать английские формы
from django import forms
from todoes.models import Note, Resource, File, Person, Task, ProblemByWorker, ProblemByUser, Categories
# from tasks.todoes.models import Worker, Client
from django.contrib.auth.forms import UserCreationForm
from django.contrib.admin import widgets
RUS_PRIORITY_CHOICES = (
('1','Лазар/Борода/Мотя'),
('2','Если не сделать сейчас - огребём проблем потом'),
('3','Всё остальное'),
('4','В ближайшем будущем'),
('5','Когда время будет')
)
ENG_PRIORITY_CHOICES = (
('1','Lazar/Boroda/Motya'),
('2','Если не сделать сейчас - огребём проблем потом'),
('3','Всё остальное'),
('4','В ближайшем будущем'),
('5','Когда время будет')
)
inp_f=( '%d-%m-%Y %H:%M:%S', # '2006-10-25 14:30:59'
'%d-%m-%Y %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30'
'%d-%m-%Y', # '2006-10-25'
'%d/%m/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%d/%m/%Y %H:%M', # '10/25/2006 14:30'
'%d/%m/%Y', # '10/25/2006'
'%d.%m.%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%Y.%m.%d %H:%M:%S', # '2010/01/26 14:30:59'
'%d/%m/%y %H:%M:%S', # '10/25/06 14:30:59'
'%d/%m/%y %H:%M', # '10/25/06 14:30'
'%d/%m/%y', )
class NewTicketForm(forms.Form):
name = forms.CharField(max_length=140, label='Название заявки')
pbus = forms.ModelChoiceField(queryset = ProblemByUser.objects.all(), label='Проблема со слов пользователя')
description = forms.CharField(widget=forms.Textarea, label='Описание')
clients = forms.ModelChoiceField(queryset = Person.objects.all(), label='Заявитель')
priority = forms.ChoiceField(widget=forms.RadioSelect,choices = PRIORITY_CHOICES, label='Приоритет')
category = forms.ModelChoiceField(queryset = Categories.objects.all(), label='Категория')
start_date = forms.DateTimeField(label='Дата создания заявки')
due_date = forms.DateTimeField(label='Предполагаемая дата завершения',input_formats=inp_f)
workers = forms.ModelChoiceField(queryset = Person.objects.all(), label='Исполнитель')
percentage = forms.DecimalField(min_value=0, max_value=100, label='Процент выполнения')
class TicketEditForm(forms.Form):
name = forms.CharField(max_length=140, label='Название заявки')
pbus = forms.ModelChoiceField(queryset = ProblemByUser.objects.all(), label='Проблема со слов пользователя')
description = forms.CharField(widget=forms.Textarea, label='Описание')
clients = forms.ModelChoiceField(queryset = Person.objects.all(), label='Заявитель')
priority = forms.ChoiceField(choices = PRIORITY_CHOICES, label='Приоритет')
category = forms.ModelChoiceField(queryset = Categories.objects.all(), label='Категория')
start_date = forms.DateTimeField(label='Дата создания заявки',input_formats=inp_f)
when_to_reminder = forms.DateTimeField(label='Установить напоминание',input_formats=inp_f,required=False)
due_date = forms.DateTimeField(label='Предполагаемая дата завершения',input_formats=inp_f)
workers = forms.ModelChoiceField(queryset = Person.objects.all(), label='Исполнитель')
percentage = forms.DecimalField(min_value=0, max_value=100, label='Процент выполнения')
class NewRegularTicketForm(forms.Form):
name = forms.CharField(max_length=140, label='Название заявки')
description = forms.CharField(widget=forms.Textarea, label='Описание',required=False)
clients = forms.ModelChoiceField(queryset = Person.objects.all(), label='Заявитель')
priority = forms.ChoiceField(widget=forms.RadioSelect,choices = PRIORITY_CHOICES, label='Приоритет')
category = forms.ModelChoiceField(queryset = Categories.objects.all(), label='Категория')
start_date = forms.DateTimeField(label='Дата создания заявки',input_formats=inp_f)
stop_date = forms.DateTimeField(label='Дата завершения',input_formats=inp_f,required=False)
workers = forms.ModelChoiceField(queryset = Person.objects.all(), label='Исполнитель')
class EditRegularTicketForm(forms.Form):
name = forms.CharField(max_length=140, label='Название заявки')
description = forms.CharField(widget=forms.Textarea, label='Описание',required=False)
clients = forms.ModelChoiceField(queryset = Person.objects.all(), label='Заявитель')
priority = forms.ChoiceField(widget=forms.RadioSelect,choices = PRIORITY_CHOICES, label='Приоритет')
category = forms.ModelChoiceField(queryset = Categories.objects.all(), label='Категория')
start_date = forms.DateTimeField(label='Дата создания заявки',input_formats=inp_f)
when_to_reminder = forms.DateTimeField(label='Установить напоминание',input_formats=inp_f,required=False)
stop_date = forms.DateTimeField(label='Дата завершения',input_formats=inp_f,required=False)
workers = forms.ModelChoiceField(queryset = Person.objects.all(), label='Исполнитель')
class TicketClosingForm(forms.Form):
done_date = forms.DateTimeField(label='Дата закрытия заявки',input_formats=inp_f)
pbw = forms.ModelChoiceField(queryset = ProblemByWorker.objects.all(), label='Выявленная проблема')
class TicketConfirmingForm(forms.Form):
confirmed = forms.BooleanField(required=False)
confirmed_date = forms.DateTimeField(label='Дата подтверждения закрытия заявки',input_formats=inp_f)
# class NoteToTicketAddForm(forms.Form):
# note = forms.CharField(widget=forms.Textarea, label='Комментарий',required=False )
# workers = forms.ModelMultipleChoiceField(queryset = Person.objects.all(), label='Кого ещё уведомить о комментарии?',required=False)
class UserCreationFormMY(UserCreationForm):
fio = forms.CharField(label='ФИО')
mail = forms.EmailField(label = 'Мыло')
tel = forms.CharField(label='Телефон', max_length=10, min_length=10)
class TicketSearchForm(forms.Form):
name = forms.CharField(max_length=140, label='Текст для поиска')
class NoteToTicketAddForm(forms.Form):
def __init__(self, *args, **kwargs):
self.defaults = kwargs.pop('defaults','')
self.exclude = kwargs.pop('exclude','')
super(NoteToTicketAddForm, self).__init__(*args, **kwargs)
self.fields['workers'].queryset = Person.objects.exclude(fio__in = [person.fio for person in self.exclude ])
self.fields['workers'].initial = Person.objects.filter(fio__in = self.defaults)
note = forms.CharField(widget=forms.Textarea, label='Комментарий',required=False )
workers = forms.ModelMultipleChoiceField(queryset = Person.objects.all(), label='Кого ещё уведомить о комментарии?',required=False,)
class File_and_NoteToTicketAddForm(forms.Form):
def __init__(self, *args, **kwargs):
self.defaults = kwargs.pop('defaults','')
self.exclude = kwargs.pop('exclude','')
super(File_and_NoteToTicketAddForm, self).__init__(*args, **kwargs)
self.fields['workers'].queryset = Person.objects.exclude(fio__in = [person.fio for person in self.exclude ])
self.fields['workers'].initial = Person.objects.filter(fio__in = self.defaults)
note = forms.CharField(widget=forms.Textarea, label='Комментарий',required=False )
file = forms.FileField()
workers = forms.ModelMultipleChoiceField(queryset = Person.objects.all(), label='Кого ещё уведомить о комментарии?',required=False,)
| 60.129032 | 138 | 0.70346 | 898 | 7,456 | 5.747216 | 0.203786 | 0.034877 | 0.052315 | 0.051153 | 0.826972 | 0.807789 | 0.793838 | 0.793838 | 0.783569 | 0.775044 | 0 | 0.02666 | 0.149812 | 7,456 | 123 | 139 | 60.617886 | 0.787506 | 0.076985 | 0 | 0.563107 | 0 | 0 | 0.175433 | 0 | 0 | 0 | 0 | 0.00813 | 0 | 1 | 0.019417 | false | 0 | 0.038835 | 0 | 0.650485 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 7 |
66e741279035c9216e7b6d9eb130526f280160e0 | 3,543 | py | Python | graphtheory/hamiltonian/tsprnn.py | gitter-badger/graphs-dict | 2be1a5b140feb050eec799d6cadf6de5eef01745 | [
"BSD-3-Clause"
] | 36 | 2015-09-20T20:55:39.000Z | 2021-09-20T05:49:03.000Z | graphtheory/hamiltonian/tsprnn.py | gitter-badger/graphs-dict | 2be1a5b140feb050eec799d6cadf6de5eef01745 | [
"BSD-3-Clause"
] | 6 | 2016-03-25T21:41:46.000Z | 2020-02-12T03:18:59.000Z | graphtheory/hamiltonian/tsprnn.py | gitter-badger/graphs-dict | 2be1a5b140feb050eec799d6cadf6de5eef01745 | [
"BSD-3-Clause"
] | 9 | 2016-09-12T07:57:27.000Z | 2022-03-21T16:15:39.000Z | #!/usr/bin/python
try:
integer_types = (int, long)
except NameError: # Python 3
integer_types = (int,)
xrange = range
class RepeatedNearestNeighborTSPWithEdges:
"""The repeated nearest neighbor algorithm for TSP.
Attributes
----------
graph : input weighted complete graph
hamiltonian_cycle : list of edges
best_weight : number
_used : dict with nodes, private
"""
def __init__(self, graph):
"""The algorithm initialization."""
if graph.is_directed():
raise ValueError("the graph is directed")
self.graph = graph
self.hamiltonian_cycle = None
self.best_weight = float("inf")
self._used = None
def run(self, source=None):
"""Executable pseudocode."""
for source in self.graph.iternodes():
start_node = source
cycle = list()
self._used = dict((node, False) for node in self.graph.iternodes())
self._used[source] = True
# Szukamy n-1 kolejnych krawedzi. Unikamy tworzenia cyklu.
for step in xrange(self.graph.v()-1):
edge = min(edge for edge in self.graph.iteroutedges(source)
if not self._used[edge.target])
cycle.append(edge)
self._used[edge.target] = True
source = edge.target
# We have to close the cycle.
for edge in self.graph.iteroutedges(source):
if edge.target == start_node:
cycle.append(edge)
break
weight = sum(edge.weight for edge in cycle)
if weight < self.best_weight:
self.best_weight = weight
self.hamiltonian_cycle = cycle
class RepeatedNearestNeighborTSPWithGraph:
"""The repeated nearest neighbor algorithm for TSP.
Attributes
----------
graph : input weighted complete graph
hamiltonian_cycle : cycle graph
best_weight : number
_used : dict with nodes, private
"""
def __init__(self, graph):
"""The algorithm initialization."""
if graph.is_directed():
raise ValueError("the graph is directed")
self.graph = graph
self.hamiltonian_cycle = None
self.best_weight = float("inf")
self._used = None
def run(self, source=None):
"""Executable pseudocode."""
for source in self.graph.iternodes():
start_node = source
cycle = self.graph.__class__(self.graph.v())
for node in self.graph.iternodes():
cycle.add_node(node)
self._used = dict((node, False) for node in self.graph.iternodes())
self._used[source] = True
# Szukamy n-1 kolejnych krawedzi. Unikamy tworzenia cyklu.
for step in xrange(self.graph.v()-1):
edge = min(edge for edge in self.graph.iteroutedges(source)
if not self._used[edge.target])
cycle.add_edge(edge)
self._used[edge.target] = True
source = edge.target
# We have to close the cycle.
for edge in self.graph.iteroutedges(source):
if edge.target == start_node:
cycle.add_edge(edge)
break
weight = sum(edge.weight for edge in cycle.iteredges())
if weight < self.best_weight:
self.best_weight = weight
self.hamiltonian_cycle = cycle
# EOF
| 34.735294 | 79 | 0.569856 | 393 | 3,543 | 5.012723 | 0.223919 | 0.077665 | 0.050254 | 0.050761 | 0.865482 | 0.865482 | 0.851777 | 0.851777 | 0.851777 | 0.851777 | 0 | 0.002128 | 0.33672 | 3,543 | 101 | 80 | 35.079208 | 0.83617 | 0.19729 | 0 | 0.793651 | 0 | 0 | 0.017512 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.063492 | false | 0 | 0 | 0 | 0.095238 | 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 |
dd451efd7241cdc08054a792bf3de0179e82d7e6 | 5,656 | py | Python | hive/server/bridge_api/methods.py | blocktradesdevs/hivemind | 0c05fbced6edcbf754093dd1109381cc36bac2d1 | [
"MIT"
] | 1 | 2019-06-28T03:20:59.000Z | 2019-06-28T03:20:59.000Z | hive/server/bridge_api/methods.py | blocktradesdevs/hivemind | 0c05fbced6edcbf754093dd1109381cc36bac2d1 | [
"MIT"
] | 6 | 2019-04-22T11:11:26.000Z | 2019-06-30T19:47:34.000Z | hive/server/bridge_api/methods.py | blocktradesdevs/hivemind | 0c05fbced6edcbf754093dd1109381cc36bac2d1 | [
"MIT"
] | 1 | 2019-03-19T12:48:55.000Z | 2019-03-19T12:48:55.000Z | """Steemd/condenser_api compatibility layer API methods."""
# pylint: disable=duplicate-code,too-many-arguments,invalid-name
import hive.server.condenser_api.cursor as cursor
from hive.server.bridge_api.objects import load_posts, load_posts_reblogs
from hive.server.condenser_api.common import (
return_error_info,
valid_account,
valid_permlink,
valid_tag,
valid_limit)
@return_error_info
async def get_discussions_by_trending(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query posts, sorted by trending score."""
ids = await cursor.pids_by_query(
context['db'],
'trending',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
@return_error_info
async def get_discussions_by_hot(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query posts, sorted by hot score."""
ids = await cursor.pids_by_query(
context['db'],
'hot',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
@return_error_info
async def get_discussions_by_promoted(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query posts, sorted by promoted amount."""
ids = await cursor.pids_by_query(
context['db'],
'promoted',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
@return_error_info
async def get_discussions_by_created(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query posts, sorted by creation date."""
ids = await cursor.pids_by_query(
context['db'],
'created',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
@return_error_info
async def get_discussions_by_blog(context, tag=None, start_author='',
start_permlink='', limit=20):
"""Retrieve account's blog posts, including reblogs."""
assert tag, '`tag` cannot be blank'
ids = await cursor.pids_by_blog(
context['db'],
valid_account(tag),
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100))
return await load_posts(context['db'], ids)
@return_error_info
async def get_discussions_by_feed(context, tag=None, start_author='',
start_permlink='', limit=20):
"""Retrieve account's personalized feed."""
assert tag, '`tag` cannot be blank'
res = await cursor.pids_by_feed_with_reblog(
context['db'],
valid_account(tag),
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100))
return await load_posts_reblogs(context['db'], res)
@return_error_info
async def get_discussions_by_comments(context, start_author=None, start_permlink='',
limit=20):
"""Get comments by made by author."""
assert start_author, '`start_author` cannot be blank'
ids = await cursor.pids_by_account_comments(
context['db'],
valid_account(start_author),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100))
return await load_posts(context['db'], ids)
@return_error_info
async def get_replies_by_last_update(context, start_author=None, start_permlink='',
limit=20):
"""Get all replies made to any of author's posts."""
assert start_author, '`start_author` cannot be blank'
ids = await cursor.pids_by_replies_to_account(
context['db'],
valid_account(start_author),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100))
return await load_posts(context['db'], ids)
@return_error_info
async def get_post_discussions_by_payout(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query top-level posts, sorted by payout."""
ids = await cursor.pids_by_query(
context['db'],
'payout',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
@return_error_info
async def get_comment_discussions_by_payout(context, start_author='', start_permlink='',
limit=20, tag=None):
"""Query comments, sorted by payout."""
ids = await cursor.pids_by_query(
context['db'],
'payout_comments',
valid_account(start_author, allow_empty=True),
valid_permlink(start_permlink, allow_empty=True),
valid_limit(limit, 100),
valid_tag(tag, allow_empty=True))
return await load_posts(context['db'], ids)
| 40.113475 | 88 | 0.654173 | 706 | 5,656 | 4.944759 | 0.127479 | 0.075623 | 0.096247 | 0.097966 | 0.814953 | 0.814953 | 0.804354 | 0.804354 | 0.753079 | 0.704956 | 0 | 0.011558 | 0.235149 | 5,656 | 140 | 89 | 40.4 | 0.795423 | 0.020686 | 0 | 0.75 | 0 | 0 | 0.037132 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 1 | 0 | false | 0 | 0.025862 | 0 | 0.112069 | 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 |
dd992c510161f9e70aefca741f0f7bb80df0a7fe | 118 | py | Python | platform/hwconf_data/efr32mg12p/PythonSnippet/__init__.py | lenloe1/v2.7 | 9ac9c4a7bb37987af382c80647f42d84db5f2e1d | [
"Zlib"
] | null | null | null | platform/hwconf_data/efr32mg12p/PythonSnippet/__init__.py | lenloe1/v2.7 | 9ac9c4a7bb37987af382c80647f42d84db5f2e1d | [
"Zlib"
] | 1 | 2020-08-25T02:36:22.000Z | 2020-08-25T02:36:22.000Z | platform/hwconf_data/efr32mg12p/PythonSnippet/__init__.py | lenloe1/v2.7 | 9ac9c4a7bb37987af382c80647f42d84db5f2e1d | [
"Zlib"
] | 1 | 2020-08-25T01:56:04.000Z | 2020-08-25T01:56:04.000Z | from efr32mg12p.halconfig import halconfig_types as types
from efr32mg12p.halconfig import halconfig_dependency as dep | 59 | 60 | 0.889831 | 16 | 118 | 6.4375 | 0.5 | 0.271845 | 0.446602 | 0.563107 | 0.737864 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074766 | 0.09322 | 118 | 2 | 60 | 59 | 0.88785 | 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 | 1 | 0 | 0 | 8 |
b07d431d617852bd73715162ce5869c19a0aa875 | 69 | py | Python | text2qdmr/datasets/__init__.py | guoyi118/sparqling-queries | 8c9b9f517d6e05ac465a84df79f40484bc852c26 | [
"MIT"
] | 21 | 2021-09-14T11:33:05.000Z | 2022-03-29T13:22:19.000Z | text2qdmr/datasets/__init__.py | guoyi118/sparqling-queries | 8c9b9f517d6e05ac465a84df79f40484bc852c26 | [
"MIT"
] | 1 | 2022-02-14T21:13:15.000Z | 2022-02-18T20:23:36.000Z | text2qdmr/datasets/__init__.py | guoyi118/sparqling-queries | 8c9b9f517d6e05ac465a84df79f40484bc852c26 | [
"MIT"
] | 5 | 2021-09-20T08:54:55.000Z | 2022-02-10T00:59:54.000Z | from . import qdmr
from . import qdmr_full_break
from . import utils
| 17.25 | 29 | 0.782609 | 11 | 69 | 4.727273 | 0.545455 | 0.576923 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 69 | 3 | 30 | 23 | 0.912281 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
b0941bb5d4bc2d524ea3c8dc791ca983698e613d | 15,974 | py | Python | python/dlxapi/api/resource_pools_api.py | dlens/dlxapi | 189a6519240ce625d7a9cdb89e305a335d2aa045 | [
"MIT"
] | null | null | null | python/dlxapi/api/resource_pools_api.py | dlens/dlxapi | 189a6519240ce625d7a9cdb89e305a335d2aa045 | [
"MIT"
] | 1 | 2020-08-20T17:31:43.000Z | 2020-08-20T17:31:43.000Z | python/dlxapi/api/resource_pools_api.py | dlens/dlxapi | 189a6519240ce625d7a9cdb89e305a335d2aa045 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Decision Lens API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
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 dlxapi.api_client import ApiClient
class ResourcePoolsApi(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_resource_pool(self, id, **kwargs): # noqa: E501
"""Retrieves a resource pool. # 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_resource_pool(id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str id: Resource Pool id (required)
:param str portfolio_plan_id: Portfolio Plan id
:return: ResourcePool
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_resource_pool_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_resource_pool_with_http_info(id, **kwargs) # noqa: E501
return data
def get_resource_pool_with_http_info(self, id, **kwargs): # noqa: E501
"""Retrieves a resource pool. # 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_resource_pool_with_http_info(id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str id: Resource Pool id (required)
:param str portfolio_plan_id: Portfolio Plan id
:return: ResourcePool
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'portfolio_plan_id'] # 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_resource_pool" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if self.api_client.client_side_validation and ('id' not in params or
params['id'] is None): # noqa: E501
raise ValueError("Missing the required parameter `id` when calling `get_resource_pool`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
if 'portfolio_plan_id' in params:
query_params.append(('portfolioPlanId', params['portfolio_plan_id'])) # noqa: E501
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 = ['OAuth2'] # noqa: E501
return self.api_client.call_api(
'/resourcePools/{id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ResourcePool', # 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 get_resource_pools_for_portfolio_plan(self, portfolio_plan_id, **kwargs): # noqa: E501
"""Fetch resource pools for portfolio plan # 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_resource_pools_for_portfolio_plan(portfolio_plan_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str portfolio_plan_id: Portfolio Plan id (required)
:param bool plan_overrides_only: Returns only plan overrides. default is false.
:param str expand: JSON string containing an array expand specifications for fields. An expand specification must have a path and includes optional properties match, unique, allPossible, limit, offset, orderBy.
:param int limit: Pagination limit
:param int offset: Pagination offset
:param str order_by: Comma delimited list of order by expressions. Use '-' in front of expression for reverse order.
:param str match: Semi-colon delimited list of expressions to include in the response only the items in a collections that satisfy the expression(s). All other items should be exluded.
:return: ResourcePools
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_resource_pools_for_portfolio_plan_with_http_info(portfolio_plan_id, **kwargs) # noqa: E501
else:
(data) = self.get_resource_pools_for_portfolio_plan_with_http_info(portfolio_plan_id, **kwargs) # noqa: E501
return data
def get_resource_pools_for_portfolio_plan_with_http_info(self, portfolio_plan_id, **kwargs): # noqa: E501
"""Fetch resource pools for portfolio plan # 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_resource_pools_for_portfolio_plan_with_http_info(portfolio_plan_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str portfolio_plan_id: Portfolio Plan id (required)
:param bool plan_overrides_only: Returns only plan overrides. default is false.
:param str expand: JSON string containing an array expand specifications for fields. An expand specification must have a path and includes optional properties match, unique, allPossible, limit, offset, orderBy.
:param int limit: Pagination limit
:param int offset: Pagination offset
:param str order_by: Comma delimited list of order by expressions. Use '-' in front of expression for reverse order.
:param str match: Semi-colon delimited list of expressions to include in the response only the items in a collections that satisfy the expression(s). All other items should be exluded.
:return: ResourcePools
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['portfolio_plan_id', 'plan_overrides_only', 'expand', 'limit', 'offset', 'order_by', 'match'] # 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_resource_pools_for_portfolio_plan" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'portfolio_plan_id' is set
if self.api_client.client_side_validation and ('portfolio_plan_id' not in params or
params['portfolio_plan_id'] is None): # noqa: E501
raise ValueError("Missing the required parameter `portfolio_plan_id` when calling `get_resource_pools_for_portfolio_plan`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'portfolio_plan_id' in params:
query_params.append(('portfolioPlanId', params['portfolio_plan_id'])) # noqa: E501
if 'plan_overrides_only' in params:
query_params.append(('planOverridesOnly', params['plan_overrides_only'])) # noqa: E501
if 'expand' in params:
query_params.append(('expand', params['expand'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'offset' in params:
query_params.append(('offset', params['offset'])) # noqa: E501
if 'order_by' in params:
query_params.append(('orderBy', params['order_by'])) # noqa: E501
if 'match' in params:
query_params.append(('match', params['match'])) # noqa: E501
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 = ['OAuth2'] # noqa: E501
return self.api_client.call_api(
'/resourcePools', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ResourcePools', # 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 update_resource_pool_budget_amounts_for_portfolio_plan(self, portfolio_plan_id, body, **kwargs): # noqa: E501
"""Update resource pool budget amounts in a portfolio plan # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_resource_pool_budget_amounts_for_portfolio_plan(portfolio_plan_id, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str portfolio_plan_id: Portfolio Plan id (required)
:param list[ResourcePoolBudgetAmountPatchItem] body: JSON Patch Operations to update multiple resource pool budget amounts (required)
:return: list[ResourcePool]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.update_resource_pool_budget_amounts_for_portfolio_plan_with_http_info(portfolio_plan_id, body, **kwargs) # noqa: E501
else:
(data) = self.update_resource_pool_budget_amounts_for_portfolio_plan_with_http_info(portfolio_plan_id, body, **kwargs) # noqa: E501
return data
def update_resource_pool_budget_amounts_for_portfolio_plan_with_http_info(self, portfolio_plan_id, body, **kwargs): # noqa: E501
"""Update resource pool budget amounts in a portfolio plan # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_resource_pool_budget_amounts_for_portfolio_plan_with_http_info(portfolio_plan_id, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str portfolio_plan_id: Portfolio Plan id (required)
:param list[ResourcePoolBudgetAmountPatchItem] body: JSON Patch Operations to update multiple resource pool budget amounts (required)
:return: list[ResourcePool]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['portfolio_plan_id', '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 update_resource_pool_budget_amounts_for_portfolio_plan" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'portfolio_plan_id' is set
if self.api_client.client_side_validation and ('portfolio_plan_id' not in params or
params['portfolio_plan_id'] is None): # noqa: E501
raise ValueError("Missing the required parameter `portfolio_plan_id` when calling `update_resource_pool_budget_amounts_for_portfolio_plan`") # noqa: E501
# verify the required parameter 'body' is set
if self.api_client.client_side_validation and ('body' not in params or
params['body'] is None): # noqa: E501
raise ValueError("Missing the required parameter `body` when calling `update_resource_pool_budget_amounts_for_portfolio_plan`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'portfolio_plan_id' in params:
query_params.append(('portfolioPlanId', params['portfolio_plan_id'])) # noqa: E501
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-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['OAuth2'] # noqa: E501
return self.api_client.call_api(
'/resourcePools', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[ResourcePool]', # 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)
| 45.124294 | 219 | 0.640979 | 1,902 | 15,974 | 5.120925 | 0.109884 | 0.082752 | 0.063142 | 0.033368 | 0.901232 | 0.87731 | 0.867248 | 0.849692 | 0.846509 | 0.834292 | 0 | 0.014166 | 0.27526 | 15,974 | 353 | 220 | 45.252125 | 0.827157 | 0.369475 | 0 | 0.666667 | 1 | 0 | 0.201394 | 0.05008 | 0 | 0 | 0 | 0 | 0 | 1 | 0.037634 | false | 0 | 0.021505 | 0 | 0.112903 | 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 |
9fef8150fcbf221b127ad6da6196a6c0150a5bb6 | 8,551 | py | Python | scrapy_random_fake_ua/middleware.py | zs527523251/scrapy-random-fake-ua | 03862d6ee51361aa331579311aee4dc5ae893b06 | [
"MIT"
] | 1 | 2020-04-27T09:01:58.000Z | 2020-04-27T09:01:58.000Z | scrapy_random_fake_ua/middleware.py | zs527523251/scrapy-random-fake-ua | 03862d6ee51361aa331579311aee4dc5ae893b06 | [
"MIT"
] | null | null | null | scrapy_random_fake_ua/middleware.py | zs527523251/scrapy-random-fake-ua | 03862d6ee51361aa331579311aee4dc5ae893b06 | [
"MIT"
] | null | null | null | import logging
from fake_useragent import UserAgent
import random
from scrapy.downloadermiddlewares.retry import RetryMiddleware
from scrapy.utils.response import response_status_message
logger = logging.getLogger(__name__)
class RandomUserAgentMiddleware(object):
def __init__(self, crawler):
super(RandomUserAgentMiddleware, self).__init__()
fallback = crawler.settings.get('FAKEUSERAGENT_FALLBACK', None)
self.per_proxy = crawler.settings.get('RANDOM_UA_PER_PROXY', False)
self.proxy2ua = {}
self.user_agent_list = [
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36",
"Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2309.372 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2117.157 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1866.237 Safari/537.36",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/4E423F",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.517 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36",
"Mozilla/5.0 (X11; CrOS i686 4319.74.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1467.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1500.55 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.90 Safari/537.36",
"Mozilla/5.0 (X11; NetBSD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
"Mozilla/5.0 (X11; CrOS i686 3912.101.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 Safari/537.15",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.14 (KHTML, like Gecko) Chrome/24.0.1292.0 Safari/537.14"
]
@classmethod
def from_crawler(cls, crawler):
return cls(crawler)
def process_request(self, request, spider):
def get_ua():
"""Gets random UA based on the type setting (random, firefox…)"""
return random.choice(self.user_agent_list)
request.headers.setdefault('User-Agent', get_ua())
class RetryUserAgentMiddleware(RetryMiddleware):
"""
Get random User-Agent set on request retry.
Use this middleware in place of the built-in RetryMiddleware.
"""
def __init__(self, settings):
super(RetryUserAgentMiddleware, self).__init__(settings)
fallback = settings.get('FAKEUSERAGENT_FALLBACK', None)
self.ua = UserAgent(fallback=fallback)
self.ua_type = settings.get('RANDOM_UA_TYPE', 'random')
def get_ua(self):
"""Gets random UA based on the type setting (random, firefox…)"""
return random.choice(self.user_agent_list)
def process_response(self, request, response, spider):
if request.meta.get('dont_retry', False):
return response
if response.status in self.retry_http_codes:
reason = response_status_message(response.status)
request.headers['User-Agent'] = self.get_ua()
return self._retry(request, reason, spider) or response
return response
def process_exception(self, request, exception, spider):
if isinstance(exception, self.EXCEPTIONS_TO_RETRY) \
and not request.meta.get('dont_retry', False):
request.headers['User-Agent'] = self.get_ua()
return self._retry(request, exception, spider) | 72.466102 | 259 | 0.664133 | 1,397 | 8,551 | 4.012885 | 0.141016 | 0.081163 | 0.081877 | 0.17838 | 0.7533 | 0.7533 | 0.71691 | 0.70817 | 0.699786 | 0.649661 | 0 | 0.183045 | 0.194363 | 8,551 | 118 | 260 | 72.466102 | 0.629845 | 0.026313 | 0 | 0.065217 | 0 | 0.543478 | 0.680366 | 0.007834 | 0 | 0 | 0 | 0 | 0 | 1 | 0.086957 | false | 0 | 0.054348 | 0.01087 | 0.23913 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
b0016dec0dd77b42e44faa9d26826068995e147e | 3,886 | py | Python | module/util/Exceptions.py | btr1975/SimpleCliTools | dc4c9e114487e68e6b8d7380bdbbb0130a95885e | [
"MIT"
] | 1 | 2018-12-20T07:12:52.000Z | 2018-12-20T07:12:52.000Z | module/util/Exceptions.py | btr1975/SimpleCliTools | dc4c9e114487e68e6b8d7380bdbbb0130a95885e | [
"MIT"
] | null | null | null | module/util/Exceptions.py | btr1975/SimpleCliTools | dc4c9e114487e68e6b8d7380bdbbb0130a95885e | [
"MIT"
] | 1 | 2019-09-05T06:44:48.000Z | 2019-09-05T06:44:48.000Z | #!/usr/bin/env python3
__author__ = 'Benjamin P. Trachtenberg'
__copyright__ = "Copyright (c) 2016, Benjamin P. Trachtenberg"
__credits__ = None
__license__ = 'The MIT License (MIT)'
__status__ = 'prod'
__version_info__ = (1, 0, 1, __status__)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Benjamin P. Trachtenberg'
__email__ = 'e_ben_75-python@yahoo.com'
class BadUniCastIP(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadUniCastIpNetwork(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadMultiCastIpNetwork(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadMultiCastIp(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadBgpCommunity(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadBgpAsNumber(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadEigrpAsNumber(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadVlanNumber(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BadDeviceType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class SequenceError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidNatType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidNatArguments(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidLeGeType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidCidrValue(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidPermitOrDenyType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidMatchOrSetType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidMatchType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidSetType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class RequiredEigrpProcessName(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class NotNumber(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidSwitchPortType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidInterfaceType(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BgpAsRequiredForMpls(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value) | 18.074419 | 62 | 0.65054 | 438 | 3,886 | 5.242009 | 0.146119 | 0.27047 | 0.160279 | 0.200348 | 0.729094 | 0.729094 | 0.729094 | 0.729094 | 0.729094 | 0.729094 | 0 | 0.00342 | 0.247555 | 3,886 | 215 | 63 | 18.074419 | 0.781806 | 0.005404 | 0 | 0.741935 | 0 | 0 | 0.036999 | 0.006468 | 0 | 0 | 0 | 0 | 0 | 1 | 0.370968 | false | 0 | 0 | 0.185484 | 0.741935 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 11 |
b06be25a00f6356dbfff958cce112cea87b5fd84 | 13 | py | Python | tests/syntax/invalid_octal.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 287 | 2019-04-08T13:18:29.000Z | 2021-03-14T19:10:21.000Z | tests/syntax/invalid_octal.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 191 | 2019-04-08T14:39:18.000Z | 2021-03-14T22:14:56.000Z | tests/syntax/invalid_octal.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 9 | 2019-04-08T12:54:08.000Z | 2020-11-20T02:26:27.000Z |
b = 0O1876
| 3.25 | 10 | 0.538462 | 2 | 13 | 3.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.625 | 0.384615 | 13 | 3 | 11 | 4.333333 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
c682389146fc8e5bc50013e729df6855a664bbd8 | 9,360 | py | Python | Protheus_WebApp/Modules/SIGACTB/CTBA355TESTCASE.py | 98llm/tir-script-samples | 0bff8393b79356aa562e9e6512c11ee6e039b177 | [
"MIT"
] | 17 | 2018-09-24T17:27:08.000Z | 2021-09-16T19:09:46.000Z | Protheus_WebApp/Modules/SIGACTB/CTBA355TESTCASE.py | 98llm/tir-script-samples | 0bff8393b79356aa562e9e6512c11ee6e039b177 | [
"MIT"
] | 4 | 2018-09-24T17:30:32.000Z | 2022-01-03T11:39:30.000Z | Protheus_WebApp/Modules/SIGACTB/CTBA355TESTCASE.py | 98llm/tir-script-samples | 0bff8393b79356aa562e9e6512c11ee6e039b177 | [
"MIT"
] | 18 | 2019-06-07T17:41:34.000Z | 2022-01-31T18:17:31.000Z | from tir import Webapp
import unittest
class CTBA355(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup("SIGACTB", "01/02/2016", "T1", "D MG 01 ", "34")
inst.oHelper.Program("CTBA355")
# ==================================================================
# Conferir não conferidos.
# ==================================================================
def test_CTBA355_001(self):
self.oHelper.SetButton("Conferir") #Re-analise
self.oHelper.SetBranch("D MG 01 ")
self.oHelper.SetValue("Conferir ?", "Nao conferidos")
self.oHelper.SetValue("Da Data ?", "01/02/2016")
self.oHelper.SetValue("Ate a Data ?", "01/02/2016")
self.oHelper.SetValue("Valor minimo ?", "0,00")
self.oHelper.SetValue("Valor maximo ?", "999.999.999.999,99")
self.oHelper.SetValue("Do Lote ?", "")
self.oHelper.SetValue("Ate o Lote ?", "ZZZZZZ")
self.oHelper.SetValue("Do SubLote ?", "")
self.oHelper.SetValue("Ate o Sublote ?", "ZZZ")
self.oHelper.SetValue("Do Documento ?", "")
self.oHelper.SetValue("Ate o Documento ?", "ZZZZZZ")
self.oHelper.SetValue("Moeda ?", "01")
self.oHelper.SetValue("Tipo de saldo ?", "1")
self.oHelper.SetValue("Conta ?", "101020")
self.oHelper.SetValue("Centro de custo ?", "")
self.oHelper.SetValue("Item contabil ?", "")
self.oHelper.SetValue("Classe de valor ?", "")
self.oHelper.SetValue("Acao do clique ?", "Conferir")
self.oHelper.SetButton("OK")
self.oHelper.WaitShow("Conferencia de lancamentos - CONFERIR")
self.oHelper.ClickBox("Data Lcto","01/02/2016" ,grid_number=1)
self.oHelper.SetButton("Salvar")
#self.oHelper.WaitShow("Deseja confirmar os registros marcados?")
#self.oHelper.SetButton("Sim")
self.oHelper.SetButton("Cancelar")
self.oHelper.AssertTrue()
# ==================================================================
# Estornar conferidos.
# ==================================================================
def test_CTBA355_002(self):
self.oHelper.SetButton("Outras Ações","Estornar") #Estornar
#self.oHelper.SetBranch("D MG 01 ")
self.oHelper.SetValue("Estornar ?", "Conferidos")
self.oHelper.SetValue("Da Data ?", "01/02/2016")
self.oHelper.SetValue("Ate a Data ?", "01/02/2016")
self.oHelper.SetValue("Valor minimo ?", "0,00")
self.oHelper.SetValue("Valor maximo ?", "999.999.999.999,99")
self.oHelper.SetValue("Do Lote ?", "")
self.oHelper.SetValue("Ate o Lote ?", "ZZZZZZ")
self.oHelper.SetValue("Do SubLote ?", "")
self.oHelper.SetValue("Ate o Sublote ?", "ZZZ")
self.oHelper.SetValue("Do Documento ?", "")
self.oHelper.SetValue("Ate o Documento ?", "ZZZZZZ")
self.oHelper.SetValue("Moeda ?", "01")
self.oHelper.SetValue("Tipo de saldo ?", "1")
self.oHelper.SetValue("Conta ?", "101030")
self.oHelper.SetValue("Centro de custo ?", "")
self.oHelper.SetValue("Item contabil ?", "")
self.oHelper.SetValue("Classe de valor ?", "")
self.oHelper.SetValue("Acao do clique ?", "Estornar")
self.oHelper.SetButton("OK")
self.oHelper.WaitShow("Conferencia de lancamentos - ESTORNAR")
self.oHelper.ClickBox("Data Lcto","01/02/2016" ,grid_number=1)
self.oHelper.SetButton("Confirmar")
#self.oHelper.WaitShow("Deseja confirmar os registros marcados?")
#self.oHelper.SetButton("Sim")
#self.oHelper.SetButton("Cancelar")
self.oHelper.AssertTrue()
# ==================================================================
# Re-analise náo conferidos
# ==================================================================
def test_CTBA355_003(self):
self.oHelper.SetButton("Conferir") #Re-analise
self.oHelper.SetBranch("D MG 01 ")
self.oHelper.SetValue("Conferir ?", "Nao conferidos")
self.oHelper.SetValue("Da Data ?", "01/02/2016")
self.oHelper.SetValue("Ate a Data ?", "01/02/2016")
self.oHelper.SetValue("Valor minimo ?", "0,00")
self.oHelper.SetValue("Valor maximo ?", "999.999.999.999,99")
self.oHelper.SetValue("Do Lote ?", "")
self.oHelper.SetValue("Ate o Lote ?", "ZZZZZZ")
self.oHelper.SetValue("Do SubLote ?", "")
self.oHelper.SetValue("Ate o Sublote ?", "ZZZ")
self.oHelper.SetValue("Do Documento ?", "")
self.oHelper.SetValue("Ate o Documento ?", "ZZZZZZ")
self.oHelper.SetValue("Moeda ?", "01")
self.oHelper.SetValue("Tipo de saldo ?", "1")
self.oHelper.SetValue("Conta ?", "101010")
self.oHelper.SetValue("Centro de custo ?", "")
self.oHelper.SetValue("Item contabil ?", "")
self.oHelper.SetValue("Classe de valor ?", "")
self.oHelper.SetValue("Acao do clique ?", "Re-analise")
self.oHelper.SetButton("OK")
self.oHelper.WaitShow("Conferencia de lancamentos - CONFERIR")
self.oHelper.ClickBox("Data Lcto","01/02/2016" ,grid_number=1)
self.oHelper.SetButton("Salvar")
self.oHelper.CheckHelp("Deseja confirmar os registros marcados?","Sim")
self.oHelper.SetButton("Cancelar")
self.oHelper.AssertTrue()
# ==================================================================
# Tela de visualizar, teste abertura,caso tela, REGISTRO CORRENTE
# ==================================================================
def test_CTBA355_004(self):
self.oHelper.SetButton("Vis. Lancamento")
self.oHelper.SetButton("Cancelar")
self.oHelper.AssertTrue()
# ==================================================================
# Tela detalhes, localizar, teste abertura, caso tela
# ==================================================================
def test_CTBA355_005(self):
self.oHelper.SetButton("Conferir") #Re-analise
self.oHelper.SetBranch("D MG 01 ")
self.oHelper.SetValue("Conferir ?", "Nao conferidos")
self.oHelper.SetValue("Da Data ?", "01/02/2016")
self.oHelper.SetValue("Ate a Data ?", "01/02/2016")
self.oHelper.SetValue("Valor minimo ?", "0,00")
self.oHelper.SetValue("Valor maximo ?", "999.999.999.999,99")
self.oHelper.SetValue("Do Lote ?", "")
self.oHelper.SetValue("Ate o Lote ?", "ZZZZZZ")
self.oHelper.SetValue("Do SubLote ?", "")
self.oHelper.SetValue("Ate o Sublote ?", "ZZZ")
self.oHelper.SetValue("Do Documento ?", "")
self.oHelper.SetValue("Ate o Documento ?", "ZZZZZZ")
self.oHelper.SetValue("Moeda ?", "01")
self.oHelper.SetValue("Tipo de saldo ?", "1")
self.oHelper.SetValue("Conta ?", "101040")
self.oHelper.SetValue("Centro de custo ?", "")
self.oHelper.SetValue("Item contabil ?", "")
self.oHelper.SetValue("Classe de valor ?", "")
self.oHelper.SetValue("Acao do clique ?", "Conferir")
self.oHelper.SetButton("OK")
##Detalhes teste de abertura da tela
self.oHelper.SetButton("Outras Ações","Detalhes")
self.oHelper.SetButton("Confirmar")
#Localizar teste de abertura de tela
self.oHelper.SetButton("Outras Ações","Localizar")
self.oHelper.SetValue("Campo:","Data Lcto")
self.oHelper.SetValue("Operador:","Igual a")
self.oHelper.SetValue("cExpr","01/02/2016",name_attr=True)
self.oHelper.SetButton("Adiciona")
self.oHelper.SetButton("Avançar")
#self.oHelper.WaitShow("Conferencia de lancamentos - CONFERIR")
#self.oHelper.ClickBox("Data Lcto","01/02/2016" ,grid_number=1)
##self.oHelper.ClickBox("Data Lcto","01/02/2016" ,grid_number=1)
self.oHelper.SetButton("Salvar")
#self.oHelper.WaitShow("Deseja confirmar os registros marcados?")
#self.oHelper.SetButton("Sim")
self.oHelper.SetButton("Cancelar")
self.oHelper.AssertTrue()
@classmethod
def tearDownClass(inst):
inst.oHelper.TearDown()
if __name__ == '__main__':
unittest.main()
| 49.005236 | 100 | 0.499893 | 870 | 9,360 | 5.350575 | 0.137931 | 0.290655 | 0.306122 | 0.075618 | 0.813319 | 0.799356 | 0.784318 | 0.784318 | 0.760902 | 0.75145 | 0 | 0.042262 | 0.297222 | 9,360 | 190 | 101 | 49.263158 | 0.6654 | 0.176816 | 0 | 0.738462 | 0 | 0 | 0.233768 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 1 | 0.053846 | false | 0 | 0.015385 | 0 | 0.076923 | 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 |
05e2142137c1cf695d250de660b58d42cc5af9d9 | 13,576 | py | Python | tests/test_routes.py | AmazingJinwei/recommendations | 409b3bb9012fdfb9e93dd339507318d8b9cee375 | [
"Apache-2.0"
] | null | null | null | tests/test_routes.py | AmazingJinwei/recommendations | 409b3bb9012fdfb9e93dd339507318d8b9cee375 | [
"Apache-2.0"
] | null | null | null | tests/test_routes.py | AmazingJinwei/recommendations | 409b3bb9012fdfb9e93dd339507318d8b9cee375 | [
"Apache-2.0"
] | null | null | null | """
TestYourResourceModel API Service Test Suite
Test cases can be run with the following:
nosetests -v --with-spec --spec-color
coverage report -m
"""
import os
import logging
from unittest import TestCase
from unittest.mock import MagicMock, patch
from flask import json
from service import status # HTTP Status Codes
from service.models import db
from service.routes import app, init_db
from service.models import Recommendations
# Product_id
PO = 3
PT = 5
RL = 1
######################################################################
# T E S T C A S E S
######################################################################
class TestYourResourceServer(TestCase):
""" REST API Server Tests """
@classmethod
def setUpClass(cls):
""" This runs once before the entire test suite """
app.debug = False
# global app
Recommendations.init_db(app)
# pass
@classmethod
def tearDownClass(cls):
""" This runs once after the entire test suite """
pass
def setUp(self):
""" This runs before each test """
db.drop_all()
db.create_all()
self.app = app.test_client()
def tearDown(self):
""" This runs after each test """
db.session.remove()
db.drop_all()
# pass
######################################################################
# P L A C E T E S T C A S E S H E R E
######################################################################
def test_index(self):
""" Test index call """
resp = self.app.get("/")
self.assertEqual(resp.status_code, status.HTTP_200_OK)
def test_add_a_recommendation(self):
""" Create a recommendation and add it to the database """
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
self.assertEqual(resp_data['product_origin'], 2)
self.assertEqual(resp_data['product_target'], 3)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
def test_add_a_recommendation_includes_bad_data(self):
""" Create a recommendation includes bad data """
recommendation_rawdata = {'product_origin': "bad data", 'product_target': 3, 'relation': 1, 'dislike': 0}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST)
recommendation_rawdata = {'product_origin': 1, 'product_target': "bad data", 'relation': 1, 'dislike': 0}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST)
recommendation_rawdata = {'product_origin': 1, 'product_target': 3, 'relation': "bad data", 'dislike': 0}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST)
recommendation_rawdata = {'product_origin': 1, 'product_target': 3, 'relation': 1, 'dislike': "bad data"}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST)
def test_add_a_had_deleted_recommendation(self):
""" Create a same recommendations and add it to the database """
# post the same data
recommendation_rawdata = {'product_origin': 3, 'product_target': 4, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
self.assertEqual(resp_data['product_origin'], 3)
self.assertEqual(resp_data['product_target'], 4)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
resp_delete = self.app.delete('/recommendations/1')
self.assertEqual(resp_delete.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(len(resp_delete.data), 0)
resp = self.app.get('/recommendations/1')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertTrue(resp is not None)
self.assertEqual(resp_data['product_origin'], 3)
self.assertEqual(resp_data['product_target'], 4)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 1)
recommendation_rawdata = {'product_origin': 3, 'product_target': 4, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
self.assertEqual(resp_data['product_origin'], 3)
self.assertEqual(resp_data['product_target'], 4)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
def test_retrieve_a_reconmmendation(self):
""" Read a Recommendation """
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
resp = self.app.get('/recommendations/1')
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertTrue(resp is not None)
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertEqual(resp_data['product_origin'], 2)
self.assertEqual(resp_data['product_target'], 3)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
def test_retrieve_a_reconmmendation_on_product_originrelation(self):
"""Read a Recommendation based on product_origin and relation"""
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
resp = self.app.get('/recommendations?product-id=2&relation=1')
resp_data = resp.get_json()
# self.assertEqual(resp.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertTrue(resp is not None)
self.assertEqual(resp_data[0]['product_origin'], 2)
self.assertEqual(resp_data[0]['product_target'], 3)
self.assertEqual(resp_data[0]['relation'], 1)
self.assertEqual(resp_data[0]['dislike'], 0)
self.assertEqual(resp_data[0]['is_deleted'], 0)
# test for no result
resp = self.app.get('/recommendations?product-id=2&relation=2')
resp_data = resp.get_json()
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertEqual(resp_data, [])
def test_not_find_a_reconmmendation(self):
""" Not found a Recommendation """
# not found
resp = self.app.get('/recommendations/99')
resp_data = json.loads(resp.data)
self.assertTrue(resp is not None)
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/txt')
self.assertEqual(resp.status_code, status.HTTP_415_UNSUPPORTED_MEDIA_TYPE)
def test_delete_a_recommendation(self):
""" Delete a Recommendation """
# delete a recommendation
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
resp = self.app.delete('/recommendations/1')
self.assertEqual(resp.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(len(resp.data), 0)
def test_update_a_recommendation(self):
""" Update a Recommendation """
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
new_date = {'product_origin': 3, 'product_target': 4, 'dislike': 0, 'relation': 1}
data_json = json.dumps(new_date)
resp = self.app.put('/recommendations/1', data=data_json, content_type='application/json')
self.assertEqual(resp.status_code, status.HTTP_200_OK)
resp_data = json.loads(resp.data)
self.assertEqual(resp_data['product_origin'], 3)
self.assertEqual(resp_data['product_target'], 4)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
resp = self.app.put('/recommendations/2', data=data_json, content_type='application/json')
self.assertEqual(resp.status_code, status.HTTP_404_NOT_FOUND)
def test_dislike_recommendations(self):
""" Dislike the Recommendations"""
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
resp_data = json.loads(resp.data)
self.assertEqual(resp_data['product_origin'], 2)
self.assertEqual(resp_data['product_target'], 3)
self.assertEqual(resp_data['relation'], 1)
self.assertEqual(resp_data['dislike'], 0)
self.assertEqual(resp_data['is_deleted'], 0)
resp = self.app.put('/recommendations/1/dislike', data=data_json, content_type='application/json')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertEqual(resp_data['dislike'], 1)
resp = self.app.put('/recommendations/2/dislike', data=data_json, content_type='application/json')
self.assertEqual(resp.status_code, status.HTTP_404_NOT_FOUND)
def test_reset_recommendations(self):
""" Reset the Recommendations"""
recommendation_rawdata = {'product_origin': 2, 'product_target': 3, 'dislike': 0, 'relation': 1}
data_json = json.dumps(recommendation_rawdata)
resp = self.app.post("/recommendations", data=data_json, content_type='application/json')
location = resp.headers.get('Location', None)
self.assertTrue(location is not None)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
resp = self.app.delete('/recommendations/reset')
self.assertEqual(resp.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(len(resp.data), 0)
resp = self.app.get('/recommendations')
resp_data = json.loads(resp.data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertEqual(resp_data, [])
def test_method_not_supported(self):
""" Method not supported """
resp = self.app.trace('/recommendations')
self.assertEqual(resp.status_code, status.HTTP_405_METHOD_NOT_ALLOWED) | 46.020339 | 113 | 0.663524 | 1,673 | 13,576 | 5.176928 | 0.095637 | 0.069276 | 0.155756 | 0.11419 | 0.838471 | 0.81942 | 0.794596 | 0.770927 | 0.758111 | 0.743217 | 0 | 0.018751 | 0.194682 | 13,576 | 295 | 114 | 46.020339 | 0.773438 | 0.072113 | 0 | 0.676329 | 0 | 0 | 0.163142 | 0.012625 | 0 | 0 | 0 | 0 | 0.410628 | 1 | 0.077295 | false | 0.004831 | 0.043478 | 0 | 0.125604 | 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 |
05fb1b7f2aaca140dad4e4c99c26296b08356cf5 | 17,038 | py | Python | scripts/simulateFragmentMatrix.py | gbotev1/haplotype-phasing | 2bf7586733b65818b7a2931bac046f6307575af2 | [
"MIT"
] | null | null | null | scripts/simulateFragmentMatrix.py | gbotev1/haplotype-phasing | 2bf7586733b65818b7a2931bac046f6307575af2 | [
"MIT"
] | null | null | null | scripts/simulateFragmentMatrix.py | gbotev1/haplotype-phasing | 2bf7586733b65818b7a2931bac046f6307575af2 | [
"MIT"
] | null | null | null |
#Charlotte Darby cdarby@jhu.edu
#updated 11-16-17
import argparse
import random,numpy,math
def diploidPairedend(fragmentlength,insertlength,height, width, gaprate, errorrate,k,outLong,out):
n_gaps = 0
n_errors = 0
haplotype = numpy.random.choice([0,1],width) #generate a random haplotype
if outLong != None: outLong = open(outLong,"w")
with open(args.matrixout,"w") as out:
if args.longfmt: outLong.write(str(height) + "\n" + str(width) + "\n")
if insertlength == None: insertlength = 0
else: insertlength = int(insertlength)
if fragmentlength == None: fragmentlength = (width-insertlength)/2
else: fragmentlength = int(fragmentlength)
span=2*fragmentlength+insertlength
#assert span <= width
end = width-span+1 #index where rightmost fragment could start +1 [OR] number of fragment starting points
startpoints = []
persite = height/end #rounds down
for _ in xrange(persite):
startpoints += range(0,end)
remaining = height - persite * end
#assert remaining < end
if remaining > 0:
if 1.0*end/remaining < 2: #choose places where fragments won't start instead of places where they will
step = end/(end-remaining) #number of places to choose
A = range(0,end,step)
startpoints += [i for i in xrange(end) if i not in A][:remaining] #"complement" of the sequence
else: #choose places where fragments will start
step = end/remaining
startpoints += range(0,end,step)[:remaining]
#assert len(startpoints) == height == remaining + persite * end
random.shuffle(startpoints)
if len(startpoints) < remaining:
for sp in xrange(remaining-len(startpoints)):
startpoints.append(sp)
H0 = startpoints[0::2]
H1 = startpoints[1::2]
for i in H0: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
suffix = ["-" for _ in xrange(i+span,width)]
insert = ["-" for _ in xrange(insertlength)]
fragment1 = [haplotype[q] for q in xrange(i,i+fragmentlength)] #ints
fragment2 = [haplotype[q] for q in xrange(i+fragmentlength+insertlength,i+span)] #ints
for f in xrange(len(fragment1)):
if random.random() < gaprate:
fragment1[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment1[f] = str(abs(1-fragment1[f]))
n_errors += 1
else:
fragment1[f] = str(fragment1[f])
for f in xrange(len(fragment2)):
if random.random() < gaprate:
fragment2[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment2[f] = str(abs(1-fragment2[f]))
n_errors += 1
else:
fragment2[f] = str(fragment2[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "\n")
for i in H1: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
suffix = ["-" for _ in xrange(i+span,width)]
insert = ["-" for _ in xrange(insertlength)]
fragment1 = [abs(1-haplotype[q]) for q in xrange(i,i+fragmentlength)] #ints
fragment2 = [abs(1-haplotype[q]) for q in xrange(i+fragmentlength+insertlength,i+span)] #ints
for f in xrange(len(fragment1)):
if random.random() < gaprate:
fragment1[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment1[f] = str(abs(1-fragment1[f]))
n_errors += 1
else:
fragment1[f] = str(fragment1[f])
for f in xrange(len(fragment2)):
if random.random() < gaprate:
fragment2[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment2[f] = str(abs(1-fragment2[f]))
n_errors += 1
else:
fragment2[f] = str(fragment2[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "\n")
if outLong != None: out.close()
print str(n_gaps) + " gaps"
print str(n_errors) + " errors"
return [haplotype]
def kploidPairedend(fragmentlength,insertlength,height, width, gaprate, errorrate,k,outLong,out):
n_gaps = 0
n_errors = 0
haplotypes = []
for _ in xrange(k):
haplotypes.append([])
for _ in xrange(width): #for each site, there is at least one 0 and at least one 1, but others are randomly selected
alleles = numpy.ndarray.tolist(numpy.random.choice([0,1],k-2)) + [0,1]
random.shuffle(alleles)
for i in xrange(len(haplotypes)):
haplotypes[i].append(alleles[i])
if outLong != None: outLong = open(outLong,"w")
with open(args.matrixout,"w") as out:
if args.longfmt: outLong.write(str(height) + "\n" + str(width) + "\n")
if insertlength == None: insertlength = 0
else: insertlength = int(insertlength)
if fragmentlength == None: fragmentlength = (width-insertlength)/2
else: fragmentlength = int(fragmentlength)
span=2*fragmentlength+insertlength
#assert span <= width
end = width-span+1 #index where rightmost fragment could start +1 [OR] number of fragment starting points
startpoints = []
persite = height/end #rounds down
for _ in xrange(persite):
startpoints += range(0,end)
remaining = height - persite * end
#assert remaining < end
if remaining > 0:
if 1.0*end/remaining < 2: #choose places where fragments won't start instead of places where they will
step = end/(end-remaining) #number of places to choose
A = range(0,end,step)
startpoints += [i for i in xrange(end) if i not in A][:remaining] #"complement" of the sequence
else: #choose places where fragments will start
step = end/remaining
startpoints += range(0,end,step)[:remaining]
#assert len(startpoints) == height == remaining + persite * end
random.shuffle(startpoints)
if len(startpoints) < remaining:
for sp in xrange(remaining-len(startpoints)):
startpoints.append(sp)
#assign start points to haplotypes
allH = []
for h in xrange(k):
allH.append(startpoints[h::k])
for h,H in enumerate(allH):
for i in H: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
suffix = ["-" for _ in xrange(i+span,width)]
insert = ["-" for _ in xrange(insertlength)]
fragment1 = [haplotypes[h][q] for q in xrange(i,i+fragmentlength)] #ints
fragment2 = [haplotypes[h][q] for q in xrange(i+fragmentlength+insertlength,i+span)] #ints
for f in xrange(len(fragment1)):
if random.random() < gaprate:
fragment1[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment1[f] = str(abs(1-fragment1[f]))
n_errors += 1
else:
fragment1[f] = str(fragment1[f])
for f in xrange(len(fragment2)):
if random.random() < gaprate:
fragment2[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment2[f] = str(abs(1-fragment2[f]))
n_errors += 1
else:
fragment2[f] = str(fragment2[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment1) + "".join(insert) + "".join(fragment2) + "\n")
if outLong != None: out.close()
print str(n_gaps) + " gaps"
print str(n_errors) + " errors"
return haplotypes
def diploid(fragmentlength,height, width, gaprate, errorrate,k,outLong,out):
n_gaps = 0
n_errors = 0
haplotype = numpy.random.choice([0,1],width) #generate a random haplotype
if outLong != None: outLong = open(outLong,"w")
with open(args.matrixout,"w") as out:
if args.longfmt: outLong.write(str(height) + "\n" + str(width) + "\n")
if fragmentlength == None: fragmentlength = width
else: fragmentlength = int(fragmentlength)
end = width-fragmentlength+1 #index where rightmost fragment could start +1 [OR] number of fragment starting points
startpoints = []
persite = height/end #rounds down
for _ in xrange(persite):
startpoints += range(0,end)
remaining = height - persite * end
#assert remaining < end
if remaining > 0:
if 1.0*end/remaining < 2: #choose places where fragments won't start instead of places where they will
step = end/(end-remaining) #number of places to choose
A = range(0,end,step)
startpoints += [i for i in xrange(end) if i not in A][:remaining] #"complement" of the sequence
else: #choose places where fragments will start
step = end/remaining
startpoints += range(0,end,step)[:remaining]
#assert len(startpoints) == height == remaining + persite * end
random.shuffle(startpoints)
if len(startpoints) < remaining:
for sp in xrange(remaining-len(startpoints)):
startpoints.append(sp)
H0 = startpoints[0::2]
H1 = startpoints[1::2]
for i in H0: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
#fragment = [ "-" if random.random() < gaprate else str(haplotype[ch]) if random.random() > errorrate else str(abs(1-haplotype[ch])) for ch in xrange(i,i+fragmentlength)]
suffix = ["-" for _ in xrange(i+fragmentlength,width)]
fragment = [haplotype[q] for q in xrange(i,i+fragmentlength)] #ints
for f in xrange(len(fragment)):
if random.random() < gaprate:
fragment[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment[f] = str(abs(1-fragment[f]))
n_errors += 1
else:
fragment[f] = str(fragment[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment) + "\n")
for i in H1: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
#fragment = [ "-" if random.random() < gaprate else str(haplotype[ch]) if random.random() < errorrate else str(abs(1-haplotype[ch])) for ch in xrange(i,i+fragmentlength)] #h1 = opposite of h0; change to < errorrate
suffix = ["-" for _ in xrange(i+fragmentlength,width)]
fragment = [abs(1-haplotype[q]) for q in xrange(i,i+fragmentlength)] #ints
for f in xrange(len(fragment)):
if random.random() < gaprate:
fragment[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment[f] = str(abs(1-fragment[f]))
n_errors += 1
else:
fragment[f] = str(fragment[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment) + "\n")
if outLong != None: out.close()
print str(n_gaps) + " gaps"
print str(n_errors) + " errors"
return [haplotype]
def kploid(fragmentlength,height, width, gaprate, errorrate,k,outLong,out):
n_gaps = 0
n_errors = 0
haplotypes = []
for _ in xrange(k):
haplotypes.append([])
for _ in xrange(width): #for each site, there is at least one 0 and at least one 1, but others are randomly selected
alleles = numpy.ndarray.tolist(numpy.random.choice([0,1],k-2)) + [0,1]
random.shuffle(alleles)
for i in xrange(len(haplotypes)):
haplotypes[i].append(alleles[i])
if outLong != None: outLong = open(outLong,"w")
with open(args.matrixout,"w") as out:
if args.longfmt: outLong.write(str(height) + "\n" + str(width) + "\n")
if fragmentlength == None: fragmentlength = width
else: fragmentlength = int(fragmentlength)
end = width-fragmentlength+1 #index where rightmost fragment could start +1 [OR] number of fragment starting points
startpoints = []
persite = height/end #rounds down
for _ in xrange(persite):
startpoints += range(0,end)
remaining = height - persite * end
#assert remaining < end
if remaining > 0:
if 1.0*end/remaining < 2: #choose places where fragments won't start instead of places where they will
step = end/(end-remaining) #number of places to choose
A = range(0,end,step)
startpoints += [i for i in xrange(end) if i not in A][:remaining] #"complement" of the sequence
else: #choose places where fragments will start
step = end/remaining
startpoints += range(0,end,step)[:remaining]
#assert len(startpoints) == height == remaining + persite * end
random.shuffle(startpoints)
if len(startpoints) < remaining:
for sp in xrange(remaining-len(startpoints)):
startpoints.append(sp)
#assign start points to haplotypes
allH = []
for h in xrange(k):
allH.append(startpoints[h::k])
for h,H in enumerate(allH):
for i in H: #number of gaps to put in front
prefix = ["-" for _ in xrange(i)]
#fragment = [ "-" if random.random() < gaprate else str(haplotype[ch]) if random.random() > errorrate else str(abs(1-haplotype[ch])) for ch in xrange(i,i+fragmentlength)]
suffix = ["-" for _ in xrange(i+fragmentlength,width)]
fragment = [haplotypes[h][q] for q in xrange(i,i+fragmentlength)] #ints
for f in xrange(len(fragment)):
if random.random() < gaprate:
fragment[f] = "-"
n_gaps += 1
elif random.random() < errorrate:
fragment[f] = str(abs(1-fragment[f]))
n_errors += 1
else:
fragment[f] = str(fragment[f])
if args.longfmt: outLong.write("".join(prefix) + "".join(fragment) + "".join(suffix) + "\n")
out.write(str(i) + "\t" + "".join(fragment) + "\n")
if outLong != None: out.close()
print str(n_gaps) + " gaps"
print str(n_errors) + " errors"
return haplotypes
parser = argparse.ArgumentParser(description='simulateDiploidMatrix.py --matrixout --hapout [--height --width --gaprate --errorrate --fragmentlength --longfmt]')
parser.add_argument('--matrixout', help='output filename for the fragment matrix',required=True)
parser.add_argument('--hapout', help='output filename for the actual haplotype - depending on error rate, may not be the haplotypes corresponding to the MEC score',required=True)
parser.add_argument('--height',help="fragment matrix height (number of fragments)",required=False,default=2)
parser.add_argument('--width',help="fragment matrix width (number of sites)",required=False,default=1)
parser.add_argument('--gaprate',help="fraction of entries within fragments that are gaps (randomly distributed; can be at ends of fragments)",required=False,default=0.0)
parser.add_argument('--errorrate',help="fraction of matrix entries that have errors (randomly distributed) given that there is not a gap at that point",required=False,default=0.0)
#parser.add_argument('--fractionh0',help="fraction of rows that come from 'hap 0' - NOT USED",required=False,default=0.5)
parser.add_argument('--fragmentlength',help="length of fragments between first non-gap and last non-gap (with --paired True it is the length of one end-segment",required=False,default=None)
parser.add_argument('--insertlength',help="number of gaps between the end-segments of the pair",required=False,default=None)
parser.add_argument('--longfmt',help="Write the fragment matrix in long format?",required=False,default=False)
parser.add_argument('--k',help="k>1 number of haplotypes to simulate",required=False,default=2)
parser.add_argument('--pairedend',help="Are reads paired-end?",required=False,default=False)
args = parser.parse_args()
(height,width) = (int(args.height),int(args.width))
gaprate = float(args.gaprate)
errorrate = float(args.errorrate)
k = int(args.k)
#fractionh0 = float(args.fractionh0) if args.fractionh0 != None else None
if args.pairedend and args.fragmentlength != None and (int(args.fragmentlength) < 1 or 2*int(args.fragmentlength) > width):
print "Since you specified fragment length in paired mode, it must be at least 1 and at most (width-insertlength)/2 (default is (width-insertlength)/2)"
sys.exit()
if args.pairedend and args.fragmentlength != None and args.insertlength != None and (int(args.insertlength) < 0 or int(args.insertlength) > width - (int(args.fragmentlength)*2)):
print "Since you specified insert length in paired mode, it must be at least 0 and at most width-(fragmentlength*2) (default is 0)"
sys.exit()
if not args.pairedend and args.fragmentlength != None and (int(args.fragmentlength) < 1 or int(args.fragmentlength) > width):
print "Since you specified fragment length (not in paired mode), it must be at least 1 and at most width (default is width)"
sys.exit()
if height < 1 or width < 1:
print "dimensions must be at least 1"
sys.exit()
if k < 2:
print "k must be greater or equal to 2"
sys.exit()
if errorrate < 0.0 or errorrate > 1.0 or gaprate < 0.0 or gaprate > 1.0:
print "rates must be between 0 and 1"
sys.exit()
if args.longfmt == False:
outfile = None
outfile1 = args.matrixout
else:
outfile = args.matrixout + "-long"
outfile1 = args.matrixout
if k == 2:
if args.pairedend: H = diploidPairedend(args.fragmentlength,args.insertlength,height, width, gaprate, errorrate,k,outfile,outfile1)
else: H = diploid(args.fragmentlength,height, width, gaprate, errorrate,k,outfile,outfile1)
else:
if args.pairedend: H = kploidPairedend(args.fragmentlength,args.insertlength,height, width, gaprate, errorrate,k,outfile,outfile1)
else: H = kploid(args.fragmentlength,height, width, gaprate, errorrate,k,outfile,outfile1)
with open(args.hapout,"w") as F:
for h in H:
F.write("".join([str(h[i]) for i in xrange(width)]))
F.write("\n") | 43.575448 | 218 | 0.678249 | 2,437 | 17,038 | 4.713172 | 0.086582 | 0.039701 | 0.018806 | 0.012537 | 0.829967 | 0.816472 | 0.816472 | 0.802716 | 0.786784 | 0.772941 | 0 | 0.016264 | 0.177192 | 17,038 | 391 | 219 | 43.575448 | 0.803053 | 0.16158 | 0 | 0.831325 | 0 | 0.018072 | 0.109197 | 0.006539 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.006024 | null | null | 0.042169 | 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 |
af5e1c07403f2a2d1609e0f66c31ca9c72481ac9 | 1,299 | py | Python | gestionProtocolos_y_Estudios/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T01:20:45.000Z | 2021-01-09T01:20:45.000Z | gestionProtocolos_y_Estudios/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T00:53:55.000Z | 2021-01-09T00:53:55.000Z | gestionProtocolos_y_Estudios/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-07T23:57:28.000Z | 2021-01-07T23:57:28.000Z | # GESTION PROTOCOLOS Y ESTUDIOS
from django.contrib import admin
from gestionProtocolos_y_Estudios.models import direccionProtocolo
# Register your models here.
class direccionProtocoloAdmin(admin.ModelAdmin):
list_display=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3")
search_fields=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3")
list_filter=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3")
date_hierarchy=("fechaInicioInvestigacion")
admin.site.register(direccionProtocolo, direccionProtocoloAdmin)
| 86.6 | 324 | 0.82756 | 98 | 1,299 | 10.72449 | 0.44898 | 0.059943 | 0.085633 | 0.134158 | 0.707897 | 0.707897 | 0.707897 | 0.707897 | 0.707897 | 0.707897 | 0 | 0.014682 | 0.056197 | 1,299 | 14 | 325 | 92.785714 | 0.842577 | 0.04311 | 0 | 0 | 0 | 0 | 0.633871 | 0.391935 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.875 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
af8716a81eadc0456f7631860ffae014f8e66b53 | 4,918 | py | Python | processedPrograms/path.py | Vlad12344/RoboDKToPulsePostprocessor | 95b3c52a82bffe43862a1d4edcf388fa25dffca0 | [
"MIT"
] | null | null | null | processedPrograms/path.py | Vlad12344/RoboDKToPulsePostprocessor | 95b3c52a82bffe43862a1d4edcf388fa25dffca0 | [
"MIT"
] | null | null | null | processedPrograms/path.py | Vlad12344/RoboDKToPulsePostprocessor | 95b3c52a82bffe43862a1d4edcf388fa25dffca0 | [
"MIT"
] | null | null | null | import time
from pulseapi import *
robot = RobotPulse('127.0.0.1:8081')
speed_ms = 0.3
speed_ms = 1.0
robot.change_tool_info(tool_info(position([0.0,0.0,0.0], [-0.0,0.0,-0.0])))
target_poses = [
pose([-148.91, -52.65, 134.48, -171.83, -90.0, 121.09]),
]
robot.run_poses(target_poses, tcp_max_velocity=1.0, motion_type=MT_JOINT)
robot.await_stop()
target_position = [
position([0.315, 0.3307, 0.0], [-3.142, -0.0, -3.142]),
]
robot.run_positions(target_position, tcp_max_velocity=1.0, motion_type=MT_LINEAR)
robot.await_stop()
speed_ms = 0.05
target_position = [
position([0.315, 0.428, 0.0], [-3.142, -0.0, -3.142]),
position([0.316, 0.4302, 0.0], [-3.142, -0.0, -3.142]),
position([0.318, 0.431, 0.0], [-3.142, -0.0, -3.142]),
position([0.3206, 0.431, 0.0], [-3.142, -0.0, -3.142]),
position([0.3221, 0.4312, 0.0], [-3.142, -0.0, -3.142]),
position([0.325, 0.4329, 0.0], [-3.142, -0.0, -3.142]),
position([0.3265, 0.436, 0.0], [-3.142, -0.0, -3.142]),
position([0.3261, 0.4394, 0.0], [-3.142, -0.0, -3.142]),
position([0.3239, 0.442, 0.0], [-3.142, -0.0, -3.142]),
position([0.3206, 0.443, 0.0], [-3.142, -0.0, -3.142]),
position([0.318, 0.443, 0.0], [-3.142, -0.0, -3.142]),
position([0.316, 0.4438, 0.0], [-3.142, -0.0, -3.142]),
position([0.315, 0.446, 0.0], [-3.142, -0.0, -3.142]),
position([0.315, 0.5433, 0.0], [-3.142, -0.0, -3.142]),
position([0.3158, 0.5453, 0.0], [-3.142, -0.0, -3.142]),
position([0.318, 0.5463, 0.0], [-3.142, -0.0, -3.142]),
position([0.3206, 0.5463, 0.0], [-3.142, -0.0, -3.142]),
position([0.3239, 0.5473, 0.0], [-3.142, -0.0, -3.142]),
position([0.3261, 0.5499, 0.0], [-3.142, -0.0, -3.142]),
position([0.3266, 0.5523, 0.0], [-3.142, -0.0, -3.142]),
position([0.3266, 0.556, 0.0], [-3.142, -0.0, -3.142]),
position([0.3274, 0.558, 0.0], [-3.142, -0.0, -3.142]),
position([0.3296, 0.559, 0.0], [-3.142, -0.0, -3.142]),
position([0.4204, 0.559, 0.0], [-3.142, -0.0, -3.142]),
position([0.4226, 0.558, 0.0], [-3.142, -0.0, -3.142]),
position([0.4234, 0.556, 0.0], [-3.142, -0.0, -3.142]),
position([0.4234, 0.5523, 0.0], [-3.142, -0.0, -3.142]),
position([0.4244, 0.549, 0.0], [-3.142, -0.0, -3.142]),
position([0.427, 0.5468, 0.0], [-3.142, -0.0, -3.142]),
position([0.4294, 0.5463, 0.0], [-3.142, -0.0, -3.142]),
position([0.432, 0.5463, 0.0], [-3.142, -0.0, -3.142]),
position([0.4342, 0.5453, 0.0], [-3.142, -0.0, -3.142]),
position([0.435, 0.5433, 0.0], [-3.142, -0.0, -3.142]),
position([0.435, 0.446, 0.0], [-3.142, -0.0, -3.142]),
position([0.434, 0.4438, 0.0], [-3.142, -0.0, -3.142]),
position([0.432, 0.443, 0.0], [-3.142, -0.0, -3.142]),
position([0.4294, 0.443, 0.0], [-3.142, -0.0, -3.142]),
position([0.4279, 0.4428, 0.0], [-3.142, -0.0, -3.142]),
position([0.425, 0.4411, 0.0], [-3.142, -0.0, -3.142]),
position([0.4235, 0.438, 0.0], [-3.142, -0.0, -3.142]),
position([0.4239, 0.4346, 0.0], [-3.142, -0.0, -3.142]),
position([0.4261, 0.432, 0.0], [-3.142, -0.0, -3.142]),
position([0.4294, 0.431, 0.0], [-3.142, -0.0, -3.142]),
position([0.432, 0.431, 0.0], [-3.142, -0.0, -3.142]),
position([0.4342, 0.43, 0.0], [-3.142, -0.0, -3.142]),
position([0.435, 0.428, 0.0], [-3.142, -0.0, -3.142]),
position([0.435, 0.3307, 0.0], [-3.142, -0.0, -3.142]),
position([0.4342, 0.3287, 0.0], [-3.142, -0.0, -3.142]),
position([0.432, 0.3277, 0.0], [-3.142, -0.0, -3.142]),
position([0.4294, 0.3277, 0.0], [-3.142, -0.0, -3.142]),
position([0.4261, 0.3267, 0.0], [-3.142, -0.0, -3.142]),
position([0.4239, 0.3241, 0.0], [-3.142, -0.0, -3.142]),
position([0.4234, 0.3217, 0.0], [-3.142, -0.0, -3.142]),
position([0.4234, 0.318, 0.0], [-3.142, -0.0, -3.142]),
position([0.4226, 0.316, 0.0], [-3.142, -0.0, -3.142]),
position([0.4204, 0.315, 0.0], [-3.142, -0.0, -3.142]),
position([0.3296, 0.315, 0.0], [-3.142, -0.0, -3.142]),
position([0.3276, 0.3158, 0.0], [-3.142, -0.0, -3.142]),
position([0.3266, 0.318, 0.0], [-3.142, -0.0, -3.142]),
position([0.3266, 0.3217, 0.0], [-3.142, -0.0, -3.142]),
position([0.3261, 0.3241, 0.0], [-3.142, -0.0, -3.142]),
position([0.3239, 0.3267, 0.0], [-3.142, -0.0, -3.142]),
position([0.3206, 0.3277, 0.0], [-3.142, -0.0, -3.142]),
position([0.318, 0.3277, 0.0], [-3.142, -0.0, -3.142]),
position([0.316, 0.3285, 0.0], [-3.142, -0.0, -3.142]),
position([0.315, 0.3307, 0.0], [-3.142, -0.0, -3.142]),
]
robot.run_positions(target_position, tcp_max_velocity=0.05, motion_type=MT_LINEAR)
robot.await_stop()
speed_ms = 1.0
target_position = [
position([0.315, 0.3307, 0.1], [-3.142, -0.0, -3.142]),
]
robot.run_positions(target_position, tcp_max_velocity=1.0, motion_type=MT_LINEAR)
robot.await_stop()
| 51.768421 | 83 | 0.519317 | 1,020 | 4,918 | 2.465686 | 0.105882 | 0.116899 | 0.161034 | 0.322068 | 0.870775 | 0.870775 | 0.860437 | 0.860437 | 0.831014 | 0.812724 | 0 | 0.367805 | 0.166328 | 4,918 | 94 | 84 | 52.319149 | 0.24561 | 0 | 0 | 0.139785 | 0 | 0 | 0.002847 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.021505 | 0 | 0.021505 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 | 9 |
afa607e75c099181d79c9a0ba64e74b995cd6023 | 172 | py | Python | utils/convert/quant_onnx.py | stephanballer/deepedgebench | 1f905f88874f063607dd9f5fa97177a701a317f9 | [
"MIT"
] | 1 | 2021-12-28T09:04:05.000Z | 2021-12-28T09:04:05.000Z | utils/convert/quant_onnx.py | stephanballer/deepedgebench | 1f905f88874f063607dd9f5fa97177a701a317f9 | [
"MIT"
] | null | null | null | utils/convert/quant_onnx.py | stephanballer/deepedgebench | 1f905f88874f063607dd9f5fa97177a701a317f9 | [
"MIT"
] | null | null | null | import onnx
from onnxruntime.quantization import quantize_dynamic
def quant_onnx(model_path, output_path):
quantized_model = quantize_dynamic(model_path, output_path)
| 28.666667 | 63 | 0.843023 | 23 | 172 | 5.956522 | 0.565217 | 0.218978 | 0.218978 | 0.277372 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104651 | 172 | 5 | 64 | 34.4 | 0.88961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 0 | 0.75 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
afd600309ff7fb3ae56ab5a96de19367c156daf0 | 75 | py | Python | xrayMP/test.py | x94carbone/xrayMP | d43aff9cfe70ccacd6b635322841faeed2d3467e | [
"BSD-3-Clause"
] | null | null | null | xrayMP/test.py | x94carbone/xrayMP | d43aff9cfe70ccacd6b635322841faeed2d3467e | [
"BSD-3-Clause"
] | null | null | null | xrayMP/test.py | x94carbone/xrayMP | d43aff9cfe70ccacd6b635322841faeed2d3467e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
def print_hello_world():
print("hello world")
| 12.5 | 24 | 0.68 | 11 | 75 | 4.454545 | 0.727273 | 0.408163 | 0.612245 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015873 | 0.16 | 75 | 5 | 25 | 15 | 0.761905 | 0.28 | 0 | 0 | 0 | 0 | 0.207547 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0 | 0.5 | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 7 |
bb7f43b3bcd518004adc561520284f007eca8b34 | 64,408 | py | Python | TweakApi/apis/team_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/team_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/team_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class TeamPermissionSetApi(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):
config = Configuration()
if api_client:
self.api_client = api_client
else:
if not config.api_client:
config.api_client = ApiClient()
self.api_client = config.api_client
def team_permission_sets_change_stream_get(self, **kwargs):
"""
Create a change stream.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_change_stream_get(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str options:
:return: file
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_change_stream_get_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_change_stream_get_with_http_info(**kwargs)
return data
def team_permission_sets_change_stream_get_with_http_info(self, **kwargs):
"""
Create a change stream.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_change_stream_get_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str options:
:return: file
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['options']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_change_stream_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets/change-stream'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'options' in params:
query_params['options'] = params['options']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='file',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_change_stream_post(self, **kwargs):
"""
Create a change stream.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_change_stream_post(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str options:
:return: file
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_change_stream_post_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_change_stream_post_with_http_info(**kwargs)
return data
def team_permission_sets_change_stream_post_with_http_info(self, **kwargs):
"""
Create a change stream.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_change_stream_post_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str options:
:return: file
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['options']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_change_stream_post" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets/change-stream'.replace('{format}', 'json')
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
if 'options' in params:
form_params.append(('options', params['options']))
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='file',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_count_get(self, **kwargs):
"""
Count instances of the model matched by where from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_count_get(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str where: Criteria to match model instances
:return: InlineResponse2001
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_count_get_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_count_get_with_http_info(**kwargs)
return data
def team_permission_sets_count_get_with_http_info(self, **kwargs):
"""
Count instances of the model matched by where from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_count_get_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str where: Criteria to match model instances
:return: InlineResponse2001
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['where']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_count_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets/count'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'where' in params:
query_params['where'] = params['where']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2001',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_find_one_get(self, **kwargs):
"""
Find first instance of the model matched by filter from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_find_one_get(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_find_one_get_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_find_one_get_with_http_info(**kwargs)
return data
def team_permission_sets_find_one_get_with_http_info(self, **kwargs):
"""
Find first instance of the model matched by filter from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_find_one_get_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['filter']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_find_one_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets/findOne'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'filter' in params:
query_params['filter'] = params['filter']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_get(self, **kwargs):
"""
Find all instances of the model matched by filter from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_get(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
:return: list[TeamPermissionSet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_get_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_get_with_http_info(**kwargs)
return data
def team_permission_sets_get_with_http_info(self, **kwargs):
"""
Find all instances of the model matched by filter from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_get_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
:return: list[TeamPermissionSet]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['filter']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'filter' in params:
query_params['filter'] = params['filter']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[TeamPermissionSet]',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_delete(self, id, **kwargs):
"""
Delete a model instance by {{id}} from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_delete(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_delete_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_delete_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_delete_with_http_info(self, id, **kwargs):
"""
Delete a model instance by {{id}} from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_delete_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_delete`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_exists_get(self, id, **kwargs):
"""
Check whether a model instance exists in the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_exists_get(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: InlineResponse2002
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_exists_get_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_exists_get_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_exists_get_with_http_info(self, id, **kwargs):
"""
Check whether a model instance exists in the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_exists_get_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: InlineResponse2002
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_exists_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_exists_get`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}/exists'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2002',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_get(self, id, **kwargs):
"""
Find a model instance by {{id}} from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_get(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_get_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_get_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_get_with_http_info(self, id, **kwargs):
"""
Find a model instance by {{id}} from the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_get_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'filter']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_get`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
query_params = {}
if 'filter' in params:
query_params['filter'] = params['filter']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_head(self, id, **kwargs):
"""
Check whether a model instance exists in the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_head(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: InlineResponse2002
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_head_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_head_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_head_with_http_info(self, id, **kwargs):
"""
Check whether a model instance exists in the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_head_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:return: InlineResponse2002
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_head" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_head`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'HEAD',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2002',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_patch(self, id, **kwargs):
"""
Patch attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_patch(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TeamPermissionSet id (required)
:param TeamPermissionSet data: An object of model property name/value pairs
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_patch_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_patch_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_patch_with_http_info(self, id, **kwargs):
"""
Patch attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_patch_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TeamPermissionSet id (required)
:param TeamPermissionSet data: An object of model property name/value pairs
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'data']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_patch" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_patch`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'data' in params:
body_params = params['data']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_put(self, id, **kwargs):
"""
Replace attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_put(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_put_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_put_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_put_with_http_info(self, id, **kwargs):
"""
Replace attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_put_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'data']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_put" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_put`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'data' in params:
body_params = params['data']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_replace_post(self, id, **kwargs):
"""
Replace attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_replace_post(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_replace_post_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_replace_post_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_replace_post_with_http_info(self, id, **kwargs):
"""
Replace attributes for a model instance and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_replace_post_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: Model id (required)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'data']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_replace_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_replace_post`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}/replace'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'data' in params:
body_params = params['data']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_id_team_get(self, id, **kwargs):
"""
Fetches belongsTo relation team.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_team_get(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TeamPermissionSet id (required)
:param bool refresh:
:return: Team
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_id_team_get_with_http_info(id, **kwargs)
else:
(data) = self.team_permission_sets_id_team_get_with_http_info(id, **kwargs)
return data
def team_permission_sets_id_team_get_with_http_info(self, id, **kwargs):
"""
Fetches belongsTo relation team.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_id_team_get_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TeamPermissionSet id (required)
:param bool refresh:
:return: Team
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'refresh']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_id_team_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `team_permission_sets_id_team_get`")
collection_formats = {}
resource_path = '/TeamPermissionSets/{id}/team'.replace('{format}', 'json')
path_params = {}
if 'id' in params:
path_params['id'] = params['id']
query_params = {}
if 'refresh' in params:
query_params['refresh'] = params['refresh']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Team',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def team_permission_sets_post(self, **kwargs):
"""
Create a new instance of the model and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_post(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.team_permission_sets_post_with_http_info(**kwargs)
else:
(data) = self.team_permission_sets_post_with_http_info(**kwargs)
return data
def team_permission_sets_post_with_http_info(self, **kwargs):
"""
Create a new instance of the model and persist it into the data source.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.team_permission_sets_post_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param TeamPermissionSet data: Model instance data
:return: TeamPermissionSet
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['data']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method team_permission_sets_post" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TeamPermissionSets'.replace('{format}', 'json')
path_params = {}
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'data' in params:
body_params = params['data']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
if not header_params['Accept']:
del header_params['Accept']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])
# Authentication setting
auth_settings = ['access_token']
return self.api_client.call_api(resource_path, 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='TeamPermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
| 41.102744 | 165 | 0.568687 | 6,572 | 64,408 | 5.34084 | 0.039257 | 0.063818 | 0.054359 | 0.036467 | 0.96416 | 0.961425 | 0.959316 | 0.949544 | 0.945584 | 0.943647 | 0 | 0.00112 | 0.348171 | 64,408 | 1,566 | 166 | 41.128991 | 0.834933 | 0.324028 | 0 | 0.821429 | 0 | 0 | 0.176511 | 0.069288 | 0 | 0 | 0 | 0 | 0 | 1 | 0.039835 | false | 0 | 0.009615 | 0 | 0.108516 | 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 |
bba3e056a32bcb1a5aa6d731a43c75fd47c8a2e7 | 7,400 | py | Python | tests/models/work_experience_tests.py | domenicosolazzo/Human | 272bbd939c90e0874a51022b9f716ed47e886fec | [
"MIT"
] | null | null | null | tests/models/work_experience_tests.py | domenicosolazzo/Human | 272bbd939c90e0874a51022b9f716ed47e886fec | [
"MIT"
] | null | null | null | tests/models/work_experience_tests.py | domenicosolazzo/Human | 272bbd939c90e0874a51022b9f716ed47e886fec | [
"MIT"
] | null | null | null | from nose.tools import *
from human.core.api.models.work_experience import Employer, Place
def test_employer():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_name():
data = {
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, None)
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_from_date():
data = {
"name": "abc",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, None)
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_to_date():
data = {
"name": "abc",
"from_date": "25/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, None)
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_summary():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, None)
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_title():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"sector": "Healthcare",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,None)
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_sector():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"keywords": ["Python"],
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, None)
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_keywords():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"place": {"name":"Oslo"}
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, [])
assert_equal(employer.place.name, "Oslo")
def test_employer__without_place():
data = {
"name": "abc",
"from_date": "25/08/1982",
"to_date":"26/08/1982",
"summary": "This is a summary",
"name": "abc",
"title": "Developer",
"sector": "Healthcare",
"keywords": ["Python"]
}
employer = Employer(data)
assert_true(isinstance(employer, Employer))
assert_equal(employer.from_date, "25/08/1982")
assert_equal(employer.to_date, "26/08/1982")
assert_equal(employer.summary, "This is a summary")
assert_equal(employer.name, "abc")
assert_equal(employer.title,"Developer" )
assert_equal(employer.sector, "Healthcare")
assert_equal(employer.keywords, ["Python"])
assert_equal(employer.place, None)
def test_employer__keywords_must_be_a_list():
data = { "keywords": 1 }
employer = Employer(data)
assert_equal(employer.keywords, [])
data = {"keywords": True}
employer = Employer(data)
assert_equal(employer.keywords, [])
data = {"keywords": "string"}
employer = Employer(data)
assert_equal(employer.keywords, [])
data = {"keywords": ["Python"]}
employer = Employer(data)
assert_equal(employer.keywords, ["Python"])
| 31.489362 | 65 | 0.628378 | 854 | 7,400 | 5.255269 | 0.052693 | 0.186275 | 0.321747 | 0.042781 | 0.948752 | 0.945633 | 0.944296 | 0.933824 | 0.929144 | 0.889706 | 0 | 0.044014 | 0.210946 | 7,400 | 234 | 66 | 31.623932 | 0.72461 | 0 | 0 | 0.838235 | 0 | 0 | 0.223214 | 0 | 0 | 0 | 0 | 0 | 0.416667 | 1 | 0.04902 | false | 0 | 0.009804 | 0 | 0.058824 | 0 | 0 | 0 | 0 | null | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
a5445586308cf87377d4a8cebf77198263e6bd4a | 44 | py | Python | test.py | coffeeTeaOne/IPProxy | a02f6fdb508394d8a9274d9da2c2ba092c0c13df | [
"Apache-2.0"
] | null | null | null | test.py | coffeeTeaOne/IPProxy | a02f6fdb508394d8a9274d9da2c2ba092c0c13df | [
"Apache-2.0"
] | null | null | null | test.py | coffeeTeaOne/IPProxy | a02f6fdb508394d8a9274d9da2c2ba092c0c13df | [
"Apache-2.0"
] | null | null | null | print(123)
print(123)
print(123)
print(123)
| 8.8 | 10 | 0.727273 | 8 | 44 | 4 | 0.25 | 1 | 1.21875 | 1.5 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.3 | 0.090909 | 44 | 4 | 11 | 11 | 0.5 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 12 |
a5ac57e8e9427ddaa34e723bc39595ea610c1ce6 | 17,822 | py | Python | thor/plotting/analysis.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | thor/plotting/analysis.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | thor/plotting/analysis.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from ..config import Config
from .helpers import _setPercentage
from .contour import plotScatterContour
__all__ = ["_plotGrid",
"plotProjectionVelocitiesFindable",
"plotProjectionVelocitiesFound",
"plotProjectionVelocitiesMissed",
"plotOrbitsFindable",
"plotOrbitsFound",
"plotOrbitsMissed"]
def _plotGrid(ax,
vxRange,
vyRange):
"""
Helper function that plots a rectangular shape.
"""
rect = patches.Rectangle((vxRange[0], vyRange[0]),
vxRange[1]-vxRange[0],
vyRange[1]-vyRange[0],
linewidth=0.5,
edgecolor='r',
facecolor='none')
ax.add_patch(rect)
return
def plotProjectionVelocitiesFindable(allObjects,
vxRange=None,
vyRange=None):
"""
Plots objects that should be findable in the projection
space based on their median velocities and the
chosen velocity ranges.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'findable' column to be populated,
as well as the median projection space velocities and the median
heliocentric distance.
vxRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in x.
[Default = None]
vyRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in y.
[Default = None]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
if vxRange is not None and vyRange is not None:
in_zone_findable = ((allObjects["dtheta_x/dt_median"] >= vxRange[0])
& (allObjects["dtheta_x/dt_median"] <= vxRange[1])
& (allObjects["dtheta_y/dt_median"] <= vyRange[1])
& (allObjects["dtheta_y/dt_median"] >= vyRange[0])
& (allObjects["findable"] == 1))
fig, ax = plt.subplots(1, 1, dpi=600)
ax.errorbar(allObjects[allObjects["findable"] == 1]["dtheta_x/dt_median"].values,
allObjects[allObjects["findable"] == 1]["dtheta_y/dt_median"].values,
yerr=allObjects[allObjects["findable"] == 1]["dtheta_y/dt_sigma"].values,
xerr=allObjects[allObjects["findable"] == 1]["dtheta_x/dt_sigma"].values,
fmt="o",
ms=0.01,
capsize=0.1,
elinewidth=0.1,
c="k", zorder=-1)
cm = ax.scatter(allObjects[allObjects["findable"] == 1]["dtheta_x/dt_median"].values,
allObjects[allObjects["findable"] == 1]["dtheta_y/dt_median"].values,
s=0.1,
c=allObjects[allObjects["findable"] == 1]["r_au_median"].values,
vmin=0,
vmax=5.0,
cmap="viridis")
cb = fig.colorbar(cm, fraction=0.02, pad=0.02)
ax.set_aspect("equal")
if vxRange is not None and vyRange is not None:
_plotGrid(ax, vxRange, vyRange)
# Add labels and text
cb.set_label("r [AU]", size=10)
ax.set_xlabel(r"Median $ d\theta_X / dt$ [Degrees Per Day]", size=10)
ax.set_ylabel(r"Median $ d\theta_Y / dt$ [Degrees Per Day]", size=10)
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.05),
"Objects Findable: {}".format(len(allObjects[allObjects["findable"] == 1])))
if vxRange is not None and vyRange is not None:
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.11),
"Objects Findable in Grid: {}".format(len(allObjects[in_zone_findable])),
color="r")
return fig, ax
def plotProjectionVelocitiesFound(allObjects,
vxRange=None,
vyRange=None):
"""
Plots objects that were found in the projection
space based on their median velocities and the
chosen velocity ranges.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'found' column to be populated,
as well as the median projection space velocities and the median
heliocentric distance.
vxRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in x.
[Default = None]
vyRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in y.
[Default = None]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
if vxRange is not None and vyRange is not None:
in_zone_found = ((allObjects["dtheta_x/dt_median"] >= vxRange[0])
& (allObjects["dtheta_x/dt_median"] <= vxRange[1])
& (allObjects["dtheta_y/dt_median"] <= vyRange[1])
& (allObjects["dtheta_y/dt_median"] >= vyRange[0])
& (allObjects["found"] == 1))
fig, ax = plt.subplots(1, 1, dpi=600)
ax.errorbar(allObjects[allObjects["findable"] == 1]["dtheta_x/dt_median"].values,
allObjects[allObjects["findable"] == 1]["dtheta_y/dt_median"].values,
yerr=allObjects[allObjects["findable"] == 1]["dtheta_y/dt_sigma"].values,
xerr=allObjects[allObjects["findable"] == 1]["dtheta_x/dt_sigma"].values,
fmt="o",
ms=0.01,
capsize=0.1,
elinewidth=0.1,
c="k", zorder=-1)
if len(allObjects[allObjects["found"] == 1]) != 0:
cm = ax.scatter(allObjects[allObjects["found"] == 1]["dtheta_x/dt_median"].values,
allObjects[allObjects["found"] == 1]["dtheta_y/dt_median"].values,
s=0.1,
c=allObjects[allObjects["found"] == 1]["r_au_median"].values,
vmin=0,
vmax=5.0,
cmap="viridis")
cb = fig.colorbar(cm, fraction=0.02, pad=0.02)
cb.set_label("r [AU]", size=10)
ax.set_aspect("equal")
if vxRange is not None and vyRange is not None:
_plotGrid(ax, vxRange, vyRange)
# Add labels and text
ax.set_xlabel(r"Median $ d\theta_X / dt$ [Degrees Per Day]", size=10)
ax.set_ylabel(r"Median $ d\theta_Y / dt$ [Degrees Per Day]", size=10)
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.05),
"Objects Found: {}".format(len(allObjects[allObjects["found"] == 1])))
if vxRange is not None and vyRange is not None:
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.11),
"Objects Found in Grid: {}".format(len(allObjects[in_zone_found])),
color="g")
return fig, ax
def plotProjectionVelocitiesMissed(allObjects,
vxRange=None,
vyRange=None):
"""
Plots objects that were missed in the projection
space based on their median velocities and the
chosen velocity ranges.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'found' and 'findable' column to be populated,
as well as the median projection space velocities and the median
heliocentric distance.
vxRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in x.
[Default = None]
vyRange : {None, list or `~numpy.ndarray` (2)}
Maximum and minimum velocity range in y.
[Default = None]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
if vxRange is not None and vyRange is not None:
in_zone_missed = ((allObjects["dtheta_x/dt_median"] >= vxRange[0])
& (allObjects["dtheta_x/dt_median"] <= vxRange[1])
& (allObjects["dtheta_y/dt_median"] <= vyRange[1])
& (allObjects["dtheta_y/dt_median"] >= vyRange[0])
& (allObjects["found"] == 0)
& (allObjects["findable"] == 1))
fig, ax = plt.subplots(1, 1, dpi=600)
ax.errorbar(allObjects[allObjects["findable"] == 1]["dtheta_x/dt_median"].values,
allObjects[allObjects["findable"] == 1]["dtheta_y/dt_median"].values,
yerr=allObjects[allObjects["findable"] == 1]["dtheta_y/dt_sigma"].values,
xerr=allObjects[allObjects["findable"] == 1]["dtheta_x/dt_sigma"].values,
fmt="o",
ms=0.01,
capsize=0.1,
elinewidth=0.1,
c="k", zorder=-1)
if len(allObjects[(allObjects["findable"] == 1) & (allObjects["found"] == 0)]) > 0:
cm = ax.scatter(allObjects[(allObjects["findable"] == 1) & (allObjects["found"] == 0)]["dtheta_x/dt_median"].values,
allObjects[(allObjects["findable"] == 1) & (allObjects["found"] == 0)]["dtheta_y/dt_median"].values,
s=0.1,
c=allObjects[(allObjects["findable"] == 1) & (allObjects["found"] == 0)]["r_au_median"].values,
vmin=0,
vmax=5.0,
cmap="viridis")
cb = fig.colorbar(cm, fraction=0.02, pad=0.02)
cb.set_label("r [AU]", size=10)
ax.set_aspect("equal")
if vxRange is not None and vyRange is not None:
_plotGrid(ax, vxRange, vyRange)
# Add labels and text
ax.set_xlabel(r"Median $ d\theta_X / dt$ [Degrees Per Day]", size=10)
ax.set_ylabel(r"Median $ d\theta_Y / dt$ [Degrees Per Day]", size=10)
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.05),
"Objects Missed: {}".format(len(allObjects[(allObjects["findable"] == 1) & (allObjects["found"] == 0)])))
if vxRange is not None and vyRange is not None:
ax.text(_setPercentage(ax.get_xlim(), 0.04),
_setPercentage(ax.get_ylim(), 0.11),
"Objects Missed in Grid: {}".format(len(allObjects[in_zone_missed])),
color="r")
return fig, ax
def plotOrbitsFindable(allObjects,
orbits,
testOrbits=None,
columnMapping=Config.COLUMN_MAPPING):
"""
Plots orbits that should be findable in semi-major axis, inclination
and eccentrity space.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'findable' column to be populated.
orbits : `~pandas.DataFrame`
Orbit DataFrame, should contain the orbits for the objects in
the allObjects DataFrame.
testOrbits : {None, `~pandas.DataFrame`}, optional
If passed, will plot test orbits in red.
[Default = None]
columnMapping : dict, optional
Column name mapping of orbits DataFrame to internally used column names.
[Default = `~thor.Config.COLUMN_MAPPING`]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
findable = orbits[orbits[columnMapping["name"]].isin(allObjects[allObjects["findable"] == 1][columnMapping["name"]].values)]
fig, ax = plotScatterContour(findable,
columnMapping["a_au"],
columnMapping["i_deg"],
columnMapping["e"],
plotCounts=False,
logCounts=True,
countLevels=4,
mask=None,
xLabel="a [AU]",
yLabel="i [Degrees]",
zLabel="e",
scatterKwargs={"s": 0.1, "vmin": 0, "vmax": 1, "cmap": "viridis"})
if type(testOrbits) == pd.DataFrame:
# If test orbits exist in known orbits, plot them
test_orbits_in_known = orbits[orbits[columnMapping["name"]].isin(testOrbits[columnMapping["name"]].values)]
if len(test_orbits_in_known) != 0:
ax.scatter(*test_orbits_in_known[[columnMapping["a_au"], columnMapping["i_deg"]]].values.T,
s=2,
c="r",
label="Test Orbits")
ax.legend(loc='upper right')
return fig, ax
def plotOrbitsFound(allObjects,
orbits,
testOrbits=None,
columnMapping=Config.COLUMN_MAPPING):
"""
Plots orbits that have been found in semi-major axis, inclination
and eccentrity space.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'found' column to be populated.
orbits : `~pandas.DataFrame`
Orbit DataFrame, should contain the orbits for the objects in
the allObjects DataFrame.
testOrbits : {None, `~pandas.DataFrame`}, optional
If passed, will plot test orbits in red.
[Default = None]
columnMapping : dict, optional
Column name mapping of orbits DataFrame to internally used column names.
[Default = `~thor.Config.COLUMN_MAPPING`]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
found = orbits[orbits[columnMapping["name"]].isin(allObjects[allObjects["found"] == 1][columnMapping["name"]].values)]
fig, ax = plotScatterContour(found,
columnMapping["a_au"],
columnMapping["i_deg"],
columnMapping["e"],
plotCounts=False,
logCounts=True,
countLevels=4,
mask=None,
xLabel="a [AU]",
yLabel="i [Degrees]",
zLabel="e",
scatterKwargs={"s": 0.1, "vmin": 0, "vmax": 1, "cmap": "viridis"})
if type(testOrbits) == pd.DataFrame:
# If test orbits exist in known orbits, plot them
test_orbits_in_known = orbits[orbits[columnMapping["name"]].isin(testOrbits[columnMapping["name"]].values)]
if len(test_orbits_in_known) != 0:
ax.scatter(*test_orbits_in_known[[columnMapping["a_au"], columnMapping["i_deg"]]].values.T,
s=2,
c="r",
label="Test Orbits")
ax.legend(loc='upper right')
return fig, ax
def plotOrbitsMissed(allObjects,
orbits,
testOrbits=None,
columnMapping=Config.COLUMN_MAPPING):
"""
Plots orbits that have been missed (but were findable) in semi-major axis, inclination
and eccentrity space.
Parameters
----------
allObjects : `~pandas.DataFrame`
Object summary DataFrame. Needs 'found' and 'findable' column to be populated.
orbits : `~pandas.DataFrame`
Orbit DataFrame, should contain the orbits for the objects in
the allObjects DataFrame.
testOrbits : {None, `~pandas.DataFrame`}, optional
If passed, will plot test orbits in red.
[Default = None]
columnMapping : dict, optional
Column name mapping of orbits DataFrame to internally used column names.
[Default = `~thor.Config.COLUMN_MAPPING`]
Returns
-------
fig : `~matplotlib.figure.Figure`
The matplotlib figure object.
ax : `~matplotlib.axes._subplots.AxesSubplot`
The matplotlib axes object.
"""
missed = orbits[orbits[columnMapping["name"]].isin(allObjects[(allObjects["found"] == 0) & (allObjects["findable"] == 1)][columnMapping["name"]].values)]
fig, ax = plotScatterContour(missed,
columnMapping["a_au"],
columnMapping["i_deg"],
columnMapping["e"],
plotCounts=False,
logCounts=True,
countLevels=4,
mask=None,
xLabel="a [AU]",
yLabel="i [Degrees]",
zLabel="e",
scatterKwargs={"s": 0.1, "vmin": 0, "vmax": 1, "cmap": "viridis"})
if type(testOrbits) == pd.DataFrame:
# If test orbits exist in known orbits, plot them
test_orbits_in_known = orbits[orbits[columnMapping["name"]].isin(testOrbits[columnMapping["name"]].values)]
if len(test_orbits_in_known) != 0:
ax.scatter(*test_orbits_in_known[[columnMapping["a_au"], columnMapping["i_deg"]]].values.T,
s=2,
c="r",
label="Test Orbits")
ax.legend(loc='upper right')
return fig, ax | 42.841346 | 157 | 0.549714 | 1,904 | 17,822 | 5.049895 | 0.108193 | 0.060322 | 0.049402 | 0.066355 | 0.914821 | 0.907748 | 0.89558 | 0.872595 | 0.837233 | 0.80572 | 0 | 0.017816 | 0.326002 | 17,822 | 416 | 158 | 42.841346 | 0.782634 | 0.271687 | 0 | 0.748918 | 0 | 0 | 0.139964 | 0.007371 | 0 | 0 | 0 | 0 | 0 | 1 | 0.030303 | false | 0 | 0.025974 | 0 | 0.08658 | 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 |
3c3562a4049268c84ac5d07ba1c687e06a5d1bc5 | 9,143 | py | Python | pylily/0409/0409/module1.py | joannachuang/2019_summer_joanna | 1773cbad88cc2b7ebf20cebbd97d2988919372e6 | [
"Apache-2.0"
] | null | null | null | pylily/0409/0409/module1.py | joannachuang/2019_summer_joanna | 1773cbad88cc2b7ebf20cebbd97d2988919372e6 | [
"Apache-2.0"
] | null | null | null | pylily/0409/0409/module1.py | joannachuang/2019_summer_joanna | 1773cbad88cc2b7ebf20cebbd97d2988919372e6 | [
"Apache-2.0"
] | 1 | 2019-07-09T08:39:47.000Z | 2019-07-09T08:39:47.000Z | import Lily.ctao.database as cdb
import Lily.crawler.url_string as url
import pandas
import numpy
import requests
import os
import io
def write_url_tofile(url, filename):
response = requests.get(url , verify=False)
datafile = io.BytesIO()
for chunk in response.iter_content(chunk_size=512 * 1024):
if chunk: # filter out keep-alive new chunks
datafile.write(chunk)
f = open (filename,'wb')
f.write(datafile.getvalue())
f.close()
return datafile.getvalue()
for a in range(1,120):
target='''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/N{0}.pdf'''
target = target.format("%03d" % a)
file = '''d:/107_N{0}.pdf'''
file = file.format("%03d" % a)
arg1 = url.url_string(target)
arg1.to_file(file)
print (target, file)
# delete file
os.remove('''d:/107_N012.pdf''')
os.remove('''d:/107_N105.pdf''')
for b in range(1,115):
target='''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/S{0}.pdf'''
target = target.format("%03d" % b)
file = '''d:/107_S{0}.pdf'''
file = file.format("%03d" % b)
arg1 = url.url_string(target)
arg1.to_file(file)
print (target, file)
os.remove('''d:/107_S024.pdf''')
for b in range(1,120):
for c in range(1,6):
target='''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N{0}.files/sheet{1}.htm'''
target = target.format("%03d"%b,"%03d"%c)
file = '''d:/107_N{0}_sheet{1}.htm'''
file = file.format("%03d"%b,"%03d"%c)
arg1 = url.url_string(target)
arg1.to_file(file)
print (target, file)
for d in range(1,115):
for e in range(1,6):
target='''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S{0}.files/sheet{1}.htm'''
target = target.format("%03d"%d,"%03d"%e)
file = '''d:/107_S{0}_sheet{1}.htm'''
file = file.format("%03d"%d,"%03d"%e)
arg1 = url.url_string(target)
arg1.to_file(file)
print (target, file)
os.remove('''d:/107_N012_sheet001.htm''')
os.remove('''d:/107_N012_sheet002.htm''')
os.remove('''d:/107_N012_sheet003.htm''')
os.remove('''d:/107_N012_sheet004.htm''')
os.remove('''d:/107_N012_sheet005.htm''')
os.remove('''d:/107_N105_sheet001.htm''')
os.remove('''d:/107_N105_sheet002.htm''')
os.remove('''d:/107_N105_sheet003.htm''')
os.remove('''d:/107_N105_sheet004.htm''')
os.remove('''d:/107_N105_sheet005.htm''')
os.remove('''d:/107_S024_sheet001.htm''')
os.remove('''d:/107_S024_sheet002.htm''')
os.remove('''d:/107_S024_sheet003.htm''')
os.remove('''d:/107_S024_sheet004.htm''')
os.remove('''d:/107_S024_sheet005.htm''')
if __name__ == '__console__' or __name__ == '__main__':
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/N012(1).pdf''', 'd:/107_N012(1).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/N012(2).pdf''', 'd:/107_N012(2).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/N105(1).pdf''', 'd:/107_N105(1).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/N105(2).pdf''', 'd:/107_N105(2).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/S024(1).pdf''', 'd:/107_S024(1).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/PDF/S024(2).pdf''', 'd:/107_S024(2).pdf')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(1).files/sheet001.htm''', 'd:/107_N012(1)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(1).files/sheet002.htm''', 'd:/107_N012(1)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(1).files/sheet003.htm''', 'd:/107_N012(1)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(1).files/sheet004.htm''', 'd:/107_N012(1)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(1).files/sheet005.htm''', 'd:/107_N012(1)_sheet005.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(2).files/sheet001.htm''', 'd:/107_N012(2)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(2).files/sheet002.htm''', 'd:/107_N012(2)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(2).files/sheet003.htm''', 'd:/107_N012(2)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(2).files/sheet004.htm''', 'd:/107_N012(2)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N012(2).files/sheet005.htm''', 'd:/107_N012(2)_sheet005.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(1).files/sheet001.htm''', 'd:/107_N105(1)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(1).files/sheet002.htm''', 'd:/107_N105(1)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(1).files/sheet003.htm''', 'd:/107_N105(1)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(1).files/sheet004.htm''', 'd:/107_N105(1)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(1).files/sheet005.htm''', 'd:/107_N015(1)_sheet005.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(2).files/sheet001.htm''', 'd:/107_N105(2)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(2).files/sheet002.htm''', 'd:/107_N105(2)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(2).files/sheet003.htm''', 'd:/107_N105(2)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(2).files/sheet004.htm''', 'd:/107_N105(2)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/N105(2).files/sheet005.htm''', 'd:/107_N105(2)_sheet005.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(1).files/sheet001.htm''', 'd:/107_S024(1)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(1).files/sheet002.htm''', 'd:/107_S024(1)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(1).files/sheet003.htm''', 'd:/107_S024(1)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(1).files/sheet004.htm''', 'd:/107_S024(1)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(1).files/sheet005.htm''', 'd:/107_S024(1)_sheet005.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(2).files/sheet001.htm''', 'd:/107_S024(2)_sheet001.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(2).files/sheet002.htm''', 'd:/107_S024(2)_sheet002.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(2).files/sheet003.htm''', 'd:/107_S024(2)_sheet003.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(2).files/sheet004.htm''', 'd:/107_S024(2)_sheet004.htm')
write_url_tofile('''http://163.29.251.188/botedata/%E4%BA%A4%E9%80%9A%E6%B5%81%E9%87%8F/107%E5%B9%B4%E5%BA%A6/HTM/S024(2).files/sheet005.htm''', 'd:/107_S024(2)_sheet005.htm')
| 71.429688 | 181 | 0.667396 | 1,911 | 9,143 | 3.085296 | 0.055992 | 0.039349 | 0.061058 | 0.081411 | 0.909939 | 0.895862 | 0.711669 | 0.711669 | 0.70251 | 0.690299 | 0 | 0.25 | 0.067265 | 9,143 | 127 | 182 | 71.992126 | 0.44137 | 0.004812 | 0 | 0.113208 | 0 | 0.377358 | 0.674876 | 0.13392 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009434 | false | 0 | 0.066038 | 0 | 0.084906 | 0.037736 | 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 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
3c6ce458d4a438bc4e21cc994f95ef3d41181ee4 | 6,138 | py | Python | tests/test_base_level_precip_changer.py | alexmitchell/terrainbento | b8f6dd7fd9c96d3a40e0d1f8cd41b1dfe8d0b5da | [
"MIT"
] | null | null | null | tests/test_base_level_precip_changer.py | alexmitchell/terrainbento | b8f6dd7fd9c96d3a40e0d1f8cd41b1dfe8d0b5da | [
"MIT"
] | null | null | null | tests/test_base_level_precip_changer.py | alexmitchell/terrainbento | b8f6dd7fd9c96d3a40e0d1f8cd41b1dfe8d0b5da | [
"MIT"
] | null | null | null | # coding: utf8
# !/usr/env/python
import pytest
from scipy.integrate import IntegrationWarning
from landlab import HexModelGrid, RasterModelGrid
from terrainbento.boundary_handlers import PrecipChanger
def test_not_passing_daily_rainfall__intermittency_factor():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=2.0,
)
def test_not_passing_daily_rainfall__intermittency_factor_troc():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=2.0,
)
def test_not_passing_rainfall__mean_rate():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=2.0,
)
def test_not_passing_rainfall__mean_rate_time_rate_of_change():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate=3.0,
rainfall__shape_factor=0.65,
infiltration_capacity=2.0,
)
def test_not_passing_rainfall__shape_factor():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
infiltration_capacity=2.0,
)
def test_not_passing_infiltration_capacity():
mg = HexModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
)
def test_a_stop_time():
"""Test that it is possible to provide a stop time."""
mg = HexModelGrid((5, 5))
pc = PrecipChanger(
mg,
daily_rainfall__intermittency_factor=0.3,
daily_rainfall__intermittency_factor_time_rate_of_change=0.001,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=2.0,
time_unit="day",
precipchanger_start_time=10.0,
precipchanger_stop_time=20.0,
)
# for the first ten steps, nothing should change
for _ in range(10):
pc.run_one_step(1.0)
i, p = pc.get_current_precip_params()
f = pc.get_erodibility_adjustment_factor()
assert i == pc.starting_frac_wet_days
assert p == pc.starting_daily_mean_depth
assert f == 1.0
# run 10 more steps and save
pc.run_one_step(10.0)
i_end, p_end = pc.get_current_precip_params()
f_end = pc.get_erodibility_adjustment_factor()
# then verify that no change occurs again.
for _ in range(10):
pc.run_one_step(1.0)
i, p = pc.get_current_precip_params()
f = pc.get_erodibility_adjustment_factor()
assert i == i_end
assert p == p_end
assert f == f_end
def test_bad_intermittency():
"""Test intermittency factors that are too big or small."""
mg = RasterModelGrid((5, 5))
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=-0.001,
daily_rainfall__intermittency_factor_time_rate_of_change=0.01,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=0,
)
with pytest.raises(ValueError):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=1.001,
daily_rainfall__intermittency_factor_time_rate_of_change=0.01,
rainfall__mean_rate=3.0,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=0,
)
def test_bad_intensity():
"""Test rainfall intensity that is too small."""
mg = RasterModelGrid((5, 5))
with pytest.raises(ValueError):
with pytest.warns(IntegrationWarning):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=1.0,
daily_rainfall__intermittency_factor_time_rate_of_change=0.01,
rainfall__mean_rate=-1,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=0,
)
def test_bad_infiltration():
"""Test infiltration_capacity that is too small."""
mg = RasterModelGrid((5, 5))
with pytest.raises(ValueError):
with pytest.warns(IntegrationWarning):
PrecipChanger(
mg,
daily_rainfall__intermittency_factor=1.0,
daily_rainfall__intermittency_factor_time_rate_of_change=0.01,
rainfall__mean_rate=0.34,
rainfall__mean_rate_time_rate_of_change=0.2,
rainfall__shape_factor=0.65,
infiltration_capacity=-0.001,
)
| 33 | 78 | 0.652493 | 750 | 6,138 | 4.866667 | 0.142667 | 0.078356 | 0.156712 | 0.192877 | 0.81589 | 0.807123 | 0.800274 | 0.795616 | 0.764384 | 0.758356 | 0 | 0.042739 | 0.271913 | 6,138 | 185 | 79 | 33.178378 | 0.773999 | 0.054904 | 0 | 0.711409 | 0 | 0 | 0.000519 | 0 | 0 | 0 | 0 | 0 | 0.040268 | 1 | 0.067114 | false | 0.040268 | 0.026846 | 0 | 0.09396 | 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 |
3c6d2cd856409896e90cab3fd637fec2b0a611be | 218 | py | Python | hds/util/__init__.py | Half-Shot/hds | 91af7e35bb4ece73cca90a815fcd7ae97fb79a80 | [
"MIT"
] | 1 | 2021-07-17T20:43:01.000Z | 2021-07-17T20:43:01.000Z | hds/util/__init__.py | Half-Shot/hds | 91af7e35bb4ece73cca90a815fcd7ae97fb79a80 | [
"MIT"
] | 1 | 2019-08-02T15:40:38.000Z | 2019-08-02T15:40:38.000Z | hds/util/__init__.py | Half-Shot/hds | 91af7e35bb4ece73cca90a815fcd7ae97fb79a80 | [
"MIT"
] | null | null | null | from .util import (HDSFailure, HDSBadKeyFailure,
verify_payload,
determine_our_host)
__all__ = [
HDSFailure,
HDSBadKeyFailure,
verify_payload,
determine_our_host]
| 21.8 | 48 | 0.62844 | 18 | 218 | 7.055556 | 0.611111 | 0.409449 | 0.503937 | 0.614173 | 0.866142 | 0.866142 | 0.866142 | 0 | 0 | 0 | 0 | 0 | 0.316514 | 218 | 9 | 49 | 24.222222 | 0.852349 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
b1e4f1389bdc41db415227d509e2b5b0ebc12105 | 811 | py | Python | tests/unit/model/test_soa.py | becelot/python-hostingde | 9af53747ccf418b97de6510f5c21627ab7bac77f | [
"MIT"
] | null | null | null | tests/unit/model/test_soa.py | becelot/python-hostingde | 9af53747ccf418b97de6510f5c21627ab7bac77f | [
"MIT"
] | 6 | 2021-11-08T10:27:45.000Z | 2021-11-21T18:20:46.000Z | tests/unit/model/test_soa.py | cancom/python-hostingde | 9af53747ccf418b97de6510f5c21627ab7bac77f | [
"MIT"
] | null | null | null | from hostingde.model.soa_values import SoaValues
def test_soa_constructor():
soa: SoaValues = SoaValues(refresh=23, retry=213, expire=25, ttl=12566, negative_ttl=2)
assert soa.refresh == 23
assert soa.retry == 213
assert soa.expire == 25
assert soa.ttl == 12566
assert soa.negative_ttl == 2
def test_soa_parse():
data = dict(refresh=23, retry=213, expire=25, ttl=12566, negativeTtl=2)
soa = SoaValues.from_json(data)
assert soa.refresh == 23
assert soa.retry == 213
assert soa.expire == 25
assert soa.ttl == 12566
assert soa.negative_ttl == 2
def test_soa_dump():
soa: SoaValues = SoaValues(refresh=23, retry=213, expire=25, ttl=12566, negative_ttl=2)
assert soa.to_json() == dict(refresh=23, retry=213, expire=25, ttl=12566, negativeTtl=2)
| 27.033333 | 92 | 0.688039 | 121 | 811 | 4.504132 | 0.231405 | 0.181651 | 0.102752 | 0.124771 | 0.805505 | 0.805505 | 0.805505 | 0.805505 | 0.805505 | 0.805505 | 0 | 0.118721 | 0.189889 | 811 | 29 | 93 | 27.965517 | 0.710807 | 0 | 0 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.578947 | 1 | 0.157895 | false | 0 | 0.052632 | 0 | 0.210526 | 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 |
b1f9181ca0ad18308fdd088510f4cdca01606b03 | 44,635 | py | Python | web/transiq/restapi/tests/tests_employee_roles_mapping.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | web/transiq/restapi/tests/tests_employee_roles_mapping.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | 14 | 2020-06-05T23:06:45.000Z | 2022-03-12T00:00:18.000Z | web/transiq/restapi/tests/tests_employee_roles_mapping.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | import json
from django.contrib.auth.models import User
from django.urls import reverse
from model_mommy import mommy
from rest_framework import status
from rest_framework.test import APITestCase
from authentication.models import Profile
from employee.models import Employee
from restapi.models import EmployeeRoles
from utils.models import AahoOffice
class EmployeeRolesMappingTests(APITestCase):
def setUp(self):
self.login_url = reverse('login')
self.logout_url = reverse('logout')
self.employeerolesmappinglist_url = reverse('employee_roles_mapping_list/')
self.employeerolesmappingcreate_url = reverse('employee_roles_mapping_create/')
self.user = User.objects.create_user(username='john_doe',
email='harshadasawant89@gmail.com',
password='abc12345')
Profile.objects.create(
user=self.user,
name='John_Doe',
phone='9619125174',
)
self.login_data = self.client.post(self.login_url, {'username': 'john_doe', 'password': 'abc12345'}).content
self.login_data = json.loads(self.login_data.decode('utf8'))
self.token = 'Token {}'.format(self.login_data['token'])
self.aaho_office = mommy.make(AahoOffice)
self.employee = mommy.make(Employee, office=self.aaho_office)
self.employee_id = self.employee.id
self.employee_roles = mommy.make(EmployeeRoles)
self.employeeroles_id = self.employee_roles.id
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.employeerolesmapping_id = response.data['data']['id']
class EmployeeRolesMappingCreateTests(EmployeeRolesMappingTests):
def setUp(self):
super().setUp()
self.aaho_office = mommy.make(AahoOffice)
self.employee = mommy.make(Employee, office=self.aaho_office)
self.employee_id = self.employee.id
self.employee_roles = mommy.make(EmployeeRoles, role="traffic")
self.employeeroles_id = self.employee_roles.id
"""
Test ID:TS01TD00055
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_create_405_wrong_method(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get(self.employeerolesmappingcreate_url,
{"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
"""
Test ID:TS01TD00056
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:no header
Status code:401
"""
def test_employee_roles_mapping_create_401_no_header(self):
self.client.credentials()
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Authentication credentials were not provided.")
"""
Test ID:TS01TD00057
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_create_401_expired_header(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.delete(self.logout_url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00057
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:wrong token
Status code:401
"""
def test_employee_roles_mapping_create_401_wrong_token(self):
token = 'Token c8b0f520fa7380fe7090131a4456859b1efc7777'
self.client.credentials(HTTP_AUTHORIZATION=token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00059
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:wrong content type
Status code:415
"""
def test_employee_roles_mapping_create_415_header_with_wrong_content_type(self):
# Negative test case of req quotes create with HTTP Header Authorization token with wrong content type
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/pdf')
self.assertEqual(response.status_code, status.HTTP_415_UNSUPPORTED_MEDIA_TYPE)
"""
Test ID:TS01TD00058
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:blank body
Status code:400
"""
def test_employee_roles_mapping_create_400_blank_body(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url, {}, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "This field is required.")
self.assertEqual(response.data['employee_role_id'][0], "This field is required.")
self.assertEqual(response.data['employee_status'][0], "This field is required.")
"""
Test ID:TS01TD00060
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:blank fields
Status code:400
"""
def test_employee_roles_mapping_create_400_blank_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": "",
"employee_role_id": "",
"employee_status": ""}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_role_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_status'][0], "\"\" is not a valid choice.")
"""
Test ID:TS01TD00061
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:currupt fields
Status code:400
"""
def test_employee_roles_mapping_create_400_corrupt_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": "ksln",
"employee_role_id": "shdks",
"employee_status": "shjdsdh"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_role_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_status'][0], "\"shjdsdh\" is not a valid choice.")
"""
Test ID:TS01TD00062
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:incorrect employee id
Status code:400
"""
def test_employee_roles_mapping_create_400_incorrect_employee_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": "6179797947",
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
"""
Test ID:TS01TD00063
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:incorrect employee role
Status code:400
"""
def test_employee_roles_mapping_create_400_incorrect_employee_role_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": "73837",
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
"""
Test ID:TS01TD00065
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:success
Message:correct feilds
Status code:201
"""
def test_employee_roles_mapping_create_201_correct_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Role Mapping Created")
"""
Test ID:TS01TD00064
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-create/
Status:failure
Message:duplicate fields
Status code:401
"""
def test_employee_roles_mapping_create_400_duplicate_role_field(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
response = self.client.post(self.employeerolesmappingcreate_url,
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
class EmployeeRolesMappingRetrieveTests(EmployeeRolesMappingTests):
"""
Test ID:TS01TD00066
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_retrieve_405_wrong_method(self):
# Negative test for getting req quotes detail with wrong method
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-retrieve/{}/".format(self.employeerolesmapping_id), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
"""
Test ID:TS01TD00067
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:failure
Message:no header
Status code:401
"""
def test_employee_roles_mapping_retrieve_401_no_header(self):
# Negative test case of req quotes create with no HTTP Header Authorization token
self.client.credentials()
response = self.client.get("/api/employee-roles-mapping-retrieve/{}/".format(self.employeerolesmapping_id), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Authentication credentials were not provided.")
"""
Test ID:TS01TD00068
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_retrieve_401_expired_header(self):
# Negative test case of req quotes create with expired/logged out HTTP Header Authorization token
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.delete(self.logout_url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response = self.client.get("/api/employee-roles-mapping-retrieve/{}/".format(self.employeerolesmapping_id), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00068
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:failure
Message:wrong token
Status code:401
"""
def test_employee_roles_mappig_retrieve_401_wrong_token(self):
# Negative test case of req quotes create with wrong HTTP Header Authorization token
token = 'Token c8b0f520fa7380fe7090131a4456859b1efc7777'
self.client.credentials(HTTP_AUTHORIZATION=token)
response = self.client.get("/api/employee-roles-mapping-retrieve/{}/".format(self.employeerolesmapping_id), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00069
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:failure
Message:wrong id
Status code:404
"""
def test_employee_roles_mapping_retrieve_404_wrong_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
employeerolesmapping_id = 10000
response = self.client.get("/api/employee-roles-mapping-retrieve/{}/".format(employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(response.data['detail'], "Not found.")
"""
Test ID:TS01TD00070
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-retrieve/<Valid ID>/
Status:sucess
Message:retreive roles
Status code:200
"""
def test_employee_roles_mapping_retrieve_200(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-retrieve/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Role Mapping Retrieved")
class EmployeeRolesMappingUpdateTests(EmployeeRolesMappingTests):
"""
Test ID:TS01TD00071
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_update_405_wrong_method(self):
# Negative test for getting req quotes detail with wrong method
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
{"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
"""
Test ID:TS01TD00072
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_update_401_no_header(self):
# Negative test case of req quotes create with no HTTP Header Authorization token
self.client.credentials()
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Authentication credentials were not provided.")
"""
Test ID:TS01TD00073
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_update_401_expired_header(self):
# Negative test case of req quotes create with expired/logged out HTTP Header Authorization token
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.delete(self.logout_url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00073
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:wrong token
Status code:401
"""
def test_employee_roles_mapping_update_401_wrong_token(self):
# Negative test case of req quotes create with wrong HTTP Header Authorization token
token = 'Token c8b0f520fa7380fe7090131a4456859b1efc7777'
self.client.credentials(HTTP_AUTHORIZATION=token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00074
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:wrong content type
Status code:415
"""
def test_employee_roles_mapping_update_415_header_with_wrong_content_type(self):
# Negative test case of req quotes create with HTTP Header Authorization token with wrong content type
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/pdf')
self.assertEqual(response.status_code, status.HTTP_415_UNSUPPORTED_MEDIA_TYPE)
"""
Test ID:TS01TD00075
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:blank body
Status code:400
"""
def test_employee_roles_mapping_update_400_blank_body(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id), {}, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "This field is required.")
self.assertEqual(response.data['employee_role_id'][0], "This field is required.")
self.assertEqual(response.data['employee_status'][0], "This field is required.")
"""
Test ID:TS01TD00076
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:blank fields
Status code:400
"""
def test_employee_roles_mapping_update_400_blank_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": "",
"employee_role_id": "",
"employee_status": ""}), content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_role_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_status'][0], "\"\" is not a valid choice.")
"""
Test ID:TS01TD00077
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:corrupt fields
Status code:400
"""
def test_employee_roles_mapping_update_400_corrupt_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": "ksln",
"employee_role_id": "shdks",
"employee_status": "shjdsdh"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['employee_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_role_id'][0], "A valid integer is required.")
self.assertEqual(response.data['employee_status'][0], "\"shjdsdh\" is not a valid choice.")
"""
Test ID:TS01TD00078
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:incorrect employee id field
Status code:400
"""
def test_employee_roles_mapping_update_400_incorrect_employee_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": "6179797947",
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
"""
Test ID:TS01TD00079
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:incorrect employee role id field
Status code:400
"""
def test_employee_roles_mapping_update_400_incorrect_employee_role_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": "73837",
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
"""
Test ID:TS01TD00080
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:failure
Message:wrong id field
Status code:400
"""
def test_employee_roles_mapping_update_400_wrong_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
employeerolesmapping_id = 10000
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data['status'], "EmployeeRolesMapping Doesn't exists")
"""
Test ID:TS01TD00081
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-update/<Valid ID>/
Status:success
Message:correct field
Status code:202
"""
def test_employee_roles_mapping_update_202_correct_fields(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-update/{}/".format(self.employeerolesmapping_id),
json.dumps({"employee_id": self.employee_id,
"employee_role_id": self.employeeroles_id,
"employee_status": "active"}),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Role Mapping Updated")
class EmployeeRolesDestroyMappingTests(EmployeeRolesMappingTests):
"""
Test ID:TS01TD00082
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_delete_405_wrong_method(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-destroy/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
"""
Test ID:TS01TD00083
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:failure
Message:no header
Status code:401
"""
def test_employee_roles_mapping_delete_401_no_header(self):
self.client.credentials()
response = self.client.post("/api/employee-roles-mapping-destroy/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Authentication credentials were not provided.")
"""
Test ID:TS01TD00084
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_delete_401_expired_header(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.delete(self.logout_url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response = self.client.post("/api/employee-roles-mapping-destroy/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00084
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:failure
Message:wrong token
Status code:401
"""
def test_employee_roles_mapping_delete_401_wrong_token(self):
token = 'Token c8b0f520fa7380fe7090131a4456859b1efc7777'
self.client.credentials(HTTP_AUTHORIZATION=token)
response = self.client.post("/api/employee-roles-mapping-destroy/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00085
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:failure
Message:wrong id
Status code:404
"""
def test_employee_roles_mapping_delete_404_wrong_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
employeerolesmapping_id = 1000
response = self.client.post("/api/employee-roles-mapping-destroy/{}/".format(employeerolesmapping_id), {'role': 'traffic'},
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(response.data['detail'], "Not found.")
"""
Test ID:TS01TD00086
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-destroy/<Valid ID>/
Status:success
Message:mapping delete
Status code:200
"""
def test_employee_roles_mapping_delete_200(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post("/api/employee-roles-mapping-destroy/{}/".format(self.employeerolesmapping_id),
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Role Mapping Deleted")
class EmployeeRolesMappingListTests(EmployeeRolesMappingTests):
"""
Test ID:TS01TD00087
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:failure
Message:wrong method
Status code:405
"""
def test_employee_roles_mapping_list_405_wrong_method(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.post(self.employeerolesmappinglist_url, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
"""
Test ID:TS01TD00088
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:failure
Message:no header
Status code:401
"""
def test_employee_roles_mapping_list_401_no_header(self):
self.client.credentials()
response = self.client.get(self.employeerolesmappinglist_url, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Authentication credentials were not provided.")
"""
Test ID:TS01TD00089
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_list_401_expired_header(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.delete(self.logout_url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response = self.client.post(self.employeerolesmappinglist_url, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00089
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:failure
Message:expired header
Status code:401
"""
def test_employee_roles_mapping_list_401_wrong_token(self):
token = 'Token c8b0f520fa7380fe7090131a4456859b1efc7777'
self.client.credentials(HTTP_AUTHORIZATION=token)
response = self.client.get(self.employeerolesmappinglist_url, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.data['detail'], "Invalid token.")
"""
Test ID:TS01TD00090
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list
Status code:200
"""
def test_employee_roles_mapping_list_200(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get(self.employeerolesmappinglist_url, content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00091
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles search by name
Status code:200
"""
def test_employee_roles_mapping_list_200_search_by_name(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/?search=ravi",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00092
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles search by employee status
Status code:200
"""
def test_employee_roles_mapping_list_200_search_by_employee_status(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/?search=active",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00093
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles search by employee role traffic
Status code:200
"""
def test_employee_roles_mapping_list_200_search_by_employee_role_traffic(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/?search=traffic",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00094
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list valid id
Status code:200
"""
def test_employee_roles_mapping_list_200_valid_id(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/?id=9",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00095
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list range
Status code:200
"""
def test_employee_roles_mapping_list_200_range(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/?id_range_0=9&id_range_1=10",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00096
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list employee
Status code:200
"""
def test_employee_roles_mapping_list_200_employee(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/??employee=harsh",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00097
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list employee status
Status code:200
"""
def test_employee_roles_mapping_list_200_employee_status(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/??employee_status=active",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
"""
Test ID:TS01TD00098
Created By:Hari
Created On:13/12/2018
Scenario:employee-roles-mapping-list/
Status:success
Message:employee roles mapping list employee role
Status code:200
"""
def test_employee_roles_mapping_list_200_employee_role(self):
self.client.credentials(HTTP_AUTHORIZATION=self.token)
response = self.client.get("/api/employee-roles-mapping-list/??employee_role=traffic",
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['status'], "success")
self.assertEqual(response.data['msg'], "Employee Roles Mapping List")
| 44.769308 | 151 | 0.627333 | 4,689 | 44,635 | 5.782256 | 0.047985 | 0.073839 | 0.107697 | 0.061742 | 0.926603 | 0.922325 | 0.917014 | 0.9141 | 0.91115 | 0.908051 | 0 | 0.044227 | 0.276621 | 44,635 | 996 | 152 | 44.814257 | 0.795497 | 0.033113 | 0 | 0.743529 | 0 | 0 | 0.174147 | 0.050873 | 0 | 0 | 0 | 0 | 0.277647 | 1 | 0.12 | false | 0.004706 | 0.023529 | 0 | 0.157647 | 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 |
593ef0d6661dc757c5e7dc5a9ee6caeedd0ba0d8 | 553 | py | Python | python/anyascii/_data/_001.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_001.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_001.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | b="A a A a A a C c C c C c C c D d D d E e E e E e E e E e G g G g G g G g H h H h I i I i I i I i I i IJ ij J j K k q L l L l L l L l L l N n N n N n 'n Ng ng O o O o O o OE oe R r R r R r S s S s S s S s T t T t T t U u U u U u U u U u U u W w Y y Y Z z Z z Z z s b B B b 6 6 O C c D D D d d E e E F f G G hw I I K k l l M N n O O o Gh gh P p R 2 2 Sh sh t T t T U u U V Y y Z z Zh Zh zh zh 2 5 5 ts w | || |= ! DZ Dz dz LJ Lj lj NJ Nj nj A a I i O o U u U u U u U u U u e A a A a AE ae G g G g K k O o O o Zh zh j DZ Dz dz G g Hw W N n A a AE ae O o" | 553 | 553 | 0.520796 | 253 | 553 | 1.13834 | 0.158103 | 0.152778 | 0.197917 | 0.222222 | 0.465278 | 0.375 | 0.340278 | 0.180556 | 0.180556 | 0.076389 | 0 | 0.02349 | 0.461121 | 553 | 1 | 553 | 553 | 0.942953 | 0 | 0 | 0 | 0 | 1 | 0.990975 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
59caf040e8f7ef303f461727895b0f648e490e15 | 107 | py | Python | model/loss.py | jiangxiluning/pytorch-template | 8976ef05606ea14585a1362232f5d659147a9aed | [
"MIT"
] | 1 | 2019-11-28T08:26:26.000Z | 2019-11-28T08:26:26.000Z | model/loss.py | MotJuMi/AlexNet | bab6623c345f2fe6c85db31623609cd5af4d0b5b | [
"MIT"
] | null | null | null | model/loss.py | MotJuMi/AlexNet | bab6623c345f2fe6c85db31623609cd5af4d0b5b | [
"MIT"
] | 2 | 2020-02-29T02:41:50.000Z | 2021-10-02T16:54:34.000Z | import torch.nn.functional as F
def my_loss(y_input, y_target):
return F.nll_loss(y_input, y_target)
| 17.833333 | 40 | 0.757009 | 21 | 107 | 3.571429 | 0.666667 | 0.133333 | 0.266667 | 0.293333 | 0.453333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149533 | 107 | 5 | 41 | 21.4 | 0.824176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 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 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 8 |
ab73879d5ba498977e4e8d82d668abf02f6f7d73 | 170 | py | Python | gym_customersim/envs/__init__.py | rezanazari/CustomerSim | adb9d3b44b29b738c5886f6161623dfc56949a97 | [
"Apache-2.0"
] | null | null | null | gym_customersim/envs/__init__.py | rezanazari/CustomerSim | adb9d3b44b29b738c5886f6161623dfc56949a97 | [
"Apache-2.0"
] | null | null | null | gym_customersim/envs/__init__.py | rezanazari/CustomerSim | adb9d3b44b29b738c5886f6161623dfc56949a97 | [
"Apache-2.0"
] | null | null | null | from gym_customersim.envs.customer_sim import CustomerSimEnv
from gym_customersim.envs.churn_sim import ChrunEnv
from gym_customersim.envs.churn_sim_v2 import ChrunEnvV2
| 42.5 | 60 | 0.894118 | 25 | 170 | 5.8 | 0.48 | 0.144828 | 0.372414 | 0.455172 | 0.413793 | 0.413793 | 0 | 0 | 0 | 0 | 0 | 0.012658 | 0.070588 | 170 | 3 | 61 | 56.666667 | 0.905063 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 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 | 7 |
abc17391ec4fff555c02b671044cf6cca5fe2aee | 270 | py | Python | python/testData/inspections/PyTypeCheckerInspection/FunctionAssignments.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/PyTypeCheckerInspection/FunctionAssignments.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/PyTypeCheckerInspection/FunctionAssignments.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def test():
def g(x):
"""
:type x: int
"""
return x
g(<warning descr="Expected type 'int', got 'str' instead">"str"</warning>) #fail
h = g
h(<warning descr="Expected type 'int', got 'str' instead">"str"</warning>) #fail
| 22.5 | 84 | 0.514815 | 36 | 270 | 3.861111 | 0.416667 | 0.172662 | 0.28777 | 0.345324 | 0.776978 | 0.776978 | 0.776978 | 0.776978 | 0.776978 | 0.776978 | 0 | 0 | 0.296296 | 270 | 11 | 85 | 24.545455 | 0.731579 | 0.02963 | 0 | 0 | 0 | 0 | 0.369369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
abd65257455504df6aa09dc3ed9a3c9da7ea4240 | 4,581 | py | Python | remlang/compiler/linked_list.py | thautwarm/Rem | 97be815bd9f90cc7bca51782b0583fe90e196c4f | [
"MIT"
] | 24 | 2017-12-30T12:37:13.000Z | 2020-10-21T02:48:42.000Z | remlang/compiler/linked_list.py | thautwarm/Rem | 97be815bd9f90cc7bca51782b0583fe90e196c4f | [
"MIT"
] | 2 | 2018-03-16T03:23:58.000Z | 2019-10-11T16:54:06.000Z | remlang/compiler/linked_list.py | thautwarm/Rem | 97be815bd9f90cc7bca51782b0583fe90e196c4f | [
"MIT"
] | null | null | null | from typing import Optional
class Node:
__slots__ = ['next', 'content']
def __init__(self, content=None):
self.next = None
self.content = content
def __str__(self):
return self.content.__str__()
def __repr__(self):
return self.content.__str__()
class LinkedList:
__slots__ = ['head', 'end']
def __init__(self, head_end=None):
if head_end:
self.head, self.end = head_end
else:
self.head: Optional[Node] = None
self.end: Optional[Node] = None
def append_node(self, node):
try:
self.end.next = node
except AttributeError:
self.head = self.end = node
self.end = node
def __getitem__(self, item):
node = self.head
for i in range(item):
if not node.next:
return None
node = node.next
return node
def append(self, v):
self.append_node(Node(v))
def append_left_node(self, node):
node.next = self.head
self.head = node
if self.end is None:
self.end = node
def append_left(self, v):
self.append_left_node(Node(v))
def extend(self, linked_list):
self.end.next = linked_list.head
self.end = linked_list.end
def extend_left(self, linked_list):
linked_list.end.next = self.head
self.head = linked_list.head
def __iter__(self):
if self.head is None:
return None
else:
n = self.head
while n.next:
yield n
n = n.next
yield n
def __repr__(self):
return self.__str__()
def __str__(self):
return [n for n in self].__str__()
@property
def tail(self):
return LinkedList(head_end=(self.head.next, self.end) if self.head is not self.end else None)
@property
def to_list(self):
return [e.content for e in self]
@property
def to_tuple(self):
return tuple(e.content for e in self)
@staticmethod
def from_iter(sequence):
_list = LinkedList()
for elem in sequence:
_list.append(elem)
return _list
class RevNode(Node):
def __init__(self, content=None):
super(RevNode, self).__init__(content)
self.prev: Optional[RevNode] = None
class RevLinkedList:
def __init__(self, head_end=None):
if head_end:
self.head, self.end = head_end
else:
self.head: Optional[RevNode] = None
self.end: Optional[RevNode] = None
def append_node(self, node):
try:
self.end.next = node
node.prev = self.end
except AttributeError:
self.head = self.end = node
self.end = node
def __getitem__(self, item):
node = self.head
for i in range(item):
if not node.next:
return None
node = node.next
return node
def append(self, v):
self.append_node(RevNode(v))
def append_left_node(self, node):
node.next = self.head
if self.head is not Node:
self.head.prev = node
self.head = node
if self.end is None:
self.end = node
def append_left(self, v):
self.append_left_node(RevNode(v))
def extend(self, linked_list):
self.end.next = linked_list.head
if linked_list.head is not None:
linked_list.head.prev = self.end
self.end = linked_list.end
def extend_left(self, linked_list):
linked_list.end.next = self.head
if self.head is not None:
self.head.prev = linked_list.end
self.head = linked_list.head
def __iter__(self):
if self.head is None:
return None
else:
n = self.head
while n.next:
yield n
n = n.next
yield n
def __repr__(self):
return self.__str__()
def __str__(self):
return [n for n in self].__str__()
@property
def tail(self):
return LinkedList(head_end=(self.head.next, self.end) if self.head is not self.end else None)
@property
def to_list(self):
return [e.content for e in self]
@property
def to_tuple(self):
return tuple(e.content for e in self)
@staticmethod
def from_iter(sequence):
_list = RevLinkedList()
for elem in sequence:
_list.append(elem)
return _list
| 24.238095 | 101 | 0.560358 | 590 | 4,581 | 4.108475 | 0.091525 | 0.09901 | 0.029703 | 0.029703 | 0.827145 | 0.786304 | 0.786304 | 0.786304 | 0.773927 | 0.740099 | 0 | 0 | 0.348614 | 4,581 | 188 | 102 | 24.367021 | 0.812332 | 0 | 0 | 0.810811 | 0 | 0 | 0.003929 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.22973 | false | 0 | 0.006757 | 0.081081 | 0.412162 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
e6017b47f0f4f995e274b05a8af1413f9c233aaa | 11,887 | py | Python | controller/api/tests/test_perm.py | shopkeep/deis | d9dd78187e1ddca7086fbdf600a738ae482c5378 | [
"Apache-2.0"
] | 1 | 2019-06-17T18:51:47.000Z | 2019-06-17T18:51:47.000Z | controller/api/tests/test_perm.py | shopkeep/deis | d9dd78187e1ddca7086fbdf600a738ae482c5378 | [
"Apache-2.0"
] | null | null | null | controller/api/tests/test_perm.py | shopkeep/deis | d9dd78187e1ddca7086fbdf600a738ae482c5378 | [
"Apache-2.0"
] | null | null | null |
from __future__ import unicode_literals
import json
from django.test import TestCase
class TestAdminPerms(TestCase):
def test_first_signup(self):
# register a first user
username, password = 'firstuser', 'password'
email = 'autotest@deis.io'
submit = {
'username': username,
'password': password,
'email': email,
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertTrue(response.data['is_superuser'])
# register a second user
username, password = 'seconduser', 'password'
email = 'autotest@deis.io'
submit = {
'username': username,
'password': password,
'email': email,
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertFalse(response.data['is_superuser'])
def test_list(self):
submit = {
'username': 'firstuser',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertTrue(response.data['is_superuser'])
self.assertTrue(
self.client.login(username='firstuser', password='password'))
response = self.client.get('/api/admin/perms', content_type='application/json')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 1)
self.assertEqual(response.data['results'][0]['username'], 'firstuser')
self.assertTrue(response.data['results'][0]['is_superuser'])
# register a non-superuser
submit = {
'username': 'seconduser',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertFalse(response.data['is_superuser'])
self.assertTrue(
self.client.login(username='seconduser', password='password'))
response = self.client.get('/api/admin/perms', content_type='application/json')
self.assertEqual(response.status_code, 403)
self.assertIn('You do not have permission', response.data['detail'])
def test_create(self):
submit = {
'username': 'first',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertTrue(response.data['is_superuser'])
submit = {
'username': 'second',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertFalse(response.data['is_superuser'])
self.assertTrue(
self.client.login(username='first', password='password'))
# grant user 2 the superuser perm
url = '/api/admin/perms'
body = {'username': 'second'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 201)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
self.assertIn('second', str(response.data['results']))
def test_delete(self):
submit = {
'username': 'first',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertTrue(response.data['is_superuser'])
submit = {
'username': 'second',
'password': 'password',
'email': 'autotest@deis.io',
}
url = '/api/auth/register'
response = self.client.post(url, json.dumps(submit), content_type='application/json')
self.assertEqual(response.status_code, 201)
self.assertFalse(response.data['is_superuser'])
self.assertTrue(
self.client.login(username='first', password='password'))
# grant user 2 the superuser perm
url = '/api/admin/perms'
body = {'username': 'second'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 201)
# revoke the superuser perm
response = self.client.delete(url + '/second')
self.assertEqual(response.status_code, 204)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 1)
self.assertNotIn('two', str(response.data['results']))
class TestAppPerms(TestCase):
fixtures = ['test_sharing.json']
def setUp(self):
self.assertTrue(
self.client.login(username='autotest-1', password='password'))
def test_create(self):
# check that user 1 sees her lone app and user 2's app
response = self.client.get('/api/apps')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
app_id = response.data['results'][0]['id']
# check that user 2 can only see his app
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
response = self.client.get('/api/apps')
self.assertEqual(len(response.data['results']), 1)
# check that user 2 can't see any of the app's builds, configs,
# containers, limits, or releases
for model in ['builds', 'config', 'containers', 'limits', 'releases']:
response = self.client.get("/api/apps/{}/{}/".format(app_id, model))
self.assertEqual(response.data['detail'], 'Not found')
# TODO: test that git pushing to the app fails
# give user 2 permission to user 1's app
self.assertTrue(
self.client.login(username='autotest-1', password='password'))
url = "/api/apps/{}/perms".format(app_id)
body = {'username': 'autotest-2'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 201)
# check that user 2 can see the app
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
response = self.client.get('/api/apps')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
# check that user 2 sees (empty) results now for builds, containers,
# and releases. (config and limit will still give 404s since we didn't
# push a build here.)
for model in ['builds', 'containers', 'releases']:
response = self.client.get("/api/apps/{}/{}/".format(app_id, model))
self.assertEqual(len(response.data['results']), 0)
# TODO: check that user 2 can git push the app
def test_create_errors(self):
# check that user 1 sees her lone app
response = self.client.get('/api/apps')
app_id = response.data['results'][0]['id']
# check that user 2 can't create a permission
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
url = "/api/apps/{}/perms".format(app_id)
body = {'username': 'autotest-2'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 403)
def test_delete(self):
# give user 2 permission to user 1's app
self.assertTrue(
self.client.login(username='autotest-1', password='password'))
response = self.client.get('/api/apps')
app_id = response.data['results'][0]['id']
url = "/api/apps/{}/perms".format(app_id)
body = {'username': 'autotest-2'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 201)
# check that user 2 can see the app as well as his own
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
response = self.client.get('/api/apps')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
# try to delete the permission as user 2
url = "/api/apps/{}/perms/{}".format(app_id, 'autotest-2')
response = self.client.delete(url, content_type='application/json')
self.assertEqual(response.status_code, 403)
self.assertIsNone(response.data)
# delete permission to user 1's app
self.assertTrue(
self.client.login(username='autotest-1', password='password'))
response = self.client.delete(url, content_type='application/json')
self.assertEqual(response.status_code, 204)
self.assertIsNone(response.data)
# check that user 2 can only see his app
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
response = self.client.get('/api/apps')
self.assertEqual(len(response.data['results']), 1)
# delete permission to user 1's app again, expecting an error
self.assertTrue(
self.client.login(username='autotest-1', password='password'))
response = self.client.delete(url, content_type='application/json')
self.assertEqual(response.status_code, 404)
def test_list(self):
# check that user 1 sees her lone app and user 2's app
response = self.client.get('/api/apps')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
app_id = response.data['results'][0]['id']
# create a new object permission
url = "/api/apps/{}/perms".format(app_id)
body = {'username': 'autotest-2'}
response = self.client.post(url, json.dumps(body), content_type='application/json')
self.assertEqual(response.status_code, 201)
# list perms on the app
response = self.client.get(
"/api/apps/{}/perms".format(app_id), content_type='application/json')
self.assertEqual(response.data, {'users': ['autotest-2']})
def test_admin_can_list(self):
"""Check that an administrator can list an app's perms"""
response = self.client.get('/api/apps')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['results']), 2)
def test_list_errors(self):
response = self.client.get('/api/apps')
app_id = response.data['results'][0]['id']
# login as user 2
self.assertTrue(
self.client.login(username='autotest-2', password='password'))
# list perms on the app
response = self.client.get(
"/api/apps/{}/perms".format(app_id), content_type='application/json')
self.assertEqual(response.status_code, 403)
| 45.197719 | 93 | 0.619164 | 1,392 | 11,887 | 5.220546 | 0.104167 | 0.07018 | 0.08917 | 0.111738 | 0.82166 | 0.814366 | 0.803358 | 0.795239 | 0.795239 | 0.790835 | 0 | 0.01607 | 0.240935 | 11,887 | 262 | 94 | 45.370229 | 0.789316 | 0.101455 | 0 | 0.821596 | 0 | 0 | 0.189197 | 0.001973 | 0 | 0 | 0 | 0.003817 | 0.333333 | 1 | 0.051643 | false | 0.117371 | 0.014085 | 0 | 0.079812 | 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 |
e6098f9147f54d830712328f16541a10eb622936 | 229 | py | Python | hedwig/stats/__init__.py | JanKralj/hedwig | a3c54fae253dca3234c880f92836cea73f1569b2 | [
"MIT"
] | 9 | 2015-01-18T14:00:13.000Z | 2020-03-28T18:57:20.000Z | hedwig/stats/__init__.py | JanKralj/hedwig | a3c54fae253dca3234c880f92836cea73f1569b2 | [
"MIT"
] | null | null | null | hedwig/stats/__init__.py | JanKralj/hedwig | a3c54fae253dca3234c880f92836cea73f1569b2 | [
"MIT"
] | 10 | 2015-01-28T10:31:46.000Z | 2021-05-29T04:58:11.000Z | from hedwig.stats import scorefunctions
from hedwig.stats import adjustment
from hedwig.stats import significance
from hedwig.stats.validate import Validate
__all__ = ["scorefunctions", "adjustment", "significance", "Validate"]
| 32.714286 | 70 | 0.816594 | 26 | 229 | 7.038462 | 0.346154 | 0.218579 | 0.327869 | 0.344262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.100437 | 229 | 6 | 71 | 38.166667 | 0.88835 | 0 | 0 | 0 | 0 | 0 | 0.19214 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
e61c7fb593163a3399d4b6f6fd861628b26696ab | 41 | py | Python | smartmove/visuals/latex/__init__.py | ryanjdillon/smartmove | fb0bf9a309939519e076ea7cbb5aadcd900f9301 | [
"MIT"
] | null | null | null | smartmove/visuals/latex/__init__.py | ryanjdillon/smartmove | fb0bf9a309939519e076ea7cbb5aadcd900f9301 | [
"MIT"
] | 13 | 2017-10-09T10:08:43.000Z | 2018-12-05T17:45:46.000Z | smartmove/visuals/latex/__init__.py | ryanjdillon/smartmove | fb0bf9a309939519e076ea7cbb5aadcd900f9301 | [
"MIT"
] | null | null | null | from . import tables
from . import utils
| 13.666667 | 20 | 0.756098 | 6 | 41 | 5.166667 | 0.666667 | 0.645161 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195122 | 41 | 2 | 21 | 20.5 | 0.939394 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 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 |
e6469a9d725b9e4af9dc714fa007ff8380655c9c | 172 | py | Python | gaiadet/models/__init__.py | zengming16/GAIA-det | cac6b5601d63aeaa3882cea2256dcb2539fecb34 | [
"Apache-2.0"
] | 149 | 2021-06-21T06:18:16.000Z | 2022-03-23T08:55:23.000Z | gaiadet/models/__init__.py | zengming16/GAIA-det | cac6b5601d63aeaa3882cea2256dcb2539fecb34 | [
"Apache-2.0"
] | 7 | 2021-07-11T07:52:58.000Z | 2022-03-30T11:41:39.000Z | gaiadet/models/__init__.py | zengming16/GAIA-det | cac6b5601d63aeaa3882cea2256dcb2539fecb34 | [
"Apache-2.0"
] | 13 | 2021-06-29T06:06:13.000Z | 2022-02-28T01:31:17.000Z | from .backbones import * # noqa: F401, F403
from .detectors import * # noqa: F401, F403
from .necks import * # noqa: F401, F403
from .utils import * # noqa: F401, F403
| 34.4 | 44 | 0.674419 | 24 | 172 | 4.833333 | 0.375 | 0.344828 | 0.482759 | 0.62069 | 0.568966 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 0.209302 | 172 | 4 | 45 | 43 | 0.676471 | 0.389535 | 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 |
0512571619fa252ebff942684fb9eb4d74c49c5c | 2,232 | py | Python | ClassicMedium/Bender/test_multiloop.py | RevDownie/CodinGameSolutions | af7d0ef4b38007766c3b121ea14be59eec26541c | [
"MIT"
] | null | null | null | ClassicMedium/Bender/test_multiloop.py | RevDownie/CodinGameSolutions | af7d0ef4b38007766c3b121ea14be59eec26541c | [
"MIT"
] | null | null | null | ClassicMedium/Bender/test_multiloop.py | RevDownie/CodinGameSolutions | af7d0ef4b38007766c3b121ea14be59eec26541c | [
"MIT"
] | null | null | null | # Test in which Bender cannot reach the goal and instead loops
import core
SAMPLE_INPUT_DIMS = '30 15'
SAMPLE_INPUT_GRID_LINES = [
'###############',
'# #@#I T$# #',
'# # IB # #',
'# # W # #',
'# # ## #',
'# #B XBN# # #',
'# ## # #',
'# # # #',
'# # W # #',
'# # ## #',
'# #B XBN# # #',
'# ## # #',
'# # # #',
'# # W # #',
'# # ## #',
'# #B XBN# # #',
'# ## # #',
'# # # #',
'# # # #',
'# # ## #',
'# # XBIT # #',
'# ######### #',
'# #',
'# ##### ##### #',
'# # # #',
'# # # ## #',
'# # # # #',
'# ##### ##### #',
'# #',
'###############']
SAMPLE_EXPECTED_OUTPUT_LINES = [
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'EAST',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'NORTH',
'WEST',
'WEST',
'WEST',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'EAST',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'NORTH',
'WEST',
'WEST',
'WEST',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'EAST',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'SOUTH',
'SOUTH',
'SOUTH',
'WEST',
'WEST',
'WEST',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'EAST',
'NORTH',
'NORTH',
'NORTH',
'NORTH',
'WEST',
'WEST',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'SOUTH',
'EAST',
'EAST',
'EAST',
'EAST'
]
h, w = core.parse_dims(SAMPLE_INPUT_DIMS)
grid = core.parse_grid(SAMPLE_INPUT_GRID_LINES, w, h)
core.run(grid, SAMPLE_EXPECTED_OUTPUT_LINES)
| 11.16 | 62 | 0.447133 | 220 | 2,232 | 4.454545 | 0.163636 | 0.632653 | 0.811224 | 0.959184 | 0.742857 | 0.742857 | 0.727551 | 0.727551 | 0.713265 | 0.713265 | 0 | 0.002278 | 0.213262 | 2,232 | 199 | 63 | 11.21608 | 0.555809 | 0.026882 | 0 | 0.917526 | 0 | 0 | 0.545161 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.005155 | 0 | 0.005155 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
052b365b1cbb76b49e15da922d705dd67f10f7a0 | 13,867 | py | Python | Collect_data.py | Tsettaro/AniHelp | 92738616e57fb951cdb32b0312faeef35095d2c6 | [
"MIT"
] | null | null | null | Collect_data.py | Tsettaro/AniHelp | 92738616e57fb951cdb32b0312faeef35095d2c6 | [
"MIT"
] | 1 | 2021-07-14T20:39:06.000Z | 2021-07-14T20:39:07.000Z | Collect_data.py | Tsettaro/AniHelp | 92738616e57fb951cdb32b0312faeef35095d2c6 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
from itertools import combinations
import re
import pandas as pd
import time
from selenium import webdriver
def get_n(soup, id, shop):
if shop == 'discomir':
goods = soup.findAll('a', class_='text_fader')
elif shop == 'XL':
driver = webdriver.Firefox(executable_path=r'A:\geckodriver.exe')
driver.get(soup)
time.sleep(6)
elif shop == 'Nyaki':
goods = soup.findAll('div', class_='product-name')
namae = []
if shop == 'discomir':
for data in goods:
namae.append(data.text)
elif shop == "XL":
tag_list = driver.find_elements_by_class_name("product-name")
for e in tag_list:
namae.append(e.text)
elif shop == 'Nyaki':
for data in goods:
namae.append(data.text)
lim = []
lim_pr = []
if id == 'manga' and shop == 'discomir':
goods.clear()
for i in range(len(namae)):
if re.findall(r'Ранобэ',namae[i]):
lim.append(i)
namae = [x for ind,x in enumerate(namae) if ind+1 not in lim]
lim.clear()
for i in range(len(namae)):
if re.findall(r'Том 1+$|Книга 1+$|Vol. 1+$',namae[i]):
lim.append(namae[i])
namae.clear()
return lim
elif id == 'manga' and shop == 'XL':
but = driver.find_elements_by_class_name("button")
for e in but:
lim.append(e.text)
del lim[0]
for e in range(len(lim)):
if lim[e] != 'Купить':
lim_pr.append(e)
for n in sorted(lim_pr, reverse=True):
del namae[n]
but.clear()
lim.clear()
for i in range(len(namae)):
if re.findall(r'Том 1+$|Книга 1+$|Vol. 1+$|Том 1.+$', namae[i]):
lim.append(namae[i])
driver.quit()
return lim
elif id == 'manga' and shop == 'Nyaki':
for i in range(len(namae)):
if re.findall(r'1 том+$|1 книга+$', namae[i]):
j = namae[i].find('1')
if namae[i][j + 1] == ' ':
lim.append(namae[i])
return lim
elif id == 'figure' and shop == 'XL':
but = driver.find_elements_by_class_name("button")
for e in but:
lim.append(e.text)
del lim[0]
for e in range(len(lim)):
if lim[e] != 'Купить':
lim_pr.append(e)
for n in sorted(lim_pr, reverse=True):
del namae[n]
but.clear()
lim.clear()
driver.quit()
return namae
elif id == 'figure' and shop == 'discomir':
for i in range(len(namae)):
if re.findall(r'Копия', namae[i]) or re.findall(r'Pokemon', namae[i]) or re.findall(r'One Piece', namae[i]):
lim.append(i)
namae = [x for ind,x in enumerate(namae) if ind+1 not in lim]
lim.clear()
return namae
elif id == 'znachok' and shop == 'discomir':
for i in range(len(namae)):
namae[i] = namae[i][:-5]
return namae
elif id == 'napitki' and shop == 'Nyaki':
return namae
def get_p(soup, id, shop):
if shop == 'discomir':
goods = soup.findAll('a', class_='text_fader')
t_pri = soup.findAll('div', class_='price')
elif shop == 'XL':
driver = webdriver.Firefox(executable_path=r'A:\geckodriver.exe')
driver.get(soup)
time.sleep(6)
elif shop == 'Nyaki':
goods = soup.findAll('div', class_='product-name')
t_pri = soup.findAll('div', class_='column column-cost')
namae = []
pri = []
if shop == 'discomir':
for data in goods:
namae.append(data.text)
for data in t_pri:
pri.append(data.text[:-5])
elif shop == 'XL':
tag_list = driver.find_elements_by_class_name("product-name")
for e in tag_list:
namae.append(e.text)
but = driver.find_elements_by_class_name("costs-value")
m = []
for e in but:
m.append(e.text)
for data in m:
r = data
if 'Цена' in r:
s = r[1:-3].find('а')
dob = r[s+3:-1]
dob = re.sub('\s', '', dob)
pri.append(dob)
else:
s = r[1:-3].find('₽')
ik = r[s + 3:-2]
dob = re.sub('\s', '', ik)
pri.append(dob)
elif shop == 'Nyaki':
for data in goods:
namae.append(data.text)
for data in t_pri:
pri.append(data.text[:-11])
lim = []
lim_pr = []
if id == 'manga' and shop == 'discomir':
goods.clear()
t_pri.clear()
for i in range(len(namae)):
if re.findall(r'Ранобэ', namae[i]):
lim.append(i)
lim_pr.append(i)
namae = [x for ind, x in enumerate(namae) if ind + 1 not in lim]
pri = [x for ind, x in enumerate(pri) if ind + 1 not in lim_pr]
lim.clear()
lim_pr.clear()
for i in range(len(namae)):
if re.findall(r'Том 1+$|Книга 1+$|Vol. 1+$', namae[i]):
lim.append(namae[i])
lim_pr.append(pri[i])
namae.clear()
pri.clear()
return lim_pr
elif id == 'manga' and shop == 'XL':
but = driver.find_elements_by_class_name("button")
for e in but:
lim.append(e.text)
del lim[0]
for e in range(len(lim)):
if lim[e] != 'Купить':
lim_pr.append(e)
for n in sorted(lim_pr, reverse=True):
del namae[n]
del pri[n]
but.clear()
lim.clear()
lim_pr.clear()
for i in range(len(namae)):
if re.findall(r'Том 1+$|Книга 1+$|Vol. 1+$|Том 1.+$', namae[i]):
lim.append(namae[i])
lim_pr.append(pri[i])
driver.quit()
return lim_pr
elif id == 'manga' and shop == 'Nyaki':
for i in range(len(namae)):
if re.findall(r'1 том+$|1 книга+$', namae[i]):
j = namae[i].find('1')
if namae[i][j + 1] == ' ':
lim_pr.append(pri[i])
return lim_pr
elif id == 'figure' and shop == 'XL':
but = driver.find_elements_by_class_name("button")
for e in but:
lim.append(e.text)
del lim[0]
for e in range(len(lim)):
if lim[e] != 'Купить':
lim_pr.append(e)
for n in sorted(lim_pr, reverse=True):
del namae[n]
del pri[n]
but.clear()
lim.clear()
lim_pr.clear()
driver.quit()
return pri
elif id == 'figure' and shop == 'discomir':
for i in range(len(namae)):
if re.findall(r'Копия', namae[i]) or re.findall(r'Pokemon', namae[i]) or re.findall(r'One Piece', namae[i]):
lim_pr.append(i)
pri = [x for ind, x in enumerate(pri) if ind + 1 not in lim_pr]
lim_pr.clear()
return pri
elif id == 'znachok' and shop == 'discomir':
return pri
elif id == 'napitki' and shop == 'Nyaki':
return pri
df = pd.read_excel('output.xlsx')
df.pop('Unnamed: 0')
# namae = []
# price = []
# Discomir (znachki)
# url = "https://diskomir.ru/catalog/znachki/nabory_znachkov/?from_movie=bananovaya_ryba_banana_fish_rybka_bananka&from_movie=voleybol_haikyu_haikyuu_&from_movie=doktor_stoun_dr_stone_doctor_stone&from_movie=drakon_gornichnaya_kobayashi_kobayashi_san_chi_no_maid_dragon_miss_kobayashi_s_dragon_maid&from_movie=durochka_aho_girl_ahogaru_clueless_girl"
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'znachok', 'discomir')
# price = price + get_p(soup, 'znachok', 'discomir')
# for i in range(len(namae)):
# if price[i].isdigit()==True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'Discomir', 'Pins']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
# Old collect data
# Diskomir (manga)
# url = 'https://diskomir.ru/catalog/manga/manga/?arrFilter_ff%5BNAME%5D=&arrFilter_pf%5BNALICHIE%5D=86&arrFilter_pf%5BFROM_MOVIE%5D=&arrFilter_pf%5BMADE_BY%5D=&set_filter=%CD%E0%E9%F2%E8'
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'manga', 'discomir')
# price = price + get_p(soup, 'manga', 'discomir')
# for k in range(2, 13):
# url = 'https://diskomir.ru/catalog/manga/manga/?arrFilter_ff%5BNAME%5D=&arrFilter_pf%5BNALICHIE%5D=86&arrFilter_pf%5BFROM_MOVIE%5D=&arrFilter_pf%5BMADE_BY%5D=&set_filter=%CD%E0%E9%F2%E8&PAGEN_1=' + str(k)
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'manga', 'discomir')
# price = price + get_p(soup, 'manga', 'discomir')
# del price[96]
# del namae[96]
#
# df = pd.DataFrame(columns=['name', 'price', 'shop', 'category'])
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'Discomir', 'Manga']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
# namae.clear()
# price.clear()
# Discomir (figurki)
# url = 'https://diskomir.ru/catalog/animefigurki/malenkie_kitayskie_figurki/?arrFilter_ff%5BNAME%5D=&arrFilter_pf%5BNALICHIE%5D=86&arrFilter_pf%5BFROM_MOVIE%5D=&arrFilter_pf%5BMADE_BY%5D=&set_filter=%CD%E0%E9%F2%E8'
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'figure', 'discomir')
# price = price + get_p(soup, 'figure', 'discomir')
# url = 'https://diskomir.ru/catalog/animefigurki/malenkie_kitayskie_figurki/?arrFilter_ff%5BNAME%5D=&arrFilter_pf%5BNALICHIE%5D=86&arrFilter_pf%5BFROM_MOVIE%5D=&arrFilter_pf%5BMADE_BY%5D=&set_filter=%CD%E0%E9%F2%E8&PAGEN_1=2'
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'figure', 'discomir')
# price = price + get_p(soup, 'figure', 'discomir')
# del namae[len(namae)-1]
# del price[len(namae)-1]
# for i in range(len(namae)):
# if price[i].isdigit()==True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'Discomir', 'Figure']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
#
# namae.clear()
# price.clear()
# XL (the end 224) (figurki)
#
# for k in range(2, 5):
# url = 'https://xlm.ru/nendoroid?by=popular&page='+str(k)
# namae = namae + get_n(url, 'figure', 'XL')
# price = price + get_p(url, 'figure', 'XL')
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'XL Media', 'Figure']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
#
# namae.clear()
# price.clear()
# XL (manga)
# url = 'https://xlm.ru/manga?by=popular'
# namae = namae + get_n(url, 'manga', 'XL')
# price = price + get_p(url, 'manga', 'XL')
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'XL Media', 'Manga']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
#
# namae.clear()
# price.clear()
#
# for k in range(2, 19):
# url = 'https://xlm.ru/manga?by=popular&page='+str(k)
# namae = namae + get_n(url, 'manga', 'XL')
# price = price + get_p(url, 'manga', 'XL')
#
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'XL Media', 'Manga']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
# Nyaki (manga)
# for i in range(1, 9):
# url = 'https://nyaki.ru/catalog/manga/?page='+str(i)
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'manga', 'Nyaki')
# price = price + get_p(soup, 'manga', 'Nyaki')
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'Nyaki', 'Manga']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
# url = 'https://nyaki.ru/catalog/napitki/'
# page = requests.get(url)
# soup = BeautifulSoup(page.text, "html.parser")
# namae = namae + get_n(soup, 'napitki', 'Nyaki')
# price = price + get_p(soup, 'napitki', 'Nyaki')
# for i in range(len(namae)):
# if price[i].isdigit() == True:
# _df = pd.DataFrame([[namae[i], int(price[i]), 'Nyaki', 'Soda']], columns=['name', 'price', 'shop', 'category'])
# df = df.append(_df, ignore_index=True)
# a = []
# for i in range(168):
# a.append(i)
# data = list(combinations(a, 3))
# print(len(data))
# a.clear()
# i = 0
# for k in range(len(data)):
# if df.iloc[data[k][0]]['category'] != df.iloc[data[k][1]]['category'] and df.iloc[data[k][0]]['category'] != df.iloc[data[k][2]]['category'] and df.iloc[data[k][1]]['category'] != df.iloc[data[k][2]]['category']:
# a.append(data[k])
# i+=1
# print('Now – '+str(k))
# print('Real – ' + str(i))
# print(a)
#
# i = 0
# k = 0
# res = pd.DataFrame(columns=['Комплект', 'name', 'price', 'shop', 'category'])
# for i in range(len(a)):
# for j in range(len(a[i])):
# _df = pd.DataFrame([[i + 1, df.at[int(a[i][j]), 'name'], df.at[int(a[i][j]), 'price'],df.at[int(a[i][j]), 'shop'], df.at[int(a[i][j]), 'category']]], columns=['Комплект', 'name', 'price', 'shop', 'category'])
# res = res.append(_df, ignore_index=True)
# k+=1
# print(k)
# res.to_excel('result.xlsx')
# i = df.iloc[0]['price']
# i = i + 1
# print(i)
# df.to_excel('output.xlsx')
| 37.579946 | 350 | 0.560035 | 1,996 | 13,867 | 3.79509 | 0.107214 | 0.026139 | 0.034323 | 0.031947 | 0.825611 | 0.798152 | 0.758416 | 0.732805 | 0.728845 | 0.716964 | 0 | 0.013915 | 0.258888 | 13,867 | 368 | 351 | 37.682065 | 0.722876 | 0.453523 | 0 | 0.843602 | 0 | 0 | 0.089125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009479 | false | 0 | 0.033175 | 0 | 0.109005 | 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 |
055f7d5cf89f8dc52c0e13c28e574fb5b8921ac0 | 14,645 | py | Python | yr_2_3_4.py | Shantanu-S/Tuition-Bot-NTU | 8632d0534679360229cd9f511e66235901c92c4b | [
"MIT"
] | 1 | 2016-12-10T01:56:09.000Z | 2016-12-10T01:56:09.000Z | yr_2_3_4.py | Shantanu-S/Tuition-Bot-NTU | 8632d0534679360229cd9f511e66235901c92c4b | [
"MIT"
] | null | null | null | yr_2_3_4.py | Shantanu-S/Tuition-Bot-NTU | 8632d0534679360229cd9f511e66235901c92c4b | [
"MIT"
] | null | null | null | YEAR 2
ALGORITHMS
['https://www.youtube.com/watch?v=JPyuH4qXLZ0&hl=en-GB&gl=SG','https://www.youtube.com/watch?v=2P-yW7LQr08&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp','https://www.youtube.com/watch?v=Nz1KZXbghj8','https://www.youtube.com/watch?v=9Jry5-82I68','https://www.youtube.com/watch?v=gXgEDyodOJU','https://www.youtube.com/watch?v=moPtwq_cVH8']
OBJECT ORIENTED DESIGN AND PROGRAMMING
['https://www.youtube.com/watch?v=lbXsrHGhBAU','https://www.youtube.com/watch?v=lbXsrHGhBAU','https://www.youtube.com/watch?v=S3t-5UtvDN0','https://www.youtube.com/watch?v=ng98qapa4Sw','https://www.youtube.com/watch?v=v4SdA2ehvoU','https://www.youtube.com/watch?v=kZnaFP9U9nY','https://www.youtube.com/watch?v=RcZAkBVNYTA','https://www.youtube.com/watch?v=ZQ5_u8Lgvyk','https://www.youtube.com/watch?v=3u1fu6f8Hto','https://www.youtube.com/watch?v=znnAMcGfI0E']
DIGITAL SYSTEMS DESIGN
['https://www.youtube.com/watch?v=0age83XI8Z4 ; https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=CLUoWkJUnN0','https://www.youtube.com/watch?v=rHtNQTjOY3E','https://www.youtube.com/watch?v=AXgfeV568c8','-','https://www.youtube.com/watch?v=Ss1Saa54sBI','https://www.youtube.com/watch?v=AVrJRPL-e0g']
CIRCUITS AND SIGNAL ANALYSIS
['https://www.youtube.com/watch?v=3ARwItoY_nc','https://www.youtube.com/watch?v=3ARwItoY_nc','https://www.youtube.com/watch?v=-FHm2pQmiSM&list=PLUl4u3cNGP61kdPAOC7CzFjJZ8f1eMUxs','https://www.youtube.com/watch?v=JAX4xARloXk']
OPERATING SYSTEMS
['https://www.youtube.com/watch?v=JAX4xARloXk','https://www.youtube.com/watch?v=hsERPf9k54U','https://www.youtube.com/watch?v=FiGKndlvO8I','https://www.youtube.com/watch?v=FiGKndlvO8I','https://www.youtube.com/watch?v=2klwq4GeVtw','https://www.youtube.com/watch?v=0FPOgQ5_YZk','https://www.youtube.com/watch?v=iqfjWIYyQ9k','https://www.youtube.com/watch?v=a86Nxi7lH1s','https://www.youtube.com/watch?v=WW2vB_e-8Os','https://www.youtube.com/watch?v=HlU5cYqGLZE','https://www.youtube.com/watch?v=6nadXMSFSjk']
SOFTWARE ENGINEERING
['https://www.youtube.com/watch?v=LOLxYo23KLc','https://www.youtube.com/watch?v=wEr6mwquPLY','https://www.youtube.com/watch?v=wEr6mwquPLY','https://www.youtube.com/watch?v=1TxXtrQRkuw','https://www.youtube.com/watch?v=1TxXtrQRkuw','https://www.youtube.com/watch?v=Zmv6ha2IBtE','https://www.youtube.com/watch?v=8CO29Pbyjx0']
MICROPROCESSOR-BASED SYSTEM DESIGN
['https://www.youtube.com/watch?v=1famitdmzwk&list=PLZ9YeF_1_vF-y4pIbimAX8iyLJhPjCeLl','https://www.youtube.com/watch?v=ssc-i-Vl3iM','https://www.youtube.com/watch?v=7LqPJGnBPMM','https://www.youtube.com/watch?v=9A5ivudtfsw','https://www.youtube.com/watch?v=Chw-FmmDh2I','https://www.youtube.com/watch?v=jxX8MexaVTk','https://www.youtube.com/watch?v=JJqraszIeeU','https://www.youtube.com/watch?v=9A5ivudtfsw','https://www.youtube.com/watch?v=omxQsvenf9o','https://www.youtube.com/watch?v=UhJ5op0WZLg','https://www.youtube.com/watch?v=whYljse4Abc','-']
year2=[['https://www.youtube.com/watch?v=JPyuH4qXLZ0&hl=en-GB&gl=SG','https://www.youtube.com/watch?v=2P-yW7LQr08&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp','https://www.youtube.com/watch?v=Nz1KZXbghj8','https://www.youtube.com/watch?v=9Jry5-82I68','https://www.youtube.com/watch?v=gXgEDyodOJU','https://www.youtube.com/watch?v=moPtwq_cVH8'],['https://www.youtube.com/watch?v=lbXsrHGhBAU','https://www.youtube.com/watch?v=lbXsrHGhBAU','https://www.youtube.com/watch?v=S3t-5UtvDN0','https://www.youtube.com/watch?v=ng98qapa4Sw','https://www.youtube.com/watch?v=v4SdA2ehvoU','https://www.youtube.com/watch?v=kZnaFP9U9nY','https://www.youtube.com/watch?v=RcZAkBVNYTA','https://www.youtube.com/watch?v=ZQ5_u8Lgvyk','https://www.youtube.com/watch?v=3u1fu6f8Hto','https://www.youtube.com/watch?v=znnAMcGfI0E'],['https://www.youtube.com/watch?v=0age83XI8Z4 ; https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=5-EEAB0XUIk','https://www.youtube.com/watch?v=CLUoWkJUnN0','https://www.youtube.com/watch?v=rHtNQTjOY3E','https://www.youtube.com/watch?v=AXgfeV568c8','-','https://www.youtube.com/watch?v=Ss1Saa54sBI','https://www.youtube.com/watch?v=AVrJRPL-e0g'],['https://www.youtube.com/watch?v=3ARwItoY_nc','https://www.youtube.com/watch?v=3ARwItoY_nc','https://www.youtube.com/watch?v=-FHm2pQmiSM&list=PLUl4u3cNGP61kdPAOC7CzFjJZ8f1eMUxs','https://www.youtube.com/watch?v=JAX4xARloXk'],['https://www.youtube.com/watch?v=JAX4xARloXk','https://www.youtube.com/watch?v=hsERPf9k54U','https://www.youtube.com/watch?v=FiGKndlvO8I','https://www.youtube.com/watch?v=FiGKndlvO8I','https://www.youtube.com/watch?v=2klwq4GeVtw','https://www.youtube.com/watch?v=0FPOgQ5_YZk','https://www.youtube.com/watch?v=iqfjWIYyQ9k','https://www.youtube.com/watch?v=a86Nxi7lH1s','https://www.youtube.com/watch?v=WW2vB_e-8Os','https://www.youtube.com/watch?v=HlU5cYqGLZE','https://www.youtube.com/watch?v=6nadXMSFSjk'],['https://www.youtube.com/watch?v=LOLxYo23KLc','https://www.youtube.com/watch?v=wEr6mwquPLY','https://www.youtube.com/watch?v=wEr6mwquPLY','https://www.youtube.com/watch?v=1TxXtrQRkuw','https://www.youtube.com/watch?v=1TxXtrQRkuw','https://www.youtube.com/watch?v=Zmv6ha2IBtE','https://www.youtube.com/watch?v=8CO29Pbyjx0'],['https://www.youtube.com/watch?v=1famitdmzwk&list=PLZ9YeF_1_vF-y4pIbimAX8iyLJhPjCeLl','https://www.youtube.com/watch?v=ssc-i-Vl3iM','https://www.youtube.com/watch?v=7LqPJGnBPMM','https://www.youtube.com/watch?v=9A5ivudtfsw','https://www.youtube.com/watch?v=Chw-FmmDh2I','https://www.youtube.com/watch?v=jxX8MexaVTk','https://www.youtube.com/watch?v=JJqraszIeeU','https://www.youtube.com/watch?v=9A5ivudtfsw','https://www.youtube.com/watch?v=omxQsvenf9o','https://www.youtube.com/watch?v=UhJ5op0WZLg','https://www.youtube.com/watch?v=whYljse4Abc','-']]
-------------------------------------------------------
YEAR 3
ADNAVED COMPUTER ARCHITECTURE
['https://www.youtube.com/watch?v=39LjZM2zMMw','Instead of seeing a video ,it would be better if you could refer the notes','https://www.youtube.com/watch?v=HbsuwpJgKao','https://www.youtube.com/watch?v=NrfuKTGvsFE','https://www.youtube.com/watch?v=ZSw5HPUwK8s','https://www.youtube.com/watch?v=BWmljynuhYo','https://www.youtube.com/watch?v=LFHOMYlWslU','https://www.youtube.com/watch?v=TfIajPoRdmw','https://www.youtube.com/watch?v=Q-1mSk0HYuY']
SENSORS, INTERFACING AND CONTROL
['https://www.youtube.com/watch?v=jnY9T4Bf9h8','https://www.youtube.com/watch?v=xaOF2SNktRY','https://www.youtube.com/watch?v=Rje5DJSe098','https://www.youtube.com/watch?v=WT-qzgaKeGI','https://www.youtube.com/watch?v=IEeltuxzPYE','https://www.youtube.com/watch?v=VtxFtzWlTgg','https://www.youtube.com/watch?v=dP496kJmzXc','https://www.youtube.com/watch?v=o1MWMrFhXXs','https://www.youtube.com/watch?v=O-OqgFE9SD4&list=PLFFbyVlrhQnvaEyHXkfxpKRVzhDocc6eT','https://www.youtube.com/watch?v=NjRiqHSGmB0','https://www.youtube.com/watch?v=RJleGwXorUk','https://www.youtube.com/watch?v=rNMlaq8xABE','https://www.youtube.com/watch?v=eNVN67eZC88']
MICROCONTROLLER PROGRAMMING
['https://www.youtube.com/watch?v=o-a1uXkcNXY','https://www.youtube.com/watch?v=pz57y4BHIy0','http://www.open-std.org/jtc1/sc22/wg21/docs/ESC_Boston_01_304_paper.pdf','https://www.youtube.com/watch?v=I35w8v_rcmY','https://www.youtube.com/watch?v=kgcUVZARftQ','https://www.youtube.com/watch?v=oWmTJdYYRTg','https://www.youtube.com/watch?v=FnGCDLhaxKU']
MULTIDISCIPLINATU DESIGN PROJECT
['-']
COMPUTER NETWORKS
['https://www.youtube.com/watch?v=JvXro0dzJY8','https://www.youtube.com/watch?v=EcbyD_YycPA','https://www.youtube.com/watch?v=0nUERzTBJbQ','https://www.youtube.com/watch?v=t9TmvFvYfWw','https://www.youtube.com/watch?v=V3E1LmPtkDk','https://www.youtube.com/watch?v=TKJ5oobqcE0','https://www.youtube.com/watch?v=0_QczZ1lNDU']
DIGITAL COMMUNICATION
['https://www.youtube.com/watch?v=3w_0163BVQk','-','https://www.youtube.com/watch?v=I0Xz0ORXkVM','https://www.youtube.com/watch?v=lYjIGni4Z7g','https://www.youtube.com/watch?v=g4FHG04Yra8','https://www.youtube.com/watch?v=lYjIGni4Z7g','https://www.youtube.com/watch?v=nDPoMPT1dYY','https://www.youtube.com/watch?v=eOMpGda71Fg','https://www.youtube.com/watch?v=whYljse4Abc']
DIGITAL SIGNAL PROCESSING
['https://www.youtube.com/watch?v=LJ--VtkMxQY','https://www.youtube.com/watch?v=_0bxZCiFZpU&list=PLdciPPorsHukq1koI2EsNpKir3j0lKkCn','https://www.youtube.com/watch?v=GDFTb-BwA0o','https://www.youtube.com/watch?v=FLPqshreE-g','https://www.youtube.com/watch?v=9yNQBWKRSs4','https://www.youtube.com/watch?v=Z1N0qeiw9oE']
year3=[['https://www.youtube.com/watch?v=39LjZM2zMMw','Instead of seeing a video ,it would be better if you could refer the notes','https://www.youtube.com/watch?v=HbsuwpJgKao','https://www.youtube.com/watch?v=NrfuKTGvsFE','https://www.youtube.com/watch?v=ZSw5HPUwK8s','https://www.youtube.com/watch?v=BWmljynuhYo','https://www.youtube.com/watch?v=LFHOMYlWslU','https://www.youtube.com/watch?v=TfIajPoRdmw','https://www.youtube.com/watch?v=Q-1mSk0HYuY'],['https://www.youtube.com/watch?v=jnY9T4Bf9h8','https://www.youtube.com/watch?v=xaOF2SNktRY','https://www.youtube.com/watch?v=Rje5DJSe098','https://www.youtube.com/watch?v=WT-qzgaKeGI','https://www.youtube.com/watch?v=IEeltuxzPYE','https://www.youtube.com/watch?v=VtxFtzWlTgg','https://www.youtube.com/watch?v=dP496kJmzXc','https://www.youtube.com/watch?v=o1MWMrFhXXs','https://www.youtube.com/watch?v=O-OqgFE9SD4&list=PLFFbyVlrhQnvaEyHXkfxpKRVzhDocc6eT','https://www.youtube.com/watch?v=NjRiqHSGmB0','https://www.youtube.com/watch?v=RJleGwXorUk','https://www.youtube.com/watch?v=rNMlaq8xABE','https://www.youtube.com/watch?v=eNVN67eZC88'],['https://www.youtube.com/watch?v=o-a1uXkcNXY','https://www.youtube.com/watch?v=pz57y4BHIy0','http://www.open-std.org/jtc1/sc22/wg21/docs/ESC_Boston_01_304_paper.pdf','https://www.youtube.com/watch?v=I35w8v_rcmY','https://www.youtube.com/watch?v=kgcUVZARftQ','https://www.youtube.com/watch?v=oWmTJdYYRTg','https://www.youtube.com/watch?v=FnGCDLhaxKU'],['-'],['https://www.youtube.com/watch?v=JvXro0dzJY8','https://www.youtube.com/watch?v=EcbyD_YycPA','https://www.youtube.com/watch?v=0nUERzTBJbQ','https://www.youtube.com/watch?v=t9TmvFvYfWw','https://www.youtube.com/watch?v=V3E1LmPtkDk','https://www.youtube.com/watch?v=TKJ5oobqcE0','https://www.youtube.com/watch?v=0_QczZ1lNDU'],['https://www.youtube.com/watch?v=3w_0163BVQk','-','https://www.youtube.com/watch?v=I0Xz0ORXkVM','https://www.youtube.com/watch?v=lYjIGni4Z7g','https://www.youtube.com/watch?v=g4FHG04Yra8','https://www.youtube.com/watch?v=lYjIGni4Z7g','https://www.youtube.com/watch?v=nDPoMPT1dYY','https://www.youtube.com/watch?v=eOMpGda71Fg','https://www.youtube.com/watch?v=whYljse4Abc'],['https://www.youtube.com/watch?v=LJ--VtkMxQY','https://www.youtube.com/watch?v=_0bxZCiFZpU&list=PLdciPPorsHukq1koI2EsNpKir3j0lKkCn','https://www.youtube.com/watch?v=GDFTb-BwA0o','https://www.youtube.com/watch?v=FLPqshreE-g','https://www.youtube.com/watch?v=9yNQBWKRSs4','https://www.youtube.com/watch?v=Z1N0qeiw9oE']]
---------------------------------------------------------
YEAR 4
VIRTUAL AND AUGMENTED REALITY
['https://www.youtube.com/watch?v=H03G8Y7C9L0','https://www.youtube.com/watch?v=zvgWgpGZVKc','http://www.tandfonline.com/doi/abs/10.1080/088395199117315','-']
VISUAL MEDIA COMPRESSION AND PROCESSING
['-']
COMPUTER VISION
['https://www.udacity.com/course/introduction-to-computer-vision--ud810']
3D MODELLING AND ANIMATION
['Resources can be found at - http://www.comp.nus.edu.sg/~kkyin/CS3242/']
AUDIO AND SPEECH PROCESSING
['https://www.youtube.com/watch?v=Xjzm7S__kBU']
PARALLEL COMPUTING
['https://www.youtube.com/watch?v=yUtn_vUPbNg&list=PL5PHm2jkkXmh4cDkC3s1VBB7-njlgiG5d']
DISTRIBUTED SYSTEMS
['https://www.youtube.com/watch?v=7zafB2GkMBk&list=PL72C36006AD9CED5C']
SIMULATION AND MODELLING
['https://www.youtube.com/watch?v=d3ChB1tDMyI&list=PLUl4u3cNGP63eWjy1orBicyAXrunfs2jT']
ADVANCED TOPICS IN ALGORITHMS
['https://www.youtube.com/watch?v=0JUN9aDxVmI']
PERVASIVE NETWORKS
['https://www.youtube.com/watch?v=t9rF051DWkk']
PERSONAL MOBILE NETWORKS
['http://www.cse.wustl.edu/~jain/cse574-10/']
ADVANCED COMPUTER NETWORKS
['-']
CRYPTOGRAPHY AND NETWORK SECURITY
['https://www.youtube.com/watch?v=WGmvE9ns4nM&list=PLPl8TJzokTObVRv1Mwo-hP_UV0S1GpUzf']
EMBEDDED SYSTEMS DESIGN
['https://www.youtube.com/watch?v=9oorSIfCR5I&list=PLQefpK95HyFmao3zi-WDOMkeSev-Je5dE']
EMBEDDED SYSTEMS DEVELOPMENT
['https://www.youtube.com/watch?v=3V9eqvkMzHA&list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM']
EMBEDDED OPERATING SYSTEMS
['https://www.youtube.com/watch?v=bOFMXuoc5kE&list=PLsiW6hTaeDlSerwQ6JYAu2ED7b4nsMBHM']
PROGRAMMABLE SYSTEMS-ON-CHIP
['https://www.youtube.com/watch?v=pFz1S5NVfRg&list=PLlBhKdf4iTIhzXN0qFK6DKDHHtUsc301S']
COMPUTER SECURITY (SYSTEM SECURITY)
['https://www.youtube.com/watch?v=GqmQg-cszw4&list=PLUl4u3cNGP62K2DjQLRxDNRi0z2IRWnNh']
SECURITY MANAGEMENT
['https://www.youtube.com/watch?v=V7T4WVWvAA8&list=PL5E6D4A5B33DCAE78']
DIGITAL FORENSICS
['https://www.youtube.com/watch?v=Gt0JyXxfB2E&list=PL6oHuo5it4TgA-ZtIo3x5G0l0HDwPPZ9d']
year4=[['https://www.youtube.com/watch?v=H03G8Y7C9L0','https://www.youtube.com/watch?v=zvgWgpGZVKc','http://www.tandfonline.com/doi/abs/10.1080/088395199117315','-'],['-'],['https://www.udacity.com/course/introduction-to-computer-vision--ud810'],['Resources can be found at - http://www.comp.nus.edu.sg/~kkyin/CS3242/'],['https://www.youtube.com/watch?v=Xjzm7S__kBU'],['https://www.youtube.com/watch?v=yUtn_vUPbNg&list=PL5PHm2jkkXmh4cDkC3s1VBB7-njlgiG5d'],['https://www.youtube.com/watch?v=7zafB2GkMBk&list=PL72C36006AD9CED5C'],['https://www.youtube.com/watch?v=d3ChB1tDMyI&list=PLUl4u3cNGP63eWjy1orBicyAXrunfs2jT'],['https://www.youtube.com/watch?v=0JUN9aDxVmI'],['https://www.youtube.com/watch?v=t9rF051DWkk'],['http://www.cse.wustl.edu/~jain/cse574-10/'],['-'],['https://www.youtube.com/watch?v=WGmvE9ns4nM&list=PLPl8TJzokTObVRv1Mwo-hP_UV0S1GpUzf'],['https://www.youtube.com/watch?v=9oorSIfCR5I&list=PLQefpK95HyFmao3zi-WDOMkeSev-Je5dE'],['https://www.youtube.com/watch?v=3V9eqvkMzHA&list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM'],['https://www.youtube.com/watch?v=bOFMXuoc5kE&list=PLsiW6hTaeDlSerwQ6JYAu2ED7b4nsMBHM'],['https://www.youtube.com/watch?v=pFz1S5NVfRg&list=PLlBhKdf4iTIhzXN0qFK6DKDHHtUsc301S'],['https://www.youtube.com/watch?v=GqmQg-cszw4&list=PLUl4u3cNGP62K2DjQLRxDNRi0z2IRWnNh'],['https://www.youtube.com/watch?v=V7T4WVWvAA8&list=PL5E6D4A5B33DCAE78'],['https://www.youtube.com/watch?v=Gt0JyXxfB2E&list=PL6oHuo5it4TgA-ZtIo3x5G0l0HDwPPZ9d']]
----------------------------------------------------
| 92.106918 | 2,832 | 0.756367 | 2,116 | 14,645 | 5.215028 | 0.140359 | 0.178342 | 0.331672 | 0.398006 | 0.941278 | 0.941278 | 0.941278 | 0.918894 | 0.90222 | 0.841867 | 0 | 0.047798 | 0.018573 | 14,645 | 158 | 2,833 | 92.689873 | 0.719961 | 0 | 0 | 0.038961 | 0 | 0.12987 | 0.855094 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
55745fd3991a092bc6741864d77e152a69da3b3b | 11,729 | py | Python | Simulators/Microsoft Airsim Simulator/Control/changeRoad.py | enesdoruk/Autonom-Vehicles-Projects | 0cf4de4fe10eb0f5c886eca8fb5117b0121ae53b | [
"MIT"
] | 2 | 2022-01-20T14:34:28.000Z | 2022-02-10T22:12:37.000Z | Simulators/Microsoft Airsim Simulator/Control/changeRoad.py | enesdoruk/Autonom-Vehicles-Projects | 0cf4de4fe10eb0f5c886eca8fb5117b0121ae53b | [
"MIT"
] | null | null | null | Simulators/Microsoft Airsim Simulator/Control/changeRoad.py | enesdoruk/Autonom-Vehicles-Projects | 0cf4de4fe10eb0f5c886eca8fb5117b0121ae53b | [
"MIT"
] | null | null | null | import setup_path
import airsim
import cv2
import numpy as np
import os
import time
import math
from Sensors.Distance import distanceSensor
def do_control(client, car_controls,label_sign, dist_sign, label_light, dist_light, label_x, label_y):
l_distance = distanceSensor.distance_left(client)
r_distance = distanceSensor.distance_right(client)
front_distance = distanceSensor.distance_front(client)
print("on====",front_distance)
print("sol====",l_distance)
print("sag====",r_distance)
if front_distance < 2:
print("Dur")
car_controls.throttle = 0.0
car_controls.steering = 0.0
client.setCarControls(car_controls)
else:
if 'stop' in label_light:
for i in range(len(label_light)):
if label_light[i] == 'stop':
if dist_light[i] < 35:
print("Duz gidiyor")
car_controls.throttle = 0.0
car_controls.steering = 0
client.setCarControls(car_controls)
else:
if front_distance > 15 and l_distance > 3 and r_distance > 3:
print("Duz gidiyor")
car_controls.throttle = 0.32
car_controls.steering = 0
client.setCarControls(car_controls)
if 'turnRight' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnRight':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 7:
car_controls.throttle = 0.25
car_controls.steering = 0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 4:
car_controls.throttle = 0.25
car_controls.steering = 0.3
client.setCarControls(car_controls)
if 'turnLeft' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnLeft':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 5:
car_controls.throttle = 0.3
car_controls.steering = -0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 3:
car_controls.throttle = 0.25
car_controls.steering = -0.35
client.setCarControls(car_controls)
if front_distance > 15 and l_distance < 3 and r_distance > 3:
print("hafif saga meyil")
car_controls.throttle = 0.3
car_controls.steering = 0.1
client.setCarControls(car_controls)
if 'turnRight' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnRight':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 7:
car_controls.throttle = 0.25
car_controls.steering = 0.10
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 4:
car_controls.throttle = 0.25
car_controls.steering = 0.3
client.setCarControls(car_controls)
if 'turnLeft' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnLeft':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 5:
car_controls.throttle = 0.3
car_controls.steering = -0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 3:
car_controls.throttle = 0.25
car_controls.steering = -0.35
client.setCarControls(car_controls)
if front_distance > 15 and l_distance > 3 and r_distance < 3:
print("hafif sola meyil")
car_controls.throttle = 0.3
car_controls.steering = -0.1
client.setCarControls(car_controls)
if 'turnRight' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnRight':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 7:
car_controls.throttle = 0.25
car_controls.steering = 0.10
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 4:
car_controls.throttle = 0.25
car_controls.steering = 0.3
client.setCarControls(car_controls)
if 'turnLeft' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnLeft':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 5:
car_controls.throttle = 0.3
car_controls.steering = -0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 3:
car_controls.throttle = 0.25
car_controls.steering = -0.35
client.setCarControls(car_controls)
if front_distance < 20 and (l_distance > r_distance * 2.2 ):
print("keskin sola meyil")
car_controls.throttle = 0.3
car_controls.steering = -0.47
client.setCarControls(car_controls)
if 'turnRight' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnRight':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 7:
car_controls.throttle = 0.25
car_controls.steering = 0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 4:
car_controls.throttle = 0.25
car_controls.steering = 0.3
client.setCarControls(car_controls)
if 'turnLeft' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnLeft':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 5:
car_controls.throttle = 0.3
car_controls.steering = -0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 3:
car_controls.throttle = 0.25
car_controls.steering = -0.35
client.setCarControls(car_controls)
if front_distance < 15 and (l_distance * 2.2 < r_distance):
print("keskin saga meyil")
car_controls.throttle = 0.3
car_controls.steering = 0.45
client.setCarControls(car_controls)
if 'turnRight' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnRight':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 7:
car_controls.throttle = 0.25
car_controls.steering = 0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 4:
car_controls.throttle = 0.25
car_controls.steering = 0.3
client.setCarControls(car_controls)
if 'turnLeft' in label_sign:
for i in range(len(label_sign)):
if label_sign[i] == 'turnLeft':
if dist_sign[i] < 25:
start_time = time.time()
while time.time() - start_time < 5:
car_controls.throttle = 0.3
car_controls.steering = -0.11
client.setCarControls(car_controls)
start_time2 = time.time()
while time.time() - start_time2 < 3:
car_controls.throttle = 0.25
car_controls.steering = -0.35
client.setCarControls(car_controls)
| 51.442982 | 102 | 0.392276 | 976 | 11,729 | 4.510246 | 0.078893 | 0.204907 | 0.116538 | 0.122672 | 0.882326 | 0.882326 | 0.87801 | 0.858246 | 0.846661 | 0.828033 | 0 | 0.041519 | 0.542075 | 11,729 | 228 | 103 | 51.442982 | 0.778067 | 0 | 0 | 0.815385 | 0 | 0 | 0.024638 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005128 | false | 0 | 0.041026 | 0 | 0.046154 | 0.051282 | 0 | 0 | 0 | null | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 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 |
e97ed56f2aa168cae85d92d1ccd077ac0e919bf8 | 351,941 | py | Python | sympy/integrals/rubi/rules/miscellaneous_algebraic.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/miscellaneous_algebraic.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/miscellaneous_algebraic.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 miscellaneous_algebraic(rubi):
pattern1 = Pattern(Integral(((x_**n_*WC('c', S(1)))**q_*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 q, x: FreeQ(q, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, q: IntegerQ(n*q)))
rule1 = ReplacementRule(pattern1, lambda p, n, a, q, x, b, c : x*(c*x**n)**(-S(1)/n)*Subst(Int((a + b*x**(n*q))**p, x), x, (c*x**n)**(1/n)))
rubi.add(rule1)
pattern2 = Pattern(Integral(x_**WC('m', S(1))*((x_**n_*WC('c', S(1)))**q_*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 m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda n, q: IntegerQ(n*q)), CustomConstraint(lambda m: IntegerQ(m)))
rule2 = ReplacementRule(pattern2, lambda p, n, a, q, x, m, b, c : x**(m + S(1))*(c*x**n)**(-(m + S(1))/n)*Subst(Int(x**m*(a + b*x**(n*q))**p, x), x, (c*x**n)**(1/n)))
rubi.add(rule2)
pattern3 = Pattern(Integral(x_**WC('m', S(1))*((a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('r', S(1))*WC('e', S(1)))**p_*((c_ + x_**WC('n', S(1))*WC('d', S(1)))**s_*WC('f', S(1)))**q_, 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)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda r, x: FreeQ(r, x)), CustomConstraint(lambda s, x: FreeQ(s, x)))
rule3 = ReplacementRule(pattern3, lambda r, p, n, a, s, q, f, x, m, b, d, e, c : (e*(a + b*x**n)**r)**p*(f*(c + d*x**n)**s)**q*(a + b*x**n)**(-p*r)*(c + d*x**n)**(-q*s)*Int(x**m*(a + b*x**n)**(p*r)*(c + d*x**n)**(q*s), x))
rubi.add(rule3)
pattern4 = Pattern(Integral(((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', S(1))))**p_*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 e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda b, a, d, c: ZeroQ(-a*d + b*c)))
rule4 = ReplacementRule(pattern4, lambda p, n, a, x, u, b, d, e, c : (b*e/d)**p*Int(u, x))
rubi.add(rule4)
pattern5 = Pattern(Integral(((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', S(1))))**p_*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 e, x: FreeQ(e, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda b, e, d: PositiveQ(b*d*e)), CustomConstraint(lambda b, a, d, c: PositiveQ(-a*d/b + c)))
rule5 = ReplacementRule(pattern5, lambda p, n, a, x, u, b, d, e, c : Int(u*(e*(a + b*x**n))**p*(c + d*x**n)**(-p), x))
rubi.add(rule5)
pattern6 = Pattern(Integral(((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda p: FractionQ(p)), CustomConstraint(lambda n: IntegerQ(1/n)), )
def With6(e, p, n, a, x, b, d, c):
q = Denominator(p)
return e*q*(-a*d + b*c)*Subst(Int(x**(q*(p + S(1)) + S(-1))*(-a*e + c*x**q)**(S(-1) + 1/n)*(b*e - d*x**q)**(S(-1) - S(1)/n), x), x, (e*(a + b*x**n)/(c + d*x**n))**(1/q))/n
rule6 = ReplacementRule(pattern6, lambda e, p, n, a, x, b, d, c : With6(e, p, n, a, x, b, d, c))
rubi.add(rule6)
pattern7 = Pattern(Integral(x_**WC('m', S(1))*((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', 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 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: FractionQ(p)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), )
def With7(p, n, a, x, m, b, d, e, c):
q = Denominator(p)
return e*q*(-a*d + b*c)*Subst(Int(x**(q*(p + S(1)) + S(-1))*(-a*e + c*x**q)**(S(-1) + (m + S(1))/n)*(b*e - d*x**q)**(S(-1) - (m + S(1))/n), x), x, (e*(a + b*x**n)/(c + d*x**n))**(1/q))/n
rule7 = ReplacementRule(pattern7, lambda p, n, a, x, m, b, d, e, c : With7(p, n, a, x, m, b, d, e, c))
rubi.add(rule7)
pattern8 = Pattern(Integral(u_**WC('r', S(1))*((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda x, u: PolynomialQ(u, x)), CustomConstraint(lambda p: FractionQ(p)), CustomConstraint(lambda n: IntegerQ(1/n)), CustomConstraint(lambda r: IntegerQ(r)), )
def With8(r, p, n, a, x, u, b, d, e, c):
q = Denominator(p)
return e*q*(-a*d + b*c)*Subst(Int(SimplifyIntegrand(x**(q*(p + S(1)) + S(-1))*(-a*e + c*x**q)**(S(-1) + 1/n)*(b*e - d*x**q)**(S(-1) - S(1)/n)*ReplaceAll(u, Rule(x, (-a*e + c*x**q)**(1/n)*(b*e - d*x**q)**(-S(1)/n)))**r, x), x), x, (e*(a + b*x**n)/(c + d*x**n))**(1/q))/n
rule8 = ReplacementRule(pattern8, lambda r, p, n, a, x, u, b, d, e, c : With8(r, p, n, a, x, u, b, d, e, c))
rubi.add(rule8)
pattern9 = Pattern(Integral(u_**WC('r', S(1))*x_**WC('m', S(1))*((x_**WC('n', S(1))*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1))/(c_ + x_**WC('n', S(1))*WC('d', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda x, u: PolynomialQ(u, x)), CustomConstraint(lambda p: FractionQ(p)), CustomConstraint(lambda n: IntegerQ(1/n)), CustomConstraint(lambda r, m: IntegersQ(m, r)), )
def With9(r, p, n, a, x, u, m, b, d, e, c):
q = Denominator(p)
return e*q*(-a*d + b*c)*Subst(Int(SimplifyIntegrand(x**(q*(p + S(1)) + S(-1))*(-a*e + c*x**q)**(S(-1) + (m + S(1))/n)*(b*e - d*x**q)**(S(-1) - (m + S(1))/n)*ReplaceAll(u, Rule(x, (-a*e + c*x**q)**(1/n)*(b*e - d*x**q)**(-S(1)/n)))**r, x), x), x, (e*(a + b*x**n)/(c + d*x**n))**(1/q))/n
rule9 = ReplacementRule(pattern9, lambda r, p, n, a, x, u, m, b, d, e, c : With9(r, p, n, a, x, u, m, b, d, e, c))
rubi.add(rule9)
pattern10 = Pattern(Integral(((WC('c', S(1))/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 c, x: FreeQ(c, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)))
rule10 = ReplacementRule(pattern10, lambda p, n, a, x, b, c : -c*Subst(Int((a + b*x**n)**p/x**S(2), x), x, c/x))
rubi.add(rule10)
pattern11 = Pattern(Integral(x_**WC('m', S(1))*((WC('c', S(1))/x_)**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 n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: IntegerQ(m)))
rule11 = ReplacementRule(pattern11, lambda p, n, a, x, m, b, c : -c**(m + S(1))*Subst(Int(x**(-m + S(-2))*(a + b*x**n)**p, x), x, c/x))
rubi.add(rule11)
pattern12 = Pattern(Integral((x_*WC('d', S(1)))**m_*((WC('c', S(1))/x_)**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 m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda m: Not(IntegerQ(m))))
rule12 = ReplacementRule(pattern12, lambda p, n, a, x, m, b, d, c : -c*(c/x)**m*(d*x)**m*Subst(Int(x**(-m + S(-2))*(a + b*x**n)**p, x), x, c/x))
rubi.add(rule12)
pattern13 = Pattern(Integral(((WC('d', S(1))/x_)**n_*WC('b', S(1)) + (WC('d', S(1))/x_)**WC('n2', S(1))*WC('c', 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 n2, n: ZeroQ(-S(2)*n + n2)))
rule13 = ReplacementRule(pattern13, lambda n2, p, n, a, x, b, d, c : -d*Subst(Int((a + b*x**n + c*x**(S(2)*n))**p/x**S(2), x), x, d/x))
rubi.add(rule13)
pattern14 = Pattern(Integral(x_**WC('m', S(1))*(a_ + (WC('d', S(1))/x_)**n_*WC('b', S(1)) + (WC('d', S(1))/x_)**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda m: IntegerQ(m)))
rule14 = ReplacementRule(pattern14, lambda n2, p, n, a, x, m, b, d, c : -d**(m + S(1))*Subst(Int(x**(-m + S(-2))*(a + b*x**n + c*x**(S(2)*n))**p, x), x, d/x))
rubi.add(rule14)
pattern15 = Pattern(Integral((x_*WC('e', S(1)))**m_*(a_ + (WC('d', S(1))/x_)**n_*WC('b', S(1)) + (WC('d', S(1))/x_)**WC('n2', 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 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda m: Not(IntegerQ(m))))
rule15 = ReplacementRule(pattern15, lambda n2, e, p, n, a, x, m, b, d, c : -d*(d/x)**m*(e*x)**m*Subst(Int(x**(-m + S(-2))*(a + b*x**n + c*x**(S(2)*n))**p, x), x, d/x))
rubi.add(rule15)
pattern16 = Pattern(Integral((x_**WC('n2', S(1))*WC('c', S(1)) + (WC('d', S(1))/x_)**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 n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(S(2)*n + n2)), CustomConstraint(lambda n: IntegerQ(S(2)*n)))
rule16 = ReplacementRule(pattern16, lambda n2, p, n, a, x, b, d, c : -d*Subst(Int((a + b*x**n + c*d**(-S(2)*n)*x**(S(2)*n))**p/x**S(2), x), x, d/x))
rubi.add(rule16)
pattern17 = Pattern(Integral(x_**WC('m', S(1))*(a_ + x_**WC('n2', S(1))*WC('c', S(1)) + (WC('d', S(1))/x_)**n_*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 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 n2, n: ZeroQ(S(2)*n + n2)), CustomConstraint(lambda n: IntegerQ(S(2)*n)), CustomConstraint(lambda m: IntegerQ(m)))
rule17 = ReplacementRule(pattern17, lambda n2, p, n, a, x, m, b, d, c : -d**(m + S(1))*Subst(Int(x**(-m + S(-2))*(a + b*x**n + c*d**(-S(2)*n)*x**(S(2)*n))**p, x), x, d/x))
rubi.add(rule17)
pattern18 = Pattern(Integral((x_*WC('e', S(1)))**m_*(a_ + x_**WC('n2', S(1))*WC('c', S(1)) + (WC('d', S(1))/x_)**n_*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 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(S(2)*n + n2)), CustomConstraint(lambda m: Not(IntegerQ(m))), CustomConstraint(lambda n: IntegerQ(S(2)*n)))
rule18 = ReplacementRule(pattern18, lambda n2, e, p, n, a, x, m, b, d, c : -d*(d/x)**m*(e*x)**m*Subst(Int(x**(-m + S(-2))*(a + b*x**n + c*d**(-S(2)*n)*x**(S(2)*n))**p, x), x, d/x))
rubi.add(rule18)
pattern19 = Pattern(Integral(u_**m_, x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda x, u: Not(LinearMatchQ(u, x))))
rule19 = ReplacementRule(pattern19, lambda x, u, m : Int(ExpandToSum(u, x)**m, x))
rubi.add(rule19)
pattern20 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('n', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda v, x, u: LinearQ(List(u, v), x)), CustomConstraint(lambda v, x, u: Not(LinearMatchQ(List(u, v), x))))
rule20 = ReplacementRule(pattern20, lambda n, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**n, x))
rubi.add(rule20)
pattern21 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('n', S(1))*w_**WC('p', 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 w, v, x, u: LinearQ(List(u, v, w), x)), CustomConstraint(lambda w, v, x, u: Not(LinearMatchQ(List(u, v, w), x))))
rule21 = ReplacementRule(pattern21, lambda p, n, w, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**n*ExpandToSum(w, x)**p, x))
rubi.add(rule21)
pattern22 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('n', S(1))*w_**WC('p', S(1))*z_**WC('q', 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 q, x: FreeQ(q, x)), CustomConstraint(lambda w, v, x, u, z: LinearQ(List(u, v, w, z), x)), CustomConstraint(lambda w, v, x, u, z: Not(LinearMatchQ(List(u, v, w, z), x))))
rule22 = ReplacementRule(pattern22, lambda p, n, q, w, v, x, u, m, z : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**n*ExpandToSum(w, x)**p*ExpandToSum(z, x)**q, x))
rubi.add(rule22)
pattern23 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: QuadraticQ(u, x)), CustomConstraint(lambda x, u: Not(QuadraticMatchQ(u, x))))
rule23 = ReplacementRule(pattern23, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule23)
pattern24 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('p', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, x, u: Not(LinearMatchQ(u, x) & QuadraticMatchQ(v, x))))
rule24 = ReplacementRule(pattern24, lambda p, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**p, x))
rubi.add(rule24)
pattern25 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('n', S(1))*w_**WC('p', 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 v, x, u: LinearQ(List(u, v), x)), CustomConstraint(lambda w, x: QuadraticQ(w, x)), CustomConstraint(lambda w, v, x, u: Not(QuadraticMatchQ(w, x) & LinearMatchQ(List(u, v), x))))
rule25 = ReplacementRule(pattern25, lambda p, n, w, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**n*ExpandToSum(w, x)**p, x))
rubi.add(rule25)
pattern26 = Pattern(Integral(u_**WC('p', S(1))*v_**WC('q', S(1)), x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda v, x, u: QuadraticQ(List(u, v), x)), CustomConstraint(lambda v, x, u: Not(QuadraticMatchQ(List(u, v), x))))
rule26 = ReplacementRule(pattern26, lambda p, q, v, x, u : Int(ExpandToSum(u, x)**p*ExpandToSum(v, x)**q, x))
rubi.add(rule26)
pattern27 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: BinomialQ(u, x)), CustomConstraint(lambda x, u: Not(BinomialMatchQ(u, x))))
rule27 = ReplacementRule(pattern27, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule27)
pattern28 = Pattern(Integral(u_**WC('p', S(1))*(x_*WC('c', S(1)))**WC('m', S(1)), x_), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: BinomialQ(u, x)), CustomConstraint(lambda x, u: Not(BinomialMatchQ(u, x))))
rule28 = ReplacementRule(pattern28, lambda p, x, u, m, c : Int((c*x)**m*ExpandToSum(u, x)**p, x))
rubi.add(rule28)
pattern29 = Pattern(Integral(u_**WC('p', S(1))*v_**WC('q', S(1)), x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda v, x, u: BinomialQ(List(u, v), x)), CustomConstraint(lambda v, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(v, x))), CustomConstraint(lambda v, x, u: Not(BinomialMatchQ(List(u, v), x))))
rule29 = ReplacementRule(pattern29, lambda p, q, v, x, u : Int(ExpandToSum(u, x)**p*ExpandToSum(v, x)**q, x))
rubi.add(rule29)
pattern30 = Pattern(Integral(u_**WC('p', S(1))*v_**WC('q', S(1))*x_**WC('m', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda v, x, u: BinomialQ(List(u, v), x)), CustomConstraint(lambda v, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(v, x))), CustomConstraint(lambda v, x, u: Not(BinomialMatchQ(List(u, v), x))))
rule30 = ReplacementRule(pattern30, lambda p, q, v, x, u, m : Int(x**m*ExpandToSum(u, x)**p*ExpandToSum(v, x)**q, x))
rubi.add(rule30)
pattern31 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('p', S(1))*w_**WC('q', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda w, v, x, u: BinomialQ(List(u, v, w), x)), CustomConstraint(lambda v, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(v, x))), CustomConstraint(lambda w, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(w, x))), CustomConstraint(lambda w, v, x, u: Not(BinomialMatchQ(List(u, v, w), x))))
rule31 = ReplacementRule(pattern31, lambda p, q, w, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**p*ExpandToSum(w, x)**q, x))
rubi.add(rule31)
pattern32 = Pattern(Integral(u_**WC('p', S(1))*v_**WC('q', S(1))*x_**WC('m', S(1))*z_**WC('r', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda r, x: FreeQ(r, x)), CustomConstraint(lambda z, v, x, u: BinomialQ(List(u, v, z), x)), CustomConstraint(lambda v, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(v, x))), CustomConstraint(lambda z, x, u: ZeroQ(BinomialDegree(u, x) - BinomialDegree(z, x))), CustomConstraint(lambda z, v, x, u: Not(BinomialMatchQ(List(u, v, z), x))))
rule32 = ReplacementRule(pattern32, lambda r, p, q, v, x, u, m, z : Int(x**m*ExpandToSum(u, x)**p*ExpandToSum(v, x)**q*ExpandToSum(z, x)**r, x))
rubi.add(rule32)
pattern33 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: GeneralizedBinomialQ(u, x)), CustomConstraint(lambda x, u: Not(GeneralizedBinomialMatchQ(u, x))))
rule33 = ReplacementRule(pattern33, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule33)
pattern34 = Pattern(Integral(u_**WC('p', S(1))*x_**WC('m', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: GeneralizedBinomialQ(u, x)), CustomConstraint(lambda x, u: Not(GeneralizedBinomialMatchQ(u, x))))
rule34 = ReplacementRule(pattern34, lambda p, x, u, m : Int(x**m*ExpandToSum(u, x)**p, x))
rubi.add(rule34)
pattern35 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: TrinomialQ(u, x)), CustomConstraint(lambda x, u: Not(TrinomialMatchQ(u, x))))
rule35 = ReplacementRule(pattern35, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule35)
pattern36 = Pattern(Integral(u_**WC('p', S(1))*(x_*WC('d', S(1)))**WC('m', S(1)), x_), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: TrinomialQ(u, x)), CustomConstraint(lambda x, u: Not(TrinomialMatchQ(u, x))))
rule36 = ReplacementRule(pattern36, lambda p, x, u, m, d : Int((d*x)**m*ExpandToSum(u, x)**p, x))
rubi.add(rule36)
pattern37 = Pattern(Integral(u_**WC('q', S(1))*v_**WC('p', S(1)), x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda x, u: BinomialQ(u, x)), CustomConstraint(lambda v, x: TrinomialQ(v, x)), CustomConstraint(lambda v, x, u: Not(BinomialMatchQ(u, x) & TrinomialMatchQ(v, x))))
rule37 = ReplacementRule(pattern37, lambda p, q, v, x, u : Int(ExpandToSum(u, x)**q*ExpandToSum(v, x)**p, x))
rubi.add(rule37)
pattern38 = Pattern(Integral(u_**WC('q', S(1))*v_**WC('p', S(1)), x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda x, u: BinomialQ(u, x)), CustomConstraint(lambda v, x: BinomialQ(v, x)), CustomConstraint(lambda v, x, u: Not(BinomialMatchQ(u, x) & BinomialMatchQ(v, x))))
rule38 = ReplacementRule(pattern38, lambda p, q, v, x, u : Int(ExpandToSum(u, x)**q*ExpandToSum(v, x)**p, x))
rubi.add(rule38)
pattern39 = Pattern(Integral(u_**WC('p', S(1))*x_**WC('m', S(1))*z_**WC('q', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda z, x: BinomialQ(z, x)), CustomConstraint(lambda x, u: TrinomialQ(u, x)), CustomConstraint(lambda z, x, u: Not(BinomialMatchQ(z, x) & TrinomialMatchQ(u, x))))
rule39 = ReplacementRule(pattern39, lambda p, q, x, u, m, z : Int(x**m*ExpandToSum(u, x)**p*ExpandToSum(z, x)**q, x))
rubi.add(rule39)
pattern40 = Pattern(Integral(u_**WC('p', S(1))*x_**WC('m', S(1))*z_**WC('q', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda z, x: BinomialQ(z, x)), CustomConstraint(lambda x, u: BinomialQ(u, x)), CustomConstraint(lambda z, x, u: Not(BinomialMatchQ(u, x) & BinomialMatchQ(z, x))))
rule40 = ReplacementRule(pattern40, lambda p, q, x, u, m, z : Int(x**m*ExpandToSum(u, x)**p*ExpandToSum(z, x)**q, x))
rubi.add(rule40)
pattern41 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: GeneralizedTrinomialQ(u, x)), CustomConstraint(lambda x, u: Not(GeneralizedTrinomialMatchQ(u, x))))
rule41 = ReplacementRule(pattern41, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule41)
pattern42 = Pattern(Integral(u_**WC('p', S(1))*x_**WC('m', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: GeneralizedTrinomialQ(u, x)), CustomConstraint(lambda x, u: Not(GeneralizedTrinomialMatchQ(u, x))))
rule42 = ReplacementRule(pattern42, lambda p, x, u, m : Int(x**m*ExpandToSum(u, x)**p, x))
rubi.add(rule42)
pattern43 = Pattern(Integral(u_**WC('p', S(1))*z_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda z, x: BinomialQ(z, x)), CustomConstraint(lambda x, u: GeneralizedTrinomialQ(u, x)), CustomConstraint(lambda z, x, u: ZeroQ(BinomialDegree(z, x) - GeneralizedTrinomialDegree(u, x))), CustomConstraint(lambda z, x, u: Not(BinomialMatchQ(z, x) & GeneralizedTrinomialMatchQ(u, x))))
rule43 = ReplacementRule(pattern43, lambda z, p, x, u : Int(ExpandToSum(u, x)**p*ExpandToSum(z, x), x))
rubi.add(rule43)
pattern44 = Pattern(Integral(u_**WC('p', S(1))*x_**WC('m', S(1))*z_, x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda z, x: BinomialQ(z, x)), CustomConstraint(lambda x, u: GeneralizedTrinomialQ(u, x)), CustomConstraint(lambda z, x, u: ZeroQ(BinomialDegree(z, x) - GeneralizedTrinomialDegree(u, x))), CustomConstraint(lambda z, x, u: Not(BinomialMatchQ(z, x) & GeneralizedTrinomialMatchQ(u, x))))
rule44 = ReplacementRule(pattern44, lambda p, x, u, m, z : Int(x**m*ExpandToSum(u, x)**p*ExpandToSum(z, x), x))
rubi.add(rule44)
pattern45 = Pattern(Integral(x_**WC('m', S(1))*(e_ + x_**WC('n', S(1))*WC('h', S(1)) + x_**WC('q', S(1))*WC('f', S(1)) + x_**WC('r', S(1))*WC('g', S(1)))/(a_ + x_**WC('n', S(1))*WC('c', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, 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 m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, q: ZeroQ(-n/S(4) + q)), CustomConstraint(lambda n, r: ZeroQ(-S(3)*n/S(4) + r)), CustomConstraint(lambda n, m: ZeroQ(S(4)*m - n + S(4))), CustomConstraint(lambda h, a, e, c: ZeroQ(a*h + c*e)))
rule45 = ReplacementRule(pattern45, lambda r, n, a, q, g, f, x, m, h, e, c : (-S(2)*a*g - S(4)*a*h*x**(n/S(4)) + S(2)*c*f*x**(n/S(2)))/(a*c*n*sqrt(a + c*x**n)))
rubi.add(rule45)
pattern46 = Pattern(Integral((d_*x_)**WC('m', S(1))*(e_ + x_**WC('n', S(1))*WC('h', S(1)) + x_**WC('q', S(1))*WC('f', S(1)) + x_**WC('r', S(1))*WC('g', S(1)))/(a_ + x_**WC('n', S(1))*WC('c', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, 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 m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, m: ZeroQ(S(4)*m - n + S(4))), CustomConstraint(lambda n, q: ZeroQ(-n/S(4) + q)), CustomConstraint(lambda n, r: ZeroQ(-S(3)*n/S(4) + r)), CustomConstraint(lambda h, a, e, c: ZeroQ(a*h + c*e)))
rule46 = ReplacementRule(pattern46, lambda r, e, n, a, q, g, f, x, m, h, d, c : x**(-m)*(d*x)**m*Int(x**m*(e + f*x**(n/S(4)) + g*x**(S(3)*n/S(4)) + h*x**n)/(a + c*x**n)**(S(3)/2), x))
rubi.add(rule46)
pattern47 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**m_*(a_ + x_*WC('b', 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: FractionQ(p)), CustomConstraint(lambda m: NegativeIntegerQ(m + S(1))), )
def With47(p, Pq, a, x, m, b, c):
n = Denominator(p)
return n*Subst(Int(x**(n*p + n + S(-1))*(-a*c/b + c*x**n/b)**m*ReplaceAll(Pq, Rule(x, -a/b + x**n/b)), x), x, (a + b*x)**(1/n))/b
rule47 = ReplacementRule(pattern47, lambda p, Pq, a, x, m, b, c : With47(p, Pq, a, x, m, b, c))
rubi.add(rule47)
pattern48 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: PositiveIntegerQ(n/(m + S(1)))), CustomConstraint(lambda Pq, x, m: PolyQ(Pq, x**(m + S(1)))))
rule48 = ReplacementRule(pattern48, lambda p, n, Pq, a, x, m, b : Subst(Int((a + b*x**(n/(m + S(1))))**p*SubstFor(x**(m + S(1)), Pq, x), x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule48)
pattern49 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(n, p)), CustomConstraint(lambda n, Pq, x: NonzeroQ(Coeff(Pq, x, n + S(-1)))))
rule49 = ReplacementRule(pattern49, lambda p, n, Pq, a, x, b : Int((a + b*x**n)**p*ExpandToSum(Pq - x**(n + S(-1))*Coeff(Pq, x, n + S(-1)), x), x) + (a + b*x**n)**(p + S(1))*Coeff(Pq, x, n + S(-1))/(b*n*(p + S(1))))
rubi.add(rule49)
pattern50 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*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 c, x: FreeQ(c, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(p) | ZeroQ(n + S(-1))))
rule50 = ReplacementRule(pattern50, lambda p, n, Pq, a, x, m, b, c : Int(ExpandIntegrand(Pq*(c*x)**m*(a + b*x**n)**p, x), x))
rubi.add(rule50)
pattern51 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*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, x: FreeQ(n, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n, p: PositiveIntegerQ(p) | ZeroQ(n + S(-1))))
rule51 = ReplacementRule(pattern51, lambda p, n, Pq, a, x, b : Int(ExpandIntegrand(Pq*(a + b*x**n)**p, x), x))
rubi.add(rule51)
pattern52 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule52 = ReplacementRule(pattern52, lambda p, n, Pq, a, x, m, b : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*x)**p*SubstFor(x**n, Pq, x), x), x, x**n)/n)
rubi.add(rule52)
pattern53 = Pattern(Integral(Pq_*(c_*x_)**WC('m', S(1))*(a_ + x_**n_*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 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule53 = ReplacementRule(pattern53, lambda p, n, Pq, a, x, m, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(Pq*x**m*(a + b*x**n)**p, x))
rubi.add(rule53)
pattern54 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))))
rule54 = ReplacementRule(pattern54, lambda p, n, Pq, a, x, m, b : Pq*(a + b*x**n)**(p + S(1))/(b*n*(p + S(1))) - Int((a + b*x**n)**(p + S(1))*D(Pq, x), x)/(b*n*(p + S(1))))
rubi.add(rule54)
pattern55 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda Pq, x: ZeroQ(Coeff(Pq, x, S(0)))))
rule55 = ReplacementRule(pattern55, lambda p, n, Pq, a, x, m, b, d : Int((d*x)**(m + S(1))*(a + b*x**n)**p*ExpandToSum(Pq/x, x), x)/d)
rubi.add(rule55)
pattern56 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda Pq, x: ZeroQ(Coeff(Pq, x, S(0)))), CustomConstraint(lambda Pq: SumQ(Pq)))
rule56 = ReplacementRule(pattern56, lambda p, n, Pq, a, x, b : Int(x*(a + b*x**n)**p*ExpandToSum(Pq/x, x), x))
rubi.add(rule56)
pattern57 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p, m: RationalQ(m, p)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda Pq, x, m: Less(m + Expon(Pq, x) + S(1), S(0))), )
def With57(p, n, Pq, a, x, m, b):
u = IntHide(Pq*x**m, x)
return -b*n*p*Int(x**(m + n)*(a + b*x**n)**(p + S(-1))*ExpandToSum(u*x**(-m + S(-1)), x), x) + u*(a + b*x**n)**p
rule57 = ReplacementRule(pattern57, lambda p, n, Pq, a, x, m, b : With57(p, n, Pq, a, x, m, b))
rubi.add(rule57)
pattern58 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2) + S(-1)/2)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0))), )
def With58(p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
i = Symbol('i')
return a*n*p*Int((c*x)**m*(a + b*x**n)**(p + S(-1))*Sum(x**i*Coeff(Pq, x, i)/(i + m + n*p + S(1)), List(i, S(0), q)), x) + (c*x)**m*(a + b*x**n)**p*Sum(x**(i + S(1))*Coeff(Pq, x, i)/(i + m + n*p + S(1)), List(i, S(0), q))
rule58 = ReplacementRule(pattern58, lambda p, n, Pq, a, x, m, b, c : With58(p, n, Pq, a, x, m, b, c))
rubi.add(rule58)
pattern59 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2) + S(-1)/2)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Greater(p, S(0))), )
def With59(p, n, Pq, a, x, b):
q = Expon(Pq, x)
i = Symbol('i')
return a*n*p*Int((a + b*x**n)**(p + S(-1))*Sum(x**i*Coeff(Pq, x, i)/(i + n*p + S(1)), List(i, S(0), q)), x) + (a + b*x**n)**p*Sum(x**(i + S(1))*Coeff(Pq, x, i)/(i + n*p + S(1)), List(i, S(0), q))
rule59 = ReplacementRule(pattern59, lambda p, n, Pq, a, x, b : With59(p, n, Pq, a, x, b))
rubi.add(rule59)
pattern60 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda b, n, Pq, a, i, x, p, q: Equal(q, n + S(-1))))
def With60(p, n, Pq, a, x, b):
q = Expon(Pq, x)
i = Symbol('i')
return Int((a + b*x**n)**(p + S(1))*Sum(x**i*(i + n*(p + S(1)) + S(1))*Coeff(Pq, x, i), List(i, S(0), q + S(-1))), x)/(a*n*(p + S(1))) + (a + b*x**n)**(p + S(1))*(a*Coeff(Pq, x, q) - b*x*ExpandToSum(Pq - x**q*Coeff(Pq, x, q), x))/(a*b*n*(p + S(1)))
rule60 = ReplacementRule(pattern60, lambda p, n, Pq, a, x, b : With60(p, n, Pq, a, x, b))
rubi.add(rule60)
pattern61 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, Pq, x: Less(Expon(Pq, x), n + S(-1))))
rule61 = ReplacementRule(pattern61, lambda p, n, Pq, a, x, b : -Pq*x*(a + b*x**n)**(p + S(1))/(a*n*(p + S(1))) + Int((a + b*x**n)**(p + S(1))*ExpandToSum(Pq*n*(p + S(1)) + D(Pq*x, x), x), x)/(a*n*(p + S(1))))
rubi.add(rule61)
pattern62 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)) + x_*WC('e', S(1)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, 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 b, a, d, g: ZeroQ(a*g + b*d)))
rule62 = ReplacementRule(pattern62, lambda a, f, x, b, d, e, g : (-S(2)*a*f - S(4)*a*g*x + S(2)*b*e*x**S(2))/(S(4)*a*b*sqrt(a + b*x**S(4))))
rubi.add(rule62)
pattern63 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda b, a, d, g: ZeroQ(a*g + b*d)))
rule63 = ReplacementRule(pattern63, lambda a, f, x, b, d, g : (-f - S(2)*g*x)/(S(2)*b*sqrt(a + b*x**S(4))))
rubi.add(rule63)
pattern64 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_*WC('e', S(1)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda b, a, d, g: ZeroQ(a*g + b*d)))
rule64 = ReplacementRule(pattern64, lambda a, x, b, d, e, g : -x*(S(2)*a*g - b*e*x)/(S(2)*a*b*sqrt(a + b*x**S(4))))
rubi.add(rule64)
pattern65 = Pattern(Integral(x_**S(2)*(x_**S(4)*WC('h', S(1)) + x_*WC('f', S(1)) + WC('e', S(0)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), 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 h, x: FreeQ(h, x)), CustomConstraint(lambda b, h, a, e: ZeroQ(-S(3)*a*h + b*e)))
rule65 = ReplacementRule(pattern65, lambda a, f, x, b, h, e : (-f + S(2)*h*x**S(3))/(S(2)*b*sqrt(a + b*x**S(4))))
rubi.add(rule65)
pattern66 = Pattern(Integral(x_**S(2)*(x_**S(4)*WC('h', S(1)) + WC('e', S(0)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda b, h, a, e: ZeroQ(-S(3)*a*h + b*e)))
rule66 = ReplacementRule(pattern66, lambda a, x, b, h, e : h*x**S(3)/(b*sqrt(a + b*x**S(4))))
rubi.add(rule66)
pattern67 = Pattern(Integral((d_ + x_**S(6)*WC('h', S(1)) + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)) + x_**S(2)*WC('e', S(1)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, 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 b, h, a, e: ZeroQ(-S(3)*a*h + b*e)), CustomConstraint(lambda b, a, d, g: ZeroQ(a*g + b*d)))
rule67 = ReplacementRule(pattern67, lambda a, f, x, b, d, h, e, g : (-a*f + S(2)*a*h*x**S(3) + S(2)*b*d*x)/(S(2)*a*b*sqrt(a + b*x**S(4))))
rubi.add(rule67)
pattern68 = Pattern(Integral((d_ + x_**S(6)*WC('h', S(1)) + x_**S(4)*WC('g', S(1)) + x_**S(2)*WC('e', S(1)))/(a_ + x_**S(4)*WC('b', S(1)))**(S(3)/2), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda b, h, a, e: ZeroQ(-S(3)*a*h + b*e)), CustomConstraint(lambda b, a, d, g: ZeroQ(a*g + b*d)))
rule68 = ReplacementRule(pattern68, lambda a, x, b, d, h, e, g : x*(a*h*x**S(2) + b*d)/(a*b*sqrt(a + b*x**S(4))))
rubi.add(rule68)
pattern69 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda b, n, Q, Pq, a, i, x, p, q, R: GreaterEqual(q, n)))
def With69(p, n, Pq, a, x, b):
q = Expon(Pq, x)
return Module(List(Set(Q, PolynomialQuotient(Pq*b**(Floor((q + S(-1))/n) + S(1)), a + b*x**n, x)), Set(R, PolynomialRemainder(Pq*b**(Floor((q + S(-1))/n) + S(1)), a + b*x**n, x)), i), -R*b**(-Floor((q + S(-1))/n) + S(-1))*x*(a + b*x**n)**(p + S(1))/(a*n*(p + S(1))) + b**(-Floor((q + S(-1))/n) + S(-1))*Int((a + b*x**n)**(p + S(1))*ExpandToSum(Q*a*n*(p + S(1)) + R*n*(p + S(1)) + D(R*x, x), x), x)/(a*n*(p + S(1))))
rule69 = ReplacementRule(pattern69, lambda p, n, Pq, a, x, b : With69(p, n, Pq, a, x, b))
rubi.add(rule69)
pattern70 = Pattern(Integral(Pq_*x_**m_*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda m: NegativeIntegerQ(m)), )
def With70(p, n, Pq, a, x, m, b):
q = Expon(Pq, x)
return Module(List(Set(Q, PolynomialQuotient(Pq*a*b**(Floor((q + S(-1))/n) + S(1))*x**m, a + b*x**n, x)), Set(R, PolynomialRemainder(Pq*a*b**(Floor((q + S(-1))/n) + S(1))*x**m, a + b*x**n, x)), i), -R*b**(-Floor((q + S(-1))/n) + S(-1))*x*(a + b*x**n)**(p + S(1))/(a**S(2)*n*(p + S(1))) + b**(-Floor((q + S(-1))/n) + S(-1))*Int(x**m*(a + b*x**n)**(p + S(1))*ExpandToSum(Q*n*x**(-m)*(p + S(1)) + Sum(x**(i - m)*(i + n*(p + S(1)) + S(1))*Coeff(R, x, i)/a, List(i, S(0), n + S(-1))), x), x)/(a*n*(p + S(1))))
rule70 = ReplacementRule(pattern70, lambda p, n, Pq, a, x, m, b : With70(p, n, Pq, a, x, m, b))
rubi.add(rule70)
pattern71 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**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 n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m)), CustomConstraint(lambda b, n, Pq, m, a, x, p, g: Unequal(g, S(1))))
def With71(p, n, Pq, a, x, m, b):
g = GCD(m + S(1), n)
return Subst(Int(x**(S(-1) + (m + S(1))/g)*(a + b*x**(n/g))**p*ReplaceAll(Pq, Rule(x, x**(1/g))), x), x, x**g)/g
rule71 = ReplacementRule(pattern71, lambda p, n, Pq, a, x, m, b : With71(p, n, Pq, a, x, m, b))
rubi.add(rule71)
pattern72 = Pattern(Integral((A_ + x_*WC('B', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda B, b, a, A: ZeroQ(-A**S(3)*b + B**S(3)*a)))
rule72 = ReplacementRule(pattern72, lambda a, x, A, B, b : B**S(3)*Int(1/(A**S(2) - A*B*x + B**S(2)*x**S(2)), x)/b)
rubi.add(rule72)
pattern73 = Pattern(Integral((A_ + x_*WC('B', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda B, b, a, A: NonzeroQ(-A**S(3)*b + B**S(3)*a)), CustomConstraint(lambda b, a: PosQ(a/b)), )
def With73(a, x, A, B, b):
r = Numerator(Rt(a/b, S(3)))
s = Denominator(Rt(a/b, S(3)))
return -r*(-A*s + B*r)*Int(1/(r + s*x), x)/(S(3)*a*s) + r*Int((r*(S(2)*A*s + B*r) + s*x*(-A*s + B*r))/(r**S(2) - r*s*x + s**S(2)*x**S(2)), x)/(S(3)*a*s)
rule73 = ReplacementRule(pattern73, lambda a, x, A, B, b : With73(a, x, A, B, b))
rubi.add(rule73)
pattern74 = Pattern(Integral((A_ + x_*WC('B', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda B, b, a, A: NonzeroQ(-A**S(3)*b + B**S(3)*a)), CustomConstraint(lambda b, a: NegQ(a/b)), )
def With74(a, x, A, B, b):
r = Numerator(Rt(-a/b, S(3)))
s = Denominator(Rt(-a/b, S(3)))
return r*(A*s + B*r)*Int(1/(r - s*x), x)/(S(3)*a*s) - r*Int((r*(-S(2)*A*s + B*r) - s*x*(A*s + B*r))/(r**S(2) + r*s*x + s**S(2)*x**S(2)), x)/(S(3)*a*s)
rule74 = ReplacementRule(pattern74, lambda a, x, A, B, b : With74(a, x, A, B, b))
rubi.add(rule74)
pattern75 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, C, A: ZeroQ(-A*C + B**S(2))), CustomConstraint(lambda B, b, a, C: ZeroQ(B**S(3)*b + C**S(3)*a)))
rule75 = ReplacementRule(pattern75, lambda a, C, x, A, B, b : -C**S(2)*Int(1/(B - C*x), x)/b)
rubi.add(rule75)
pattern76 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A*b**(S(2)/3) - B*a**(S(1)/3)*b**(S(1)/3) - S(2)*C*a**(S(2)/3))), )
def With76(a, C, x, A, B, b):
q = a**(S(1)/3)/b**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule76 = ReplacementRule(pattern76, lambda a, C, x, A, B, b : With76(a, C, x, A, B, b))
rubi.add(rule76)
pattern77 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*a**(S(1)/3)*b**(S(1)/3) + S(2)*C*a**(S(2)/3))), )
def With77(a, C, x, B, b):
q = a**(S(1)/3)/b**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule77 = ReplacementRule(pattern77, lambda a, C, x, B, b : With77(a, C, x, B, b))
rubi.add(rule77)
pattern78 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A*b**(S(2)/3) - S(2)*C*a**(S(2)/3))), )
def With78(a, C, x, A, b):
q = a**(S(1)/3)/b**(S(1)/3)
return C*q*Int(1/(q**S(2) - q*x + x**S(2)), x)/b + C*Int(1/(q + x), x)/b
rule78 = ReplacementRule(pattern78, lambda a, C, x, A, b : With78(a, C, x, A, b))
rubi.add(rule78)
pattern79 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A*(-b)**(S(2)/3) - B*(-a)**(S(1)/3)*(-b)**(S(1)/3) - S(2)*C*(-a)**(S(2)/3))), )
def With79(a, C, x, A, B, b):
q = (-a)**(S(1)/3)/(-b)**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule79 = ReplacementRule(pattern79, lambda a, C, x, A, B, b : With79(a, C, x, A, B, b))
rubi.add(rule79)
pattern80 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*(-a)**(S(1)/3)*(-b)**(S(1)/3) + S(2)*C*(-a)**(S(2)/3))), )
def With80(a, C, x, B, b):
q = (-a)**(S(1)/3)/(-b)**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule80 = ReplacementRule(pattern80, lambda a, C, x, B, b : With80(a, C, x, B, b))
rubi.add(rule80)
pattern81 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A*(-b)**(S(2)/3) - S(2)*C*(-a)**(S(2)/3))), )
def With81(a, C, x, A, b):
q = (-a)**(S(1)/3)/(-b)**(S(1)/3)
return C*q*Int(1/(q**S(2) - q*x + x**S(2)), x)/b + C*Int(1/(q + x), x)/b
rule81 = ReplacementRule(pattern81, lambda a, C, x, A, b : With81(a, C, x, A, b))
rubi.add(rule81)
pattern82 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A*b**(S(2)/3) + B*b**(S(1)/3)*(-a)**(S(1)/3) - S(2)*C*(-a)**(S(2)/3))), )
def With82(a, C, x, A, B, b):
q = (-a)**(S(1)/3)/b**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule82 = ReplacementRule(pattern82, lambda a, C, x, A, B, b : With82(a, C, x, A, B, b))
rubi.add(rule82)
pattern83 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*b**(S(1)/3)*(-a)**(S(1)/3) - S(2)*C*(-a)**(S(2)/3))), )
def With83(a, C, x, B, b):
q = (-a)**(S(1)/3)/b**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule83 = ReplacementRule(pattern83, lambda a, C, x, B, b : With83(a, C, x, B, b))
rubi.add(rule83)
pattern84 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A*b**(S(2)/3) - S(2)*C*(-a)**(S(2)/3))), )
def With84(a, C, x, A, b):
q = (-a)**(S(1)/3)/b**(S(1)/3)
return -C*q*Int(1/(q**S(2) + q*x + x**S(2)), x)/b - C*Int(1/(q - x), x)/b
rule84 = ReplacementRule(pattern84, lambda a, C, x, A, b : With84(a, C, x, A, b))
rubi.add(rule84)
pattern85 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A*(-b)**(S(2)/3) + B*a**(S(1)/3)*(-b)**(S(1)/3) - S(2)*C*a**(S(2)/3))), )
def With85(a, C, x, A, B, b):
q = a**(S(1)/3)/(-b)**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule85 = ReplacementRule(pattern85, lambda a, C, x, A, B, b : With85(a, C, x, A, B, b))
rubi.add(rule85)
pattern86 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*a**(S(1)/3)*(-b)**(S(1)/3) - S(2)*C*a**(S(2)/3))), )
def With86(a, C, x, B, b):
q = a**(S(1)/3)/(-b)**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule86 = ReplacementRule(pattern86, lambda a, C, x, B, b : With86(a, C, x, B, b))
rubi.add(rule86)
pattern87 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A*(-b)**(S(2)/3) - S(2)*C*a**(S(2)/3))), )
def With87(a, C, x, A, b):
q = a**(S(1)/3)/(-b)**(S(1)/3)
return -C*q*Int(1/(q**S(2) + q*x + x**S(2)), x)/b - C*Int(1/(q - x), x)/b
rule87 = ReplacementRule(pattern87, lambda a, C, x, A, b : With87(a, C, x, A, b))
rubi.add(rule87)
pattern88 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A - B*(a/b)**(S(1)/3) - S(2)*C*(a/b)**(S(2)/3))), )
def With88(a, C, x, A, B, b):
q = (a/b)**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule88 = ReplacementRule(pattern88, lambda a, C, x, A, B, b : With88(a, C, x, A, B, b))
rubi.add(rule88)
pattern89 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*(a/b)**(S(1)/3) + S(2)*C*(a/b)**(S(2)/3))), )
def With89(a, C, x, B, b):
q = (a/b)**(S(1)/3)
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule89 = ReplacementRule(pattern89, lambda a, C, x, B, b : With89(a, C, x, B, b))
rubi.add(rule89)
pattern90 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A - S(2)*C*(a/b)**(S(2)/3))), )
def With90(a, C, x, A, b):
q = (a/b)**(S(1)/3)
return C*q*Int(1/(q**S(2) - q*x + x**S(2)), x)/b + C*Int(1/(q + x), x)/b
rule90 = ReplacementRule(pattern90, lambda a, C, x, A, b : With90(a, C, x, A, b))
rubi.add(rule90)
pattern91 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A - B*Rt(a/b, S(3)) - S(2)*C*Rt(a/b, S(3))**S(2))), )
def With91(a, C, x, A, B, b):
q = Rt(a/b, S(3))
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule91 = ReplacementRule(pattern91, lambda a, C, x, A, B, b : With91(a, C, x, A, B, b))
rubi.add(rule91)
pattern92 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*Rt(a/b, S(3)) + S(2)*C*Rt(a/b, S(3))**S(2))), )
def With92(a, C, x, B, b):
q = Rt(a/b, S(3))
return C*Int(1/(q + x), x)/b + (B + C*q)*Int(1/(q**S(2) - q*x + x**S(2)), x)/b
rule92 = ReplacementRule(pattern92, lambda a, C, x, B, b : With92(a, C, x, B, b))
rubi.add(rule92)
pattern93 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A - S(2)*C*Rt(a/b, S(3))**S(2))), )
def With93(a, C, x, A, b):
q = Rt(a/b, S(3))
return C*q*Int(1/(q**S(2) - q*x + x**S(2)), x)/b + C*Int(1/(q + x), x)/b
rule93 = ReplacementRule(pattern93, lambda a, C, x, A, b : With93(a, C, x, A, b))
rubi.add(rule93)
pattern94 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A + B*(-a/b)**(S(1)/3) - S(2)*C*(-a/b)**(S(2)/3))), )
def With94(a, C, x, A, B, b):
q = (-a/b)**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule94 = ReplacementRule(pattern94, lambda a, C, x, A, B, b : With94(a, C, x, A, B, b))
rubi.add(rule94)
pattern95 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*(-a/b)**(S(1)/3) - S(2)*C*(-a/b)**(S(2)/3))), )
def With95(a, C, x, B, b):
q = (-a/b)**(S(1)/3)
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule95 = ReplacementRule(pattern95, lambda a, C, x, B, b : With95(a, C, x, B, b))
rubi.add(rule95)
pattern96 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A - S(2)*C*(-a/b)**(S(2)/3))), )
def With96(a, C, x, A, b):
q = (-a/b)**(S(1)/3)
return -C*q*Int(1/(q**S(2) + q*x + x**S(2)), x)/b - C*Int(1/(q - x), x)/b
rule96 = ReplacementRule(pattern96, lambda a, C, x, A, b : With96(a, C, x, A, b))
rubi.add(rule96)
pattern97 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A + B*Rt(-a/b, S(3)) - S(2)*C*Rt(-a/b, S(3))**S(2))), )
def With97(a, C, x, A, B, b):
q = Rt(-a/b, S(3))
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule97 = ReplacementRule(pattern97, lambda a, C, x, A, B, b : With97(a, C, x, A, B, b))
rubi.add(rule97)
pattern98 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*Rt(-a/b, S(3)) - S(2)*C*Rt(-a/b, S(3))**S(2))), )
def With98(a, C, x, B, b):
q = Rt(-a/b, S(3))
return -C*Int(1/(q - x), x)/b + (B - C*q)*Int(1/(q**S(2) + q*x + x**S(2)), x)/b
rule98 = ReplacementRule(pattern98, lambda a, C, x, B, b : With98(a, C, x, B, b))
rubi.add(rule98)
pattern99 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A - S(2)*C*Rt(-a/b, S(3))**S(2))), )
def With99(a, C, x, A, b):
q = Rt(-a/b, S(3))
return -C*q*Int(1/(q**S(2) + q*x + x**S(2)), x)/b - C*Int(1/(q - x), x)/b
rule99 = ReplacementRule(pattern99, lambda a, C, x, A, b : With99(a, C, x, A, b))
rubi.add(rule99)
pattern100 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, A: Not(RationalQ(a/b)) | ZeroQ(-A**S(3)*b + B**S(3)*a)))
rule100 = ReplacementRule(pattern100, lambda a, C, x, A, B, b : C*Int(x**S(2)/(a + b*x**S(3)), x) + Int((A + B*x)/(a + b*x**S(3)), x))
rubi.add(rule100)
pattern101 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a: Not(RationalQ(a/b))))
rule101 = ReplacementRule(pattern101, lambda a, C, x, B, b : B*Int(x/(a + b*x**S(3)), x) + C*Int(x**S(2)/(a + b*x**S(3)), x))
rubi.add(rule101)
pattern102 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: Not(RationalQ(a, b, A, C))))
rule102 = ReplacementRule(pattern102, lambda a, C, x, A, b : A*Int(1/(a + b*x**S(3)), x) + C*Int(x**S(2)/(a + b*x**S(3)), x))
rubi.add(rule102)
pattern103 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A - B*(a/b)**(S(1)/3) + C*(a/b)**(S(2)/3))), )
def With103(a, C, x, A, B, b):
q = (a/b)**(S(1)/3)
return q**S(2)*Int((A + C*q*x)/(q**S(2) - q*x + x**S(2)), x)/a
rule103 = ReplacementRule(pattern103, lambda a, C, x, A, B, b : With103(a, C, x, A, B, b))
rubi.add(rule103)
pattern104 = Pattern(Integral(x_*(x_*WC('C', S(1)) + WC('B', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*(a/b)**(S(1)/3) - C*(a/b)**(S(2)/3))), )
def With104(a, C, x, B, b):
q = (a/b)**(S(1)/3)
return C*q**S(3)*Int(x/(q**S(2) - q*x + x**S(2)), x)/a
rule104 = ReplacementRule(pattern104, lambda a, C, x, B, b : With104(a, C, x, B, b))
rubi.add(rule104)
pattern105 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A + C*(a/b)**(S(2)/3))), )
def With105(a, C, x, A, b):
q = (a/b)**(S(1)/3)
return q**S(2)*Int((A + C*q*x)/(q**S(2) - q*x + x**S(2)), x)/a
rule105 = ReplacementRule(pattern105, lambda a, C, x, A, b : With105(a, C, x, A, b))
rubi.add(rule105)
pattern106 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda a, C, A, B, b: ZeroQ(A + B*(-a/b)**(S(1)/3) + C*(-a/b)**(S(2)/3))), )
def With106(a, C, x, A, B, b):
q = (-a/b)**(S(1)/3)
return q*Int((A*q + x*(A + B*q))/(q**S(2) + q*x + x**S(2)), x)/a
rule106 = ReplacementRule(pattern106, lambda a, C, x, A, B, b : With106(a, C, x, A, B, b))
rubi.add(rule106)
pattern107 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, C: ZeroQ(B*(-a/b)**(S(1)/3) + C*(-a/b)**(S(2)/3))), )
def With107(a, C, x, B, b):
q = (-a/b)**(S(1)/3)
return B*q**S(2)*Int(x/(q**S(2) + q*x + x**S(2)), x)/a
rule107 = ReplacementRule(pattern107, lambda a, C, x, B, b : With107(a, C, x, B, b))
rubi.add(rule107)
pattern108 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a, C, A: ZeroQ(A + C*(-a/b)**(S(2)/3))), )
def With108(a, C, x, A, b):
q = (-a/b)**(S(1)/3)
return A*q*Int((q + x)/(q**S(2) + q*x + x**S(2)), x)/a
rule108 = ReplacementRule(pattern108, lambda a, C, x, A, b : With108(a, C, x, A, b))
rubi.add(rule108)
pattern109 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, A: NonzeroQ(-A**S(3)*b + B**S(3)*a)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Greater(a/b, S(0))), CustomConstraint(lambda C, a, x, q, B, A: NonzeroQ(A - B*q + C*q**S(2))))
def With109(a, C, x, A, B, b):
q = (a/b)**(S(1)/3)
return q*(A - B*q + C*q**S(2))*Int(1/(q + x), x)/(S(3)*a) + q*Int((q*(S(2)*A + B*q - C*q**S(2)) - x*(A - B*q - S(2)*C*q**S(2)))/(q**S(2) - q*x + x**S(2)), x)/(S(3)*a)
rule109 = ReplacementRule(pattern109, lambda a, C, x, A, B, b : With109(a, C, x, A, B, b))
rubi.add(rule109)
pattern110 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Greater(a/b, S(0))), CustomConstraint(lambda C, a, x, q, B: NonzeroQ(B*q - C*q**S(2))))
def With110(a, C, x, B, b):
q = (a/b)**(S(1)/3)
return -q*(B*q - C*q**S(2))*Int(1/(q + x), x)/(S(3)*a) + q*Int((q*(B*q - C*q**S(2)) + x*(B*q + S(2)*C*q**S(2)))/(q**S(2) - q*x + x**S(2)), x)/(S(3)*a)
rule110 = ReplacementRule(pattern110, lambda a, C, x, B, b : With110(a, C, x, B, b))
rubi.add(rule110)
pattern111 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Greater(a/b, S(0))), CustomConstraint(lambda C, a, x, q, A: NonzeroQ(A + C*q**S(2))))
def With111(a, C, x, A, b):
q = (a/b)**(S(1)/3)
return q*(A + C*q**S(2))*Int(1/(q + x), x)/(S(3)*a) + q*Int((q*(S(2)*A - C*q**S(2)) - x*(A - S(2)*C*q**S(2)))/(q**S(2) - q*x + x**S(2)), x)/(S(3)*a)
rule111 = ReplacementRule(pattern111, lambda a, C, x, A, b : With111(a, C, x, A, b))
rubi.add(rule111)
pattern112 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda B, b, a, A: NonzeroQ(-A**S(3)*b + B**S(3)*a)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Less(a/b, S(0))), CustomConstraint(lambda C, a, x, q, B, A: NonzeroQ(A + B*q + C*q**S(2))))
def With112(a, C, x, A, B, b):
q = (-a/b)**(S(1)/3)
return q*(A + B*q + C*q**S(2))*Int(1/(q - x), x)/(S(3)*a) + q*Int((q*(S(2)*A - B*q - C*q**S(2)) + x*(A + B*q - S(2)*C*q**S(2)))/(q**S(2) + q*x + x**S(2)), x)/(S(3)*a)
rule112 = ReplacementRule(pattern112, lambda a, C, x, A, B, b : With112(a, C, x, A, B, b))
rubi.add(rule112)
pattern113 = Pattern(Integral(x_*(B_ + x_*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Less(a/b, S(0))), CustomConstraint(lambda C, a, x, q, B: NonzeroQ(B*q + C*q**S(2))))
def With113(a, C, x, B, b):
q = (-a/b)**(S(1)/3)
return q*(B*q + C*q**S(2))*Int(1/(q - x), x)/(S(3)*a) + q*Int((-q*(B*q + C*q**S(2)) + x*(B*q - S(2)*C*q**S(2)))/(q**S(2) + q*x + x**S(2)), x)/(S(3)*a)
rule113 = ReplacementRule(pattern113, lambda a, C, x, B, b : With113(a, C, x, B, b))
rubi.add(rule113)
pattern114 = Pattern(Integral((A_ + x_**S(2)*WC('C', S(1)))/(a_ + x_**S(3)*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, a: RationalQ(a/b)), CustomConstraint(lambda b, a: Less(a/b, S(0))), CustomConstraint(lambda C, a, x, q, A: NonzeroQ(A + C*q**S(2))))
def With114(a, C, x, A, b):
q = (-a/b)**(S(1)/3)
return q*(A + C*q**S(2))*Int(1/(q - x), x)/(S(3)*a) + q*Int((q*(S(2)*A - C*q**S(2)) + x*(A - S(2)*C*q**S(2)))/(q**S(2) + q*x + x**S(2)), x)/(S(3)*a)
rule114 = ReplacementRule(pattern114, lambda a, C, x, A, b : With114(a, C, x, A, b))
rubi.add(rule114)
pattern115 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))/(a_ + x_**n_*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 m, x: FreeQ(m, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2))), CustomConstraint(lambda n, Pq, x: Less(Expon(Pq, x), n)), CustomConstraint(lambda v, x: SumQ(v)))
def With115(n, Pq, a, x, m, b, c):
v = Sum(c**(-ii)*(c*x)**(ii + m)*(x**(n/S(2))*Coeff(Pq, x, ii + n/S(2)) + Coeff(Pq, x, ii))/(a + b*x**n), List(ii, S(0), n/S(2) + S(-1)))
return Int(v, x)
rule115 = ReplacementRule(pattern115, lambda n, Pq, a, x, m, b, c : With115(n, Pq, a, x, m, b, c))
rubi.add(rule115)
pattern116 = Pattern(Integral(Pq_/(a_ + x_**n_*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2))), CustomConstraint(lambda n, Pq, x: Less(Expon(Pq, x), n)), CustomConstraint(lambda v, x: SumQ(v)))
def With116(n, Pq, a, x, b):
v = Sum(x**ii*(x**(n/S(2))*Coeff(Pq, x, ii + n/S(2)) + Coeff(Pq, x, ii))/(a + b*x**n), List(ii, S(0), n/S(2) + S(-1)))
return Int(v, x)
rule116 = ReplacementRule(pattern116, lambda n, Pq, a, x, b : With116(n, Pq, a, x, b))
rubi.add(rule116)
pattern117 = Pattern(Integral((c_ + x_*WC('d', S(1)))/sqrt(a_ + x_**S(3)*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 a: PosQ(a)), CustomConstraint(lambda b, a, d, c: ZeroQ(c*Rt(b/a, S(3)) - d*(-sqrt(S(3)) + S(1)))), )
def With117(a, x, b, d, c):
r = Numer(Rt(b/a, S(3)))
s = Denom(Rt(b/a, S(3)))
return -S(3)**(S(1)/4)*d*s*sqrt((r**S(2)*x**S(2) - r*s*x + s**S(2))/(r*x + s*(S(1) + sqrt(S(3))))**S(2))*sqrt(-sqrt(S(3)) + S(2))*(r*x + s)*EllipticE(asin((r*x + s*(-sqrt(S(3)) + S(1)))/(r*x + s*(S(1) + sqrt(S(3))))), S(-7) - S(4)*sqrt(S(3)))/(r**S(2)*sqrt(s*(r*x + s)/(r*x + s*(S(1) + sqrt(S(3))))**S(2))*sqrt(a + b*x**S(3))) + S(2)*d*s**S(3)*sqrt(a + b*x**S(3))/(a*r**S(2)*(r*x + s*(S(1) + sqrt(S(3)))))
rule117 = ReplacementRule(pattern117, lambda a, x, b, d, c : With117(a, x, b, d, c))
rubi.add(rule117)
pattern118 = Pattern(Integral((c_ + x_*WC('d', S(1)))/sqrt(a_ + x_**S(3)*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 a: PosQ(a)), CustomConstraint(lambda b, a, d, c: NonzeroQ(c*Rt(b/a, S(3)) - d*(-sqrt(S(3)) + S(1)))), )
def With118(a, x, b, d, c):
r = Numer(Rt(b/a, S(3)))
s = Denom(Rt(b/a, S(3)))
return d*Int((r*x + s*(-sqrt(S(3)) + S(1)))/sqrt(a + b*x**S(3)), x)/r + (c*r - d*s*(-sqrt(S(3)) + S(1)))*Int(1/sqrt(a + b*x**S(3)), x)/r
rule118 = ReplacementRule(pattern118, lambda a, x, b, d, c : With118(a, x, b, d, c))
rubi.add(rule118)
pattern119 = Pattern(Integral((c_ + x_*WC('d', S(1)))/sqrt(a_ + x_**S(3)*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 a: NegQ(a)), CustomConstraint(lambda b, a, d, c: ZeroQ(c*Rt(b/a, S(3)) - d*(S(1) + sqrt(S(3))))), )
def With119(a, x, b, d, c):
r = Numer(Rt(b/a, S(3)))
s = Denom(Rt(b/a, S(3)))
return S(3)**(S(1)/4)*d*s*sqrt((r**S(2)*x**S(2) - r*s*x + s**S(2))/(r*x + s*(-sqrt(S(3)) + S(1)))**S(2))*sqrt(sqrt(S(3)) + S(2))*(r*x + s)*EllipticE(asin((r*x + s*(S(1) + sqrt(S(3))))/(r*x + s*(-sqrt(S(3)) + S(1)))), S(-7) + S(4)*sqrt(S(3)))/(r**S(2)*sqrt(-s*(r*x + s)/(r*x + s*(-sqrt(S(3)) + S(1)))**S(2))*sqrt(a + b*x**S(3))) + S(2)*d*s**S(3)*sqrt(a + b*x**S(3))/(a*r**S(2)*(r*x + s*(-sqrt(S(3)) + S(1))))
rule119 = ReplacementRule(pattern119, lambda a, x, b, d, c : With119(a, x, b, d, c))
rubi.add(rule119)
pattern120 = Pattern(Integral((c_ + x_*WC('d', S(1)))/sqrt(a_ + x_**S(3)*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 a: NegQ(a)), CustomConstraint(lambda b, a, d, c: NonzeroQ(c*Rt(b/a, S(3)) - d*(S(1) + sqrt(S(3))))), )
def With120(a, x, b, d, c):
r = Numer(Rt(b/a, S(3)))
s = Denom(Rt(b/a, S(3)))
return d*Int((r*x + s*(S(1) + sqrt(S(3))))/sqrt(a + b*x**S(3)), x)/r + (c*r - d*s*(S(1) + sqrt(S(3))))*Int(1/sqrt(a + b*x**S(3)), x)/r
rule120 = ReplacementRule(pattern120, lambda a, x, b, d, c : With120(a, x, b, d, c))
rubi.add(rule120)
pattern121 = Pattern(Integral((c_ + x_**S(4)*WC('d', S(1)))/sqrt(a_ + x_**S(6)*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 b, a, d, c: ZeroQ(S(2)*c*Rt(b/a, S(3))**S(2) - d*(-sqrt(S(3)) + S(1)))), )
def With121(a, x, b, d, c):
r = Numer(Rt(b/a, S(3)))
s = Denom(Rt(b/a, S(3)))
return -S(3)**(S(1)/4)*d*s*x*sqrt((r**S(2)*x**S(4) - r*s*x**S(2) + s**S(2))/(r*x**S(2)*(S(1) + sqrt(S(3))) + s)**S(2))*(r*x**S(2) + s)*EllipticE(acos((r*x**S(2)*(-sqrt(S(3)) + S(1)) + s)/(r*x**S(2)*(S(1) + sqrt(S(3))) + s)), sqrt(S(3))/S(4) + S(1)/2)/(S(2)*r**S(2)*sqrt(r*x**S(2)*(r*x**S(2) + s)/(r*x**S(2)*(S(1) + sqrt(S(3))) + s)**S(2))*sqrt(a + b*x**S(6))) + d*s**S(3)*x*(S(1) + sqrt(S(3)))*sqrt(a + b*x**S(6))/(S(2)*a*r**S(2)*(r*x**S(2)*(S(1) + sqrt(S(3))) + s))
rule121 = ReplacementRule(pattern121, lambda a, x, b, d, c : With121(a, x, b, d, c))
rubi.add(rule121)
pattern122 = Pattern(Integral((c_ + x_**S(4)*WC('d', S(1)))/sqrt(a_ + x_**S(6)*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 b, a, d, c: NonzeroQ(S(2)*c*Rt(b/a, S(3))**S(2) - d*(-sqrt(S(3)) + S(1)))), )
def With122(a, x, b, d, c):
q = Rt(b/a, S(3))
return d*Int((S(2)*q**S(2)*x**S(4) - sqrt(S(3)) + S(1))/sqrt(a + b*x**S(6)), x)/(S(2)*q**S(2)) + (S(2)*c*q**S(2) - d*(-sqrt(S(3)) + S(1)))*Int(1/sqrt(a + b*x**S(6)), x)/(S(2)*q**S(2))
rule122 = ReplacementRule(pattern122, lambda a, x, b, d, c : With122(a, x, b, d, c))
rubi.add(rule122)
pattern123 = Pattern(Integral((c_ + x_**S(2)*WC('d', S(1)))/sqrt(a_ + x_**S(8)*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 b, a, d, c: ZeroQ(-a*d**S(4) + b*c**S(4))))
rule123 = ReplacementRule(pattern123, lambda a, x, b, d, c : -c*d*x**S(3)*sqrt(-(c - d*x**S(2))**S(2)/(c*d*x**S(2)))*sqrt(-d**S(2)*(a + b*x**S(8))/(b*c**S(2)*x**S(4)))*EllipticF(asin(sqrt((sqrt(S(2))*c**S(2) + S(2)*c*d*x**S(2) + sqrt(S(2))*d**S(2)*x**S(4))/(c*d*x**S(2)))/S(2)), S(-2) + S(2)*sqrt(S(2)))/(sqrt(sqrt(S(2)) + S(2))*sqrt(a + b*x**S(8))*(c - d*x**S(2))))
rubi.add(rule123)
pattern124 = Pattern(Integral((c_ + x_**S(2)*WC('d', S(1)))/sqrt(a_ + x_**S(8)*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 b, a, d, c: NonzeroQ(-a*d**S(4) + b*c**S(4))))
rule124 = ReplacementRule(pattern124, lambda a, x, b, d, c : -(-c*Rt(b/a, S(4)) + d)*Int((-x**S(2)*Rt(b/a, S(4)) + S(1))/sqrt(a + b*x**S(8)), x)/(S(2)*Rt(b/a, S(4))) + (c*Rt(b/a, S(4)) + d)*Int((x**S(2)*Rt(b/a, S(4)) + S(1))/sqrt(a + b*x**S(8)), x)/(S(2)*Rt(b/a, S(4))))
rubi.add(rule124)
pattern125 = Pattern(Integral(Pq_/(x_*sqrt(a_ + x_**n_*WC('b', S(1)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda Pq, x: NonzeroQ(Coeff(Pq, x, S(0)))))
rule125 = ReplacementRule(pattern125, lambda n, Pq, a, x, b : Coeff(Pq, x, S(0))*Int(S(1)/(x*sqrt(a + b*x**n)), x) + Int(ExpandToSum((Pq - Coeff(Pq, x, S(0)))/x, x)/sqrt(a + b*x**n), x))
rubi.add(rule125)
pattern126 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2))), CustomConstraint(lambda n, Pq, x: Not(PolyQ(Pq, x**(n/S(2))))), )
def With126(p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
j = Symbol('j')
k = Symbol('k')
return Int(Sum(c**(-j)*(c*x)**(j + m)*(a + b*x**n)**p*Sum(x**(k*n/S(2))*Coeff(Pq, x, j + k*n/S(2)), List(k, S(0), S(1) + S(2)*(-j + q)/n)), List(j, S(0), n/S(2) + S(-1))), x)
rule126 = ReplacementRule(pattern126, lambda p, n, Pq, a, x, m, b, c : With126(p, n, Pq, a, x, m, b, c))
rubi.add(rule126)
pattern127 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n/S(2))), CustomConstraint(lambda n, Pq, x: Not(PolyQ(Pq, x**(n/S(2))))), )
def With127(p, n, Pq, a, x, b):
q = Expon(Pq, x)
j = Symbol('j')
k = Symbol('k')
return Int(Sum(x**j*(a + b*x**n)**p*Sum(x**(k*n/S(2))*Coeff(Pq, x, j + k*n/S(2)), List(k, S(0), S(1) + S(2)*(-j + q)/n)), List(j, S(0), n/S(2) + S(-1))), x)
rule127 = ReplacementRule(pattern127, lambda p, n, Pq, a, x, b : With127(p, n, Pq, a, x, b))
rubi.add(rule127)
pattern128 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, Pq, x: Equal(Expon(Pq, x), n + S(-1))))
rule128 = ReplacementRule(pattern128, lambda p, n, Pq, a, x, b : Coeff(Pq, x, n + S(-1))*Int(x**(n + S(-1))*(a + b*x**n)**p, x) + Int((a + b*x**n)**p*ExpandToSum(Pq - x**(n + S(-1))*Coeff(Pq, x, n + S(-1)), x), x))
rubi.add(rule128)
pattern129 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))/(a_ + x_**n_*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 m, x: FreeQ(m, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: IntegerQ(n)))
rule129 = ReplacementRule(pattern129, lambda n, Pq, a, x, m, b, c : Int(ExpandIntegrand(Pq*(c*x)**m/(a + b*x**n), x), x))
rubi.add(rule129)
pattern130 = Pattern(Integral(Pq_/(a_ + x_**n_*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: IntegerQ(n)))
rule130 = ReplacementRule(pattern130, lambda n, Pq, a, x, b : Int(ExpandIntegrand(Pq/(a + b*x**n), x), x))
rubi.add(rule130)
pattern131 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**m_*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Less(m, S(-1))), CustomConstraint(lambda n, Pq, x: LessEqual(n + S(-1), Expon(Pq, x))), CustomConstraint(lambda b, n, Pq, m, Pq0, a, x, p, c: NonzeroQ(Pq0)))
def With131(p, n, Pq, a, x, m, b, c):
Pq0 = Coeff(Pq, x, S(0))
return Pq0*(c*x)**(m + S(1))*(a + b*x**n)**(p + S(1))/(a*c*(m + S(1))) + Int((c*x)**(m + S(1))*(a + b*x**n)**p*ExpandToSum(-S(2)*Pq0*b*x**(n + S(-1))*(m + n*(p + S(1)) + S(1)) + S(2)*a*(Pq - Pq0)*(m + S(1))/x, x), x)/(S(2)*a*c*(m + S(1)))
rule131 = ReplacementRule(pattern131, lambda p, n, Pq, a, x, m, b, c : With131(p, n, Pq, a, x, m, b, c))
rubi.add(rule131)
pattern132 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda Pqq, b, n, Pq, m, a, x, p, q, c: GreaterEqual(-n + q, S(0)) & NonzeroQ(m + n*p + q + S(1)) & (IntegerQ(S(2)*p) | IntegerQ(p + (q + S(1))/(S(2)*n)))))
def With132(p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*c**(n - q + S(-1))*(c*x)**(m - n + q + S(1))*(a + b*x**n)**(p + S(1))/(b*(m + n*p + q + S(1))) + Int((c*x)**m*(a + b*x**n)**p*ExpandToSum(-Pqq*a*x**(-n + q)*(m - n + q + S(1)) + b*(Pq - Pqq*x**q)*(m + n*p + q + S(1)), x), x)/(b*(m + n*p + q + S(1))))
rule132 = ReplacementRule(pattern132, lambda p, n, Pq, a, x, m, b, c : With132(p, n, Pq, a, x, m, b, c))
rubi.add(rule132)
pattern133 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda Pqq, b, n, Pq, a, x, p, q: GreaterEqual(-n + q, S(0)) & NonzeroQ(n*p + q + S(1)) & (IntegerQ(S(2)*p) | IntegerQ(p + (q + S(1))/(S(2)*n)))))
def With133(p, n, Pq, a, x, b):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*x**(-n + q + S(1))*(a + b*x**n)**(p + S(1))/(b*(n*p + q + S(1))) + Int((a + b*x**n)**p*ExpandToSum(-Pqq*a*x**(-n + q)*(-n + q + S(1)) + b*(Pq - Pqq*x**q)*(n*p + q + S(1)), x), x)/(b*(n*p + q + S(1))))
rule133 = ReplacementRule(pattern133, lambda p, n, Pq, a, x, b : With133(p, n, Pq, a, x, b))
rubi.add(rule133)
pattern134 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m)), )
def With134(p, n, Pq, a, x, m, b):
q = Expon(Pq, x)
return -Subst(Int(x**(-m - q + S(-2))*(a + b*x**(-n))**p*ExpandToSum(x**q*ReplaceAll(Pq, Rule(x, 1/x)), x), x), x, 1/x)
rule134 = ReplacementRule(pattern134, lambda p, n, Pq, a, x, m, b : With134(p, n, Pq, a, x, m, b))
rubi.add(rule134)
pattern135 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), )
def With135(p, n, Pq, a, x, m, b, c):
g = Denominator(m)
q = Expon(Pq, x)
return -g*Subst(Int(x**(-g*(m + q + S(1)) + S(-1))*(a + b*c**(-n)*x**(-g*n))**p*ExpandToSum(x**(g*q)*ReplaceAll(Pq, Rule(x, x**(-g)/c)), x), x), x, (c*x)**(-S(1)/g))/c
rule135 = ReplacementRule(pattern135, lambda p, n, Pq, a, x, m, b, c : With135(p, n, Pq, a, x, m, b, c))
rubi.add(rule135)
pattern136 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**m_*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: Not(RationalQ(m))), )
def With136(p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
return -(c*x)**m*(1/x)**m*Subst(Int(x**(-m - q + S(-2))*(a + b*x**(-n))**p*ExpandToSum(x**q*ReplaceAll(Pq, Rule(x, 1/x)), x), x), x, 1/x)
rule136 = ReplacementRule(pattern136, lambda p, n, Pq, a, x, m, b, c : With136(p, n, Pq, a, x, m, b, c))
rubi.add(rule136)
pattern137 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: FractionQ(n)), )
def With137(p, n, Pq, a, x, m, b):
g = Denominator(n)
return g*Subst(Int(x**(g*(m + S(1)) + S(-1))*(a + b*x**(g*n))**p*ReplaceAll(Pq, Rule(x, x**g)), x), x, x**(1/g))
rule137 = ReplacementRule(pattern137, lambda p, n, Pq, a, x, m, b : With137(p, n, Pq, a, x, m, b))
rubi.add(rule137)
pattern138 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)))**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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: FractionQ(n)), )
def With138(p, n, Pq, a, x, b):
g = Denominator(n)
return g*Subst(Int(x**(g + S(-1))*(a + b*x**(g*n))**p*ReplaceAll(Pq, Rule(x, x**g)), x), x, x**(1/g))
rule138 = ReplacementRule(pattern138, lambda p, n, Pq, a, x, b : With138(p, n, Pq, a, x, b))
rubi.add(rule138)
pattern139 = Pattern(Integral(Pq_*(c_*x_)**m_*(a_ + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda n: FractionQ(n)))
rule139 = ReplacementRule(pattern139, lambda p, n, Pq, a, x, m, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(Pq*x**m*(a + b*x**n)**p, x))
rubi.add(rule139)
pattern140 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)))**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 p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule140 = ReplacementRule(pattern140, lambda p, n, Pq, a, x, m, b : Subst(Int((a + b*x**(n/(m + S(1))))**p*ReplaceAll(SubstFor(x**n, Pq, x), Rule(x, x**(n/(m + S(1))))), x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule140)
pattern141 = Pattern(Integral(Pq_*(c_*x_)**m_*(a_ + x_**n_*WC('b', 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule141 = ReplacementRule(pattern141, lambda p, n, Pq, a, x, m, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(Pq*x**m*(a + b*x**n)**p, x))
rubi.add(rule141)
pattern142 = Pattern(Integral((A_ + x_**WC('m', S(1))*WC('B', S(1)))*(a_ + x_**n_*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 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))))
rule142 = ReplacementRule(pattern142, lambda p, n, a, m, x, A, B, b : A*Int((a + b*x**n)**p, x) + B*Int(x**m*(a + b*x**n)**p, x))
rubi.add(rule142)
pattern143 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a_ + x_**n_*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 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, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)))
rule143 = ReplacementRule(pattern143, lambda p, n, Pq, a, x, m, b, c : Int(ExpandIntegrand(Pq*(c*x)**m*(a + b*x**n)**p, x), x))
rubi.add(rule143)
pattern144 = Pattern(Integral(Pq_*(a_ + x_**n_*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, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)))
rule144 = ReplacementRule(pattern144, lambda p, n, Pq, a, x, b : Int(ExpandIntegrand(Pq*(a + b*x**n)**p, x), x))
rubi.add(rule144)
pattern145 = Pattern(Integral(Pq_*u_**WC('m', S(1))*(a_ + v_**WC('n', S(1))*WC('b', S(1)))**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 p, x: FreeQ(p, x)), CustomConstraint(lambda v, x, u: LinearPairQ(u, v, x)), CustomConstraint(lambda n, Pq, v: PolyQ(Pq, v**n)))
rule145 = ReplacementRule(pattern145, lambda p, n, Pq, a, v, x, u, m, b : u**m*v**(-m)*Subst(Int(x**m*(a + b*x**n)**p*SubstFor(v, Pq, x), x), x, v)/Coeff(v, x, S(1)))
rubi.add(rule145)
pattern146 = Pattern(Integral(Pq_*(a_ + v_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda v, x: LinearQ(v, x)), CustomConstraint(lambda n, Pq, v: PolyQ(Pq, v**n)))
rule146 = ReplacementRule(pattern146, lambda p, n, Pq, a, v, x, b : Subst(Int((a + b*x**n)**p*SubstFor(v, Pq, x), x), x, v)/Coeff(v, x, S(1)))
rubi.add(rule146)
pattern147 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a1_ + x_**WC('n', S(1))*WC('b1', S(1)))**WC('p', S(1))*(a2_ + x_**WC('n', S(1))*WC('b2', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a1, x: FreeQ(a1, x)), CustomConstraint(lambda b1, x: FreeQ(b1, x)), CustomConstraint(lambda a2, x: FreeQ(a2, x)), CustomConstraint(lambda b2, x: FreeQ(b2, 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda a2, b2, a1, b1: ZeroQ(a1*b2 + a2*b1)), CustomConstraint(lambda a2, a1, p: IntegerQ(p) | (PositiveQ(a1) & PositiveQ(a2))))
rule147 = ReplacementRule(pattern147, lambda b2, p, n, Pq, a2, a1, x, b1, m, c : Int(Pq*(c*x)**m*(a1*a2 + b1*b2*x**(S(2)*n))**p, x))
rubi.add(rule147)
pattern148 = Pattern(Integral(Pq_*(a1_ + x_**WC('n', S(1))*WC('b1', S(1)))**WC('p', S(1))*(a2_ + x_**WC('n', S(1))*WC('b2', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a1, x: FreeQ(a1, x)), CustomConstraint(lambda b1, x: FreeQ(b1, x)), CustomConstraint(lambda a2, x: FreeQ(a2, x)), CustomConstraint(lambda b2, x: FreeQ(b2, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda a2, b2, a1, b1: ZeroQ(a1*b2 + a2*b1)), CustomConstraint(lambda a2, a1, p: IntegerQ(p) | (PositiveQ(a1) & PositiveQ(a2))))
rule148 = ReplacementRule(pattern148, lambda b2, p, n, Pq, a2, a1, x, b1 : Int(Pq*(a1*a2 + b1*b2*x**(S(2)*n))**p, x))
rubi.add(rule148)
pattern149 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(a1_ + x_**WC('n', S(1))*WC('b1', S(1)))**WC('p', S(1))*(a2_ + x_**WC('n', S(1))*WC('b2', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a1, x: FreeQ(a1, x)), CustomConstraint(lambda b1, x: FreeQ(b1, x)), CustomConstraint(lambda a2, x: FreeQ(a2, x)), CustomConstraint(lambda b2, x: FreeQ(b2, 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda a2, b2, a1, b1: ZeroQ(a1*b2 + a2*b1)))
rule149 = ReplacementRule(pattern149, lambda b2, p, n, Pq, a2, a1, x, b1, m, c : (a1 + b1*x**n)**FracPart(p)*(a2 + b2*x**n)**FracPart(p)*(a1*a2 + b1*b2*x**(S(2)*n))**(-FracPart(p))*Int(Pq*(c*x)**m*(a1*a2 + b1*b2*x**(S(2)*n))**p, x))
rubi.add(rule149)
pattern150 = Pattern(Integral(Pq_*(a1_ + x_**WC('n', S(1))*WC('b1', S(1)))**WC('p', S(1))*(a2_ + x_**WC('n', S(1))*WC('b2', S(1)))**WC('p', S(1)), x_), CustomConstraint(lambda a1, x: FreeQ(a1, x)), CustomConstraint(lambda b1, x: FreeQ(b1, x)), CustomConstraint(lambda a2, x: FreeQ(a2, x)), CustomConstraint(lambda b2, x: FreeQ(b2, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda a2, b2, a1, b1: ZeroQ(a1*b2 + a2*b1)))
rule150 = ReplacementRule(pattern150, lambda b2, p, n, Pq, a2, a1, x, b1 : (a1 + b1*x**n)**FracPart(p)*(a2 + b2*x**n)**FracPart(p)*(a1*a2 + b1*b2*x**(S(2)*n))**(-FracPart(p))*Int(Pq*(a1*a2 + b1*b2*x**(S(2)*n))**p, x))
rubi.add(rule150)
pattern151 = Pattern(Integral((a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('p', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('p', S(1))*(e_ + x_**WC('n', S(1))*WC('f', S(1)) + x_**WC('n2', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda p, n, a, f, b, d, e, c: ZeroQ(a*c*f - e*(a*d + b*c)*(n*(p + S(1)) + S(1)))), CustomConstraint(lambda e, p, c, n, a, b, d, g: ZeroQ(a*c*g - b*d*e*(S(2)*n*(p + S(1)) + S(1)))))
rule151 = ReplacementRule(pattern151, lambda n2, e, p, c, n, a, f, x, b, d, g : e*x*(a + b*x**n)**(p + S(1))*(c + d*x**n)**(p + S(1))/(a*c))
rubi.add(rule151)
pattern152 = Pattern(Integral((a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('p', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('p', S(1))*(e_ + x_**WC('n2', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, p: ZeroQ(n*(p + S(1)) + S(1))), CustomConstraint(lambda e, p, c, n, a, b, d, g: ZeroQ(a*c*g - b*d*e*(S(2)*n*(p + S(1)) + S(1)))))
rule152 = ReplacementRule(pattern152, lambda n2, e, p, c, n, a, x, b, d, g : e*x*(a + b*x**n)**(p + S(1))*(c + d*x**n)**(p + S(1))/(a*c))
rubi.add(rule152)
pattern153 = Pattern(Integral((x_*WC('h', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('p', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('p', S(1))*(e_ + x_**WC('n', S(1))*WC('f', S(1)) + x_**WC('n2', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda p, n, a, f, m, b, d, e, c: ZeroQ(a*c*f*(m + S(1)) - e*(a*d + b*c)*(m + n*(p + S(1)) + S(1)))), CustomConstraint(lambda e, p, c, n, a, m, b, d, g: ZeroQ(a*c*g*(m + S(1)) - b*d*e*(m + S(2)*n*(p + S(1)) + S(1)))), CustomConstraint(lambda m: NonzeroQ(m + S(1))))
rule153 = ReplacementRule(pattern153, lambda n2, e, p, c, n, a, f, x, m, b, h, d, g : e*(h*x)**(m + S(1))*(a + b*x**n)**(p + S(1))*(c + d*x**n)**(p + S(1))/(a*c*h*(m + S(1))))
rubi.add(rule153)
pattern154 = Pattern(Integral((x_*WC('h', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('p', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('p', S(1))*(e_ + x_**WC('n2', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, p, m: ZeroQ(m + n*(p + S(1)) + S(1))), CustomConstraint(lambda e, p, c, n, a, m, b, d, g: ZeroQ(a*c*g*(m + S(1)) - b*d*e*(m + S(2)*n*(p + S(1)) + S(1)))), CustomConstraint(lambda m: NonzeroQ(m + S(1))))
rule154 = ReplacementRule(pattern154, lambda n2, e, p, c, n, a, x, m, b, h, d, g : e*(h*x)**(m + S(1))*(a + b*x**n)**(p + S(1))*(c + d*x**n)**(p + S(1))/(a*c*h*(m + S(1))))
rubi.add(rule154)
pattern155 = Pattern(Integral((A_ + x_**WC('m', S(1))*WC('B', S(1)))*(c_ + x_**n_*WC('d', S(1)))**WC('q', S(1))*(x_**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 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 q, x: FreeQ(q, x)), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))))
rule155 = ReplacementRule(pattern155, lambda p, n, a, q, x, A, m, B, b, d, c : A*Int((a + b*x**n)**p*(c + d*x**n)**q, x) + B*Int(x**m*(a + b*x**n)**p*(c + d*x**n)**q, x))
rubi.add(rule155)
pattern156 = Pattern(Integral(Px_**WC('q', S(1))*((c_ + x_*WC('d', S(1)))**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 c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda Px, x: PolynomialQ(Px, x)), CustomConstraint(lambda q: IntegerQ(q)), CustomConstraint(lambda n: RationalQ(n)), )
def With156(p, n, a, Px, q, x, b, d, c):
k = Denominator(n)
return k*Subst(Int(SimplifyIntegrand(x**(k + S(-1))*(a + b*x**(k*n))**p*ReplaceAll(Px, Rule(x, -c/d + x**k/d))**q, x), x), x, (c + d*x)**(1/k))/d
rule156 = ReplacementRule(pattern156, lambda p, n, a, Px, q, x, b, d, c : With156(p, n, a, Px, q, x, b, d, c))
rubi.add(rule156)
pattern157 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))))
rule157 = ReplacementRule(pattern157, lambda n2, p, n, Pq, a, x, m, b, c : Subst(Int((a + b*x + c*x**S(2))**p*SubstFor(x**n, Pq, x), x), x, x**n)/n)
rubi.add(rule157)
pattern158 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)))
rule158 = ReplacementRule(pattern158, lambda n2, p, n, Pq, a, x, m, b, d, c : Int(ExpandIntegrand(Pq*(d*x)**m*(a + b*x**n + c*x**(S(2)*n))**p, x), x))
rubi.add(rule158)
pattern159 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)))
rule159 = ReplacementRule(pattern159, lambda n2, p, n, Pq, a, x, b, c : Int(ExpandIntegrand(Pq*(a + b*x**n + c*x**(S(2)*n))**p, x), x))
rubi.add(rule159)
pattern160 = Pattern(Integral((a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**WC('p', S(1))*(d_ + x_**WC('n', S(1))*WC('e', S(1)) + x_**WC('n2', S(1))*WC('f', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda e, p, n, a, b, d: ZeroQ(a*e - b*d*(n*(p + S(1)) + S(1)))), CustomConstraint(lambda p, n, a, f, d, c: ZeroQ(a*f - c*d*(S(2)*n*(p + S(1)) + S(1)))))
rule160 = ReplacementRule(pattern160, lambda n2, p, n, a, f, x, b, d, e, c : d*x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/a)
rubi.add(rule160)
pattern161 = Pattern(Integral((d_ + x_**WC('n2', S(1))*WC('f', S(1)))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, p: ZeroQ(n*(p + S(1)) + S(1))), CustomConstraint(lambda f, a, d, c: ZeroQ(a*f + c*d)))
rule161 = ReplacementRule(pattern161, lambda n2, p, n, a, f, x, b, d, c : d*x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/a)
rubi.add(rule161)
pattern162 = Pattern(Integral((x_*WC('g', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**WC('p', S(1))*(d_ + x_**WC('n', S(1))*WC('e', S(1)) + x_**WC('n2', S(1))*WC('f', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda e, p, n, a, m, b, d: ZeroQ(a*e*(m + S(1)) - b*d*(m + n*(p + S(1)) + S(1)))), CustomConstraint(lambda p, n, a, f, m, d, c: ZeroQ(a*f*(m + S(1)) - c*d*(m + S(2)*n*(p + S(1)) + S(1)))), CustomConstraint(lambda m: NonzeroQ(m + S(1))))
rule162 = ReplacementRule(pattern162, lambda n2, p, n, a, g, f, x, m, b, d, e, c : d*(g*x)**(m + S(1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/(a*g*(m + S(1))))
rubi.add(rule162)
pattern163 = Pattern(Integral((x_*WC('g', S(1)))**WC('m', S(1))*(d_ + x_**WC('n2', S(1))*WC('f', S(1)))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, p, m: ZeroQ(m + n*(p + S(1)) + S(1))), CustomConstraint(lambda f, a, d, c: ZeroQ(a*f + c*d)), CustomConstraint(lambda m: NonzeroQ(m + S(1))))
rule163 = ReplacementRule(pattern163, lambda n2, p, n, a, g, f, x, m, b, d, c : d*(g*x)**(m + S(1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/(a*g*(m + S(1))))
rubi.add(rule163)
pattern164 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: ZeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: Not(IntegerQ(S(2)*p))))
rule164 = ReplacementRule(pattern164, lambda n2, p, n, Pq, a, x, m, b, d, c : (S(4)*c)**(-IntPart(p))*(b + S(2)*c*x**n)**(-S(2)*FracPart(p))*(a + b*x**n + c*x**(S(2)*n))**FracPart(p)*Int(Pq*(d*x)**m*(b + S(2)*c*x**n)**(S(2)*p), x))
rubi.add(rule164)
pattern165 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: ZeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: Not(IntegerQ(S(2)*p))))
rule165 = ReplacementRule(pattern165, lambda n2, p, n, Pq, a, x, b, c : (S(4)*c)**(-IntPart(p))*(b + S(2)*c*x**n)**(-S(2)*FracPart(p))*(a + b*x**n + c*x**(S(2)*n))**FracPart(p)*Int(Pq*(b + S(2)*c*x**n)**(S(2)*p), x))
rubi.add(rule165)
pattern166 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule166 = ReplacementRule(pattern166, lambda n2, p, n, Pq, a, x, m, b, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a + b*x + c*x**S(2))**p*SubstFor(x**n, Pq, x), x), x, x**n)/n)
rubi.add(rule166)
pattern167 = Pattern(Integral(Pq_*(d_*x_)**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule167 = ReplacementRule(pattern167, lambda n2, p, n, Pq, a, x, m, b, d, c : x**(-m)*(d*x)**m*Int(Pq*x**m*(a + b*x**n + c*x**(S(2)*n))**p, x))
rubi.add(rule167)
pattern168 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda Pq, x: ZeroQ(Coeff(Pq, x, S(0)))))
rule168 = ReplacementRule(pattern168, lambda n2, p, n, Pq, a, x, m, b, d, c : Int((d*x)**(m + S(1))*(a + b*x**n + c*x**(S(2)*n))**p*ExpandToSum(Pq/x, x), x)/d)
rubi.add(rule168)
pattern169 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda Pq, x: ZeroQ(Coeff(Pq, x, S(0)))), CustomConstraint(lambda Pq: SumQ(Pq)))
rule169 = ReplacementRule(pattern169, lambda n2, p, n, Pq, a, x, b, c : Int(x*(a + b*x**n + c*x**(S(2)*n))**p*ExpandToSum(Pq/x, x), x))
rubi.add(rule169)
pattern170 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**WC('p', S(1))*(d_ + x_**n_*WC('e', S(1)) + x_**WC('n2', S(1))*WC('f', S(1)) + x_**WC('n3', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p, n, a, g, b, d, e, c: ZeroQ(a**S(2)*g*(n + S(1)) - c*(a*e - b*d*(n*(p + S(1)) + S(1)))*(n*(S(2)*p + S(3)) + S(1)))), CustomConstraint(lambda e, p, n, a, f, b, d, c: ZeroQ(a**S(2)*f*(n + S(1)) - a*c*d*(n + S(1))*(S(2)*n*(p + S(1)) + S(1)) - b*(a*e - b*d*(n*(p + S(1)) + S(1)))*(n*(p + S(2)) + S(1)))))
rule170 = ReplacementRule(pattern170, lambda n2, n3, p, n, a, g, f, x, b, d, e, c : x*(S(3)*a*d - x**S(2)*(-a*e + S(2)*b*d*p + S(3)*b*d))*(a + b*x**S(2) + c*x**S(4))**(p + S(1))/(S(3)*a**S(2)))
rubi.add(rule170)
pattern171 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**WC('p', S(1))*(d_ + x_**WC('n2', S(1))*WC('f', S(1)) + x_**WC('n3', S(1))*WC('g', 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 f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p, n, a, g, b, d, c: ZeroQ(a**S(2)*g*(n + S(1)) + b*c*d*(n*(p + S(1)) + S(1))*(n*(S(2)*p + S(3)) + S(1)))), CustomConstraint(lambda p, n, a, f, b, d, c: ZeroQ(a**S(2)*f*(n + S(1)) - a*c*d*(n + S(1))*(S(2)*n*(p + S(1)) + S(1)) + b**S(2)*d*(n*(p + S(1)) + S(1))*(n*(p + S(2)) + S(1)))))
rule171 = ReplacementRule(pattern171, lambda n2, n3, p, n, a, g, f, x, b, d, c : x*(S(3)*a*d - x**S(2)*(S(2)*b*d*p + S(3)*b*d))*(a + b*x**S(2) + c*x**S(4))**(p + S(1))/(S(3)*a**S(2)))
rubi.add(rule171)
pattern172 = Pattern(Integral((a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**WC('p', S(1))*(d_ + x_**n_*WC('e', S(1)) + x_**WC('n3', S(1))*WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p, n, a, g, b, d, e, c: ZeroQ(a**S(2)*g*(n + S(1)) - c*(a*e - b*d*(n*(p + S(1)) + S(1)))*(n*(S(2)*p + S(3)) + S(1)))), CustomConstraint(lambda e, p, n, a, b, d, c: ZeroQ(a*c*d*(n + S(1))*(S(2)*n*(p + S(1)) + S(1)) + b*(a*e - b*d*(n*(p + S(1)) + S(1)))*(n*(p + S(2)) + S(1)))))
rule172 = ReplacementRule(pattern172, lambda n2, n3, p, c, n, a, x, b, d, e, g : x*(S(3)*a*d - x**S(2)*(-a*e + S(2)*b*d*p + S(3)*b*d))*(a + b*x**S(2) + c*x**S(4))**(p + S(1))/(S(3)*a**S(2)))
rubi.add(rule172)
pattern173 = Pattern(Integral((d_ + x_**WC('n3', S(1))*WC('g', S(1)))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p, n, a, g, b, d, c: ZeroQ(a**S(2)*g*(n + S(1)) + b*c*d*(n*(p + S(1)) + S(1))*(n*(S(2)*p + S(3)) + S(1)))), CustomConstraint(lambda p, n, a, b, d, c: ZeroQ(a*c*d*(n + S(1))*(S(2)*n*(p + S(1)) + S(1)) - b**S(2)*d*(n*(p + S(1)) + S(1))*(n*(p + S(2)) + S(1)))))
rule173 = ReplacementRule(pattern173, lambda n2, n3, p, n, a, g, x, b, d, c : x*(S(3)*a*d - x**S(2)*(S(2)*b*d*p + S(3)*b*d))*(a + b*x**S(2) + c*x**S(4))**(p + S(1))/(S(3)*a**S(2)))
rubi.add(rule173)
pattern174 = Pattern(Integral(x_**WC('m', S(1))*(e_ + x_**WC('q', S(1))*WC('f', S(1)) + x_**WC('r', S(1))*WC('g', S(1)) + x_**WC('s', S(1))*WC('h', S(1)))/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**(S(3)/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 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 m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, q: ZeroQ(-n/S(2) + q)), CustomConstraint(lambda n, r: ZeroQ(-S(3)*n/S(2) + r)), CustomConstraint(lambda n, s: ZeroQ(-S(2)*n + s)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: ZeroQ(S(2)*m - n + S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(a*h + c*e)))
rule174 = ReplacementRule(pattern174, lambda n2, r, n, a, q, g, f, s, x, m, b, h, e, c : (-S(2)*c*x**n*(-b*g + S(2)*c*f) - S(2)*c*(-S(2)*a*g + b*f) - S(2)*h*x**(n/S(2))*(-S(4)*a*c + b**S(2)))/(c*n*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**n + c*x**(S(2)*n))))
rubi.add(rule174)
pattern175 = Pattern(Integral((d_*x_)**WC('m', S(1))*(e_ + x_**WC('q', S(1))*WC('f', S(1)) + x_**WC('r', S(1))*WC('g', S(1)) + x_**WC('s', S(1))*WC('h', S(1)))/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', S(1))*WC('c', S(1)))**(S(3)/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 h, x: FreeQ(h, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, q: ZeroQ(-n/S(2) + q)), CustomConstraint(lambda n, r: ZeroQ(-S(3)*n/S(2) + r)), CustomConstraint(lambda n, s: ZeroQ(-S(2)*n + s)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: ZeroQ(S(2)*m - n + S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(a*h + c*e)))
rule175 = ReplacementRule(pattern175, lambda n2, r, e, n, a, q, g, f, s, x, m, b, h, d, c : x**(-m)*(d*x)**m*Int(x**m*(e + f*x**(n/S(2)) + g*x**(S(3)*n/S(2)) + h*x**(S(2)*n))/(a + b*x**n + c*x**(S(2)*n))**(S(3)/2), x))
rubi.add(rule175)
pattern176 = Pattern(Integral(Pq_*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda b, n, Pq, a, i, x, p, q, c: Less(q, S(2)*n)))
def With176(n2, p, n, Pq, a, x, b, c):
q = Expon(Pq, x)
i = Symbol('i')
return -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Sum(c*x**(i + n)*(-S(2)*a*Coeff(Pq, x, i + n) + b*Coeff(Pq, x, i)) + x**i*(-a*b*Coeff(Pq, x, i + n) + (-S(2)*a*c + b**S(2))*Coeff(Pq, x, i)), List(i, S(0), n + S(-1)))/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))) + Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Sum(c*x**(i + n)*(-S(2)*a*Coeff(Pq, x, i + n) + b*Coeff(Pq, x, i))*(i + n*(S(2)*p + S(3)) + S(1)) + x**i*(-a*b*(i + S(1))*Coeff(Pq, x, i + n) + (-S(2)*a*c*(i + S(2)*n*(p + S(1)) + S(1)) + b**S(2)*(i + n*(p + S(1)) + S(1)))*Coeff(Pq, x, i)), List(i, S(0), n + S(-1))), x)/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2)))
rule176 = ReplacementRule(pattern176, lambda n2, p, n, Pq, a, x, b, c : With176(n2, p, n, Pq, a, x, b, c))
rubi.add(rule176)
pattern177 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)) + x_*WC('e', S(1)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda g, a, d, c: ZeroQ(a*g + c*d)))
rule177 = ReplacementRule(pattern177, lambda c, a, f, x, b, d, e, g : (-c*x**S(2)*(-b*f + S(2)*c*e) - c*(-S(2)*a*f + b*e) - g*x*(-S(4)*a*c + b**S(2)))/(c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule177)
pattern178 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda g, a, d, c: ZeroQ(a*g + c*d)))
rule178 = ReplacementRule(pattern178, lambda c, a, f, x, b, d, g : (S(2)*a*c*f + b*c*f*x**S(2) - g*x*(-S(4)*a*c + b**S(2)))/(c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule178)
pattern179 = Pattern(Integral((d_ + x_**S(4)*WC('g', S(1)) + x_*WC('e', S(1)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 g, x: FreeQ(g, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda g, a, d, c: ZeroQ(a*g + c*d)))
rule179 = ReplacementRule(pattern179, lambda c, a, x, b, d, e, g : (-b*c*e - S(2)*c**S(2)*e*x**S(2) - g*x*(-S(4)*a*c + b**S(2)))/(c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule179)
pattern180 = Pattern(Integral(x_**S(2)*(x_**S(4)*WC('h', S(1)) + x_**S(2)*WC('g', S(1)) + x_*WC('f', S(1)) + WC('e', S(0)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 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 b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(-S(3)*a*h + c*e)), CustomConstraint(lambda g, h, b, c: ZeroQ(-S(2)*b*h + c*g)))
rule180 = ReplacementRule(pattern180, lambda c, a, f, x, b, h, e, g : (S(2)*a**S(2)*c*f + a*b*c*f*x**S(2) + a*h*x**S(3)*(-S(4)*a*c + b**S(2)))/(a*c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule180)
pattern181 = Pattern(Integral(x_**S(2)*(x_**S(4)*WC('h', S(1)) + x_**S(2)*WC('g', S(1)) + WC('e', S(0)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 e, x: FreeQ(e, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(-S(3)*a*h + c*e)), CustomConstraint(lambda g, h, b, c: ZeroQ(-S(2)*b*h + c*g)))
rule181 = ReplacementRule(pattern181, lambda c, a, x, b, h, e, g : h*x**S(3)/(c*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule181)
pattern182 = Pattern(Integral((d_ + x_**S(6)*WC('h', S(1)) + x_**S(4)*WC('g', S(1)) + x_**S(3)*WC('f', S(1)) + x_**S(2)*WC('e', S(1)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 h, x: FreeQ(h, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(-S(3)*a*h + c*e)), CustomConstraint(lambda a, g, b, d, e, c: ZeroQ(S(3)*a*g - S(2)*b*e + S(3)*c*d)))
rule182 = ReplacementRule(pattern182, lambda c, a, f, x, b, d, h, e, g : (S(2)*a**S(2)*c*f + a*b*c*f*x**S(2) + a*h*x**S(3)*(-S(4)*a*c + b**S(2)) + c*d*x*(-S(4)*a*c + b**S(2)))/(a*c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule182)
pattern183 = Pattern(Integral((d_ + x_**S(6)*WC('h', S(1)) + x_**S(3)*WC('f', S(1)) + x_**S(2)*WC('e', S(1)))/(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))**(S(3)/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 h, x: FreeQ(h, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda h, a, e, c: ZeroQ(-S(3)*a*h + c*e)), CustomConstraint(lambda b, e, d, c: ZeroQ(-S(2)*b*e + S(3)*c*d)))
rule183 = ReplacementRule(pattern183, lambda a, f, x, b, d, h, e, c : (S(2)*a**S(2)*c*f + a*b*c*f*x**S(2) + a*h*x**S(3)*(-S(4)*a*c + b**S(2)) + c*d*x*(-S(4)*a*c + b**S(2)))/(a*c*(-S(4)*a*c + b**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule183)
pattern184 = Pattern(Integral(Pq_*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda b, n, Q, Pq, a, i, x, p, q, c, R: GreaterEqual(q, S(2)*n)))
def With184(n2, p, n, Pq, a, x, b, c):
q = Expon(Pq, x)
return Module(List(Set(Q, PolynomialQuotient(Pq*(b*c)**(Floor((q + S(-1))/n) + S(1)), a + b*x**n + c*x**(S(2)*n), x)), Set(R, PolynomialRemainder(Pq*(b*c)**(Floor((q + S(-1))/n) + S(1)), a + b*x**n + c*x**(S(2)*n), x)), i), -x*(b*c)**(-Floor((q + S(-1))/n) + S(-1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Sum(c*x**(i + n)*(-S(2)*a*Coeff(R, x, i + n) + b*Coeff(R, x, i)) + x**i*(-a*b*Coeff(R, x, i + n) + (-S(2)*a*c + b**S(2))*Coeff(R, x, i)), List(i, S(0), n + S(-1)))/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))) + (b*c)**(-Floor((q + S(-1))/n) + S(-1))*Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*ExpandToSum(Q*a*n*(p + S(1))*(-S(4)*a*c + b**S(2)) + Sum(c*x**(i + n)*(-S(2)*a*Coeff(R, x, i + n) + b*Coeff(R, x, i))*(i + n*(S(2)*p + S(3)) + S(1)) + x**i*(-a*b*(i + S(1))*Coeff(R, x, i + n) + (-S(2)*a*c*(i + S(2)*n*(p + S(1)) + S(1)) + b**S(2)*(i + n*(p + S(1)) + S(1)))*Coeff(R, x, i)), List(i, S(0), n + S(-1))), x), x)/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rule184 = ReplacementRule(pattern184, lambda n2, p, n, Pq, a, x, b, c : With184(n2, p, n, Pq, a, x, b, c))
rubi.add(rule184)
pattern185 = Pattern(Integral(Pq_*x_**m_*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda m: NegativeIntegerQ(m)), CustomConstraint(lambda b, n, Q, Pq, m, a, i, x, p, q, c, R: GreaterEqual(q, S(2)*n)))
def With185(n2, p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
return Module(List(Set(Q, PolynomialQuotient(Pq*a*x**m*(b*c)**(Floor((q + S(-1))/n) + S(1)), a + b*x**n + c*x**(S(2)*n), x)), Set(R, PolynomialRemainder(Pq*a*x**m*(b*c)**(Floor((q + S(-1))/n) + S(1)), a + b*x**n + c*x**(S(2)*n), x)), i), (b*c)**(-Floor((q + S(-1))/n) + S(-1))*Int(x**m*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*ExpandToSum(Q*n*x**(-m)*(p + S(1))*(-S(4)*a*c + b**S(2)) + Sum(c*x**(i - m + n)*(-S(2)*Coeff(R, x, i + n) + b*Coeff(R, x, i)/a)*(i + n*(S(2)*p + S(3)) + S(1)) + x**(i - m)*(-b*(i + S(1))*Coeff(R, x, i + n) + (-S(2)*c*(i + S(2)*n*(p + S(1)) + S(1)) + b**S(2)*(i + n*(p + S(1)) + S(1))/a)*Coeff(R, x, i)), List(i, S(0), n + S(-1))), x), x)/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - x*(b*c)**(-Floor((q + S(-1))/n) + S(-1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Sum(c*x**(i + n)*(-S(2)*a*Coeff(R, x, i + n) + b*Coeff(R, x, i)) + x**i*(-a*b*Coeff(R, x, i + n) + (-S(2)*a*c + b**S(2))*Coeff(R, x, i)), List(i, S(0), n + S(-1)))/(a**S(2)*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rule185 = ReplacementRule(pattern185, lambda n2, p, n, Pq, a, x, m, b, c : With185(n2, p, n, Pq, a, x, m, b, c))
rubi.add(rule185)
pattern186 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m)), CustomConstraint(lambda b, n, Pq, m, a, x, p, g, c: Unequal(g, S(1))))
def With186(n2, p, n, Pq, a, x, m, b, c):
g = GCD(m + S(1), n)
return Subst(Int(x**(S(-1) + (m + S(1))/g)*(a + b*x**(n/g) + c*x**(S(2)*n/g))**p*ReplaceAll(Pq, Rule(x, x**(1/g))), x), x, x**g)/g
rule186 = ReplacementRule(pattern186, lambda n2, p, n, Pq, a, x, m, b, c : With186(n2, p, n, Pq, a, x, m, b, c))
rubi.add(rule186)
pattern187 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))/(a_ + x_**n2_*WC('c', S(1)) + x_**WC('n', S(1))*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 m, x: FreeQ(m, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda b, a, c: NiceSqrtQ(-S(4)*a*c + b**S(2))))
rule187 = ReplacementRule(pattern187, lambda n2, n, Pq, a, x, m, b, d, c : Int(ExpandIntegrand(Pq*(d*x)**m/(a + b*x**n + c*x**(S(2)*n)), x), x))
rubi.add(rule187)
pattern188 = Pattern(Integral(Pq_/(a_ + x_**n2_*WC('c', S(1)) + x_**WC('n', S(1))*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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, Pq, a, x, b, c: Less(Expon(Pq, x), n) | NiceSqrtQ(-S(4)*a*c + b**S(2))))
rule188 = ReplacementRule(pattern188, lambda n2, n, Pq, a, x, b, c : Int(ExpandIntegrand(Pq/(a + b*x**n + c*x**(S(2)*n)), x), x))
rubi.add(rule188)
pattern189 = Pattern(Integral(Pq_*(a_ + x_**S(2)*WC('c', S(1)) + x_*WC('b', 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda Pqq, b, Pq, a, x, p, q, c: Equal(S(2)*p + q + S(1), S(0))))
def With189(p, Pq, a, x, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*c**p*log(a + b*x + c*x**S(2))/S(2) + Int((a + b*x + c*x**S(2))**p*ExpandToSum(S(2)*Pq - Pqq*c**p*(b + S(2)*c*x)*(a + b*x + c*x**S(2))**(-p + S(-1)), x), x)/S(2))
rule189 = ReplacementRule(pattern189, lambda p, Pq, a, x, b, c : With189(p, Pq, a, x, b, c))
rubi.add(rule189)
pattern190 = Pattern(Integral(Pq_*(a_ + x_**S(2)*WC('c', S(1)) + x_*WC('b', 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1)/2)), CustomConstraint(lambda c: PosQ(c)), CustomConstraint(lambda Pqq, b, Pq, a, x, p, q, c: Equal(S(2)*p + q + S(1), S(0))))
def With190(p, Pq, a, x, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*c**p*atanh((b + S(2)*c*x)/(S(2)*sqrt(a + b*x + c*x**S(2))*Rt(c, S(2)))) + Int((a + b*x + c*x**S(2))**p*ExpandToSum(Pq - Pqq*c**(p + S(1)/2)*(a + b*x + c*x**S(2))**(-p + S(-1)/2), x), x))
rule190 = ReplacementRule(pattern190, lambda p, Pq, a, x, b, c : With190(p, Pq, a, x, b, c))
rubi.add(rule190)
pattern191 = Pattern(Integral(Pq_*(a_ + x_**S(2)*WC('c', S(1)) + x_*WC('b', 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 Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1)/2)), CustomConstraint(lambda c: NegQ(c)), CustomConstraint(lambda Pqq, b, Pq, a, x, p, q, c: Equal(S(2)*p + q + S(1), S(0))))
def With191(p, Pq, a, x, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), -Pqq*(-c)**p*atan((b + S(2)*c*x)/(S(2)*sqrt(a + b*x + c*x**S(2))*Rt(-c, S(2)))) + Int((a + b*x + c*x**S(2))**p*ExpandToSum(Pq - Pqq*(-c)**(p + S(1)/2)*(a + b*x + c*x**S(2))**(-p + S(-1)/2), x), x))
rule191 = ReplacementRule(pattern191, lambda p, Pq, a, x, b, c : With191(p, Pq, a, x, b, c))
rubi.add(rule191)
pattern192 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**n2_*WC('c', S(1)) + x_**WC('n', S(1))*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda d, Pqq, b, n, Pq, m, a, x, p, q, c: GreaterEqual(q, S(2)*n) & Unequal(m + S(2)*n*p + q + S(1), S(0)) & (IntegerQ(S(2)*p) | (Equal(n, S(1)) & IntegerQ(S(4)*p)) | IntegerQ(p + (q + S(1))/(S(2)*n)))))
def With192(n2, p, n, Pq, a, x, m, b, d, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*d**(S(2)*n - q + S(-1))*(d*x)**(m - S(2)*n + q + S(1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/(c*(m + S(2)*n*p + q + S(1))) + Int((d*x)**m*(a + b*x**n + c*x**(S(2)*n))**p*ExpandToSum(Pq - Pqq*x**q - Pqq*(a*x**(-S(2)*n + q)*(m - S(2)*n + q + S(1)) + b*x**(-n + q)*(m + n*(p + S(-1)) + q + S(1)))/(c*(m + S(2)*n*p + q + S(1))), x), x))
rule192 = ReplacementRule(pattern192, lambda n2, p, n, Pq, a, x, m, b, d, c : With192(n2, p, n, Pq, a, x, m, b, d, c))
rubi.add(rule192)
pattern193 = Pattern(Integral(Pq_*(a_ + x_**n2_*WC('c', S(1)) + x_**WC('n', S(1))*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda Pqq, b, n, Pq, a, x, p, q, c: GreaterEqual(q, S(2)*n) & Unequal(S(2)*n*p + q + S(1), S(0)) & (IntegerQ(S(2)*p) | (Equal(n, S(1)) & IntegerQ(S(4)*p)) | IntegerQ(p + (q + S(1))/(S(2)*n)))))
def With193(n2, p, n, Pq, a, x, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*x**(-S(2)*n + q + S(1))*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))/(c*(S(2)*n*p + q + S(1))) + Int((a + b*x**n + c*x**(S(2)*n))**p*ExpandToSum(Pq - Pqq*x**q - Pqq*(a*x**(-S(2)*n + q)*(-S(2)*n + q + S(1)) + b*x**(-n + q)*(n*(p + S(-1)) + q + S(1)))/(c*(S(2)*n*p + q + S(1))), x), x))
rule193 = ReplacementRule(pattern193, lambda n2, p, n, Pq, a, x, b, c : With193(n2, p, n, Pq, a, x, b, c))
rubi.add(rule193)
pattern194 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, Pq, x: Not(PolyQ(Pq, x**n))), )
def With194(n2, p, n, Pq, a, x, m, b, d, c):
q = Expon(Pq, x)
j = Symbol('j')
k = Symbol('k')
return Int(Sum(d**(-j)*(d*x)**(j + m)*(a + b*x**n + c*x**(S(2)*n))**p*Sum(x**(k*n)*Coeff(Pq, x, j + k*n), List(k, S(0), S(1) + (-j + q)/n)), List(j, S(0), n + S(-1))), x)
rule194 = ReplacementRule(pattern194, lambda n2, p, n, Pq, a, x, m, b, d, c : With194(n2, p, n, Pq, a, x, m, b, d, c))
rubi.add(rule194)
pattern195 = Pattern(Integral(Pq_*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)), CustomConstraint(lambda n, Pq, x: Not(PolyQ(Pq, x**n))), )
def With195(n2, p, n, Pq, a, x, b, c):
q = Expon(Pq, x)
j = Symbol('j')
k = Symbol('k')
return Int(Sum(x**j*(a + b*x**n + c*x**(S(2)*n))**p*Sum(x**(k*n)*Coeff(Pq, x, j + k*n), List(k, S(0), S(1) + (-j + q)/n)), List(j, S(0), n + S(-1))), x)
rule195 = ReplacementRule(pattern195, lambda n2, p, n, Pq, a, x, b, c : With195(n2, p, n, Pq, a, x, b, c))
rubi.add(rule195)
pattern196 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)))
rule196 = ReplacementRule(pattern196, lambda n2, n, Pq, a, x, m, b, d, c : Int(RationalFunctionExpand(Pq*(d*x)**m/(a + b*x**n + c*x**(S(2)*n)), x), x))
rubi.add(rule196)
pattern197 = Pattern(Integral(Pq_/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: PositiveIntegerQ(n)))
rule197 = ReplacementRule(pattern197, lambda n2, n, Pq, a, x, b, c : Int(RationalFunctionExpand(Pq/(a + b*x**n + c*x**(S(2)*n)), x), x))
rubi.add(rule197)
pattern198 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: IntegerQ(m)), )
def With198(n2, p, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
return -Subst(Int(x**(-m - q + S(-2))*(a + b*x**(-n) + c*x**(-S(2)*n))**p*ExpandToSum(x**q*ReplaceAll(Pq, Rule(x, 1/x)), x), x), x, 1/x)
rule198 = ReplacementRule(pattern198, lambda n2, p, n, Pq, a, x, m, b, c : With198(n2, p, n, Pq, a, x, m, b, c))
rubi.add(rule198)
pattern199 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: FractionQ(m)), )
def With199(n2, p, n, Pq, a, x, m, b, d, c):
g = Denominator(m)
q = Expon(Pq, x)
return -g*Subst(Int(x**(-g*(m + q + S(1)) + S(-1))*(a + b*d**(-n)*x**(-g*n) + c*d**(-S(2)*n)*x**(-S(2)*g*n))**p*ExpandToSum(x**(g*q)*ReplaceAll(Pq, Rule(x, x**(-g)/d)), x), x), x, (d*x)**(-S(1)/g))/d
rule199 = ReplacementRule(pattern199, lambda n2, p, n, Pq, a, x, m, b, d, c : With199(n2, p, n, Pq, a, x, m, b, d, c))
rubi.add(rule199)
pattern200 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**m_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: NegativeIntegerQ(n)), CustomConstraint(lambda m: Not(RationalQ(m))), )
def With200(n2, p, n, Pq, a, x, m, b, d, c):
q = Expon(Pq, x)
return -(d*x)**m*(1/x)**m*Subst(Int(x**(-m - q + S(-2))*(a + b*x**(-n) + c*x**(-S(2)*n))**p*ExpandToSum(x**q*ReplaceAll(Pq, Rule(x, 1/x)), x), x), x, 1/x)
rule200 = ReplacementRule(pattern200, lambda n2, p, n, Pq, a, x, m, b, d, c : With200(n2, p, n, Pq, a, x, m, b, d, c))
rubi.add(rule200)
pattern201 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: FractionQ(n)), )
def With201(n2, p, n, Pq, a, x, m, b, c):
g = Denominator(n)
return g*Subst(Int(x**(g*(m + S(1)) + S(-1))*(a + b*x**(g*n) + c*x**(S(2)*g*n))**p*ReplaceAll(Pq, Rule(x, x**g)), x), x, x**(1/g))
rule201 = ReplacementRule(pattern201, lambda n2, p, n, Pq, a, x, m, b, c : With201(n2, p, n, Pq, a, x, m, b, c))
rubi.add(rule201)
pattern202 = Pattern(Integral(Pq_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: FractionQ(n)), )
def With202(n2, p, n, Pq, a, x, b, c):
g = Denominator(n)
return g*Subst(Int(x**(g + S(-1))*(a + b*x**(g*n) + c*x**(S(2)*g*n))**p*ReplaceAll(Pq, Rule(x, x**g)), x), x, x**(1/g))
rule202 = ReplacementRule(pattern202, lambda n2, p, n, Pq, a, x, b, c : With202(n2, p, n, Pq, a, x, b, c))
rubi.add(rule202)
pattern203 = Pattern(Integral(Pq_*(d_*x_)**m_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: FractionQ(n)), CustomConstraint(lambda m: PositiveIntegerQ(m + S(1)/2)))
rule203 = ReplacementRule(pattern203, lambda n2, p, n, Pq, a, x, m, b, d, c : d**(m + S(-1)/2)*sqrt(d*x)*Int(Pq*x**m*(a + b*x**n + c*x**(S(2)*n))**p, x)/sqrt(x))
rubi.add(rule203)
pattern204 = Pattern(Integral(Pq_*(d_*x_)**m_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: FractionQ(n)), CustomConstraint(lambda m: NegativeIntegerQ(m + S(-1)/2)))
rule204 = ReplacementRule(pattern204, lambda n2, p, n, Pq, a, x, m, b, d, c : d**(m + S(1)/2)*sqrt(x)*Int(Pq*x**m*(a + b*x**n + c*x**(S(2)*n))**p, x)/sqrt(d*x))
rubi.add(rule204)
pattern205 = Pattern(Integral(Pq_*(d_*x_)**m_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n: FractionQ(n)))
rule205 = ReplacementRule(pattern205, lambda n2, p, n, Pq, a, x, m, b, d, c : x**(-m)*(d*x)**m*Int(Pq*x**m*(a + b*x**n + c*x**(S(2)*n))**p, x))
rubi.add(rule205)
pattern206 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule206 = ReplacementRule(pattern206, lambda n2, p, n, Pq, a, x, m, b, c : Subst(Int((a + b*x**(n/(m + S(1))) + c*x**(S(2)*n/(m + S(1))))**p*ReplaceAll(SubstFor(x**n, Pq, x), Rule(x, x**(n/(m + S(1))))), x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule206)
pattern207 = Pattern(Integral(Pq_*(d_*x_)**m_*(a_ + x_**n_*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule207 = ReplacementRule(pattern207, lambda n2, p, n, Pq, a, x, m, b, d, c : x**(-m)*(d*x)**m*Int(Pq*x**m*(a + b*x**n + c*x**(S(2)*n))**p, x))
rubi.add(rule207)
pattern208 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), )
def With208(n2, n, Pq, a, x, m, b, d, c):
q = Rt(-S(4)*a*c + b**S(2), S(2))
return S(2)*c*Int(Pq*(d*x)**m/(b + S(2)*c*x**n - q), x)/q - S(2)*c*Int(Pq*(d*x)**m/(b + S(2)*c*x**n + q), x)/q
rule208 = ReplacementRule(pattern208, lambda n2, n, Pq, a, x, m, b, d, c : With208(n2, n, Pq, a, x, m, b, d, c))
rubi.add(rule208)
pattern209 = Pattern(Integral(Pq_/(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), )
def With209(n2, n, Pq, a, x, b, c):
q = Rt(-S(4)*a*c + b**S(2), S(2))
return S(2)*c*Int(Pq/(b + S(2)*c*x**n - q), x)/q - S(2)*c*Int(Pq/(b + S(2)*c*x**n + q), x)/q
rule209 = ReplacementRule(pattern209, lambda n2, n, Pq, a, x, b, c : With209(n2, n, Pq, a, x, b, c))
rubi.add(rule209)
pattern210 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule210 = ReplacementRule(pattern210, lambda n2, p, n, Pq, a, x, m, b, d, c : Int(ExpandIntegrand(Pq*(d*x)**m*(a + b*x**n + c*x**(S(2)*n))**p, x), x))
rubi.add(rule210)
pattern211 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule211 = ReplacementRule(pattern211, lambda n2, p, n, Pq, a, x, b, c : Int(ExpandIntegrand(Pq*(a + b*x**n + c*x**(S(2)*n))**p, x), x))
rubi.add(rule211)
pattern212 = Pattern(Integral(Pq_*(x_*WC('d', S(1)))**WC('m', S(1))*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)))
rule212 = ReplacementRule(pattern212, lambda n2, p, n, Pq, a, x, m, b, d, c : Int(Pq*(d*x)**m*(a + b*x**n + c*x**(S(2)*n))**p, x))
rubi.add(rule212)
pattern213 = Pattern(Integral(Pq_*(a_ + x_**WC('n', S(1))*WC('b', S(1)) + x_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)))
rule213 = ReplacementRule(pattern213, lambda n2, p, n, Pq, a, x, b, c : Int(Pq*(a + b*x**n + c*x**(S(2)*n))**p, x))
rubi.add(rule213)
pattern214 = Pattern(Integral(Pq_*u_**WC('m', S(1))*(a_ + v_**n_*WC('b', S(1)) + v_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda v, x, u: LinearPairQ(u, v, x)), CustomConstraint(lambda n, Pq, v: PolyQ(Pq, v**n)))
rule214 = ReplacementRule(pattern214, lambda n2, p, n, Pq, a, v, x, u, m, b, c : u**m*v**(-m)*Subst(Int(x**m*(a + b*x**n + c*x**(S(2)*n))**p*SubstFor(v, Pq, x), x), x, v)/Coefficient(v, x, S(1)))
rubi.add(rule214)
pattern215 = Pattern(Integral(Pq_*(a_ + v_**n_*WC('b', S(1)) + v_**WC('n2', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda v, x: LinearQ(v, x)), CustomConstraint(lambda n, Pq, v: PolyQ(Pq, v**n)))
rule215 = ReplacementRule(pattern215, lambda n2, p, n, Pq, a, v, x, b, c : Subst(Int((a + b*x**n + c*x**(S(2)*n))**p*SubstFor(v, Pq, x), x), x, v)/Coefficient(v, x, S(1)))
rubi.add(rule215)
pattern216 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j: ZeroQ(j*p + j - n + S(1))))
rule216 = ReplacementRule(pattern216, lambda p, n, a, x, j, b : x**(-n + S(1))*(a*x**j + b*x**n)**(p + S(1))/(b*(-j + n)*(p + S(1))))
rubi.add(rule216)
pattern217 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j: NegativeIntegerQ((j - n*p - n + S(-1))/(j - n))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))))
rule217 = ReplacementRule(pattern217, lambda p, n, a, x, j, b : -x**(-j + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))) + (-j + n*p + n + S(1))*Int(x**(-j)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))))
rubi.add(rule217)
pattern218 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j: NegativeIntegerQ((j - n*p - n + S(-1))/(j - n))), CustomConstraint(lambda p, j: NonzeroQ(j*p + S(1))))
rule218 = ReplacementRule(pattern218, lambda p, n, a, x, j, b : -b*(-j + n*p + n + S(1))*Int(x**(-j + n)*(a*x**j + b*x**n)**p, x)/(a*(j*p + S(1))) + x**(-j + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(j*p + S(1))))
rubi.add(rule218)
pattern219 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda p, j: Less(j*p + S(1), S(0))))
rule219 = ReplacementRule(pattern219, lambda p, n, a, x, j, b : -b*p*(-j + n)*Int(x**n*(a*x**j + b*x**n)**(p + S(-1)), x)/(j*p + S(1)) + x*(a*x**j + b*x**n)**p/(j*p + S(1)))
rubi.add(rule219)
pattern220 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda n, p: NonzeroQ(n*p + S(1))))
rule220 = ReplacementRule(pattern220, lambda p, n, a, x, j, b : a*p*(-j + n)*Int(x**j*(a*x**j + b*x**n)**(p + S(-1)), x)/(n*p + S(1)) + x*(a*x**j + b*x**n)**p/(n*p + S(1)))
rubi.add(rule220)
pattern221 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, p, j: Greater(j*p + S(1), -j + n)))
rule221 = ReplacementRule(pattern221, lambda p, n, a, x, j, b : x**(-n + S(1))*(a*x**j + b*x**n)**(p + S(1))/(b*(-j + n)*(p + S(1))) - (j*p + j - n + S(1))*Int(x**(-n)*(a*x**j + b*x**n)**(p + S(1)), x)/(b*(-j + n)*(p + S(1))))
rubi.add(rule221)
pattern222 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda p: Less(p, S(-1))))
rule222 = ReplacementRule(pattern222, lambda p, n, a, x, j, b : -x**(-j + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))) + (-j + n*p + n + S(1))*Int(x**(-j)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))))
rubi.add(rule222)
pattern223 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p + S(1)/2)), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda p, j: ZeroQ(j*p + S(1))))
rule223 = ReplacementRule(pattern223, lambda p, n, a, x, j, b : a*Int(x**j*(a*x**j + b*x**n)**(p + S(-1)), x) + x*(a*x**j + b*x**n)**p/(p*(-j + n)))
rubi.add(rule223)
pattern224 = Pattern(Integral(1/sqrt(x_**S(2)*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 n: NonzeroQ(n + S(-2))))
rule224 = ReplacementRule(pattern224, lambda n, b, a, x : S(2)*Subst(Int(1/(-a*x**S(2) + S(1)), x), x, x/sqrt(a*x**S(2) + b*x**n))/(-n + S(2)))
rubi.add(rule224)
pattern225 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1)/2)), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda p, j: ZeroQ(j*p + S(1))))
rule225 = ReplacementRule(pattern225, lambda p, n, a, x, j, b : -x**(-j + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))) + (-j + n*p + n + S(1))*Int(x**(-j)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))))
rubi.add(rule225)
pattern226 = Pattern(Integral(1/sqrt(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda n, j: RationalQ(j, n)), CustomConstraint(lambda n, j: Less(S(2)*n + S(-2), j, n)))
rule226 = ReplacementRule(pattern226, lambda n, a, x, j, b : -a*(-j + S(2)*n + S(-2))*Int(x**(j - n)/sqrt(a*x**j + b*x**n), x)/(b*(n + S(-2))) - S(2)*x**(-n + S(1))*sqrt(a*x**j + b*x**n)/(b*(n + S(-2))))
rubi.add(rule226)
pattern227 = Pattern(Integral((x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: PosQ(-j + n)))
rule227 = ReplacementRule(pattern227, lambda p, n, a, x, j, b : x**(-j*FracPart(p))*(a + b*x**(-j + n))**(-FracPart(p))*(a*x**j + b*x**n)**FracPart(p)*Int(x**(j*p)*(a + b*x**(-j + n))**p, x))
rubi.add(rule227)
pattern228 = Pattern(Integral((u_**WC('j', S(1))*WC('a', S(1)) + u_**WC('n', S(1))*WC('b', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda x, u: NonzeroQ(u - x)))
rule228 = ReplacementRule(pattern228, lambda p, n, a, x, u, j, b : Subst(Int((a*x**j + b*x**n)**p, x), x, u)/Coefficient(u, x, S(1)))
rubi.add(rule228)
pattern229 = Pattern(Integral(x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: ZeroQ(m - n + S(1))))
rule229 = ReplacementRule(pattern229, lambda p, n, a, m, x, j, b : Subst(Int((a*x**(j/n) + b*x)**p, x), x, x**n)/n)
rubi.add(rule229)
pattern230 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j, m: ZeroQ(-j + m + n*p + n + S(1))), CustomConstraint(lambda c, j: IntegerQ(j) | PositiveQ(c)))
rule230 = ReplacementRule(pattern230, lambda p, j, n, a, x, m, b, c : -c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))))
rubi.add(rule230)
pattern231 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j, m: NegativeIntegerQ((j - m - n*p - n + S(-1))/(j - n))), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda c, j: IntegerQ(j) | PositiveQ(c)))
rule231 = ReplacementRule(pattern231, lambda p, j, n, a, x, m, b, c : c**j*(-j + m + n*p + n + S(1))*Int((c*x)**(-j + m)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))) - c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))))
rubi.add(rule231)
pattern232 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j, m: NegativeIntegerQ((j - m - n*p - n + S(-1))/(j - n))), CustomConstraint(lambda p, j, m: NonzeroQ(j*p + m + S(1))), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)))
rule232 = ReplacementRule(pattern232, lambda p, j, n, a, x, m, b, c : -b*c**(j - n)*(-j + m + n*p + n + S(1))*Int((c*x)**(-j + m + n)*(a*x**j + b*x**n)**p, x)/(a*(j*p + m + S(1))) + c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(j*p + m + S(1))))
rubi.add(rule232)
pattern233 = Pattern(Integral((c_*x_)**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, p, j, m: NegativeIntegerQ((j - m - n*p - n + S(-1))/(j - n))))
rule233 = ReplacementRule(pattern233, lambda p, n, a, m, x, j, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule233)
pattern234 = Pattern(Integral(x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), CustomConstraint(lambda n: NonzeroQ(n**S(2) + S(-1))))
rule234 = ReplacementRule(pattern234, lambda p, n, a, m, x, j, b : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a*x**(j/n) + b*x)**p, x), x, x**n)/n)
rubi.add(rule234)
pattern235 = Pattern(Integral((c_*x_)**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), CustomConstraint(lambda n: NonzeroQ(n**S(2) + S(-1))))
rule235 = ReplacementRule(pattern235, lambda p, n, a, m, x, j, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule235)
pattern236 = Pattern(Integral((x_*WC('c', S(1)))**m_*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p: Not(IntegerQ(p))), CustomConstraint(lambda n, m, p, j: RationalQ(j, m, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda p, j, m: Less(j*p + m + S(1), S(0))))
rule236 = ReplacementRule(pattern236, lambda p, n, a, m, x, j, b, c : -b*c**(-n)*p*(-j + n)*Int((c*x)**(m + n)*(a*x**j + b*x**n)**(p + S(-1)), x)/(j*p + m + S(1)) + (c*x)**(m + S(1))*(a*x**j + b*x**n)**p/(c*(j*p + m + S(1))))
rubi.add(rule236)
pattern237 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda p: Greater(p, S(0))), CustomConstraint(lambda n, p, m: NonzeroQ(m + n*p + S(1))))
rule237 = ReplacementRule(pattern237, lambda p, j, n, a, x, m, b, c : a*c**(-j)*p*(-j + n)*Int((c*x)**(j + m)*(a*x**j + b*x**n)**(p + S(-1)), x)/(m + n*p + S(1)) + (c*x)**(m + S(1))*(a*x**j + b*x**n)**p/(c*(m + n*p + S(1))))
rubi.add(rule237)
pattern238 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p: Not(IntegerQ(p))), CustomConstraint(lambda n, m, p, j: RationalQ(j, m, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda n, p, j, m: Greater(j*p + m + S(1), -j + n)))
rule238 = ReplacementRule(pattern238, lambda p, j, n, a, x, m, b, c : -c**n*(j*p + j + m - n + S(1))*Int((c*x)**(m - n)*(a*x**j + b*x**n)**(p + S(1)), x)/(b*(-j + n)*(p + S(1))) + c**(n + S(-1))*(c*x)**(m - n + S(1))*(a*x**j + b*x**n)**(p + S(1))/(b*(-j + n)*(p + S(1))))
rubi.add(rule238)
pattern239 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p: Not(IntegerQ(p))), CustomConstraint(lambda n, p, j: RationalQ(j, n, p)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda p: Less(p, S(-1))))
rule239 = ReplacementRule(pattern239, lambda p, j, n, a, x, m, b, c : c**j*(-j + m + n*p + n + S(1))*Int((c*x)**(-j + m)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))) - c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))))
rubi.add(rule239)
pattern240 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: RationalQ(j, n)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda n, p, j, m: PositiveQ(j*p + j + m - n + S(1))), CustomConstraint(lambda n, p, m: NonzeroQ(m + n*p + S(1))))
rule240 = ReplacementRule(pattern240, lambda p, j, n, a, x, m, b, c : -a*c**(-j + n)*(j*p + j + m - n + S(1))*Int((c*x)**(j + m - n)*(a*x**j + b*x**n)**p, x)/(b*(m + n*p + S(1))) + c**(n + S(-1))*(c*x)**(m - n + S(1))*(a*x**j + b*x**n)**(p + S(1))/(b*(m + n*p + S(1))))
rubi.add(rule240)
pattern241 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: RationalQ(j, n)), CustomConstraint(lambda n, j: Less(S(0), j, n)), CustomConstraint(lambda n, c, j: PositiveQ(c) | IntegersQ(j, n)), CustomConstraint(lambda p, j, m: NegativeQ(j*p + m + S(1))))
rule241 = ReplacementRule(pattern241, lambda p, j, n, a, x, m, b, c : -b*c**(j - n)*(-j + m + n*p + n + S(1))*Int((c*x)**(-j + m + n)*(a*x**j + b*x**n)**p, x)/(a*(j*p + m + S(1))) + c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(j*p + m + S(1))))
rubi.add(rule241)
pattern242 = Pattern(Integral(x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule242 = ReplacementRule(pattern242, lambda p, n, a, m, x, j, b : Subst(Int((a*x**(j/(m + S(1))) + b*x**(n/(m + S(1))))**p, x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule242)
pattern243 = Pattern(Integral((c_*x_)**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule243 = ReplacementRule(pattern243, lambda p, n, a, m, x, j, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule243)
pattern244 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: PositiveIntegerQ(p + S(1)/2)), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda p, j, m: ZeroQ(j*p + m + S(1))), CustomConstraint(lambda c, j: IntegerQ(j) | PositiveQ(c)))
rule244 = ReplacementRule(pattern244, lambda p, j, n, a, x, m, b, c : a*c**(-j)*Int((c*x)**(j + m)*(a*x**j + b*x**n)**(p + S(-1)), x) + (c*x)**(m + S(1))*(a*x**j + b*x**n)**p/(c*p*(-j + n)))
rubi.add(rule244)
pattern245 = Pattern(Integral(x_**WC('m', S(1))/sqrt(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', S(1))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda j, m: ZeroQ(-j/S(2) + m + S(1))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)))
rule245 = ReplacementRule(pattern245, lambda n, a, m, x, j, b : -S(2)*Subst(Int(1/(-a*x**S(2) + S(1)), x), x, x**(j/S(2))/sqrt(a*x**j + b*x**n))/(-j + n))
rubi.add(rule245)
pattern246 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1)/2)), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda p, j, m: ZeroQ(j*p + m + S(1))), CustomConstraint(lambda c, j: IntegerQ(j) | PositiveQ(c)))
rule246 = ReplacementRule(pattern246, lambda p, j, n, a, x, m, b, c : c**j*(-j + m + n*p + n + S(1))*Int((c*x)**(-j + m)*(a*x**j + b*x**n)**(p + S(1)), x)/(a*(-j + n)*(p + S(1))) - c**(j + S(-1))*(c*x)**(-j + m + S(1))*(a*x**j + b*x**n)**(p + S(1))/(a*(-j + n)*(p + S(1))))
rubi.add(rule246)
pattern247 = Pattern(Integral((c_*x_)**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: IntegerQ(p + S(1)/2)), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda p, j, m: ZeroQ(j*p + m + S(1))))
rule247 = ReplacementRule(pattern247, lambda p, n, a, m, x, j, b, c : c**IntPart(m)*x**(-FracPart(m))*(c*x)**FracPart(m)*Int(x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule247)
pattern248 = Pattern(Integral((x_*WC('c', S(1)))**WC('m', S(1))*(x_**WC('j', S(1))*WC('a', S(1)) + x_**WC('n', S(1))*WC('b', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: PosQ(-j + n)))
rule248 = ReplacementRule(pattern248, lambda p, j, n, a, x, m, b, c : c**IntPart(m)*x**(-j*FracPart(p) - FracPart(m))*(c*x)**FracPart(m)*(a + b*x**(-j + n))**(-FracPart(p))*(a*x**j + b*x**n)**FracPart(p)*Int(x**(j*p + m)*(a + b*x**(-j + n))**p, x))
rubi.add(rule248)
pattern249 = Pattern(Integral(u_**WC('m', S(1))*(v_**WC('j', S(1))*WC('a', S(1)) + v_**WC('n', S(1))*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 j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda v, x, u: LinearPairQ(u, v, x)))
rule249 = ReplacementRule(pattern249, lambda p, n, a, m, v, x, u, j, b : u**m*v**(-m)*Subst(Int(x**m*(a*x**j + b*x**n)**p, x), x, v)/Coefficient(v, x, S(1)))
rubi.add(rule249)
pattern250 = Pattern(Integral(x_**WC('m', S(1))*(c_ + x_**n_*WC('d', S(1)))**WC('q', S(1))*(x_**j_*WC('a', S(1)) + x_**WC('k', S(1))*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda k, j: NonzeroQ(-j + k)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, k: IntegerQ(k/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), CustomConstraint(lambda n: NonzeroQ(n**S(2) + S(-1))))
rule250 = ReplacementRule(pattern250, lambda p, j, n, a, k, q, x, m, b, d, c : Subst(Int(x**(S(-1) + (m + S(1))/n)*(c + d*x)**q*(a*x**(j/n) + b*x**(k/n))**p, x), x, x**n)/n)
rubi.add(rule250)
pattern251 = Pattern(Integral((e_*x_)**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('q', S(1))*(x_**j_*WC('a', S(1)) + x_**WC('k', S(1))*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda k, j: NonzeroQ(-j + k)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, k: IntegerQ(k/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), CustomConstraint(lambda n: NonzeroQ(n**S(2) + S(-1))))
rule251 = ReplacementRule(pattern251, lambda e, p, j, n, k, a, q, x, m, b, d, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(c + d*x**n)**q*(a*x**j + b*x**k)**p, x))
rubi.add(rule251)
pattern252 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))*(x_**WC('jn', S(1))*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, 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, jn, j: ZeroQ(jn - j - n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda p, n, a, m, j, b, d, c: ZeroQ(a*d*(j*p + m + S(1)) - b*c*(m + n + p*(j + n) + S(1)))), CustomConstraint(lambda e, j: IntegersQ(j) | PositiveQ(e)), CustomConstraint(lambda p, j, m: NonzeroQ(j*p + m + S(1))))
rule252 = ReplacementRule(pattern252, lambda p, n, a, m, jn, x, j, b, d, e, c : c*e**(j + S(-1))*(e*x)**(-j + m + S(1))*(a*x**j + b*x**(j + n))**(p + S(1))/(a*(j*p + m + S(1))))
rubi.add(rule252)
pattern253 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))*(x_**WC('jn', S(1))*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, jn, j: ZeroQ(jn - j - n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda m, p, j: RationalQ(j, m, p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda m, j: Inequality(S(0), Less, j, LessEqual, m)), CustomConstraint(lambda e, j: IntegerQ(j) | PositiveQ(e)))
rule253 = ReplacementRule(pattern253, lambda p, n, a, m, jn, x, j, b, d, e, c : -e**j*(a*d*(j*p + m + S(1)) - b*c*(m + n + p*(j + n) + S(1)))*Int((e*x)**(-j + m)*(a*x**j + b*x**(j + n))**(p + S(1)), x)/(a*b*n*(p + S(1))) - e**(j + S(-1))*(e*x)**(-j + m + S(1))*(-a*d + b*c)*(a*x**j + b*x**(j + n))**(p + S(1))/(a*b*n*(p + S(1))))
rubi.add(rule253)
pattern254 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))*(x_**WC('jn', S(1))*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, jn, j: ZeroQ(jn - j - n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda n, m: RationalQ(m, n)), CustomConstraint(lambda n: Greater(n, S(0))), CustomConstraint(lambda n, p, j, m: Less(j*p + m, S(-1)) | (Less(p, S(0)) & IntegersQ(m + S(-1)/2, p + S(-1)/2) & Less(m, -n*p + S(-1)))), CustomConstraint(lambda n, e, j: PositiveQ(e) | IntegersQ(j, n)), CustomConstraint(lambda p, j, m: NonzeroQ(j*p + m + S(1))), CustomConstraint(lambda n, p, j, m: NonzeroQ(j*p + m - n + S(1))))
rule254 = ReplacementRule(pattern254, lambda p, n, a, m, jn, x, j, b, d, e, c : c*e**(j + S(-1))*(e*x)**(-j + m + S(1))*(a*x**j + b*x**(j + n))**(p + S(1))/(a*(j*p + m + S(1))) + e**(-n)*(a*d*(j*p + m + S(1)) - b*c*(m + n + p*(j + n) + S(1)))*Int((e*x)**(m + n)*(a*x**j + b*x**(j + n))**p, x)/(a*(j*p + m + S(1))))
rubi.add(rule254)
pattern255 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))*(x_**WC('jn', S(1))*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, 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, jn, j: ZeroQ(jn - j - n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda n, p, j, m: NonzeroQ(m + n + p*(j + n) + S(1))), CustomConstraint(lambda e, j: IntegerQ(j) | PositiveQ(e)))
rule255 = ReplacementRule(pattern255, lambda p, n, a, m, jn, x, j, b, d, e, c : d*e**(j + S(-1))*(e*x)**(-j + m + S(1))*(a*x**j + b*x**(j + n))**(p + S(1))/(b*(m + n + p*(j + n) + S(1))) - (a*d*(j*p + m + S(1)) - b*c*(m + n + p*(j + n) + S(1)))*Int((e*x)**m*(a*x**j + b*x**(j + n))**p, x)/(b*(m + n + p*(j + n) + S(1))))
rubi.add(rule255)
pattern256 = Pattern(Integral(x_**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('q', S(1))*(x_**j_*WC('a', S(1)) + x_**WC('k', S(1))*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda k, j: NonzeroQ(-j + k)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, k: IntegerQ(k/n)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule256 = ReplacementRule(pattern256, lambda p, j, n, k, a, q, x, m, b, d, c : Subst(Int((c + d*x**(n/(m + S(1))))**q*(a*x**(j/(m + S(1))) + b*x**(k/(m + S(1))))**p, x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule256)
pattern257 = Pattern(Integral((e_*x_)**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('q', S(1))*(x_**j_*WC('a', S(1)) + x_**WC('k', S(1))*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda k, j: NonzeroQ(-j + k)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, k: IntegerQ(k/n)), CustomConstraint(lambda m: NonzeroQ(m + S(1))), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule257 = ReplacementRule(pattern257, lambda e, p, j, n, k, a, q, x, m, b, d, c : e**IntPart(m)*x**(-FracPart(m))*(e*x)**FracPart(m)*Int(x**m*(c + d*x**n)**q*(a*x**j + b*x**k)**p, x))
rubi.add(rule257)
pattern258 = Pattern(Integral((x_*WC('e', S(1)))**WC('m', S(1))*(c_ + x_**WC('n', S(1))*WC('d', S(1)))**WC('q', S(1))*(x_**WC('jn', S(1))*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda q, x: FreeQ(q, x)), CustomConstraint(lambda n, jn, j: ZeroQ(jn - j - n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda n, j: Not(ZeroQ(j + S(-1)) & ZeroQ(n + S(-1)))))
rule258 = ReplacementRule(pattern258, lambda p, n, a, q, m, jn, x, j, b, d, e, c : e**IntPart(m)*x**(-j*FracPart(p) - FracPart(m))*(e*x)**FracPart(m)*(a + b*x**n)**(-FracPart(p))*(a*x**j + b*x**(j + n))**FracPart(p)*Int(x**(j*p + m)*(a + b*x**n)**p*(c + d*x**n)**q, x))
rubi.add(rule258)
pattern259 = Pattern(Integral(Pq_*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: RationalQ(j, n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n: Less(S(-1), n, S(1))), )
def With259(p, n, Pq, a, x, j, b):
d = Denominator(n)
return d*Subst(Int(x**(d + S(-1))*(a*x**(d*j) + b*x**(d*n))**p*ReplaceAll(SubstFor(x**n, Pq, x), Rule(x, x**(d*n))), x), x, x**(1/d))
rule259 = ReplacementRule(pattern259, lambda p, n, Pq, a, x, j, b : With259(p, n, Pq, a, x, j, b))
rubi.add(rule259)
pattern260 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule260 = ReplacementRule(pattern260, lambda p, n, Pq, a, m, x, j, b : Subst(Int(x**(S(-1) + (m + S(1))/n)*(a*x**(j/n) + b*x)**p*SubstFor(x**n, Pq, x), x), x, x**n)/n)
rubi.add(rule260)
pattern261 = Pattern(Integral(Pq_*(c_*x_)**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m**S(2), S(1))))
rule261 = ReplacementRule(pattern261, lambda p, n, Pq, a, m, x, j, b, c : c**(Quotient(m, sign(m))*sign(m))*x**(-Mod(m, sign(m)))*(c*x)**Mod(m, sign(m))*Int(Pq*x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule261)
pattern262 = Pattern(Integral(Pq_*(c_*x_)**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule262 = ReplacementRule(pattern262, lambda p, n, Pq, a, m, x, j, b, c : x**(-m)*(c*x)**m*Int(Pq*x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule262)
pattern263 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**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 n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: PositiveIntegerQ(j, n, j/n)), CustomConstraint(lambda m: IntegerQ(m)), CustomConstraint(lambda b, n, Pq, m, j, a, x, p, g: Unequal(g, S(1))))
def With263(p, n, Pq, a, m, x, j, b):
g = GCD(m + S(1), n)
return Subst(Int(x**(S(-1) + (m + S(1))/g)*(a*x**(j/g) + b*x**(n/g))**p*ReplaceAll(Pq, Rule(x, x**(1/g))), x), x, x**g)/g
rule263 = ReplacementRule(pattern263, lambda p, n, Pq, a, m, x, j, b : With263(p, n, Pq, a, m, x, j, b))
rubi.add(rule263)
pattern264 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 p, x: FreeQ(p, x)), CustomConstraint(lambda Pq, x: PolyQ(Pq, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: PositiveIntegerQ(j, n)), CustomConstraint(lambda n, j: Less(j, n)), CustomConstraint(lambda Pqq, b, n, Pq, m, j, a, x, p, q, c: Greater(q, n + S(-1)) & Unequal(m + n*p + q + S(1), S(0)) & (IntegerQ(S(2)*p) | IntegerQ(p + (q + S(1))/(S(2)*n)))))
def With264(p, j, n, Pq, a, x, m, b, c):
q = Expon(Pq, x)
return With(List(Set(Pqq, Coeff(Pq, x, q))), Pqq*c**(n - q + S(-1))*(c*x)**(m - n + q + S(1))*(a*x**j + b*x**n)**(p + S(1))/(b*(m + n*p + q + S(1))) + Int((c*x)**m*(a*x**j + b*x**n)**p*ExpandToSum(Pq - Pqq*a*x**(-n + q)*(m - n + q + S(1))/(b*(m + n*p + q + S(1))) - Pqq*x**q, x), x))
rule264 = ReplacementRule(pattern264, lambda p, j, n, Pq, a, x, m, b, c : With264(p, j, n, Pq, a, x, m, b, c))
rubi.add(rule264)
pattern265 = Pattern(Integral(Pq_*x_**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule265 = ReplacementRule(pattern265, lambda p, n, Pq, a, m, x, j, b : Subst(Int((a*x**(j/(m + S(1))) + b*x**(n/(m + S(1))))**p*ReplaceAll(SubstFor(x**n, Pq, x), Rule(x, x**(n/(m + S(1))))), x), x, x**(m + S(1)))/(m + S(1)))
rubi.add(rule265)
pattern266 = Pattern(Integral(Pq_*(c_*x_)**m_*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))), CustomConstraint(lambda m: RationalQ(m)), CustomConstraint(lambda m: Greater(m**S(2), S(1))))
rule266 = ReplacementRule(pattern266, lambda p, n, Pq, a, m, x, j, b, c : c**(Quotient(m, sign(m))*sign(m))*x**(-Mod(m, sign(m)))*(c*x)**Mod(m, sign(m))*Int(Pq*x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule266)
pattern267 = Pattern(Integral(Pq_*(c_*x_)**m_*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, 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, Pq, x: PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)), CustomConstraint(lambda n, j: IntegerQ(j/n)), CustomConstraint(lambda n, m: IntegerQ(n/(m + S(1)))), CustomConstraint(lambda n: Not(IntegerQ(n))))
rule267 = ReplacementRule(pattern267, lambda p, n, Pq, a, m, x, j, b, c : x**(-m)*(c*x)**m*Int(Pq*x**m*(a*x**j + b*x**n)**p, x))
rubi.add(rule267)
pattern268 = Pattern(Integral(Pq_*(x_*WC('c', S(1)))**WC('m', S(1))*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', 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 j, x: FreeQ(j, 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, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)))
rule268 = ReplacementRule(pattern268, lambda p, j, n, Pq, a, x, m, b, c : Int(ExpandIntegrand(Pq*(c*x)**m*(a*x**j + b*x**n)**p, x), x))
rubi.add(rule268)
pattern269 = Pattern(Integral(Pq_*(x_**n_*WC('b', S(1)) + x_**WC('j', S(1))*WC('a', S(1)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda n, Pq, x: PolyQ(Pq, x) | PolyQ(Pq, x**n)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda n, j: NonzeroQ(-j + n)))
rule269 = ReplacementRule(pattern269, lambda p, n, Pq, a, x, j, b : Int(ExpandIntegrand(Pq*(a*x**j + b*x**n)**p, x), x))
rubi.add(rule269)
pattern270 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda b, a, d: ZeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule270 = ReplacementRule(pattern270, lambda p, a, x, b, d : S(3)**(-S(3)*p)*a**(-S(2)*p)*Int((S(3)*a - b*x)**p*(S(3)*a + S(2)*b*x)**(S(2)*p), x))
rubi.add(rule270)
pattern271 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule271 = ReplacementRule(pattern271, lambda p, a, x, b, d : Int(ExpandToSum((a + b*x + d*x**S(3))**p, x), x))
rubi.add(rule271)
pattern272 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), CustomConstraint(lambda x, p, u: ProductQ(NonfreeFactors(u, x))))
def With272(p, a, x, b, d):
u = Factor(a + b*x + d*x**S(3))
return FreeFactors(u, x)**p*Int(DistributeDegree(NonfreeFactors(u, x), p), x)
rule272 = ReplacementRule(pattern272, lambda p, a, x, b, d : With272(p, a, x, b, d))
rubi.add(rule272)
pattern273 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), )
def With273(p, a, x, b, d):
r = Rt(-S(27)*a*d**S(2) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*b**S(3)*d), S(3))
return S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p, x)
rule273 = ReplacementRule(pattern273, lambda p, a, x, b, d : With273(p, a, x, b, d))
rubi.add(rule273)
pattern274 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: ZeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule274 = ReplacementRule(pattern274, lambda p, a, x, b, d : (S(3)*a - b*x)**(-p)*(S(3)*a + S(2)*b*x)**(-S(2)*p)*(a + b*x + d*x**S(3))**p*Int((S(3)*a - b*x)**p*(S(3)*a + S(2)*b*x)**(S(2)*p), x))
rubi.add(rule274)
pattern275 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), CustomConstraint(lambda d, a, b, x, p, u: ProductQ(u)))
def With275(p, a, x, b, d):
u = NonfreeFactors(Factor(a + b*x + d*x**S(3)), x)
return (a + b*x + d*x**S(3))**p*Int(DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule275 = ReplacementRule(pattern275, lambda p, a, x, b, d : With275(p, a, x, b, d))
rubi.add(rule275)
pattern276 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), )
def With276(p, a, x, b, d):
r = Rt(-S(27)*a*d**S(2) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*b**S(3)*d), S(3))
return (-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(a + b*x + d*x**S(3))**p*Int((-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p, x)
rule276 = ReplacementRule(pattern276, lambda p, a, x, b, d : With276(p, a, x, b, d))
rubi.add(rule276)
pattern277 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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: IntegerQ(p)), CustomConstraint(lambda b, a, d: ZeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule277 = ReplacementRule(pattern277, lambda p, a, f, x, m, b, d, e : S(3)**(-S(3)*p)*a**(-S(2)*p)*Int((S(3)*a - b*x)**p*(S(3)*a + S(2)*b*x)**(S(2)*p)*(e + f*x)**m, x))
rubi.add(rule277)
pattern278 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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: PositiveIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule278 = ReplacementRule(pattern278, lambda p, a, f, x, m, b, d, e : Int(ExpandIntegrand((e + f*x)**m*(a + b*x + d*x**S(3))**p, x), x))
rubi.add(rule278)
pattern279 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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: NegativeIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), CustomConstraint(lambda f, e, x, p, u, m: ProductQ(NonfreeFactors(u, x))))
def With279(p, a, f, x, m, b, d, e):
u = Factor(a + b*x + d*x**S(3))
return FreeFactors(u, x)**p*Int((e + f*x)**m*DistributeDegree(NonfreeFactors(u, x), p), x)
rule279 = ReplacementRule(pattern279, lambda p, a, f, x, m, b, d, e : With279(p, a, f, x, m, b, d, e))
rubi.add(rule279)
pattern280 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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: NegativeIntegerQ(p)), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), )
def With280(p, a, f, x, m, b, d, e):
r = Rt(-S(27)*a*d**S(2) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*b**S(3)*d), S(3))
return S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((e + f*x)**m*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p, x)
rule280 = ReplacementRule(pattern280, lambda p, a, f, x, m, b, d, e : With280(p, a, f, x, m, b, d, e))
rubi.add(rule280)
pattern281 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: ZeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))))
rule281 = ReplacementRule(pattern281, lambda p, a, f, x, m, b, d, e : (S(3)*a - b*x)**(-p)*(S(3)*a + S(2)*b*x)**(-S(2)*p)*(a + b*x + d*x**S(3))**p*Int((S(3)*a - b*x)**p*(S(3)*a + S(2)*b*x)**(S(2)*p)*(e + f*x)**m, x))
rubi.add(rule281)
pattern282 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), CustomConstraint(lambda f, d, b, m, e, a, x, p, u: ProductQ(u)))
def With282(p, a, f, x, m, b, d, e):
u = NonfreeFactors(Factor(a + b*x + d*x**S(3)), x)
return (a + b*x + d*x**S(3))**p*Int((e + f*x)**m*DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule282 = ReplacementRule(pattern282, lambda p, a, f, x, m, b, d, e : With282(p, a, f, x, m, b, d, e))
rubi.add(rule282)
pattern283 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_*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 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, a, d: NonzeroQ(S(27)*a**S(2)*d + S(4)*b**S(3))), )
def With283(p, a, f, x, m, b, d, e):
r = Rt(-S(27)*a*d**S(2) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*b**S(3)*d), S(3))
return (-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(a + b*x + d*x**S(3))**p*Int((e + f*x)**m*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(-S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) - S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(S(3)*d*x + S(2)**(S(1)/3)*(S(6)*b*d - S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p, x)
rule283 = ReplacementRule(pattern283, lambda p, a, f, x, m, b, d, e : With283(p, a, f, x, m, b, d, e))
rubi.add(rule283)
pattern284 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda a, d, c: ZeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule284 = ReplacementRule(pattern284, lambda p, a, x, d, c : -S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((c - S(3)*d*x)**p*(S(2)*c + S(3)*d*x)**(S(2)*p), x))
rubi.add(rule284)
pattern285 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule285 = ReplacementRule(pattern285, lambda p, a, x, d, c : Int(ExpandToSum((a + c*x**S(2) + d*x**S(3))**p, x), x))
rubi.add(rule285)
pattern286 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), CustomConstraint(lambda x, p, u: ProductQ(NonfreeFactors(u, x))))
def With286(p, a, x, d, c):
u = Factor(a + c*x**S(2) + d*x**S(3))
return FreeFactors(u, x)**p*Int(DistributeDegree(NonfreeFactors(u, x), p), x)
rule286 = ReplacementRule(pattern286, lambda p, a, x, d, c : With286(p, a, x, d, c))
rubi.add(rule286)
pattern287 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), )
def With287(p, a, x, d, c):
r = Rt(-S(27)*a*d**S(2) - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*a*c**S(3)), S(3))
return S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule287 = ReplacementRule(pattern287, lambda p, a, x, d, c : With287(p, a, x, d, c))
rubi.add(rule287)
pattern288 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: ZeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule288 = ReplacementRule(pattern288, lambda p, a, x, d, c : (c - S(3)*d*x)**(-p)*(S(2)*c + S(3)*d*x)**(-S(2)*p)*(a + c*x**S(2) + d*x**S(3))**p*Int((c - S(3)*d*x)**p*(S(2)*c + S(3)*d*x)**(S(2)*p), x))
rubi.add(rule288)
pattern289 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), CustomConstraint(lambda d, a, x, p, c, u: ProductQ(u)))
def With289(p, a, x, d, c):
u = NonfreeFactors(Factor(a + c*x**S(2) + d*x**S(3)), x)
return (a + c*x**S(2) + d*x**S(3))**p*Int(DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule289 = ReplacementRule(pattern289, lambda p, a, x, d, c : With289(p, a, x, d, c))
rubi.add(rule289)
pattern290 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), )
def With290(p, a, x, d, c):
r = Rt(-S(27)*a*d**S(2) - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*a*c**S(3)), S(3))
return (a + c*x**S(2) + d*x**S(3))**p*(c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*Int((c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule290 = ReplacementRule(pattern290, lambda p, a, x, d, c : With290(p, a, x, d, c))
rubi.add(rule290)
pattern291 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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: IntegerQ(p)), CustomConstraint(lambda a, d, c: ZeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule291 = ReplacementRule(pattern291, lambda p, a, f, x, m, d, e, c : -S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((c - S(3)*d*x)**p*(S(2)*c + S(3)*d*x)**(S(2)*p)*(e + f*x)**m, x))
rubi.add(rule291)
pattern292 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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: PositiveIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule292 = ReplacementRule(pattern292, lambda p, a, f, x, m, d, e, c : Int(ExpandIntegrand((e + f*x)**m*(a + c*x**S(2) + d*x**S(3))**p, x), x))
rubi.add(rule292)
pattern293 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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: NegativeIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), CustomConstraint(lambda f, e, x, p, u, m: ProductQ(NonfreeFactors(u, x))))
def With293(p, a, f, x, m, d, e, c):
u = Factor(a + c*x**S(2) + d*x**S(3))
return FreeFactors(u, x)**p*Int((e + f*x)**m*DistributeDegree(NonfreeFactors(u, x), p), x)
rule293 = ReplacementRule(pattern293, lambda p, a, f, x, m, d, e, c : With293(p, a, f, x, m, d, e, c))
rubi.add(rule293)
pattern294 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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: NegativeIntegerQ(p)), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), )
def With294(p, a, f, x, m, d, e, c):
r = Rt(-S(27)*a*d**S(2) - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*a*c**S(3)), S(3))
return S(3)**(-S(3)*p)*d**(-S(2)*p)*Int((e + f*x)**m*(c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule294 = ReplacementRule(pattern294, lambda p, a, f, x, m, d, e, c : With294(p, a, f, x, m, d, e, c))
rubi.add(rule294)
pattern295 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: ZeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))))
rule295 = ReplacementRule(pattern295, lambda p, a, f, x, m, d, e, c : (c - S(3)*d*x)**(-p)*(S(2)*c + S(3)*d*x)**(-S(2)*p)*(a + c*x**S(2) + d*x**S(3))**p*Int((c - S(3)*d*x)**p*(S(2)*c + S(3)*d*x)**(S(2)*p)*(e + f*x)**m, x))
rubi.add(rule295)
pattern296 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), CustomConstraint(lambda f, d, m, e, a, x, p, c, u: ProductQ(u)))
def With296(p, a, f, x, m, d, e, c):
u = NonfreeFactors(Factor(a + c*x**S(2) + d*x**S(3)), x)
return (a + c*x**S(2) + d*x**S(3))**p*Int((e + f*x)**m*DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule296 = ReplacementRule(pattern296, lambda p, a, f, x, m, d, e, c : With296(p, a, f, x, m, d, e, c))
rubi.add(rule296)
pattern297 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + WC('a', S(0)))**p_, x_), CustomConstraint(lambda a, x: FreeQ(a, 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, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda a, d, c: NonzeroQ(S(27)*a*d**S(2) + S(4)*c**S(3))), )
def With297(p, a, f, x, m, d, e, c):
r = Rt(-S(27)*a*d**S(2) - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) + S(4)*a*c**S(3)), S(3))
return (a + c*x**S(2) + d*x**S(3))**p*(c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*Int((e + f*x)**m*(c + S(3)*d*x - S(2)**(S(1)/3)*(S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)**(S(1)/3)*r**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule297 = ReplacementRule(pattern297, lambda p, a, f, x, m, d, e, c : With297(p, a, f, x, m, d, e, c))
rubi.add(rule297)
pattern298 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: IntegerQ(p)), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))))
rule298 = ReplacementRule(pattern298, lambda p, a, x, b, d, c : S(3)**(-p)*b**(-p)*c**(-p)*Int((b + c*x)**(S(3)*p), x))
rubi.add(rule298)
pattern299 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: IntegerQ(p)), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))))
rule299 = ReplacementRule(pattern299, lambda p, a, x, b, d, c : S(3)**(-p)*b**(-p)*c**(-p)*Subst(Int((S(3)*a*b*c - b**S(3) + c**S(3)*x**S(3))**p, x), x, c/(S(3)*d) + x))
rubi.add(rule299)
pattern300 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: IntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))), )
def With300(p, a, x, b, d, c):
r = Rt(-S(3)*b*c*d + c**S(3), S(3))
return S(3)**(-p)*b**(-p)*c**(-p)*Int((b + x*(c - r))**p*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p, x)
rule300 = ReplacementRule(pattern300, lambda p, a, x, b, d, c : With300(p, a, x, b, d, c))
rubi.add(rule300)
pattern301 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: PositiveIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))))
rule301 = ReplacementRule(pattern301, lambda p, a, x, b, d, c : Int(ExpandToSum((a + b*x + c*x**S(2) + d*x**S(3))**p, x), x))
rubi.add(rule301)
pattern302 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: NegativeIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), CustomConstraint(lambda x, p, u: ProductQ(NonfreeFactors(u, x))))
def With302(p, a, x, b, d, c):
u = Factor(a + b*x + c*x**S(2) + d*x**S(3))
return FreeFactors(u, x)**p*Int(DistributeDegree(NonfreeFactors(u, x), p), x)
rule302 = ReplacementRule(pattern302, lambda p, a, x, b, d, c : With302(p, a, x, b, d, c))
rubi.add(rule302)
pattern303 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p: NegativeIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))))
rule303 = ReplacementRule(pattern303, lambda p, a, x, b, d, c : S(3)**(-S(3)*p)*d**(-S(2)*p)*Subst(Int((S(27)*a*d**S(2) - S(9)*b*c*d + S(2)*c**S(3) + S(27)*d**S(3)*x**S(3) - S(9)*d*x*(-S(3)*b*d + c**S(2)))**p, x), x, c/(S(3)*d) + x))
rubi.add(rule303)
pattern304 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))))
rule304 = ReplacementRule(pattern304, lambda p, a, x, b, d, c : (b + c*x)**(-S(3)*p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((b + c*x)**(S(3)*p), x))
rubi.add(rule304)
pattern305 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), )
def With305(p, a, x, b, d, c):
r = Rt(-S(3)*a*b*c + b**S(3), S(3))
return (b + c*x - r)**(-p)*(b + c*x + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2))**(-p)*(b + c*x + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((b + c*x - r)**p*(b + c*x + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2))**p*(b + c*x + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2))**p, x)
rule305 = ReplacementRule(pattern305, lambda p, a, x, b, d, c : With305(p, a, x, b, d, c))
rubi.add(rule305)
pattern306 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))), )
def With306(p, a, x, b, d, c):
r = Rt(-S(3)*b*c*d + c**S(3), S(3))
return (b + x*(c - r))**(-p)*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**(-p)*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((b + x*(c - r))**p*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p, x)
rule306 = ReplacementRule(pattern306, lambda p, a, x, b, d, c : With306(p, a, x, b, d, c))
rubi.add(rule306)
pattern307 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), CustomConstraint(lambda d, a, b, x, p, c, u: ProductQ(u)))
def With307(p, a, x, b, d, c):
u = NonfreeFactors(Factor(a + b*x + c*x**S(2) + d*x**S(3)), x)
return (a + b*x + c*x**S(2) + d*x**S(3))**p*Int(DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule307 = ReplacementRule(pattern307, lambda p, a, x, b, d, c : With307(p, a, x, b, d, c))
rubi.add(rule307)
pattern308 = Pattern(Integral((x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), )
def With308(p, a, x, b, d, c):
r = Rt(-S(27)*a*d**S(2) + S(9)*b*c*d - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) - S(18)*a*b*c*d + S(4)*a*c**S(3) + S(4)*b**S(3)*d - b**S(2)*c**S(2)), S(3))
return (c + S(3)*d*x - S(2)**(S(1)/3)*(-S(6)*b*d + S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(-ImaginaryI + sqrt(S(3))) - S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(-S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(ImaginaryI + sqrt(S(3))) - S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((c + S(3)*d*x - S(2)**(S(1)/3)*(-S(6)*b*d + S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(-ImaginaryI + sqrt(S(3))) - S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(-S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(ImaginaryI + sqrt(S(3))) - S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule308 = ReplacementRule(pattern308, lambda p, a, x, b, d, c : With308(p, a, x, b, d, c))
rubi.add(rule308)
pattern309 = Pattern(Integral(u_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: PolyQ(u, x, S(3))), CustomConstraint(lambda x, u: Not(CubicMatchQ(u, x))))
rule309 = ReplacementRule(pattern309, lambda p, x, u : Int(ExpandToSum(u, x)**p, x))
rubi.add(rule309)
pattern310 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))))
rule310 = ReplacementRule(pattern310, lambda p, a, f, x, m, b, d, e, c : S(3)**(-p)*b**(-p)*c**(-p)*Int((b + c*x)**(S(3)*p)*(e + f*x)**m, x))
rubi.add(rule310)
pattern311 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), )
def With311(p, a, f, x, m, b, d, e, c):
r = Rt(-S(3)*a*b*c + b**S(3), S(3))
return S(3)**(-p)*b**(-p)*c**(-p)*Int((e + f*x)**m*(b + c*x - r)**p*(b + c*x + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2))**p*(b + c*x + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2))**p, x)
rule311 = ReplacementRule(pattern311, lambda p, a, f, x, m, b, d, e, c : With311(p, a, f, x, m, b, d, e, c))
rubi.add(rule311)
pattern312 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: IntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))), )
def With312(p, a, f, x, m, b, d, e, c):
r = Rt(-S(3)*b*c*d + c**S(3), S(3))
return S(3)**(-p)*b**(-p)*c**(-p)*Int((b + x*(c - r))**p*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(e + f*x)**m, x)
rule312 = ReplacementRule(pattern312, lambda p, a, f, x, m, b, d, e, c : With312(p, a, f, x, m, b, d, e, c))
rubi.add(rule312)
pattern313 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: PositiveIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))))
rule313 = ReplacementRule(pattern313, lambda p, a, f, x, m, b, d, e, c : Int(ExpandIntegrand((e + f*x)**m*(a + b*x + c*x**S(2) + d*x**S(3))**p, x), x))
rubi.add(rule313)
pattern314 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), CustomConstraint(lambda f, e, x, p, u, m: ProductQ(NonfreeFactors(u, x))))
def With314(p, a, f, x, m, b, d, e, c):
u = Factor(a + b*x + c*x**S(2) + d*x**S(3))
return FreeFactors(u, x)**p*Int((e + f*x)**m*DistributeDegree(NonfreeFactors(u, x), p), x)
rule314 = ReplacementRule(pattern314, lambda p, a, f, x, m, b, d, e, c : With314(p, a, f, x, m, b, d, e, c))
rubi.add(rule314)
pattern315 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p: NegativeIntegerQ(p)), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))))
rule315 = ReplacementRule(pattern315, lambda p, a, f, x, m, b, d, e, c : S(3)**(-S(3)*p)*d**(-S(2)*p)*Subst(Int((S(27)*a*d**S(2) - S(9)*b*c*d + S(2)*c**S(3) + S(27)*d**S(3)*x**S(3) - S(9)*d*x*(-S(3)*b*d + c**S(2)))**p, x), x, c/(S(3)*d) + x))
rubi.add(rule315)
pattern316 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))))
rule316 = ReplacementRule(pattern316, lambda p, a, f, x, m, b, d, e, c : (b + c*x)**(-S(3)*p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((b + c*x)**(S(3)*p)*(e + f*x)**m, x))
rubi.add(rule316)
pattern317 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: ZeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), )
def With317(p, a, f, x, m, b, d, e, c):
r = Rt(-S(3)*a*b*c + b**S(3), S(3))
return (b + c*x - r)**(-p)*(b + c*x + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2))**(-p)*(b + c*x + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((e + f*x)**m*(b + c*x - r)**p*(b + c*x + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2))**p*(b + c*x + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2))**p, x)
rule317 = ReplacementRule(pattern317, lambda p, a, f, x, m, b, d, e, c : With317(p, a, f, x, m, b, d, e, c))
rubi.add(rule317)
pattern318 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: ZeroQ(-S(3)*a*c + b**S(2))), )
def With318(p, a, f, x, m, b, d, e, c):
r = Rt(-S(3)*b*c*d + c**S(3), S(3))
return (b + x*(c - r))**(-p)*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**(-p)*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((b + x*(c - r))**p*(b + x*(c + r*(-sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(b + x*(c + r*(sqrt(S(3))*ImaginaryI + S(1))/S(2)))**p*(e + f*x)**m, x)
rule318 = ReplacementRule(pattern318, lambda p, a, f, x, m, b, d, e, c : With318(p, a, f, x, m, b, d, e, c))
rubi.add(rule318)
pattern319 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), CustomConstraint(lambda f, d, b, m, e, a, x, p, c, u: ProductQ(u)))
def With319(p, a, f, x, m, b, d, e, c):
u = NonfreeFactors(Factor(a + b*x + c*x**S(2) + d*x**S(3)), x)
return (a + b*x + c*x**S(2) + d*x**S(3))**p*Int((e + f*x)**m*DistributeDegree(u, p), x)/DistributeDegree(u, p)
rule319 = ReplacementRule(pattern319, lambda p, a, f, x, m, b, d, e, c : With319(p, a, f, x, m, b, d, e, c))
rubi.add(rule319)
pattern320 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))**WC('m', S(1))*(x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 f, x: FreeQ(f, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda p: Not(IntegerQ(p))), CustomConstraint(lambda b, d, c: NonzeroQ(-S(3)*b*d + c**S(2))), CustomConstraint(lambda b, a, c: NonzeroQ(-S(3)*a*c + b**S(2))), )
def With320(p, a, f, x, m, b, d, e, c):
r = Rt(-S(27)*a*d**S(2) + S(9)*b*c*d - S(2)*c**S(3) + S(3)*sqrt(S(3))*d*sqrt(S(27)*a**S(2)*d**S(2) - S(18)*a*b*c*d + S(4)*a*c**S(3) + S(4)*b**S(3)*d - b**S(2)*c**S(2)), S(3))
return (c + S(3)*d*x - S(2)**(S(1)/3)*(-S(6)*b*d + S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(-ImaginaryI + sqrt(S(3))) - S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(c + S(3)*d*x + S(2)**(S(1)/3)*(-S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(ImaginaryI + sqrt(S(3))) - S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**(-p)*(a + b*x + c*x**S(2) + d*x**S(3))**p*Int((e + f*x)**m*(c + S(3)*d*x - S(2)**(S(1)/3)*(-S(6)*b*d + S(2)*c**S(2) + S(2)**(S(1)/3)*r**S(2))/(S(2)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(-ImaginaryI + sqrt(S(3))) - S(6)*b*d*(-sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(-sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p*(c + S(3)*d*x + S(2)**(S(1)/3)*(-S(2)**(S(1)/3)*ImaginaryI*r**S(2)*(ImaginaryI + sqrt(S(3))) - S(6)*b*d*(sqrt(S(3))*ImaginaryI + S(1)) + S(2)*c**S(2)*(sqrt(S(3))*ImaginaryI + S(1)))/(S(4)*r))**p, x)
rule320 = ReplacementRule(pattern320, lambda p, a, f, x, m, b, d, e, c : With320(p, a, f, x, m, b, d, e, c))
rubi.add(rule320)
pattern321 = Pattern(Integral(u_**WC('m', S(1))*v_**WC('p', S(1)), x_), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda v, x: PolyQ(v, x, S(3))), CustomConstraint(lambda v, x, u: Not(CubicMatchQ(v, x) & LinearMatchQ(u, x))))
rule321 = ReplacementRule(pattern321, lambda p, v, x, u, m : Int(ExpandToSum(u, x)**m*ExpandToSum(v, x)**p, x))
rubi.add(rule321)
pattern322 = Pattern(Integral((f_ + x_**S(2)*WC('g', S(1)))/((d_ + x_**S(2)*WC('d', S(1)) + x_*WC('e', S(1)))*sqrt(a_ + x_**S(4)*WC('a', S(1)) + x_**S(3)*WC('b', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 g, x: FreeQ(g, x)), CustomConstraint(lambda b, e, a, d: ZeroQ(-a*e + b*d)), CustomConstraint(lambda f, g: ZeroQ(f + g)), CustomConstraint(lambda a, c: PosQ(a**S(2)*(S(2)*a - c))))
rule322 = ReplacementRule(pattern322, lambda e, a, g, f, x, b, d, c : a*f*atan((a*b*x**S(2) + a*b + x*(S(4)*a**S(2) - S(2)*a*c + b**S(2)))/(S(2)*sqrt(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2))*Rt(a**S(2)*(S(2)*a - c), S(2))))/(d*Rt(a**S(2)*(S(2)*a - c), S(2))))
rubi.add(rule322)
pattern323 = Pattern(Integral((f_ + x_**S(2)*WC('g', S(1)))/((d_ + x_**S(2)*WC('d', S(1)) + x_*WC('e', S(1)))*sqrt(a_ + x_**S(4)*WC('a', S(1)) + x_**S(3)*WC('b', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 g, x: FreeQ(g, x)), CustomConstraint(lambda b, e, a, d: ZeroQ(-a*e + b*d)), CustomConstraint(lambda f, g: ZeroQ(f + g)), CustomConstraint(lambda a, c: NegQ(a**S(2)*(S(2)*a - c))))
rule323 = ReplacementRule(pattern323, lambda e, a, g, f, x, b, d, c : -a*f*atanh((a*b*x**S(2) + a*b + x*(S(4)*a**S(2) - S(2)*a*c + b**S(2)))/(S(2)*sqrt(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2))*Rt(-a**S(2)*(S(2)*a - c), S(2))))/(d*Rt(-a**S(2)*(S(2)*a - c), S(2))))
rubi.add(rule323)
pattern324 = Pattern(Integral((x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda b, e, d, c: ZeroQ(S(8)*b*e**S(2) - S(4)*c*d*e + d**S(3))), CustomConstraint(lambda p: UnsameQ(p, S(2))), CustomConstraint(lambda p: UnsameQ(p, S(3))))
rule324 = ReplacementRule(pattern324, lambda p, a, x, b, d, e, c : Subst(Int(SimplifyIntegrand((a - b*d/(S(8)*e) + d**S(4)/(S(256)*e**S(3)) + e*x**S(4) + x**S(2)*(c - S(3)*d**S(2)/(S(8)*e)))**p, x), x), x, d/(S(4)*e) + x))
rubi.add(rule324)
pattern325 = Pattern(Integral(v_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda v, x: PolynomialQ(v, x)), CustomConstraint(lambda v, x: Equal(Exponent(v, x), S(4))), CustomConstraint(lambda p: UnsameQ(p, S(2))), CustomConstraint(lambda p: UnsameQ(p, S(3))), CustomConstraint(lambda e, a, d, b, x, p, c: NonzeroQ(d) & ZeroQ(S(8)*b*e**S(2) - S(4)*c*d*e + d**S(3))))
def With325(v, p, x):
a = Coefficient(v, x, S(0))
b = Coefficient(v, x, S(1))
c = Coefficient(v, x, S(2))
d = Coefficient(v, x, S(3))
e = Coefficient(v, x, S(4))
return Subst(Int(SimplifyIntegrand((a - b*d/(S(8)*e) + d**S(4)/(S(256)*e**S(3)) + e*x**S(4) + x**S(2)*(c - S(3)*d**S(2)/(S(8)*e)))**p, x), x), x, d/(S(4)*e) + x)
rule325 = ReplacementRule(pattern325, lambda v, p, x : With325(v, p, x))
rubi.add(rule325)
pattern326 = Pattern(Integral(u_*(x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: PolynomialQ(u, x)), CustomConstraint(lambda b, e, d, c: ZeroQ(S(8)*b*e**S(2) - S(4)*c*d*e + d**S(3))), CustomConstraint(lambda p: Not(PositiveIntegerQ(p))))
rule326 = ReplacementRule(pattern326, lambda p, a, x, u, b, d, e, c : Subst(Int(SimplifyIntegrand((a - b*d/(S(8)*e) + d**S(4)/(S(256)*e**S(3)) + e*x**S(4) + x**S(2)*(c - S(3)*d**S(2)/(S(8)*e)))**p*ReplaceAll(u, Rule(x, -d/(S(4)*e) + x)), x), x), x, d/(S(4)*e) + x))
rubi.add(rule326)
pattern327 = Pattern(Integral(u_*v_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda x, u: PolynomialQ(u, x)), CustomConstraint(lambda v, x: PolynomialQ(v, x)), CustomConstraint(lambda v, x: Equal(Exponent(v, x), S(4))), CustomConstraint(lambda p: Not(PositiveIntegerQ(p))), CustomConstraint(lambda d, b, e, a, x, p, c, u: NonzeroQ(d) & ZeroQ(S(8)*b*e**S(2) - S(4)*c*d*e + d**S(3))))
def With327(v, p, x, u):
a = Coefficient(v, x, S(0))
b = Coefficient(v, x, S(1))
c = Coefficient(v, x, S(2))
d = Coefficient(v, x, S(3))
e = Coefficient(v, x, S(4))
return Subst(Int(SimplifyIntegrand((a - b*d/(S(8)*e) + d**S(4)/(S(256)*e**S(3)) + e*x**S(4) + x**S(2)*(c - S(3)*d**S(2)/(S(8)*e)))**p*ReplaceAll(u, Rule(x, -d/(S(4)*e) + x)), x), x), x, d/(S(4)*e) + x)
rule327 = ReplacementRule(pattern327, lambda v, p, x, u : With327(v, p, x, u))
rubi.add(rule327)
pattern328 = Pattern(Integral((a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda b, a, d, c: ZeroQ(S(8)*a**S(2)*d - S(4)*a*b*c + b**S(3))), CustomConstraint(lambda p: IntegerQ(S(2)*p)))
rule328 = ReplacementRule(pattern328, lambda p, a, x, b, d, e, c : -S(16)*a**S(2)*Subst(Int((a*(S(256)*a**S(4)*x**S(4) + S(256)*a**S(3)*e - S(64)*a**S(2)*b*d - S(32)*a**S(2)*x**S(2)*(-S(8)*a*c + S(3)*b**S(2)) + S(16)*a*b**S(2)*c - S(3)*b**S(4))/(-S(4)*a*x + b)**S(4))**p/(-S(4)*a*x + b)**S(2), x), x, 1/x + b/(S(4)*a)))
rubi.add(rule328)
pattern329 = Pattern(Integral(v_**p_, x_), CustomConstraint(lambda p, x: FreeQ(p, x)), CustomConstraint(lambda v, x: PolynomialQ(v, x)), CustomConstraint(lambda v, x: Equal(Exponent(v, x), S(4))), CustomConstraint(lambda p: IntegerQ(S(2)*p)), CustomConstraint(lambda d, e, a, b, x, p, c: NonzeroQ(a) & NonzeroQ(b) & ZeroQ(S(8)*a**S(2)*d - S(4)*a*b*c + b**S(3))))
def With329(v, p, x):
a = Coefficient(v, x, S(0))
b = Coefficient(v, x, S(1))
c = Coefficient(v, x, S(2))
d = Coefficient(v, x, S(3))
e = Coefficient(v, x, S(4))
return -S(16)*a**S(2)*Subst(Int((a*(S(256)*a**S(4)*x**S(4) + S(256)*a**S(3)*e - S(64)*a**S(2)*b*d - S(32)*a**S(2)*x**S(2)*(-S(8)*a*c + S(3)*b**S(2)) + S(16)*a*b**S(2)*c - S(3)*b**S(4))/(-S(4)*a*x + b)**S(4))**p/(-S(4)*a*x + b)**S(2), x), x, 1/x + b/(S(4)*a))
rule329 = ReplacementRule(pattern329, lambda v, p, x : With329(v, p, x))
rubi.add(rule329)
pattern330 = Pattern(Integral((x_**S(3)*WC('D', S(1)) + x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 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, d: ZeroQ(-b + d)), CustomConstraint(lambda a, e: ZeroQ(-a + e)), CustomConstraint(lambda b, a, x, c: SumQ(Factor(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2)))), )
def With330(e, a, C, x, A, B, D, d, b, c):
q = sqrt(S(8)*a**S(2) - S(4)*a*c + b**S(2))
return -Int((A*b - A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a - S(2)*C*a + D*b - D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b - q)), x)/q + Int((A*b + A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a - S(2)*C*a + D*b + D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b + q)), x)/q
rule330 = ReplacementRule(pattern330, lambda e, a, C, x, A, B, D, d, b, c : With330(e, a, C, x, A, B, D, d, b, c))
rubi.add(rule330)
pattern331 = Pattern(Integral((x_**S(3)*WC('D', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda D, x: FreeQ(D, x)), CustomConstraint(lambda b, d: ZeroQ(-b + d)), CustomConstraint(lambda a, e: ZeroQ(-a + e)), CustomConstraint(lambda b, a, x, c: SumQ(Factor(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2)))), )
def With331(e, a, x, A, B, D, d, b, c):
q = sqrt(S(8)*a**S(2) - S(4)*a*c + b**S(2))
return -Int((A*b - A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a + D*b - D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b - q)), x)/q + Int((A*b + A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a + D*b + D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b + q)), x)/q
rule331 = ReplacementRule(pattern331, lambda e, a, x, A, B, D, d, b, c : With331(e, a, x, A, B, D, d, b, c))
rubi.add(rule331)
pattern332 = Pattern(Integral(x_**WC('m', S(1))*(x_**S(3)*WC('D', S(1)) + x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 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 b, d: ZeroQ(-b + d)), CustomConstraint(lambda a, e: ZeroQ(-a + e)), CustomConstraint(lambda b, a, x, c: SumQ(Factor(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2)))), )
def With332(e, a, C, m, x, A, B, D, d, b, c):
q = sqrt(S(8)*a**S(2) - S(4)*a*c + b**S(2))
return -Int(x**m*(A*b - A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a - S(2)*C*a + D*b - D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b - q)), x)/q + Int(x**m*(A*b + A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a - S(2)*C*a + D*b + D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b + q)), x)/q
rule332 = ReplacementRule(pattern332, lambda e, a, C, m, x, A, B, D, d, b, c : With332(e, a, C, m, x, A, B, D, d, b, c))
rubi.add(rule332)
pattern333 = Pattern(Integral(x_**WC('m', S(1))*(x_**S(3)*WC('D', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda D, x: FreeQ(D, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda b, d: ZeroQ(-b + d)), CustomConstraint(lambda a, e: ZeroQ(-a + e)), CustomConstraint(lambda b, a, x, c: SumQ(Factor(a*x**S(4) + a + b*x**S(3) + b*x + c*x**S(2)))), )
def With333(e, a, m, x, A, B, D, d, b, c):
q = sqrt(S(8)*a**S(2) - S(4)*a*c + b**S(2))
return -Int(x**m*(A*b - A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a + D*b - D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b - q)), x)/q + Int(x**m*(A*b + A*q - S(2)*B*a + S(2)*D*a + x*(S(2)*A*a + D*b + D*q))/(S(2)*a*x**S(2) + S(2)*a + x*(b + q)), x)/q
rule333 = ReplacementRule(pattern333, lambda e, a, m, x, A, B, D, d, b, c : With333(e, a, m, x, A, B, D, d, b, c))
rubi.add(rule333)
pattern334 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda e, C, A, B, b, d, c: ZeroQ(B**S(2)*d - S(2)*B*(S(2)*A*e + C*c) + S(2)*C*(A*d + C*b))), CustomConstraint(lambda e, a, C, A, B, d, c: ZeroQ(-S(4)*A*B*C*d + S(4)*A*e*(S(2)*A*C + B**S(2)) - B**S(3)*d + S(2)*B**S(2)*C*c - S(8)*C**S(3)*a)), CustomConstraint(lambda e, C, A, B, d, c: PosQ(C*(C*(-S(4)*c*e + d**S(2)) + S(2)*e*(-S(4)*A*e + B*d)))), )
def With334(e, a, C, x, A, B, b, d, c):
q = Rt(C*(C*(-S(4)*c*e + d**S(2)) + S(2)*e*(-S(4)*A*e + B*d)), S(2))
return -S(2)*C**S(2)*atanh((-B*e + C*d + S(2)*C*e*x)/q)/q + S(2)*C**S(2)*atanh(C*(S(12)*A*B*e - S(4)*A*C*d - S(3)*B**S(2)*d + S(4)*B*C*c + S(8)*C**S(2)*e*x**S(3) + S(4)*C*x**S(2)*(-B*e + S(2)*C*d) + S(4)*C*x*(S(2)*A*e - B*d + S(2)*C*c))/(q*(-S(4)*A*C + B**S(2))))/q
rule334 = ReplacementRule(pattern334, lambda e, a, C, x, A, B, b, d, c : With334(e, a, C, x, A, B, b, d, c))
rubi.add(rule334)
pattern335 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, d, A, C: ZeroQ(A*d + C*b)), CustomConstraint(lambda a, e, A, C: ZeroQ(-A**S(2)*e + C**S(2)*a)), CustomConstraint(lambda e, C, A, d, c: PosQ(C*(-S(8)*A*e**S(2) + C*(-S(4)*c*e + d**S(2))))), )
def With335(e, a, C, x, A, b, d, c):
q = Rt(C*(-S(8)*A*e**S(2) + C*(-S(4)*c*e + d**S(2))), S(2))
return -S(2)*C**S(2)*atanh(C*(d + S(2)*e*x)/q)/q + S(2)*C**S(2)*atanh(C*(A*d - S(2)*C*d*x**S(2) - S(2)*C*e*x**S(3) - S(2)*x*(A*e + C*c))/(A*q))/q
rule335 = ReplacementRule(pattern335, lambda e, a, C, x, A, b, d, c : With335(e, a, C, x, A, b, d, c))
rubi.add(rule335)
pattern336 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda e, C, A, B, b, d, c: ZeroQ(B**S(2)*d - S(2)*B*(S(2)*A*e + C*c) + S(2)*C*(A*d + C*b))), CustomConstraint(lambda e, a, C, A, B, d, c: ZeroQ(-S(4)*A*B*C*d + S(4)*A*e*(S(2)*A*C + B**S(2)) - B**S(3)*d + S(2)*B**S(2)*C*c - S(8)*C**S(3)*a)), CustomConstraint(lambda e, C, A, B, d, c: NegQ(C*(C*(-S(4)*c*e + d**S(2)) + S(2)*e*(-S(4)*A*e + B*d)))), )
def With336(e, a, C, x, A, B, b, d, c):
q = Rt(-C*(C*(-S(4)*c*e + d**S(2)) + S(2)*e*(-S(4)*A*e + B*d)), S(2))
return S(2)*C**S(2)*atan((-B*e + C*d + S(2)*C*e*x)/q)/q - S(2)*C**S(2)*atan(C*(S(12)*A*B*e - S(4)*A*C*d - S(3)*B**S(2)*d + S(4)*B*C*c + S(8)*C**S(2)*e*x**S(3) + S(4)*C*x**S(2)*(-B*e + S(2)*C*d) + S(4)*C*x*(S(2)*A*e - B*d + S(2)*C*c))/(q*(-S(4)*A*C + B**S(2))))/q
rule336 = ReplacementRule(pattern336, lambda e, a, C, x, A, B, b, d, c : With336(e, a, C, x, A, B, b, d, c))
rubi.add(rule336)
pattern337 = Pattern(Integral((x_**S(2)*WC('C', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda C, x: FreeQ(C, x)), CustomConstraint(lambda b, d, A, C: ZeroQ(A*d + C*b)), CustomConstraint(lambda a, e, A, C: ZeroQ(-A**S(2)*e + C**S(2)*a)), CustomConstraint(lambda e, C, A, d, c: NegQ(C*(-S(8)*A*e**S(2) + C*(-S(4)*c*e + d**S(2))))), )
def With337(e, a, C, x, A, b, d, c):
q = Rt(-C*(-S(8)*A*e**S(2) + C*(-S(4)*c*e + d**S(2))), S(2))
return S(2)*C**S(2)*atan((C*d + S(2)*C*e*x)/q)/q + S(2)*C**S(2)*atan(C*(-A*d + S(2)*C*d*x**S(2) + S(2)*C*e*x**S(3) + S(2)*x*(A*e + C*c))/(A*q))/q
rule337 = ReplacementRule(pattern337, lambda e, a, C, x, A, b, d, c : With337(e, a, C, x, A, b, d, c))
rubi.add(rule337)
pattern338 = Pattern(Integral((x_**S(3)*WC('D', S(1)) + x_**S(2)*WC('C', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 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, C, A, B, D, d, e, c: ZeroQ(S(4)*d*(-S(2)*B*e + D*c)**S(2) - S(4)*(-S(2)*B*e + D*c)*(-S(8)*A*e**S(2) - S(4)*C*c*e + S(2)*D*b*e + S(3)*D*c*d) + S(8)*(-S(4)*C*e + S(3)*D*d)*(-A*d*e - C*b*e + D*b*d))), CustomConstraint(lambda b, a, C, A, B, D, d, e, c: ZeroQ(S(8)*a*(-S(4)*C*e + S(3)*D*d)**S(3) - S(8)*c*(-S(2)*B*e + D*c)**S(2)*(-S(4)*C*e + S(3)*D*d) + S(8)*d*(-S(4)*A*e + D*b)*(-S(2)*B*e + D*c)*(-S(4)*C*e + S(3)*D*d) + S(8)*d*(-S(2)*B*e + D*c)**S(3) - S(4)*e*(-S(4)*A*e + D*b)*(S(2)*(-S(4)*A*e + D*b)*(-S(4)*C*e + S(3)*D*d) + S(4)*(-S(2)*B*e + D*c)**S(2)))))
rule338 = ReplacementRule(pattern338, lambda e, a, C, x, A, B, D, d, b, c : D*log(a + b*x + c*x**S(2) + d*x**S(3) + e*x**S(4))/(S(4)*e) - Int((-S(4)*A*e + D*b + x**S(2)*(-S(4)*C*e + S(3)*D*d) + S(2)*x*(-S(2)*B*e + D*c))/(a + b*x + c*x**S(2) + d*x**S(3) + e*x**S(4)), x)/(S(4)*e))
rubi.add(rule338)
pattern339 = Pattern(Integral((x_**S(3)*WC('D', S(1)) + x_*WC('B', S(1)) + WC('A', S(0)))/(a_ + x_**S(4)*WC('e', S(1)) + x_**S(3)*WC('d', S(1)) + x_**S(2)*WC('c', S(1)) + x_*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda D, x: FreeQ(D, x)), CustomConstraint(lambda e, A, D, d, b, c: ZeroQ(D**S(2)*c**S(2)*d - D*c*(-S(8)*A*e**S(2) - S(4)*C*c*e + S(2)*D*b*e + S(3)*D*c*d) + S(2)*(-S(4)*C*e + S(3)*D*d)*(-A*d*e - C*b*e + D*b*d))), CustomConstraint(lambda e, b, a, A, B, D, d, c: ZeroQ(S(54)*D**S(3)*a*d**S(3) - S(6)*D*c*d*(-S(2)*B*e + D*c)**S(2) + S(6)*D*d**S(2)*(-S(4)*A*e + D*b)*(-S(2)*B*e + D*c) + S(2)*d*(-S(2)*B*e + D*c)**S(3) - e*(-S(4)*A*e + D*b)*(S(6)*D*d*(-S(4)*A*e + D*b) + S(4)*(-S(2)*B*e + D*c)**S(2)))))
rule339 = ReplacementRule(pattern339, lambda e, a, x, A, B, D, d, b, c : D*log(a + b*x + c*x**S(2) + d*x**S(3) + e*x**S(4))/(S(4)*e) - Int((-S(4)*A*e + D*b + S(3)*D*d*x**S(2) + S(2)*x*(-S(2)*B*e + D*c))/(a + b*x + c*x**S(2) + d*x**S(3) + e*x**S(4)), x)/(S(4)*e))
rubi.add(rule339)
pattern340 = Pattern(Integral(u_/(sqrt(x_*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1)) + sqrt(x_*WC('d', S(1)) + WC('c', S(0)))*WC('f', 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, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda f, a, e, c: ZeroQ(a*e**S(2) - c*f**S(2))))
rule340 = ReplacementRule(pattern340, lambda a, f, x, u, b, d, e, c : -a*Int(u*sqrt(c + d*x)/x, x)/(f*(-a*d + b*c)) + c*Int(u*sqrt(a + b*x)/x, x)/(e*(-a*d + b*c)))
rubi.add(rule340)
pattern341 = Pattern(Integral(u_/(sqrt(x_*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1)) + sqrt(x_*WC('d', S(1)) + WC('c', S(0)))*WC('f', 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, d, c: NonzeroQ(-a*d + b*c)), CustomConstraint(lambda b, d, f, e: ZeroQ(b*e**S(2) - d*f**S(2))))
rule341 = ReplacementRule(pattern341, lambda a, f, x, u, b, d, e, c : b*Int(u*sqrt(c + d*x), x)/(f*(-a*d + b*c)) - d*Int(u*sqrt(a + b*x), x)/(e*(-a*d + b*c)))
rubi.add(rule341)
pattern342 = Pattern(Integral(u_/(sqrt(x_*WC('b', S(1)) + WC('a', S(0)))*WC('e', S(1)) + sqrt(x_*WC('d', S(1)) + WC('c', S(0)))*WC('f', 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 f, a, e, c: NonzeroQ(a*e**S(2) - c*f**S(2))), CustomConstraint(lambda b, d, f, e: NonzeroQ(b*e**S(2) - d*f**S(2))))
rule342 = ReplacementRule(pattern342, lambda a, f, x, u, b, d, e, c : e*Int(u*sqrt(a + b*x)/(a*e**S(2) - c*f**S(2) + x*(b*e**S(2) - d*f**S(2))), x) - f*Int(u*sqrt(c + d*x)/(a*e**S(2) - c*f**S(2) + x*(b*e**S(2) - d*f**S(2))), x))
rubi.add(rule342)
pattern343 = Pattern(Integral(WC('u', S(1))/(x_**WC('n', S(1))*WC('d', S(1)) + sqrt(x_**WC('p', S(1))*WC('b', S(1)) + WC('a', S(0)))*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 d, x: FreeQ(d, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, p: ZeroQ(-S(2)*n + p)), CustomConstraint(lambda b, d, c: ZeroQ(b*c**S(2) - d**S(2))))
rule343 = ReplacementRule(pattern343, lambda p, n, a, x, u, b, d, c : -b*Int(u*x**n, x)/(a*d) + Int(u*sqrt(a + b*x**(S(2)*n)), x)/(a*c))
rubi.add(rule343)
pattern344 = Pattern(Integral(x_**WC('m', S(1))/(x_**WC('n', S(1))*WC('d', S(1)) + sqrt(x_**WC('p', S(1))*WC('b', S(1)) + WC('a', S(0)))*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 d, x: FreeQ(d, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n, p: ZeroQ(-S(2)*n + p)), CustomConstraint(lambda b, d, c: NonzeroQ(b*c**S(2) - d**S(2))))
rule344 = ReplacementRule(pattern344, lambda p, n, a, x, m, b, d, c : c*Int(x**m*sqrt(a + b*x**(S(2)*n))/(a*c**S(2) + x**(S(2)*n)*(b*c**S(2) - d**S(2))), x) - d*Int(x**(m + n)/(a*c**S(2) + x**(S(2)*n)*(b*c**S(2) - d**S(2))), x))
rubi.add(rule344)
pattern345 = Pattern(Integral(S(1)/((a_ + x_**S(3)*WC('b', S(1)))*sqrt(x_**S(2)*WC('f', S(1)) + x_*WC('e', S(1)) + WC('d', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, 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: PosQ(a/b)), )
def With345(a, f, x, b, d, e):
r = Numerator(Rt(a/b, S(3)))
s = Denominator(Rt(a/b, S(3)))
return r*Int(S(1)/((r + s*x)*sqrt(d + e*x + f*x**S(2))), x)/(S(3)*a) + r*Int((S(2)*r - s*x)/(sqrt(d + e*x + f*x**S(2))*(r**S(2) - r*s*x + s**S(2)*x**S(2))), x)/(S(3)*a)
rule345 = ReplacementRule(pattern345, lambda a, f, x, b, d, e : With345(a, f, x, b, d, e))
rubi.add(rule345)
pattern346 = Pattern(Integral(S(1)/((a_ + x_**S(3)*WC('b', S(1)))*sqrt(x_**S(2)*WC('f', S(1)) + WC('d', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: PosQ(a/b)), )
def With346(a, f, x, b, d):
r = Numerator(Rt(a/b, S(3)))
s = Denominator(Rt(a/b, S(3)))
return r*Int(S(1)/(sqrt(d + f*x**S(2))*(r + s*x)), x)/(S(3)*a) + r*Int((S(2)*r - s*x)/(sqrt(d + f*x**S(2))*(r**S(2) - r*s*x + s**S(2)*x**S(2))), x)/(S(3)*a)
rule346 = ReplacementRule(pattern346, lambda a, f, x, b, d : With346(a, f, x, b, d))
rubi.add(rule346)
pattern347 = Pattern(Integral(S(1)/((a_ + x_**S(3)*WC('b', S(1)))*sqrt(x_**S(2)*WC('f', S(1)) + x_*WC('e', S(1)) + WC('d', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, 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: NegQ(a/b)), )
def With347(a, f, x, b, d, e):
r = Numerator(Rt(-a/b, S(3)))
s = Denominator(Rt(-a/b, S(3)))
return r*Int(S(1)/((r - s*x)*sqrt(d + e*x + f*x**S(2))), x)/(S(3)*a) + r*Int((S(2)*r + s*x)/(sqrt(d + e*x + f*x**S(2))*(r**S(2) + r*s*x + s**S(2)*x**S(2))), x)/(S(3)*a)
rule347 = ReplacementRule(pattern347, lambda a, f, x, b, d, e : With347(a, f, x, b, d, e))
rubi.add(rule347)
pattern348 = Pattern(Integral(S(1)/((a_ + x_**S(3)*WC('b', S(1)))*sqrt(x_**S(2)*WC('f', S(1)) + WC('d', S(0)))), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda b, x: FreeQ(b, x)), CustomConstraint(lambda d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda b, a: NegQ(a/b)), )
def With348(a, f, x, b, d):
r = Numerator(Rt(-a/b, S(3)))
s = Denominator(Rt(-a/b, S(3)))
return r*Int(S(1)/(sqrt(d + f*x**S(2))*(r - s*x)), x)/(S(3)*a) + r*Int((S(2)*r + s*x)/(sqrt(d + f*x**S(2))*(r**S(2) + r*s*x + s**S(2)*x**S(2))), x)/(S(3)*a)
rule348 = ReplacementRule(pattern348, lambda a, f, x, b, d : With348(a, f, x, b, d))
rubi.add(rule348)
pattern349 = Pattern(Integral(S(1)/((d_ + x_*WC('e', S(1)))*sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*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)))
rule349 = ReplacementRule(pattern349, lambda e, a, x, b, d, c : d*Int(S(1)/((d**S(2) - e**S(2)*x**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))), x) - e*Int(x/((d**S(2) - e**S(2)*x**S(2))*sqrt(a + b*x**S(2) + c*x**S(4))), x))
rubi.add(rule349)
pattern350 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(4)*WC('c', S(1)))*(d_ + x_*WC('e', 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 e, x: FreeQ(e, x)))
rule350 = ReplacementRule(pattern350, lambda e, a, x, d, c : d*Int(S(1)/(sqrt(a + c*x**S(4))*(d**S(2) - e**S(2)*x**S(2))), x) - e*Int(x/(sqrt(a + c*x**S(4))*(d**S(2) - e**S(2)*x**S(2))), x))
rubi.add(rule350)
pattern351 = Pattern(Integral(S(1)/((d_ + x_*WC('e', S(1)))**S(2)*sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*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 a, b, d, e, c: NonzeroQ(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4))), CustomConstraint(lambda b, e, d, c: ZeroQ(b*d*e**S(2) + S(2)*c*d**S(3))))
rule351 = ReplacementRule(pattern351, lambda e, a, x, b, d, c : -c*Int((d**S(2) - e**S(2)*x**S(2))/sqrt(a + b*x**S(2) + c*x**S(4)), x)/(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4)) - e**S(3)*sqrt(a + b*x**S(2) + c*x**S(4))/((d + e*x)*(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4))))
rubi.add(rule351)
pattern352 = Pattern(Integral(S(1)/((d_ + x_*WC('e', S(1)))**S(2)*sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*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 a, b, d, e, c: NonzeroQ(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4))), CustomConstraint(lambda b, e, d, c: NonzeroQ(b*d*e**S(2) + S(2)*c*d**S(3))))
rule352 = ReplacementRule(pattern352, lambda e, a, x, b, d, c : -c*Int((d**S(2) - e**S(2)*x**S(2))/sqrt(a + b*x**S(2) + c*x**S(4)), x)/(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4)) - e**S(3)*sqrt(a + b*x**S(2) + c*x**S(4))/((d + e*x)*(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4))) + (b*d*e**S(2) + S(2)*c*d**S(3))*Int(S(1)/((d + e*x)*sqrt(a + b*x**S(2) + c*x**S(4))), x)/(a*e**S(4) + b*d**S(2)*e**S(2) + c*d**S(4)))
rubi.add(rule352)
pattern353 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(4)*WC('c', S(1)))*(d_ + x_*WC('e', S(1)))**S(2)), x_), CustomConstraint(lambda a, x: FreeQ(a, 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, a, d, c: NonzeroQ(a*e**S(4) + c*d**S(4))))
rule353 = ReplacementRule(pattern353, lambda e, a, x, d, c : S(2)*c*d**S(3)*Int(S(1)/(sqrt(a + c*x**S(4))*(d + e*x)), x)/(a*e**S(4) + c*d**S(4)) - c*Int((d**S(2) - e**S(2)*x**S(2))/sqrt(a + c*x**S(4)), x)/(a*e**S(4) + c*d**S(4)) - e**S(3)*sqrt(a + c*x**S(4))/((d + e*x)*(a*e**S(4) + c*d**S(4))))
rubi.add(rule353)
pattern354 = Pattern(Integral((A_ + x_**S(2)*WC('B', S(1)))/((d_ + x_**S(2)*WC('e', S(1)))*sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda B, e, d, A: ZeroQ(A*e + B*d)), CustomConstraint(lambda e, a, d, c: ZeroQ(-a*e**S(2) + c*d**S(2))))
rule354 = ReplacementRule(pattern354, lambda a, x, A, B, b, d, e, c : A*Subst(Int(1/(d - x**S(2)*(-S(2)*a*e + b*d)), x), x, x/sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule354)
pattern355 = Pattern(Integral((A_ + x_**S(2)*WC('B', S(1)))/(sqrt(a_ + x_**S(4)*WC('c', S(1)))*(d_ + x_**S(2)*WC('e', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda B, e, d, A: ZeroQ(A*e + B*d)), CustomConstraint(lambda e, a, d, c: ZeroQ(-a*e**S(2) + c*d**S(2))))
rule355 = ReplacementRule(pattern355, lambda a, x, A, B, d, e, c : A*Subst(Int(1/(S(2)*a*e*x**S(2) + d), x), x, x/sqrt(a + c*x**S(4))))
rubi.add(rule355)
pattern356 = Pattern(Integral((A_ + x_**S(4)*WC('B', S(1)))/(sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))*(d_ + x_**S(4)*WC('f', S(1)) + x_**S(2)*WC('e', 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 A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda f, a, d, c: ZeroQ(-a*f + c*d)), CustomConstraint(lambda B, a, c, A: ZeroQ(A*c + B*a)))
rule356 = ReplacementRule(pattern356, lambda a, f, x, A, B, b, d, e, c : A*Subst(Int(1/(d - x**S(2)*(-a*e + b*d)), x), x, x/sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule356)
pattern357 = Pattern(Integral((A_ + x_**S(4)*WC('B', S(1)))/(sqrt(a_ + x_**S(4)*WC('c', S(1)))*(d_ + x_**S(4)*WC('f', S(1)) + x_**S(2)*WC('e', 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 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 f, a, d, c: ZeroQ(-a*f + c*d)), CustomConstraint(lambda B, a, c, A: ZeroQ(A*c + B*a)))
rule357 = ReplacementRule(pattern357, lambda a, f, x, A, B, d, e, c : A*Subst(Int(1/(a*e*x**S(2) + d), x), x, x/sqrt(a + c*x**S(4))))
rubi.add(rule357)
pattern358 = Pattern(Integral((A_ + x_**S(4)*WC('B', S(1)))/((d_ + x_**S(4)*WC('f', S(1)))*sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*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 f, x: FreeQ(f, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda f, a, d, c: ZeroQ(-a*f + c*d)), CustomConstraint(lambda B, a, c, A: ZeroQ(A*c + B*a)))
rule358 = ReplacementRule(pattern358, lambda a, f, x, A, B, b, d, c : A*Subst(Int(1/(-b*d*x**S(2) + d), x), x, x/sqrt(a + b*x**S(2) + c*x**S(4))))
rubi.add(rule358)
pattern359 = Pattern(Integral(sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))/(d_ + x_**S(4)*WC('e', 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 e, a, d, c: ZeroQ(a*e + c*d)), CustomConstraint(lambda a, c: PosQ(a*c)))
rule359 = ReplacementRule(pattern359, lambda a, x, b, d, e, c : a*Subst(Int(1/(-S(2)*b*x**S(2) + x**S(4)*(-S(4)*a*c + b**S(2)) + S(1)), x), x, x/sqrt(a + b*x**S(2) + c*x**S(4)))/d)
rubi.add(rule359)
pattern360 = Pattern(Integral(sqrt(a_ + x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)))/(d_ + x_**S(4)*WC('e', 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 e, a, d, c: ZeroQ(a*e + c*d)), CustomConstraint(lambda a, c: NegQ(a*c)), )
def With360(a, x, b, d, e, c):
q = sqrt(-S(4)*a*c + b**S(2))
return sqrt(S(2))*a*sqrt(-b + q)*atanh(sqrt(S(2))*x*sqrt(-b + q)*(b + S(2)*c*x**S(2) + q)/(S(4)*sqrt(a + b*x**S(2) + c*x**S(4))*Rt(-a*c, S(2))))/(S(4)*d*Rt(-a*c, S(2))) - sqrt(S(2))*a*sqrt(b + q)*atan(sqrt(S(2))*x*sqrt(b + q)*(b + S(2)*c*x**S(2) - q)/(S(4)*sqrt(a + b*x**S(2) + c*x**S(4))*Rt(-a*c, S(2))))/(S(4)*d*Rt(-a*c, S(2)))
rule360 = ReplacementRule(pattern360, lambda a, x, b, d, e, c : With360(a, x, b, d, e, c))
rubi.add(rule360)
pattern361 = Pattern(Integral(S(1)/((a_ + x_*WC('b', S(1)))*sqrt(c_ + x_**S(2)*WC('d', S(1)))*sqrt(e_ + x_**S(2)*WC('f', 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)))
rule361 = ReplacementRule(pattern361, lambda e, a, f, x, b, d, c : a*Int(S(1)/((a**S(2) - b**S(2)*x**S(2))*sqrt(c + d*x**S(2))*sqrt(e + f*x**S(2))), x) - b*Int(x/((a**S(2) - b**S(2)*x**S(2))*sqrt(c + d*x**S(2))*sqrt(e + f*x**S(2))), x))
rubi.add(rule361)
pattern362 = Pattern(Integral((x_*WC('h', S(1)) + WC('g', S(0)))*sqrt(x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))*WC('f', S(1)) + WC('d', 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 h, x: FreeQ(h, x)), CustomConstraint(lambda e, c, a, f, b, h, d, g: ZeroQ(-f**S(2)*(a*h**S(2) - b*g*h + c*g**S(2)) + (-d*h + e*g)**S(2))), CustomConstraint(lambda e, c, f, b, h, d, g: ZeroQ(-S(2)*d*e*h + S(2)*e**S(2)*g - f**S(2)*(-b*h + S(2)*c*g))))
rule362 = ReplacementRule(pattern362, lambda c, a, f, x, b, d, h, e, g : S(2)*sqrt(d + e*x + f*sqrt(a + b*x + c*x**S(2)))*(S(9)*c**S(2)*f*g*h*x**S(2) + S(3)*c**S(2)*f*h**S(2)*x**S(3) + c*f*x*(a*h**S(2) - b*g*h + S(10)*c*g**S(2)) + f*(S(2)*a*b*h**S(2) - S(3)*a*c*g*h - S(2)*b**S(2)*g*h + S(5)*b*c*g**S(2)) - (-d*h + e*g)*sqrt(a + b*x + c*x**S(2))*(-S(2)*b*h + S(5)*c*g + c*h*x))/(S(15)*c**S(2)*f*(g + h*x)))
rubi.add(rule362)
pattern363 = Pattern(Integral((u_ + (sqrt(v_)*WC('k', S(1)) + WC('j', S(0)))*WC('f', S(1)))**WC('n', S(1))*(x_*WC('h', S(1)) + WC('g', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda f, v, x, u, j: Not(LinearMatchQ(u, x) & QuadraticMatchQ(v, x) & (ZeroQ(j) | ZeroQ(f + S(-1))))), CustomConstraint(lambda k, f, v, x, u, j, h, g: ZeroQ(-f**S(2)*k**S(2)*(g**S(2)*Coefficient(v, x, S(2)) - g*h*Coefficient(v, x, S(1)) + h**S(2)*Coefficient(v, x, S(0))) + (g*Coefficient(u, x, S(1)) - h*(f*j + Coefficient(u, x, S(0))))**S(2))))
rule363 = ReplacementRule(pattern363, lambda n, k, m, f, v, x, u, j, h, g : Int((g + h*x)**m*(f*k*sqrt(ExpandToSum(v, x)) + ExpandToSum(f*j + u, x))**n, x))
rubi.add(rule363)
pattern364 = Pattern(Integral(((x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))*WC('f', S(1)) + WC('d', S(0)))**n_*WC('h', S(1)) + WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda p: IntegerQ(p)))
rule364 = ReplacementRule(pattern364, lambda p, c, n, a, f, x, b, d, h, e, g : S(2)*Subst(Int((g + h*x**n)**p*(d**S(2)*e + e*x**S(2) - f**S(2)*(-a*e + b*d) - x*(-b*f**S(2) + S(2)*d*e))/(b*f**S(2) - S(2)*d*e + S(2)*e*x)**S(2), x), x, d + e*x + f*sqrt(a + b*x + c*x**S(2))))
rubi.add(rule364)
pattern365 = Pattern(Integral(((x_*WC('e', S(1)) + sqrt(a_ + x_**S(2)*WC('c', S(1)))*WC('f', S(1)) + WC('d', S(0)))**n_*WC('h', S(1)) + WC('g', S(0)))**WC('p', 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 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 n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda p: IntegerQ(p)))
rule365 = ReplacementRule(pattern365, lambda p, c, n, a, f, x, d, h, e, g : Subst(Int((g + h*x**n)**p*(a*f**S(2) + d**S(2) - S(2)*d*x + x**S(2))/(d - x)**S(2), x), x, d + e*x + f*sqrt(a + c*x**S(2)))/(S(2)*e))
rubi.add(rule365)
pattern366 = Pattern(Integral(((u_ + sqrt(v_)*WC('f', S(1)))**n_*WC('h', S(1)) + WC('g', S(0)))**WC('p', S(1)), x_), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda v, x: QuadraticQ(v, x)), CustomConstraint(lambda v, x, u: Not(LinearMatchQ(u, x) & QuadraticMatchQ(v, x))), CustomConstraint(lambda f, v, x, u: ZeroQ(-f**S(2)*Coefficient(v, x, S(2)) + Coefficient(u, x, S(1))**S(2))), CustomConstraint(lambda p: IntegerQ(p)))
rule366 = ReplacementRule(pattern366, lambda p, n, f, v, x, u, h, g : Int((g + h*(f*sqrt(ExpandToSum(v, x)) + ExpandToSum(u, x))**n)**p, x))
rubi.add(rule366)
pattern367 = Pattern(Integral((x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + WC('a', S(0)))*WC('f', S(1)))**WC('n', S(1))*(x_*WC('h', S(1)) + WC('g', S(0)))**WC('m', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, 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 n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda m: IntegerQ(m)))
rule367 = ReplacementRule(pattern367, lambda c, n, a, f, x, m, h, e, g : S(2)**(-m + S(-1))*e**(-m + S(-1))*Subst(Int(x**(-m + n + S(-2))*(a*f**S(2) + x**S(2))*(-a*f**S(2)*h + S(2)*e*g*x + h*x**S(2))**m, x), x, e*x + f*sqrt(a + c*x**S(2))))
rubi.add(rule367)
pattern368 = Pattern(Integral(x_**WC('p', S(1))*(g_ + x_**S(2)*WC('i', S(1)))**WC('m', S(1))*(x_*WC('e', S(1)) + sqrt(a_ + x_**S(2)*WC('c', S(1)))*WC('f', S(1)))**WC('n', S(1)), x_), CustomConstraint(lambda a, x: FreeQ(a, x)), CustomConstraint(lambda c, x: FreeQ(c, x)), CustomConstraint(lambda e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda p, m: IntegersQ(p, S(2)*m)), CustomConstraint(lambda i, c, m: IntegerQ(m) | PositiveQ(i/c)))
rule368 = ReplacementRule(pattern368, lambda i, p, n, a, g, f, x, m, e, c : S(2)**(-S(2)*m - p + S(-1))*e**(-p + S(-1))*f**(-S(2)*m)*(i/c)**m*Subst(Int(x**(-S(2)*m + n - p + S(-2))*(-a*f**S(2) + x**S(2))**p*(a*f**S(2) + x**S(2))**(S(2)*m + S(1)), x), x, e*x + f*sqrt(a + c*x**S(2))))
rubi.add(rule368)
pattern369 = Pattern(Integral((x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))*WC('f', S(1)) + WC('d', S(0)))**WC('n', S(1))*(x_**S(2)*WC('i', S(1)) + x_*WC('h', S(1)) + WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda b, i, h, c: ZeroQ(-b*i + c*h)), CustomConstraint(lambda m: IntegerQ(S(2)*m)), CustomConstraint(lambda i, c, m: IntegerQ(m) | PositiveQ(i/c)))
rule369 = ReplacementRule(pattern369, lambda i, e, c, n, a, f, x, m, b, h, d, g : S(2)*f**(-S(2)*m)*(i/c)**m*Subst(Int(x**n*(b*f**S(2) - S(2)*d*e + S(2)*e*x)**(-S(2)*m + S(-2))*(d**S(2)*e + e*x**S(2) - f**S(2)*(-a*e + b*d) - x*(-b*f**S(2) + S(2)*d*e))**(S(2)*m + S(1)), x), x, d + e*x + f*sqrt(a + b*x + c*x**S(2))))
rubi.add(rule369)
pattern370 = Pattern(Integral((g_ + x_**S(2)*WC('i', S(1)))**WC('m', S(1))*(x_*WC('e', S(1)) + sqrt(a_ + x_**S(2)*WC('c', S(1)))*WC('f', S(1)) + WC('d', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda m: IntegerQ(S(2)*m)), CustomConstraint(lambda i, c, m: IntegerQ(m) | PositiveQ(i/c)))
rule370 = ReplacementRule(pattern370, lambda i, n, a, g, f, x, m, d, e, c : S(2)**(-S(2)*m + S(-1))*f**(-S(2)*m)*(i/c)**m*Subst(Int(x**n*(-d + x)**(-S(2)*m + S(-2))*(a*f**S(2) + d**S(2) - S(2)*d*x + x**S(2))**(S(2)*m + S(1)), x), x, d + e*x + f*sqrt(a + c*x**S(2)))/e)
rubi.add(rule370)
pattern371 = Pattern(Integral((x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))*WC('f', S(1)) + WC('d', S(0)))**WC('n', S(1))*(x_**S(2)*WC('i', S(1)) + x_*WC('h', S(1)) + WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda b, i, h, c: ZeroQ(-b*i + c*h)), CustomConstraint(lambda m: PositiveIntegerQ(m + S(1)/2)), CustomConstraint(lambda i, c: Not(PositiveQ(i/c))))
rule371 = ReplacementRule(pattern371, lambda i, e, c, n, a, f, x, m, b, h, d, g : (i/c)**(m + S(-1)/2)*sqrt(g + h*x + i*x**S(2))*Int((a + b*x + c*x**S(2))**m*(d + e*x + f*sqrt(a + b*x + c*x**S(2)))**n, x)/sqrt(a + b*x + c*x**S(2)))
rubi.add(rule371)
pattern372 = Pattern(Integral((g_ + x_**S(2)*WC('i', S(1)))**WC('m', S(1))*(x_*WC('e', S(1)) + sqrt(a_ + x_**S(2)*WC('c', S(1)))*WC('f', S(1)) + WC('d', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda m: PositiveIntegerQ(m + S(1)/2)), CustomConstraint(lambda i, c: Not(PositiveQ(i/c))))
rule372 = ReplacementRule(pattern372, lambda i, n, a, g, f, x, m, d, e, c : (i/c)**(m + S(-1)/2)*sqrt(g + i*x**S(2))*Int((a + c*x**S(2))**m*(d + e*x + f*sqrt(a + c*x**S(2)))**n, x)/sqrt(a + c*x**S(2)))
rubi.add(rule372)
pattern373 = Pattern(Integral((x_*WC('e', S(1)) + sqrt(x_**S(2)*WC('c', S(1)) + x_*WC('b', S(1)) + WC('a', S(0)))*WC('f', S(1)) + WC('d', S(0)))**WC('n', S(1))*(x_**S(2)*WC('i', S(1)) + x_*WC('h', S(1)) + WC('g', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda h, x: FreeQ(h, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda b, i, h, c: ZeroQ(-b*i + c*h)), CustomConstraint(lambda m: NegativeIntegerQ(m + S(-1)/2)), CustomConstraint(lambda i, c: Not(PositiveQ(i/c))))
rule373 = ReplacementRule(pattern373, lambda i, e, c, n, a, f, x, m, b, h, d, g : (i/c)**(m + S(1)/2)*sqrt(a + b*x + c*x**S(2))*Int((a + b*x + c*x**S(2))**m*(d + e*x + f*sqrt(a + b*x + c*x**S(2)))**n, x)/sqrt(g + h*x + i*x**S(2)))
rubi.add(rule373)
pattern374 = Pattern(Integral((g_ + x_**S(2)*WC('i', S(1)))**WC('m', S(1))*(x_*WC('e', S(1)) + sqrt(a_ + x_**S(2)*WC('c', S(1)))*WC('f', S(1)) + WC('d', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda i, x: FreeQ(i, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda f, e, c: ZeroQ(-c*f**S(2) + e**S(2))), CustomConstraint(lambda g, i, a, c: ZeroQ(-a*i + c*g)), CustomConstraint(lambda m: NegativeIntegerQ(m + S(-1)/2)), CustomConstraint(lambda i, c: Not(PositiveQ(i/c))))
rule374 = ReplacementRule(pattern374, lambda i, n, a, g, f, x, m, d, e, c : (i/c)**(m + S(1)/2)*sqrt(a + c*x**S(2))*Int((a + c*x**S(2))**m*(d + e*x + f*sqrt(a + c*x**S(2)))**n, x)/sqrt(g + i*x**S(2)))
rubi.add(rule374)
pattern375 = Pattern(Integral(w_**WC('m', S(1))*(u_ + (sqrt(v_)*WC('k', S(1)) + WC('j', S(0)))*WC('f', S(1)))**WC('n', S(1)), x_), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda j, x: FreeQ(j, x)), CustomConstraint(lambda k, x: FreeQ(k, x)), CustomConstraint(lambda m, x: FreeQ(m, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda x, u: LinearQ(u, x)), CustomConstraint(lambda w, v, x: QuadraticQ(List(v, w), x)), CustomConstraint(lambda w, v, f, x, u, j: Not(LinearMatchQ(u, x) & QuadraticMatchQ(List(v, w), x) & (ZeroQ(j) | ZeroQ(f + S(-1))))), CustomConstraint(lambda k, f, v, x, u: ZeroQ(-f**S(2)*k**S(2)*Coefficient(v, x, S(2)) + Coefficient(u, x, S(1))**S(2))))
rule375 = ReplacementRule(pattern375, lambda j, n, k, w, f, v, x, u, m : Int((f*k*sqrt(ExpandToSum(v, x)) + ExpandToSum(f*j + u, x))**n*ExpandToSum(w, x)**m, x))
rubi.add(rule375)
pattern376 = Pattern(Integral(S(1)/((a_ + x_**WC('n', S(1))*WC('b', S(1)))*sqrt(x_**S(2)*WC('c', S(1)) + (a_ + x_**WC('n', S(1))*WC('b', S(1)))**WC('p', S(1))*WC('d', 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 n, p: ZeroQ(p - S(2)/n)))
rule376 = ReplacementRule(pattern376, lambda p, n, a, x, b, d, c : Subst(Int(1/(-c*x**S(2) + S(1)), x), x, x/sqrt(c*x**S(2) + d*(a + b*x**n)**(S(2)/n)))/a)
rubi.add(rule376)
pattern377 = Pattern(Integral(sqrt(a_ + sqrt(c_ + x_**S(2)*WC('d', S(1)))*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 b, a, c: ZeroQ(a**S(2) - b**S(2)*c)))
rule377 = ReplacementRule(pattern377, lambda a, x, b, d, c : S(2)*a*x/sqrt(a + b*sqrt(c + d*x**S(2))) + S(2)*b**S(2)*d*x**S(3)/(S(3)*(a + b*sqrt(c + d*x**S(2)))**(S(3)/2)))
rubi.add(rule377)
pattern378 = Pattern(Integral(sqrt(x_**S(2)*WC('a', S(1)) + x_*sqrt(c_ + x_**S(2)*WC('d', S(1)))*WC('b', S(1)))/(x_*sqrt(c_ + x_**S(2)*WC('d', 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 b, a, d: ZeroQ(a**S(2) - b**S(2)*d)), CustomConstraint(lambda b, a, c: ZeroQ(a + b**S(2)*c)))
rule378 = ReplacementRule(pattern378, lambda a, x, b, d, c : sqrt(S(2))*b*Subst(Int(1/sqrt(S(1) + x**S(2)/a), x), x, a*x + b*sqrt(c + d*x**S(2)))/a)
rubi.add(rule378)
pattern379 = Pattern(Integral(sqrt(x_*(x_*WC('a', S(1)) + sqrt(c_ + x_**S(2)*WC('d', S(1)))*WC('b', S(1)))*WC('e', S(1)))/(x_*sqrt(c_ + x_**S(2)*WC('d', 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 b, a, d: ZeroQ(a**S(2) - b**S(2)*d)), CustomConstraint(lambda b, a, e, c: ZeroQ(a + b**S(2)*c*e)))
rule379 = ReplacementRule(pattern379, lambda a, x, b, d, e, c : Int(sqrt(a*e*x**S(2) + b*e*x*sqrt(c + d*x**S(2)))/(x*sqrt(c + d*x**S(2))), x))
rubi.add(rule379)
pattern380 = Pattern(Integral(sqrt(x_**S(2)*WC('c', S(1)) + sqrt(a_ + x_**S(4)*WC('b', S(1)))*WC('d', S(1)))/sqrt(a_ + x_**S(4)*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 b, d, c: ZeroQ(-b*d**S(2) + c**S(2))))
rule380 = ReplacementRule(pattern380, lambda a, x, b, d, c : d*Subst(Int(1/(-S(2)*c*x**S(2) + S(1)), x), x, x/sqrt(c*x**S(2) + d*sqrt(a + b*x**S(4)))))
rubi.add(rule380)
pattern381 = Pattern(Integral((x_*WC('d', S(1)) + WC('c', S(0)))**WC('m', S(1))*sqrt(x_**S(2)*WC('b', S(1)) + sqrt(a_ + x_**S(4)*WC('e', S(1))))/sqrt(a_ + x_**S(4)*WC('e', 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 b, e: ZeroQ(-b**S(2) + e)), CustomConstraint(lambda a: PositiveQ(a)))
rule381 = ReplacementRule(pattern381, lambda a, x, m, b, d, e, c : (-ImaginaryI/S(2) + S(1)/2)*Int((c + d*x)**m/sqrt(-ImaginaryI*b*x**S(2) + sqrt(a)), x) + (ImaginaryI/S(2) + S(1)/2)*Int((c + d*x)**m/sqrt(ImaginaryI*b*x**S(2) + sqrt(a)), x))
rubi.add(rule381)
pattern382 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: PosQ(b)), )
def With382(a, x, b, d, c):
q = Rt(b/a, S(3))
return d*Int((q*x + S(1) + sqrt(S(3)))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(-c*q + d*(S(1) + sqrt(S(3)))) - q*Int(1/sqrt(a + b*x**S(3)), x)/(-c*q + d*(S(1) + sqrt(S(3))))
rule382 = ReplacementRule(pattern382, lambda a, x, b, d, c : With382(a, x, b, d, c))
rubi.add(rule382)
pattern383 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: NegQ(b)), )
def With383(a, x, b, d, c):
q = Rt(-b/a, S(3))
return d*Int((-q*x + S(1) + sqrt(S(3)))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(c*q + d*(S(1) + sqrt(S(3)))) + q*Int(1/sqrt(a + b*x**S(3)), x)/(c*q + d*(S(1) + sqrt(S(3))))
rule383 = ReplacementRule(pattern383, lambda a, x, b, d, c : With383(a, x, b, d, c))
rubi.add(rule383)
pattern384 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: PosQ(b)), )
def With384(a, x, b, d, c):
q = Rt(-b/a, S(3))
return d*Int((-q*x - sqrt(S(3)) + S(1))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(c*q + d*(-sqrt(S(3)) + S(1))) + q*Int(1/sqrt(a + b*x**S(3)), x)/(c*q + d*(-sqrt(S(3)) + S(1)))
rule384 = ReplacementRule(pattern384, lambda a, x, b, d, c : With384(a, x, b, d, c))
rubi.add(rule384)
pattern385 = Pattern(Integral(S(1)/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: NegQ(b)), )
def With385(a, x, b, d, c):
q = Rt(b/a, S(3))
return d*Int((q*x - sqrt(S(3)) + S(1))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(-c*q + d*(-sqrt(S(3)) + S(1))) - q*Int(1/sqrt(a + b*x**S(3)), x)/(-c*q + d*(-sqrt(S(3)) + S(1)))
rule385 = ReplacementRule(pattern385, lambda a, x, b, d, c : With385(a, x, b, d, c))
rubi.add(rule385)
pattern386 = Pattern(Integral((e_ + x_*WC('f', S(1)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: PosQ(b)), CustomConstraint(lambda f, d, a, e, b, x, q, c: ZeroQ(-e*q + f*(S(1) + sqrt(S(3))))))
def With386(e, a, f, x, b, d, c):
q = Rt(b/a, S(3))
return S(4)*S(3)**(S(1)/4)*f*sqrt((q**S(2)*x**S(2) - q*x + S(1))/(q*x + S(1) + sqrt(S(3)))**S(2))*sqrt(-sqrt(S(3)) + S(2))*(q*x + S(1))*Subst(Int(S(1)/(sqrt(-x**S(2) + S(1))*sqrt(x**S(2) - S(4)*sqrt(S(3)) + S(7))*(-c*q + d*(-sqrt(S(3)) + S(1)) + x*(-c*q + d*(S(1) + sqrt(S(3)))))), x), x, (-q*x + S(-1) + sqrt(S(3)))/(q*x + S(1) + sqrt(S(3))))/(q*sqrt((q*x + S(1))/(q*x + S(1) + sqrt(S(3)))**S(2))*sqrt(a + b*x**S(3)))
rule386 = ReplacementRule(pattern386, lambda e, a, f, x, b, d, c : With386(e, a, f, x, b, d, c))
rubi.add(rule386)
pattern387 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: PosQ(b)), CustomConstraint(lambda f, d, b, e, a, x, q, c: NonzeroQ(-e*q + f*(S(1) + sqrt(S(3))))))
def With387(a, f, x, b, d, e, c):
q = Rt(b/a, S(3))
return (-c*f + d*e)*Int((q*x + S(1) + sqrt(S(3)))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(-c*q + d*(S(1) + sqrt(S(3)))) + (-e*q + f*(S(1) + sqrt(S(3))))*Int(1/sqrt(a + b*x**S(3)), x)/(-c*q + d*(S(1) + sqrt(S(3))))
rule387 = ReplacementRule(pattern387, lambda a, f, x, b, d, e, c : With387(a, f, x, b, d, e, c))
rubi.add(rule387)
pattern388 = Pattern(Integral((e_ + x_*WC('f', S(1)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: NegQ(b)), CustomConstraint(lambda f, d, a, e, b, x, q, c: ZeroQ(e*q + f*(S(1) + sqrt(S(3))))))
def With388(e, a, f, x, b, d, c):
q = Rt(-b/a, S(3))
return -S(4)*S(3)**(S(1)/4)*f*sqrt((q**S(2)*x**S(2) + q*x + S(1))/(-q*x + S(1) + sqrt(S(3)))**S(2))*sqrt(-sqrt(S(3)) + S(2))*(-q*x + S(1))*Subst(Int(S(1)/(sqrt(-x**S(2) + S(1))*sqrt(x**S(2) - S(4)*sqrt(S(3)) + S(7))*(c*q + d*(-sqrt(S(3)) + S(1)) + x*(c*q + d*(S(1) + sqrt(S(3)))))), x), x, (q*x + S(-1) + sqrt(S(3)))/(-q*x + S(1) + sqrt(S(3))))/(q*sqrt((-q*x + S(1))/(-q*x + S(1) + sqrt(S(3)))**S(2))*sqrt(a + b*x**S(3)))
rule388 = ReplacementRule(pattern388, lambda e, a, f, x, b, d, c : With388(e, a, f, x, b, d, c))
rubi.add(rule388)
pattern389 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: PosQ(a)), CustomConstraint(lambda b: NegQ(b)), CustomConstraint(lambda f, d, b, e, a, x, q, c: NonzeroQ(e*q + f*(S(1) + sqrt(S(3))))))
def With389(a, f, x, b, d, e, c):
q = Rt(-b/a, S(3))
return (-c*f + d*e)*Int((-q*x + S(1) + sqrt(S(3)))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(c*q + d*(S(1) + sqrt(S(3)))) + (e*q + f*(S(1) + sqrt(S(3))))*Int(1/sqrt(a + b*x**S(3)), x)/(c*q + d*(S(1) + sqrt(S(3))))
rule389 = ReplacementRule(pattern389, lambda a, f, x, b, d, e, c : With389(a, f, x, b, d, e, c))
rubi.add(rule389)
pattern390 = Pattern(Integral((e_ + x_*WC('f', S(1)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: PosQ(b)), CustomConstraint(lambda f, d, a, e, b, x, q, c: ZeroQ(e*q + f*(-sqrt(S(3)) + S(1)))))
def With390(e, a, f, x, b, d, c):
q = Rt(-b/a, S(3))
return S(4)*S(3)**(S(1)/4)*f*sqrt((q**S(2)*x**S(2) + q*x + S(1))/(-q*x - sqrt(S(3)) + S(1))**S(2))*sqrt(sqrt(S(3)) + S(2))*(-q*x + S(1))*Subst(Int(S(1)/(sqrt(-x**S(2) + S(1))*sqrt(x**S(2) + S(4)*sqrt(S(3)) + S(7))*(c*q + d*(S(1) + sqrt(S(3))) + x*(c*q + d*(-sqrt(S(3)) + S(1))))), x), x, (-q*x + S(1) + sqrt(S(3)))/(q*x + S(-1) + sqrt(S(3))))/(q*sqrt((q*x + S(-1))/(-q*x - sqrt(S(3)) + S(1))**S(2))*sqrt(a + b*x**S(3)))
rule390 = ReplacementRule(pattern390, lambda e, a, f, x, b, d, c : With390(e, a, f, x, b, d, c))
rubi.add(rule390)
pattern391 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: PosQ(b)), CustomConstraint(lambda f, d, b, e, a, x, q, c: NonzeroQ(e*q + f*(-sqrt(S(3)) + S(1)))))
def With391(a, f, x, b, d, e, c):
q = Rt(-b/a, S(3))
return (-c*f + d*e)*Int((-q*x - sqrt(S(3)) + S(1))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(c*q + d*(-sqrt(S(3)) + S(1))) + (e*q + f*(-sqrt(S(3)) + S(1)))*Int(1/sqrt(a + b*x**S(3)), x)/(c*q + d*(-sqrt(S(3)) + S(1)))
rule391 = ReplacementRule(pattern391, lambda a, f, x, b, d, e, c : With391(a, f, x, b, d, e, c))
rubi.add(rule391)
pattern392 = Pattern(Integral((e_ + x_*WC('f', S(1)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: NegQ(b)), CustomConstraint(lambda f, d, a, e, b, x, q, c: ZeroQ(-e*q + f*(-sqrt(S(3)) + S(1)))))
def With392(e, a, f, x, b, d, c):
q = Rt(b/a, S(3))
return -S(4)*S(3)**(S(1)/4)*f*sqrt((q**S(2)*x**S(2) - q*x + S(1))/(q*x - sqrt(S(3)) + S(1))**S(2))*sqrt(sqrt(S(3)) + S(2))*(q*x + S(1))*Subst(Int(S(1)/(sqrt(-x**S(2) + S(1))*sqrt(x**S(2) + S(4)*sqrt(S(3)) + S(7))*(-c*q + d*(S(1) + sqrt(S(3))) + x*(-c*q + d*(-sqrt(S(3)) + S(1))))), x), x, (q*x + S(1) + sqrt(S(3)))/(-q*x + S(-1) + sqrt(S(3))))/(q*sqrt((-q*x + S(-1))/(q*x - sqrt(S(3)) + S(1))**S(2))*sqrt(a + b*x**S(3)))
rule392 = ReplacementRule(pattern392, lambda e, a, f, x, b, d, c : With392(e, a, f, x, b, d, c))
rubi.add(rule392)
pattern393 = Pattern(Integral((x_*WC('f', S(1)) + WC('e', S(0)))/(sqrt(a_ + x_**S(3)*WC('b', S(1)))*(c_ + x_*WC('d', 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 a: NegQ(a)), CustomConstraint(lambda b: NegQ(b)), CustomConstraint(lambda f, d, b, e, a, x, q, c: NonzeroQ(-e*q + f*(-sqrt(S(3)) + S(1)))))
def With393(a, f, x, b, d, e, c):
q = Rt(b/a, S(3))
return (-c*f + d*e)*Int((q*x - sqrt(S(3)) + S(1))/(sqrt(a + b*x**S(3))*(c + d*x)), x)/(-c*q + d*(-sqrt(S(3)) + S(1))) + (-e*q + f*(-sqrt(S(3)) + S(1)))*Int(1/sqrt(a + b*x**S(3)), x)/(-c*q + d*(-sqrt(S(3)) + S(1)))
rule393 = ReplacementRule(pattern393, lambda a, f, x, b, d, e, c : With393(a, f, x, b, d, e, c))
rubi.add(rule393)
pattern394 = Pattern(Integral(x_**WC('m', S(1))/(c_ + x_**n_*WC('d', S(1)) + sqrt(a_ + x_**n_*WC('b', S(1)))*WC('e', 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 b, a, d, c: ZeroQ(-a*d + b*c, S(0))), CustomConstraint(lambda n, m: IntegerQ((m + S(1))/n)))
rule394 = ReplacementRule(pattern394, lambda n, a, x, m, b, d, e, c : Subst(Int(x**(S(-1) + (m + S(1))/n)/(c + d*x + e*sqrt(a + b*x)), x), x, x**n)/n)
rubi.add(rule394)
pattern395 = Pattern(Integral(WC('u', S(1))/(c_ + x_**n_*WC('d', S(1)) + sqrt(a_ + x_**n_*WC('b', S(1)))*WC('e', 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 n, x: FreeQ(n, x)), CustomConstraint(lambda b, a, d, c: ZeroQ(-a*d + b*c, S(0))))
rule395 = ReplacementRule(pattern395, lambda n, a, x, u, b, d, e, c : -a*e*Int(u/(sqrt(a + b*x**n)*(-a*e**S(2) + c**S(2) + c*d*x**n)), x) + c*Int(u/(-a*e**S(2) + c**S(2) + c*d*x**n), x))
rubi.add(rule395)
pattern396 = Pattern(Integral((A_ + x_**n_*WC('B', S(1)))/(a_ + x_**S(2)*WC('b', S(1)) + x_**n2_*WC('d', S(1)) + x_**n_*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 d, x: FreeQ(d, x)), CustomConstraint(lambda A, x: FreeQ(A, x)), CustomConstraint(lambda B, x: FreeQ(B, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n: NonzeroQ(n + S(-2))), CustomConstraint(lambda n, a, A, B, d: ZeroQ(-A**S(2)*d*(n + S(-1))**S(2) + B**S(2)*a)), CustomConstraint(lambda n, A, B, d, c: ZeroQ(S(2)*A*d*(n + S(-1)) + B*c)))
rule396 = ReplacementRule(pattern396, lambda n2, n, a, x, A, B, b, d, c : A**S(2)*(n + S(-1))*Subst(Int(1/(A**S(2)*b*x**S(2)*(n + S(-1))**S(2) + a), x), x, x/(A*(n + S(-1)) - B*x**n)))
rubi.add(rule396)
pattern397 = Pattern(Integral(x_**WC('m', S(1))*(A_ + x_**WC('n', S(1))*WC('B', S(1)))/(a_ + x_**n2_*WC('d', S(1)) + x_**WC('k', S(1))*WC('b', S(1)) + 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 d, x: FreeQ(d, 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda k, m: ZeroQ(k - S(2)*m + S(-2))), CustomConstraint(lambda n, a, m, A, B, d: ZeroQ(-A**S(2)*d*(m - n + S(1))**S(2) + B**S(2)*a*(m + S(1))**S(2))), CustomConstraint(lambda n, A, m, B, d, c: ZeroQ(-S(2)*A*d*(m - n + S(1)) + B*c*(m + S(1)))))
rule397 = ReplacementRule(pattern397, lambda n2, n, k, a, x, A, m, B, b, d, c : A**S(2)*(m - n + S(1))*Subst(Int(1/(A**S(2)*b*x**S(2)*(m - n + S(1))**S(2) + a), x), x, x**(m + S(1))/(A*(m - n + S(1)) + B*x**n*(m + S(1))))/(m + S(1)))
rubi.add(rule397)
pattern398 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', S(1)))**p_*(d_ + g_*x_**n3_ + x_**n2_*WC('f', S(1)) + x_**n_*WC('e', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule398 = ReplacementRule(pattern398, lambda n2, n3, p, n, a, g, f, x, b, d, e, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-a*b*(a*g + c*e) - S(2)*a*c*(-a*f + c*d) + b**S(2)*c*d + x**n*(-a*b**S(2)*g - S(2)*a*c*(-a*g + c*e) + b*c*(a*f + c*d)))/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(a*b*(a*g + c*e) - S(2)*a*c*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))) - b**S(2)*c*d*(n*p + n + S(1)) + x**n*(a*b**S(2)*g*(n*(p + S(2)) + S(1)) - S(2)*a*c*(a*g*(n + S(1)) - c*e*(n*(S(2)*p + S(3)) + S(1))) - b*c*(a*f + c*d)*(n*(S(2)*p + S(3)) + S(1))), x), x)/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule398)
pattern399 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', S(1)))**p_*(d_ + x_**n2_*WC('f', S(1)) + x_**n_*WC('e', 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 n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule399 = ReplacementRule(pattern399, lambda n2, p, n, a, f, x, b, d, e, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-a*b*e - S(2)*a*(-a*f + c*d) + b**S(2)*d + x**n*(-S(2)*a*c*e + b*(a*f + c*d)))/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(a*b*e - S(2)*a*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))) - b**S(2)*d*(n*p + n + S(1)) - x**n*(-S(2)*a*c*e*(n*(S(2)*p + S(3)) + S(1)) + b*(a*f + c*d)*(n*(S(2)*p + S(3)) + S(1))), x), x)/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule399)
pattern400 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', S(1)))**p_*(d_ + g_*x_**n3_ + x_**n_*WC('e', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule400 = ReplacementRule(pattern400, lambda n2, n3, p, n, a, g, x, b, d, e, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-a*b*(a*g + c*e) - S(2)*a*c**S(2)*d + b**S(2)*c*d + x**n*(-a*b**S(2)*g - S(2)*a*c*(-a*g + c*e) + b*c**S(2)*d))/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(a*b*(a*g + c*e) + S(2)*a*c**S(2)*d*(S(2)*n*(p + S(1)) + S(1)) - b**S(2)*c*d*(n*p + n + S(1)) + x**n*(a*b**S(2)*g*(n*(p + S(2)) + S(1)) - S(2)*a*c*(a*g*(n + S(1)) - c*e*(n*(S(2)*p + S(3)) + S(1))) - b*c**S(2)*d*(n*(S(2)*p + S(3)) + S(1))), x), x)/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule400)
pattern401 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', S(1)))**p_*(d_ + g_*x_**n3_ + x_**n2_*WC('f', 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 f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule401 = ReplacementRule(pattern401, lambda n2, n3, p, n, a, g, f, x, b, d, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-a**S(2)*b*g - S(2)*a*c*(-a*f + c*d) + b**S(2)*c*d + x**n*(S(2)*a**S(2)*c*g - a*b**S(2)*g + b*c*(a*f + c*d)))/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(a**S(2)*b*g - S(2)*a*c*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))) - b**S(2)*c*d*(n*p + n + S(1)) + x**n*(-S(2)*a**S(2)*c*g*(n + S(1)) + a*b**S(2)*g*(n*(p + S(2)) + S(1)) - b*c*(a*f + c*d)*(n*(S(2)*p + S(3)) + S(1))), x), x)/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule401)
pattern402 = Pattern(Integral((d_ + x_**n2_*WC('f', S(1)))*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule402 = ReplacementRule(pattern402, lambda n2, p, n, a, f, x, b, d, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-S(2)*a*(-a*f + c*d) + b**S(2)*d + b*x**n*(a*f + c*d))/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))) + Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(S(2)*a*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))) + b**S(2)*d*(n*p + n + S(1)) + b*x**n*(a*f + c*d)*(n*(S(2)*p + S(3)) + S(1)), x), x)/(a*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule402)
pattern403 = Pattern(Integral((d_ + g_*x_**n3_)*(a_ + x_**n2_*WC('c', S(1)) + x_**n_*WC('b', 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 d, x: FreeQ(d, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda b, a, c: NonzeroQ(-S(4)*a*c + b**S(2))), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule403 = ReplacementRule(pattern403, lambda n2, n3, p, n, a, g, x, b, d, c : -x*(a + b*x**n + c*x**(S(2)*n))**(p + S(1))*(-a**S(2)*b*g - S(2)*a*c**S(2)*d + b**S(2)*c*d + x**n*(S(2)*a**S(2)*c*g - a*b**S(2)*g + b*c**S(2)*d))/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))) - Int((a + b*x**n + c*x**(S(2)*n))**(p + S(1))*Simp(a**S(2)*b*g + S(2)*a*c**S(2)*d*(S(2)*n*(p + S(1)) + S(1)) - b**S(2)*c*d*(n*p + n + S(1)) + x**n*(-S(2)*a**S(2)*c*g*(n + S(1)) + a*b**S(2)*g*(n*(p + S(2)) + S(1)) - b*c**S(2)*d*(n*(S(2)*p + S(3)) + S(1))), x), x)/(a*c*n*(p + S(1))*(-S(4)*a*c + b**S(2))))
rubi.add(rule403)
pattern404 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)))**p_*(d_ + g_*x_**n3_ + x_**n2_*WC('f', S(1)) + x_**n_*WC('e', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule404 = ReplacementRule(pattern404, lambda n2, n3, p, n, a, g, f, x, d, e, c : x*(a + c*x**(S(2)*n))**(p + S(1))*(-S(2)*a*c*x**n*(-a*g + c*e) - S(2)*a*c*(-a*f + c*d))/(S(4)*a**S(2)*c**S(2)*n*(p + S(1))) + Int((a + c*x**(S(2)*n))**(p + S(1))*Simp(-S(2)*a*c*x**n*(a*g*(n + S(1)) - c*e*(n*(S(2)*p + S(3)) + S(1))) - S(2)*a*c*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))), x), x)/(S(4)*a**S(2)*c**S(2)*n*(p + S(1))))
rubi.add(rule404)
pattern405 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)))**p_*(d_ + x_**n2_*WC('f', S(1)) + x_**n_*WC('e', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule405 = ReplacementRule(pattern405, lambda n2, p, n, a, f, x, d, e, c : x*(a + c*x**(S(2)*n))**(p + S(1))*(-S(2)*a*c*e*x**n - S(2)*a*(-a*f + c*d))/(S(4)*a**S(2)*c*n*(p + S(1))) + Int((a + c*x**(S(2)*n))**(p + S(1))*Simp(S(2)*a*c*e*x**n*(n*(S(2)*p + S(3)) + S(1)) - S(2)*a*(a*f - c*d*(S(2)*n*(p + S(1)) + S(1))), x), x)/(S(4)*a**S(2)*c*n*(p + S(1))))
rubi.add(rule405)
pattern406 = Pattern(Integral((a_ + x_**n2_*WC('c', S(1)))**p_*(d_ + g_*x_**n3_ + x_**n_*WC('e', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda n, x: FreeQ(n, x)), CustomConstraint(lambda n2, n: ZeroQ(-S(2)*n + n2)), CustomConstraint(lambda n, n3: ZeroQ(-S(3)*n + n3)), CustomConstraint(lambda p: NegativeIntegerQ(p + S(1))))
rule406 = ReplacementRule(pattern406, lambda n2, n3, p, n, a, g, x, d, e, c : x*(a + c*x**(S(2)*n))**(p + S(1))*(-S(2)*a*c**S(2)*d - S(2)*a*c*x**n*(-a*g + c*e))/(S(4)*a**S(2)*c**S(2)*n*(p + S(1))) + Int((a + c*x**(S(2)*n))**(p + S(1))*Simp(S(2)*a*c**S(2)*d*(S(2)*n*(p + S(1)) + S(1)) - S(2)*a*c*x**n*(a*g*(n + S(1)) - c*e*(n*(S(2)*p + S(3)) + S(1))), x), x)/(S(4)*a**S(2)*c**S(2)*n*(p + S(1))))
rubi.add(rule406)
pattern407 = Pattern(Integral((x_**S(4)*WC('c', S(1)) + x_**S(2)*WC('b', S(1)) + WC('a', S(0)))/(d_ + x_**S(6)*WC('g', S(1)) + x_**S(4)*WC('f', S(1)) + x_**S(2)*WC('e', 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 g, x: FreeQ(g, x)), CustomConstraint(lambda a, g, f, b, d, c: ZeroQ(-S(12)*a**S(3)*g**S(2) + a**S(2)*c*f**S(2) + S(2)*a*b*g*(a*f + S(3)*c*d) + S(9)*c**S(3)*d**S(2) - c*d*f*(S(6)*a*c + b**S(2)))), CustomConstraint(lambda a, g, f, b, d, e, c: ZeroQ(a**S(3)*c*f**S(2)*g + S(2)*a**S(3)*g**S(2)*(-S(6)*a*g + b*f) - S(3)*a**S(2)*c**S(2)*d*f*g + S(3)*c**S(4)*d**S(2)*e - c**S(3)*d*(-S(12)*a*d*g + a*e*f + S(2)*b*d*f))), CustomConstraint(lambda f, a, d, c: NonzeroQ(-a*f + S(3)*c*d)), CustomConstraint(lambda c, a, b, d, g: NonzeroQ(-S(2)*a**S(2)*g + b*c*d)), CustomConstraint(lambda a, g, f, b, d, c: NonzeroQ(S(4)*a**S(2)*g - a*b*f + b*c*d)), CustomConstraint(lambda c, a, f, b, d, g: PosQ((S(12)*a**S(2)*g**S(2) - a*c*f**S(2) + f*(-S(2)*a*b*g + S(3)*c**S(2)*d))/(c*g*(-a*f + S(3)*c*d)))), )
def With407(a, g, f, x, b, d, e, c):
q = Rt((S(12)*a**S(2)*g**S(2) - a*c*f**S(2) + f*(-S(2)*a*b*g + S(3)*c**S(2)*d))/(c*g*(-a*f + S(3)*c*d)), S(2))
r = Rt((a*c*f**S(2) - f*(S(2)*a*b*g + S(3)*c**S(2)*d) + S(4)*g*(a**S(2)*g + b*c*d))/(c*g*(-a*f + S(3)*c*d)), S(2))
return -c*atan((r - S(2)*x)/q)/(g*q) + c*atan((r + S(2)*x)/q)/(g*q) - c*atan(x*(-a*f + S(3)*c*d)*(S(6)*a**S(2)*b*g**S(2) - S(2)*a**S(2)*c*f*g - a*b**S(2)*f*g + b*c**S(2)*d*f + c**S(2)*g*x**S(4)*(-a*f + S(3)*c*d) + c*x**S(2)*(S(2)*a**S(2)*g**S(2) - a*c*f**S(2) - b*c*d*g + S(3)*c**S(2)*d*f))/(g*q*(-S(2)*a**S(2)*g + b*c*d)*(S(4)*a**S(2)*g - a*b*f + b*c*d)))/(g*q)
rule407 = ReplacementRule(pattern407, lambda a, g, f, x, b, d, e, c : With407(a, g, f, x, b, d, e, c))
rubi.add(rule407)
pattern408 = Pattern(Integral((x_**S(4)*WC('c', S(1)) + WC('a', S(0)))/(d_ + x_**S(6)*WC('g', S(1)) + x_**S(4)*WC('f', S(1)) + x_**S(2)*WC('e', 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 e, x: FreeQ(e, x)), CustomConstraint(lambda f, x: FreeQ(f, x)), CustomConstraint(lambda g, x: FreeQ(g, x)), CustomConstraint(lambda c, a, f, d, g: ZeroQ(-S(12)*a**S(3)*g**S(2) + a**S(2)*c*f**S(2) - S(6)*a*c**S(2)*d*f + S(9)*c**S(3)*d**S(2))), CustomConstraint(lambda a, g, f, d, e, c: ZeroQ(-S(12)*a**S(4)*g**S(3) + a**S(3)*c*f**S(2)*g - S(3)*a**S(2)*c**S(2)*d*f*g - a*c**S(3)*d*(-S(12)*d*g + e*f) + S(3)*c**S(4)*d**S(2)*e)), CustomConstraint(lambda f, a, d, c: NonzeroQ(-a*f + S(3)*c*d)), CustomConstraint(lambda c, a, f, d, g: PosQ((S(12)*a**S(2)*g**S(2) - a*c*f**S(2) + S(3)*c**S(2)*d*f)/(c*g*(-a*f + S(3)*c*d)))), )
def With408(c, a, f, x, d, e, g):
q = Rt((S(12)*a**S(2)*g**S(2) - a*c*f**S(2) + S(3)*c**S(2)*d*f)/(c*g*(-a*f + S(3)*c*d)), S(2))
r = Rt((S(4)*a**S(2)*g**S(2) + a*c*f**S(2) - S(3)*c**S(2)*d*f)/(c*g*(-a*f + S(3)*c*d)), S(2))
return -c*atan((r - S(2)*x)/q)/(g*q) + c*atan((r + S(2)*x)/q)/(g*q) - c*atan(c*x*(-a*f + S(3)*c*d)*(S(2)*a**S(2)*f*g - c*g*x**S(4)*(-a*f + S(3)*c*d) - x**S(2)*(S(2)*a**S(2)*g**S(2) - a*c*f**S(2) + S(3)*c**S(2)*d*f))/(S(8)*a**S(4)*g**S(3)*q))/(g*q)
rule408 = ReplacementRule(pattern408, lambda c, a, f, x, d, e, g : With408(c, a, f, x, d, e, g))
rubi.add(rule408)
pattern409 = Pattern(Integral(u_*v_**p_, x_), CustomConstraint(lambda p: RationalQ(p)), CustomConstraint(lambda p: Less(p, S(-1))), CustomConstraint(lambda x, u: PolynomialQ(u, x)), CustomConstraint(lambda v, x: PolynomialQ(v, x)), CustomConstraint(lambda v: SumQ(v)), CustomConstraint(lambda v, x, u: Not(BinomialQ(v, x) & MonomialQ(u, x))), CustomConstraint(lambda v, x, u: Not(ZeroQ(Coefficient(u, x, S(0))) & ZeroQ(Coefficient(v, x, S(0))))), CustomConstraint(lambda v, n, w, LessEqual, Less, m, x, p, c, u: FalseQ(DerivativeDivides(v, u, x)) & Less(m + n*p, S(-1)) & Inequality(S(1), Less, n, LessEqual, m + S(1))))
def With409(v, p, x, u):
m = Exponent(u, x)
n = Exponent(v, x)
return Module(List(Set(c, Coefficient(u, x, m)/((m + n*p + S(1))*Coefficient(v, x, n))), w), CompoundExpression(Set(c, Coefficient(u, x, m)/((m + n*p + S(1))*Coefficient(v, x, n))), Set(w, Apart(-c*x**(m - n)*(v*(m - n + S(1)) + x*(p + S(1))*D(v, x)) + u, x)), If(ZeroQ(w), c*v**(p + S(1))*x**(m - n + S(1)), c*v**(p + S(1))*x**(m - n + S(1)) + Int(v**p*w, x))))
rule409 = ReplacementRule(pattern409, lambda v, p, x, u : With409(v, p, x, u))
rubi.add(rule409)
return rubi
| 163.76966 | 6,553 | 0.576858 | 68,397 | 351,941 | 2.931196 | 0.022545 | 0.369913 | 0.30711 | 0.058777 | 0.856807 | 0.848398 | 0.834282 | 0.817318 | 0.803152 | 0.789456 | 0 | 0.043399 | 0.141674 | 351,941 | 2,148 | 6,554 | 163.845903 | 0.620283 | 0 | 0 | 0.1188 | 0 | 0 | 0.00549 | 0.000088 | 0 | 0 | 0 | 0 | 0 | 1 | 0.087082 | false | 0 | 0.006344 | 0 | 0.180508 | 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 |
e99cc11fc06ef511c97815b69e90b4ccecdcd2b8 | 13,099 | py | Python | idea_6_analysis.py | sherlock1987/ConvLab-2 | 9547cb09bfd7e297e2c609637c9e38f6c94fdbfb | [
"Apache-2.0"
] | 1 | 2020-06-05T08:42:51.000Z | 2020-06-05T08:42:51.000Z | idea_6_analysis.py | sherlock1987/ConvLab-2 | 9547cb09bfd7e297e2c609637c9e38f6c94fdbfb | [
"Apache-2.0"
] | null | null | null | idea_6_analysis.py | sherlock1987/ConvLab-2 | 9547cb09bfd7e297e2c609637c9e38f6c94fdbfb | [
"Apache-2.0"
] | 1 | 2020-06-05T09:15:51.000Z | 2020-06-05T09:15:51.000Z | import os
import torch
import logging
import torch.nn as nn
import numpy as np
from convlab2.util.train_util import to_device
import torch.nn as nn
from torch import optim
import zipfile
import sys
import matplotlib.pyplot as plt
import pickle
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
import torch.tensor as tensor
import copy
# result for the descriminator
encoder = {}
decoder = {}
collections = {'[1, 0, 1, 0, 0, 0, 0, 0, 0]', '[1, 0, 0, 0, 0, 0, 1, 0, 1]', '[0, 0, 1, 1, 0, 0, 0, 0, 0]', '[0, 0, 1, 0, 0, 0, 1, 0, 0]', '[1, 0, 0, 0, 0, 1, 0, 0, 0]', '[0, 1, 1, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 1, 0, 1]', '[0, 0, 1, 0, 0, 1, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 1, 0, 0, 0, 0, 1, 0]', '[1, 0, 0, 0, 0, 0, 0, 0, 1]', '[0, 1, 0, 1, 0, 0, 0, 0, 0]', '[0, 0, 0, 1, 0, 0, 0, 0, 0]', '[1, 0, 0, 0, 0, 0, 1, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 1]', '[1, 1, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 1, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 1, 1, 1, 0]', '[0, 0, 0, 0, 0, 0, 1, 1, 1]', '[1, 0, 1, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 1, 1, 0, 0]', '[1, 0, 0, 0, 0, 0, 0, 1, 1]', '[1, 0, 0, 0, 0, 1, 0, 1, 0]', '[0, 1, 0, 0, 0, 1, 0, 1, 0]', '[0, 0, 0, 0, 0, 1, 0, 0, 0]', '[0, 0, 1, 0, 0, 0, 0, 0, 1]', '[0, 0, 1, 0, 0, 1, 0, 1, 0]', '[0, 1, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 1, 0, 0, 1, 0, 0, 1]', '[0, 0, 1, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 1, 1, 0, 1]', '[1, 0, 0, 0, 0, 1, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 1, 1, 0]', '[0, 0, 1, 0, 0, 0, 1, 0, 1]', '[1, 0, 1, 0, 0, 0, 0, 0, 1]', '[0, 1, 0, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 1, 0, 1, 0, 0, 0]', '[0, 0, 0, 0, 0, 1, 0, 0, 1]', '[1, 0, 0, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 1, 0, 1, 1]', '[0, 0, 1, 0, 0, 0, 1, 1, 0]', '[1, 0, 0, 0, 0, 0, 1, 1, 0]', '[0, 0, 1, 0, 0, 0, 0, 0, 0]', '[1, 0, 0, 0, 0, 0, 0, 0, 0]', '[1, 0, 1, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 0, 1, 0, 0]', '[0, 0, 0, 0, 0, 1, 0, 1, 0]'}
# len_comb = len(collections)
# print(len(collections))
# zeros = [0] * len_comb
# for i, ele in enumerate(collections):
# one_hot = copy.deepcopy(zeros)
# one_hot[i] = 1
# encoder[ele] = i
# decoder[str(one_hot)] = ele
# print(collections)
# print(encoder)
# print(decoder)
a = torch.rand((2, 3))
one = torch.ones_like(a)
zero = torch.zeros_like(a)
a = torch.where(a > 0.5, one, a)
print(a)
print(torch.where(a <0.5, zero, a))
# from domain list to one hot
encoder = {'[1, 0, 0, 0, 0, 1, 0, 0, 0]': 0, '[0, 0, 0, 0, 0, 0, 1, 1, 1]': 1, '[1, 0, 1, 0, 0, 0, 0, 1, 0]': 2, '[0, 0, 0, 0, 0, 0, 0, 0, 0]': 3, '[0, 0, 0, 0, 0, 1, 0, 1, 0]': 4, '[1, 0, 0, 0, 0, 0, 1, 0, 1]': 5, '[1, 0, 1, 0, 0, 0, 0, 0, 1]': 6, '[1, 0, 0, 0, 0, 0, 0, 0, 1]': 7, '[0, 0, 1, 0, 0, 1, 0, 0, 1]': 8, '[0, 0, 0, 1, 0, 0, 0, 0, 0]': 9, '[1, 0, 1, 0, 0, 0, 0, 1, 1]': 10, '[1, 0, 0, 0, 0, 1, 0, 1, 0]': 11, '[0, 0, 0, 0, 0, 1, 1, 0, 0]': 12, '[1, 0, 1, 0, 0, 0, 0, 0, 0]': 13, '[0, 0, 0, 0, 0, 0, 1, 0, 0]': 14, '[0, 0, 1, 0, 0, 1, 0, 1, 0]': 15, '[1, 0, 0, 0, 0, 1, 0, 0, 1]': 16, '[0, 0, 0, 0, 0, 1, 0, 0, 0]': 17, '[0, 0, 0, 0, 0, 1, 0, 1, 1]': 18, '[1, 0, 0, 0, 0, 0, 0, 1, 1]': 19, '[0, 0, 1, 0, 0, 0, 0, 1, 1]': 20, '[0, 0, 0, 0, 0, 0, 1, 0, 1]': 21, '[0, 0, 0, 0, 0, 0, 0, 0, 1]': 22, '[0, 1, 0, 0, 0, 1, 0, 1, 0]': 23, '[0, 0, 0, 1, 0, 0, 0, 1, 0]': 24, '[0, 0, 0, 0, 0, 0, 0, 1, 0]': 25, '[0, 1, 0, 0, 0, 0, 0, 0, 0]': 26, '[0, 0, 1, 1, 0, 0, 0, 0, 0]': 27, '[1, 0, 0, 0, 0, 0, 0, 0, 0]': 28, '[0, 0, 0, 0, 0, 0, 0, 1, 1]': 29, '[0, 0, 0, 0, 0, 0, 1, 1, 0]': 30, '[0, 0, 1, 0, 0, 0, 0, 0, 0]': 31, '[0, 1, 0, 0, 0, 0, 0, 1, 0]': 32, '[0, 0, 0, 0, 0, 1, 0, 0, 1]': 33, '[0, 0, 0, 0, 0, 1, 1, 0, 1]': 34, '[0, 0, 1, 0, 0, 0, 0, 1, 0]': 35, '[0, 0, 1, 0, 0, 0, 1, 0, 0]': 36, '[0, 0, 1, 0, 0, 0, 1, 1, 0]': 37, '[0, 0, 0, 1, 0, 1, 0, 0, 0]': 38, '[1, 0, 0, 0, 0, 0, 1, 1, 0]': 39, '[1, 0, 0, 0, 0, 0, 1, 0, 0]': 40, '[0, 1, 0, 1, 0, 0, 0, 0, 0]': 41, '[0, 0, 1, 0, 0, 0, 0, 0, 1]': 42, '[1, 0, 0, 0, 0, 0, 0, 1, 0]': 43, '[0, 0, 1, 0, 0, 0, 1, 0, 1]': 44, '[1, 1, 0, 0, 0, 0, 0, 0, 0]': 45, '[0, 0, 1, 0, 0, 1, 0, 0, 0]': 46, '[0, 0, 0, 0, 0, 1, 1, 1, 0]': 47, '[0, 1, 1, 0, 0, 0, 0, 0, 0]': 48}
# from one hot to domain list
decoder = {'[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 1, 0, 0, 0]', '[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 1, 1, 1]', '[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 1, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 0, 1, 0]', '[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 1, 0, 1]', '[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 1, 0, 0, 0, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 1, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 1, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 1, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 1, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 1, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 1, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 1, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 1, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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]': '[1, 0, 0, 0, 0, 1, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 0, 1, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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]': '[1, 0, 0, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 1, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 1, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 1, 0, 1, 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, 1, 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, 1, 0, 0, 0, 1, 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, 1, 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, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 1, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 1, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 1]', '[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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 0, 1, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 1, 0, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 0, 0, 1, 1, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 1, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 1, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[0, 0, 0, 1, 0, 1, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 1, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 1, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]': '[0, 1, 0, 1, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 0, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]': '[1, 0, 0, 0, 0, 0, 0, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]': '[0, 0, 1, 0, 0, 0, 1, 0, 1]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]': '[1, 1, 0, 0, 0, 0, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]': '[0, 0, 1, 0, 0, 1, 0, 0, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]': '[0, 0, 0, 0, 0, 1, 1, 1, 0]', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]': '[0, 1, 1, 0, 0, 0, 0, 0, 0]'}
| 304.627907 | 8,928 | 0.34308 | 3,928 | 13,099 | 1.141548 | 0.026731 | 1.349688 | 1.851249 | 2.275647 | 0.844335 | 0.830955 | 0.830955 | 0.830955 | 0.830955 | 0.737957 | 0 | 0.416912 | 0.300328 | 13,099 | 42 | 8,929 | 311.880952 | 0.07234 | 0.026949 | 0 | 0.076923 | 0 | 1.884615 | 0.878093 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.538462 | 0 | 0.538462 | 0.076923 | 0 | 0 | 1 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 18 |
e9b393ba7f8b4b260d3f0e50e9838089159cd2f1 | 34,894 | py | Python | src/frr/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | src/frr/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | src/frr/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# test_bgp_conditional_advertisement.py
#
# Copyright (c) 2020 by
# Samsung R&D Institute India - Bangalore.
# Madhurilatha Kuruganti
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
"""
Test BGP conditional advertisement functionality.
+--------+ +--------+ +--------+
| | | | | |
| R1 |------------| R2 |------------| R3 |
| | | | | |
+--------+ +--------+ +--------+
R2 is DUT and peers with R1 and R3 in default bgp instance.
Following tests are covered under BGP conditional advertisement functionality.
Conditional advertisement
-------------------------
TC11: R3 BGP convergence, without advertise-map configuration.
All routes are advertised to R3.
TC21: exist-map routes present in R2's BGP table.
advertise-map routes present in R2's BGP table are advertised to R3.
TC22: exist-map routes not present in R2's BGP table
advertise-map routes present in R2's BGP table are withdrawn from R3.
TC31: non-exist-map routes not present in R2's BGP table
advertise-map routes present in R2's BGP table are advertised to R3.
TC32: non-exist-map routes present in R2's BGP table
advertise-map routes present in R2's BGP table are withdrawn from R3.
TC41: non-exist-map route-map configuration removed in R2.
advertise-map routes present in R2's BGP table are advertised to R3.
TC42: exist-map route-map configuration removed in R2
advertise-map routes present in R2's BGP table are withdrawn from R3.
Conditional advertisement(received routes) along with Route-map Filter
----------------------------------------------------------------------
TC51: exist-map routes present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 except advertise-map routes.
TC52: exist-map routes present in R2's BGP table, without route-map filter.
All routes are advertised to R3 including advertise-map routes.
TC53: non-exist-map routes present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 including advertise-map routes.
TC54: non-exist-map routes present in R2's BGP table, without route-map filter.
All routes are advertised to R3 except advertise-map routes.
TC61: exist-map routes not present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 including advertise-map routes.
TC62: exist-map routes not present in R2's BGP table, without route-map filter.
All routes are advertised to R3 except advertise-map routes.
TC63: non-exist-map routes not present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 except advertise-map routes.
TC64: non-exist-map routes not present in R2's BGP table, without route-map filter.
All routes are advertised to R3 including advertise-map routes.
Conditional advertisement(attached routes) along with Route-map Filter
-----------------------------------------------------------------
TC71: exist-map routes present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 except advertise-map routes.
TC72: exist-map routes present in R2's BGP table, without route-map filter.
All routes are advertised to R3 including advertise-map routes.
TC73: non-exist-map routes present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 including advertise-map routes.
TC74: non-exist-map routes present in R2's BGP table, without route-map filter.
All routes are advertised to R3 except advertise-map routes.
TC81: exist-map routes not present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 including advertise-map routes.
TC82: exist-map routes not present in R2's BGP table, without route-map filter.
All routes are advertised to R3 except advertise-map routes.
TC83: non-exist-map routes not present in R2's BGP table, with route-map filter.
All routes are withdrawn from R3 except advertise-map routes.
TC84: non-exist-map routes not present in R2's BGP table, without route-map filter.
All routes are advertised to R3 including advertise-map routes.
TC91: exist-map routes present in R2's BGP table, with route-map filter and network.
All routes are advertised to R3 including advertise-map routes.
TC92: exist-map routes present in R2's BGP table, with route-map filter and no network.
All routes are advertised to R3 except advertise-map routes.
TC93: non-exist-map routes not present in R2's BGP table, with route-map filter and network.
All routes are advertised to R3 including advertise-map routes.
TC94: non-exist-map routes not present in R2's BGP table, with route-map filter and no network.
All routes are advertised to R3 except advertise-map routes.
i.e.
+----------------+-------------------------+------------------------+
| Routes in | exist-map status | advertise-map status |
| BGP table | | |
+----------------+-------------------------+------------------------+
| Present | Condition matched | Advertise |
+----------------+-------------------------+------------------------+
| Not Present | Condition not matched | Withdrawn |
+----------------+-------------------------+------------------------+
| | non-exist-map status | advertise-map status |
| | | |
+----------------+-------------------------+------------------------+
| Present | Condition matched | Withdrawn |
+----------------+-------------------------+------------------------+
| Not Present | Condition not matched | Advertise |
+----------------+-------------------------+------------------------+
Here in this topology, based on the default route presence in R2 and
the configured condition-map (exist-map/non-exist-map) 10.139.224.0/20
will be either advertised/withdrawn to/from R3.
"""
import os
import sys
import json
import time
import pytest
import functools
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
pytestmark = [pytest.mark.bgpd]
def build_topo(tgen):
r1 = tgen.add_router("r1")
r2 = tgen.add_router("r2")
r3 = tgen.add_router("r3")
switch = tgen.add_switch("s1")
switch.add_link(r1)
switch.add_link(r2)
switch = tgen.add_switch("s2")
switch.add_link(r2)
switch.add_link(r3)
def setup_module(mod):
testsuite_run_time = time.asctime(time.localtime(time.time()))
logger.info("Testsuite start time: {}".format(testsuite_run_time))
logger.info("=" * 40)
logger.info("Running setup_module to create topology")
tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()
for i, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
router.load_config(
TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
)
tgen.start_router()
logger.info("Running setup_module() done")
def teardown_module(mod):
"""
Teardown the pytest environment
* `mod`: module name
"""
logger.info("Running teardown_module to delete topology")
tgen = get_topogen()
tgen.stop_topology()
logger.info(
"Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
)
logger.info("=" * 40)
def test_bgp_conditional_advertisement():
"""
Test BGP conditional advertisement functionality.
"""
tgen = get_topogen()
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
router1 = tgen.gears["r1"]
router2 = tgen.gears["r2"]
router3 = tgen.gears["r3"]
passed = "PASSED!!!"
failed = "FAILED!!!"
def _all_routes_advertised(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": [{"protocol": "bgp"}],
"192.0.2.1/32": [{"protocol": "bgp"}],
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": [{"protocol": "bgp"}],
"203.0.113.1/32": [{"protocol": "bgp"}],
}
return topotest.json_cmp(output, expected)
def _all_routes_withdrawn(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": None,
"192.0.2.5/32": None,
"10.139.224.0/20": None,
"203.0.113.1/32": None,
}
return topotest.json_cmp(output, expected)
# BGP conditional advertisement with route-maps
# EXIST-MAP, ADV-MAP-1 and RMAP-1
def _exist_map_routes_present(router):
return _all_routes_advertised(router)
def _exist_map_routes_not_present(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": None,
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": None,
"203.0.113.1/32": [{"protocol": "bgp"}],
}
return topotest.json_cmp(output, expected)
def _non_exist_map_routes_present(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": [{"protocol": "bgp"}],
"192.0.2.1/32": None,
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": None,
"203.0.113.1/32": [{"protocol": "bgp"}],
}
return topotest.json_cmp(output, expected)
def _non_exist_map_routes_not_present(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": [{"protocol": "bgp"}],
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": [{"protocol": "bgp"}],
"203.0.113.1/32": [{"protocol": "bgp"}],
}
return topotest.json_cmp(output, expected)
def _exist_map_no_condition_route_map(router):
return _non_exist_map_routes_present(router)
def _non_exist_map_no_condition_route_map(router):
return _all_routes_advertised(router)
def _exist_map_routes_present_rmap_filter(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": [{"protocol": "bgp"}],
"192.0.2.5/32": None,
"10.139.224.0/20": [{"protocol": "bgp"}],
"203.0.113.1/32": None,
}
return topotest.json_cmp(output, expected)
def _exist_map_routes_present_no_rmap_filter(router):
return _all_routes_advertised(router)
def _non_exist_map_routes_present_rmap_filter(router):
return _all_routes_withdrawn(router)
def _non_exist_map_routes_present_no_rmap_filter(router):
return _non_exist_map_routes_present(router)
def _exist_map_routes_not_present_rmap_filter(router):
return _all_routes_withdrawn(router)
def _exist_map_routes_not_present_no_rmap_filter(router):
return _exist_map_routes_not_present(router)
def _non_exist_map_routes_not_present_rmap_filter(router):
return _exist_map_routes_present_rmap_filter(router)
def _non_exist_map_routes_not_present_no_rmap_filter(router):
return _non_exist_map_routes_not_present(router)
# BGP conditional advertisement with route-maps
# EXIST-MAP, ADV-MAP-2 and RMAP-2
def _exist_map_routes_not_present_rmap2_filter(router):
return _all_routes_withdrawn(router)
def _exist_map_routes_not_present_no_rmap2_filter(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": [{"protocol": "bgp"}],
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": [{"protocol": "bgp"}],
"203.0.113.1/32": None,
}
return topotest.json_cmp(output, expected)
def _non_exist_map_routes_not_present_rmap2_filter(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": None,
"192.0.2.1/32": None,
"192.0.2.5/32": None,
"10.139.224.0/20": None,
"203.0.113.1/32": [{"protocol": "bgp"}],
}
return topotest.json_cmp(output, expected)
def _non_exist_map_routes_not_present_no_rmap2_filter(router):
return _non_exist_map_routes_not_present(router)
def _exist_map_routes_present_rmap2_filter(router):
return _non_exist_map_routes_not_present_rmap2_filter(router)
def _exist_map_routes_present_no_rmap2_filter(router):
return _all_routes_advertised(router)
def _non_exist_map_routes_present_rmap2_filter(router):
return _all_routes_withdrawn(router)
def _non_exist_map_routes_present_no_rmap2_filter(router):
output = json.loads(router.vtysh_cmd("show ip route json"))
expected = {
"0.0.0.0/0": [{"protocol": "bgp"}],
"192.0.2.1/32": [{"protocol": "bgp"}],
"192.0.2.5/32": [{"protocol": "bgp"}],
"10.139.224.0/20": [{"protocol": "bgp"}],
"203.0.113.1/32": None,
}
return topotest.json_cmp(output, expected)
def _exist_map_routes_present_rmap2_network(router):
return _non_exist_map_routes_not_present_rmap2_filter(router)
def _exist_map_routes_present_rmap2_no_network(router):
return _all_routes_withdrawn(router)
def _non_exist_map_routes_not_present_rmap2_network(router):
return _non_exist_map_routes_not_present_rmap2_filter(router)
def _non_exist_map_routes_not_present_rmap2_no_network(router):
return _all_routes_withdrawn(router)
# TC11: R3 BGP convergence, without advertise-map configuration.
# All routes are advertised to R3.
test_func = functools.partial(_all_routes_advertised, router3)
success, result = topotest.run_and_expect(test_func, None, count=130, wait=1)
msg = 'TC11: "router3" BGP convergence - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC21: exist-map routes present in R2's BGP table.
# advertise-map routes present in R2's BGP table are advertised to R3.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 advertise-map ADV-MAP-1 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_routes_present, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC21: exist-map routes present in "router2" BGP table - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC22: exist-map routes not present in R2's BGP table
# advertise-map routes present in R2's BGP table are withdrawn from R3.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
no network 0.0.0.0/0 route-map DEF
"""
)
test_func = functools.partial(_exist_map_routes_not_present, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC22: exist-map routes not present in "router2" BGP table - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC31: non-exist-map routes not present in R2's BGP table
# advertise-map routes present in R2's BGP table are advertised to R3.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 advertise-map ADV-MAP-1 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(_non_exist_map_routes_not_present, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC31: non-exist-map routes not present in "router2" BGP table - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC32: non-exist-map routes present in R2's BGP table
# advertise-map routes present in R2's BGP table are withdrawn from R3.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
network 0.0.0.0/0 route-map DEF
"""
)
test_func = functools.partial(_non_exist_map_routes_present, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC32: non-exist-map routes present in "router2" BGP table - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC41: non-exist-map route-map configuration removed in R2.
# advertise-map routes present in R2's BGP table are advertised to R3.
router2.vtysh_cmd(
"""
configure terminal
no route-map EXIST-MAP permit 10
"""
)
test_func = functools.partial(_non_exist_map_no_condition_route_map, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC41: non-exist-map route-map removed in "router2" - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC42: exist-map route-map configuration removed in R2
# advertise-map routes present in R2's BGP table are withdrawn from R3.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 advertise-map ADV-MAP-1 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_no_condition_route_map, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = 'TC42: exist-map route-map removed in "router2" - '
assert result is None, msg + failed
logger.info(msg + passed)
# TC51: exist-map routes present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
route-map EXIST-MAP permit 10
match community DEFAULT-ROUTE
match ip address prefix-list DEFAULT-ROUTE
!
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-1 out
"""
)
test_func = functools.partial(_exist_map_routes_present_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC51: exist-map routes present with route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC52: exist-map routes present in R2's BGP table, no route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-1 out
"""
)
test_func = functools.partial(_exist_map_routes_present_no_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC52: exist-map routes present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC53: non-exist-map routes present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-1 out
neighbor 10.10.20.3 advertise-map ADV-MAP-1 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(_non_exist_map_routes_present_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC53: non-exist-map routes present, with route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC54: non-exist-map routes present in R2's BGP table, no route-map filter.
# All routes are advertised to R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-1 out
"""
)
test_func = functools.partial(_non_exist_map_routes_present_no_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC54: non-exist-map routes present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC61: exist-map routes not present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 including advertise-map routes.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
no network 0.0.0.0/0 route-map DEF
"""
)
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-1 out
neighbor 10.10.20.3 advertise-map ADV-MAP-1 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_routes_not_present_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC61: exist-map routes not present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC62: exist-map routes not present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-1 out
"""
)
test_func = functools.partial(_exist_map_routes_not_present_no_rmap_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC62: exist-map routes not present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC63: non-exist-map routes not present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-1 out
neighbor 10.10.20.3 advertise-map ADV-MAP-1 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_rmap_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC63: non-exist-map routes not present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC64: non-exist-map routes not present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-1 out
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_no_rmap_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC64: non-exist-map routes not present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC71: exist-map routes present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 except advertise-map routes.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
network 0.0.0.0/0 route-map DEF
"""
)
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-2 out
neighbor 10.10.20.3 advertise-map ADV-MAP-2 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_routes_present_rmap2_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC71: exist-map routes present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC72: exist-map routes present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-2 out
"""
)
test_func = functools.partial(_exist_map_routes_present_no_rmap2_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC72: exist-map routes present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC73: non-exist-map routes present in R2's BGP table, with route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-2 out
neighbor 10.10.20.3 advertise-map ADV-MAP-2 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(_non_exist_map_routes_present_rmap2_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC73: non-exist-map routes present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC74: non-exist-map routes present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-2 out
"""
)
test_func = functools.partial(
_non_exist_map_routes_present_no_rmap2_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC74: non-exist-map routes present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC81: exist-map routes not present in R2's BGP table, with route-map filter.
# All routes are withdrawn from R3 including advertise-map routes.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
no network 0.0.0.0/0 route-map DEF
"""
)
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-2 out
neighbor 10.10.20.3 advertise-map ADV-MAP-2 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_routes_not_present_rmap2_filter, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC81: exist-map routes not present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC82: exist-map routes not present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-2 out
"""
)
test_func = functools.partial(
_exist_map_routes_not_present_no_rmap2_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC82: exist-map routes not present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC83: non-exist-map routes not present in R2's BGP table, with route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-2 out
neighbor 10.10.20.3 advertise-map ADV-MAP-2 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_rmap2_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC83: non-exist-map routes not present, route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC84: non-exist-map routes not present in R2's BGP table, without route-map filter.
# All routes are advertised to R3 including advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no neighbor 10.10.20.3 route-map RMAP-2 out
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_no_rmap2_filter, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC84: non-exist-map routes not present, no route-map filter - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC91: exist-map routes present in R2's BGP table, with route-map filter and network.
# All routes are advertised to R3 including advertise-map routes.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
network 0.0.0.0/0 route-map DEF
"""
)
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
neighbor 10.10.20.3 route-map RMAP-2 out
neighbor 10.10.20.3 advertise-map ADV-MAP-2 exist-map EXIST-MAP
"""
)
test_func = functools.partial(_exist_map_routes_present_rmap2_network, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC91: exist-map routes present, route-map filter and network - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC92: exist-map routes present in R2's BGP table, with route-map filter and no network.
# All routes are advertised to R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no network 203.0.113.1/32
"""
)
test_func = functools.partial(_exist_map_routes_present_rmap2_no_network, router3)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC92: exist-map routes present, route-map filter and no network - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC93: non-exist-map routes not present in R2's BGP table, with route-map filter and network.
# All routes are advertised to R3 including advertise-map routes.
router1.vtysh_cmd(
"""
configure terminal
router bgp 1
address-family ipv4 unicast
no network 0.0.0.0/0 route-map DEF
"""
)
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
network 203.0.113.1/32
neighbor 10.10.20.3 advertise-map ADV-MAP-2 non-exist-map EXIST-MAP
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_rmap2_network, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC93: non-exist-map routes not present, route-map filter and network - "
assert result is None, msg + failed
logger.info(msg + passed)
# TC94: non-exist-map routes not present in R2's BGP table, with route-map filter and no network.
# All routes are advertised to R3 except advertise-map routes.
router2.vtysh_cmd(
"""
configure terminal
router bgp 2
address-family ipv4 unicast
no network 203.0.113.1/32
"""
)
test_func = functools.partial(
_non_exist_map_routes_not_present_rmap2_no_network, router3
)
success, result = topotest.run_and_expect(test_func, None, count=90, wait=1)
msg = "TC94: non-exist-map routes not present, route-map filter and no network - "
assert result is None, msg + failed
logger.info(msg + passed)
def test_memory_leak():
"Run the memory leak test and report results."
tgen = get_topogen()
if not tgen.is_memleak_enabled():
pytest.skip("Memory leak test/report is disabled")
tgen.report_memory_leaks()
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))
| 36.347917 | 101 | 0.636585 | 4,801 | 34,894 | 4.484691 | 0.062487 | 0.075658 | 0.083879 | 0.0529 | 0.881287 | 0.864428 | 0.853328 | 0.847383 | 0.837072 | 0.827876 | 0 | 0.047893 | 0.25202 | 34,894 | 959 | 102 | 36.385819 | 0.77705 | 0.309881 | 0 | 0.534483 | 0 | 0 | 0.157228 | 0 | 0 | 0 | 0 | 0 | 0.066502 | 1 | 0.081281 | false | 0.068966 | 0.022167 | 0.046798 | 0.172414 | 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 |
e9c236bac4581f2fc6513b618ef715f2d352c951 | 275 | py | Python | tests/test_version.py | simonsobs/productdb | 60daf768ee8f30169e9947dda1a6dc4ffcf89e11 | [
"MIT"
] | null | null | null | tests/test_version.py | simonsobs/productdb | 60daf768ee8f30169e9947dda1a6dc4ffcf89e11 | [
"MIT"
] | 4 | 2022-02-07T15:12:14.000Z | 2022-03-18T14:00:49.000Z | tests/test_version.py | simonsobs/productdb | 60daf768ee8f30169e9947dda1a6dc4ffcf89e11 | [
"MIT"
] | null | null | null | import productdb
##__________________________________________________________________||
def test_version():
"""test if the version string is attached to the module
"""
productdb.__version__
##__________________________________________________________________||
| 27.5 | 70 | 0.818182 | 17 | 275 | 5.176471 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116364 | 275 | 9 | 71 | 30.555556 | 0.36214 | 0.705455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
e9d0eaca046ba2b0d678f1ccf5bb92bfbdabfb40 | 360 | py | Python | bradfield/test_x5_06_islands.py | savarin/algorithms | 4d1f8f2361de12a02f376883f648697562d177ae | [
"MIT"
] | 1 | 2020-06-16T23:22:54.000Z | 2020-06-16T23:22:54.000Z | bradfield/test_x5_06_islands.py | savarin/algorithms | 4d1f8f2361de12a02f376883f648697562d177ae | [
"MIT"
] | null | null | null | bradfield/test_x5_06_islands.py | savarin/algorithms | 4d1f8f2361de12a02f376883f648697562d177ae | [
"MIT"
] | null | null | null | from x5_06_islands import count_islands
def test_count_islands():
assert count_islands(["11110",
"11010",
"11000",
"00000"]) == 1
assert count_islands(["11000",
"11000",
"00100",
"00011"]) == 3
| 27.692308 | 40 | 0.380556 | 27 | 360 | 4.814815 | 0.62963 | 0.369231 | 0.276923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258621 | 0.516667 | 360 | 12 | 41 | 30 | 0.488506 | 0 | 0 | 0.2 | 0 | 0 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.1 | true | 0 | 0.1 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
759060a1999016f32923d065f83a7b0e2712e755 | 3,484 | py | Python | www/courses/cs1120/spring2017/code/day22.py | ic4f/sergey.cs.uni.edu | 52bbf121f73603fdb465dae36dbe691fe39e6e47 | [
"Unlicense"
] | null | null | null | www/courses/cs1120/spring2017/code/day22.py | ic4f/sergey.cs.uni.edu | 52bbf121f73603fdb465dae36dbe691fe39e6e47 | [
"Unlicense"
] | null | null | null | www/courses/cs1120/spring2017/code/day22.py | ic4f/sergey.cs.uni.edu | 52bbf121f73603fdb465dae36dbe691fe39e6e47 | [
"Unlicense"
] | null | null | null | #simple flip
def flip(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
for x in range(width):
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, y, x)
setColor(targetPixel, getColor(sourcePixel))
return target
#version 1
def rotate90(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
y1 = 0
for x in range(width):
x1 = width - 1
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, x1, y1)
setColor( targetPixel, getColor(sourcePixel))
x1 -= 1
y1 += 1
return target
def rotate270(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
x1 = width - 1
for x in range(width):
y1 = 0
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, y1, x1)
setColor(targetPixel, getColor(sourcePixel))
y1 += 1
x1 -= 1
return target
def rotate180(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
x1 = width - 1
for x in range(width):
y1 = width - 1
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, x1, y1)
setColor(targetPixel, getColor(sourcePixel))
y1 -= 1
x1 -= 1
return target
#version 2
def simpleRotate90(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
for x in range(width):
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, width-1-x, y)
setColor(targetPixel, getColor(sourcePixel))
return target
def simpleRotate180(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
for x in range(width):
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, width-1-x, width-1-y)
setColor(targetPixel, getColor(sourcePixel))
return target
def simpleRotate270(source):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
for x in range(width):
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getPixel(target, x, width-1-y)
setColor(targetPixel, getColor(sourcePixel))
return target
#version 3
def rotate(source, angle):
width = getWidth(source)
height = getHeight(source)
target = makeEmptyPicture(width, height)
for x in range(width):
for y in range(height):
sourcePixel = getPixel(source, x, y)
targetPixel = getRotatedPixel(target, x, y, width, angle)
setColor(targetPixel, getColor(sourcePixel))
return target
#helper fucntion
def getRotatedPixel(picture, x, y, width, angle):
if angle == 90:
return getPixel(picture, width-1-x, y)
elif angle == 180:
return getPixel(picture, width-1-x, width-1-y)
elif angle == 270:
return getPixel(picture, x, width-1-y)
else:
return getPixel(picture, x, y)
| 29.033333 | 64 | 0.625144 | 406 | 3,484 | 5.364532 | 0.1133 | 0.051423 | 0.069789 | 0.091827 | 0.847107 | 0.839761 | 0.787879 | 0.758494 | 0.732323 | 0.732323 | 0 | 0.025702 | 0.27411 | 3,484 | 119 | 65 | 29.277311 | 0.835508 | 0.016361 | 0 | 0.752475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.089109 | false | 0 | 0 | 0 | 0.207921 | 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 |
75af6de348f0dd59512a30c770859dd1c7ae40fa | 14,597 | py | Python | pyreach/impl/snapshot_impl_test.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | 13 | 2021-09-01T01:10:22.000Z | 2022-03-05T10:01:52.000Z | pyreach/impl/snapshot_impl_test.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | null | null | null | pyreach/impl/snapshot_impl_test.py | google-research/pyreach | f91753ce7a26e77e122eb02a9fdd5a1ce3ce0159 | [
"Apache-2.0"
] | 6 | 2021-09-20T21:17:53.000Z | 2022-03-14T18:42:48.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for snapshot_impl."""
import json
import unittest
from pyreach.common.proto_gen import logs_pb2
from pyreach import snapshot
from pyreach.common.python import types_gen
from pyreach.core import PyReachStatus
from pyreach.impl import snapshot_impl
class SnapshotImpl(unittest.TestCase):
def test_reverse_snapshot(self) -> None:
self.assertIsNone(snapshot_impl.reverse_snapshot(None))
snapshot_cmd = snapshot_impl.reverse_snapshot(
types_gen.Snapshot(
source="pyreach-test",
device_data_refs=[types_gen.DeviceDataRef(ts=2000, seq=1)],
responses=[
types_gen.SnapshotResponse(
cid=5,
gym_element_type="vacuum",
gym_config_name="test-vacuum",
device_data_ref=types_gen.DeviceDataRef(ts=3000, seq=4)),
types_gen.SnapshotResponse(
cid=6,
gym_element_type="arm",
gym_config_name="test-arm",
device_data_ref=types_gen.DeviceDataRef(ts=7000, seq=0),
status=types_gen.Status(
status="test-status",
script="test-script",
error="test-error",
progress=8.0,
message="test-message",
code=9)),
types_gen.SnapshotResponse(
cid=10,
gym_element_type="oracle",
gym_config_name="test-oracle",
device_data_ref=types_gen.DeviceDataRef(ts=11000, seq=12),
status=types_gen.Status(
status="test-status",
script="test-script",
error="test-error",
progress=13.0,
message="test-message",
code=14)),
],
gym_server_ts=1,
gym_actions=[
types_gen.GymAction(
device_type="test-type",
device_name="test-name",
synchronous=True),
types_gen.GymAction(
device_type="test-vacuum",
device_name="vacuum",
synchronous=True,
vacuum_action_params=types_gen.VacuumActionParams(1)),
types_gen.GymAction(
device_type="test-logger",
device_name="logger",
synchronous=False,
logger_action_params=types_gen.LoggerActionParams([
types_gen.KeyValue(key="1", value="2"),
types_gen.KeyValue(key="3", value="4")
], True)),
types_gen.GymAction(
device_type="test-arm",
device_name="arm",
synchronous=True,
arm_action_params=types_gen.ArmActionParams(
command=1,
cid=2,
joint_angles=[1.1, 2.2, 3.3, 4.4, 5.5, 6.6],
pose=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
reach_action=3,
timeout_sec=6.0,
use_linear=True,
velocity=4.0,
acceleration=5.0,
action_name="test-action",
use_unity_ik=True,
intent="test-intent",
success_type="success",
pick_id="test-id",
apply_tip_adjust_transform=True,
servo=True,
servo_t_secs=7.0,
servo_lookahead_time_secs=8.0,
servo_gain=9.0,
allow_uncalibrated=True,
controller_name="test-controller")),
types_gen.GymAction(
device_type="test-client",
device_name="client",
synchronous=True,
client_annotation_action_params=types_gen
.ClientAnnotationActionParams(
annotation=types_gen.ClientAnnotation(
text_annotation=types_gen.TextAnnotation(
category="test-category", text="test-text")))),
],
gym_env_id="test-env-id",
gym_run_id="test-run-id",
gym_episode=1,
gym_step=2,
gym_reward=3.0,
gym_done=True))
assert snapshot_cmd is not None
expect_snapshot = snapshot.Snapshot(
source="pyreach-test",
device_data_refs=(snapshot.SnapshotReference(2.0, 1),),
responses=(snapshot.SnapshotResponse(5, "vacuum", "test-vacuum",
snapshot.SnapshotReference(3.0,
4)),
snapshot.SnapshotResponse(
6, "arm", "test-arm",
PyReachStatus(
time=7.0,
status="test-status",
script="test-script",
error="test-error",
progress=8.0,
message="test-message",
code=9)),
snapshot.SnapshotResponse(
10, "oracle", "test-oracle",
snapshot.SnapshotReference(11.0, 12))),
gym_server_time=0.001,
gym_env_id="test-env-id",
gym_run_id="test-run-id",
gym_episode=1,
gym_step=2,
gym_reward=3.0,
gym_done=True,
gym_actions=(snapshot.SnapshotGymAction("test-type", "test-name", True),
snapshot.SnapshotGymVacuumAction("test-vacuum", "vacuum",
True, 1),
snapshot.SnapshotGymLoggerAction("test-logger", "logger",
False, True, {
"1": "2",
"3": "4"
}),
snapshot.SnapshotGymArmAction(
"test-arm", "arm", True, 1, 2,
(1.1, 2.2, 3.3, 4.4, 5.5, 6.6),
(1.0, 2.0, 3.0, 4.0, 5.0, 6.0), True, 4.0, 5.0, 6.0,
"test-action", True, "test-intent", "success",
"test-id", True, True, 7.0, 8.0, 9.0, True,
"test-controller"),
snapshot.SnapshotGymClientAnnotationAction(
"test-client", "client", True,
logs_pb2.ClientAnnotation(
text_annotation=logs_pb2.TextAnnotation(
category="test-category", text="test-text")))))
self.assertEqual(expect_snapshot, snapshot_cmd)
def test_convert_snapshot(self) -> None:
self.assertIsNone(snapshot_impl.convert_snapshot(None))
snapshot_cmd = snapshot_impl.convert_snapshot(
snapshot.Snapshot(
source="pyreach-test",
device_data_refs=(snapshot.SnapshotReference(2.0, 1),),
responses=(snapshot.SnapshotResponse(
5, "vacuum", "test-vacuum", snapshot.SnapshotReference(3.0, 4)),
snapshot.SnapshotResponse(
6, "arm", "test-arm",
PyReachStatus(
time=7.0,
status="test-status",
script="test-script",
error="test-error",
progress=8.0,
message="test-message",
code=9)),
snapshot.SnapshotResponse(
10, "oracle", "test-oracle",
PyReachStatus(
time=11.0,
sequence=12,
status="test-status",
script="test-script",
error="test-error",
progress=13.0,
message="test-message",
code=14))),
gym_server_time=0.001,
gym_env_id="test-env-id",
gym_run_id="test-run-id",
gym_episode=1,
gym_step=2,
gym_reward=3.0,
gym_done=True,
gym_actions=(
snapshot.SnapshotGymAction("test-type", "test-name", True),
snapshot.SnapshotGymVacuumAction("test-vacuum", "vacuum", True,
1),
snapshot.SnapshotGymLoggerAction("test-logger", "logger", False,
True, {
"1": "2",
"3": "4"
}),
snapshot.SnapshotGymArmAction(
"test-arm", "arm", True, 1, 2,
(1.1, 2.2, 3.3, 4.4, 5.5, 6.6),
(1.0, 2.0, 3.0, 4.0, 5.0, 6.0), True, 4.0, 5.0, 6.0,
"test-action", True, "test-intent", "success", "test-id",
True, True, 7.0, 8.0, 9.0, True, "test-controller"),
snapshot.SnapshotGymClientAnnotationAction(
"test-client",
"client",
True,
logs_pb2.ClientAnnotation(
text_annotation=logs_pb2.TextAnnotation(
category="test-category", text="test-text")),
))))
self.assertIsNotNone(snapshot_cmd)
expect_snapshot = types_gen.Snapshot(
source="pyreach-test",
device_data_refs=[types_gen.DeviceDataRef(ts=2000, seq=1)],
responses=[
types_gen.SnapshotResponse(
cid=5,
gym_element_type="vacuum",
gym_config_name="test-vacuum",
device_data_ref=types_gen.DeviceDataRef(ts=3000, seq=4)),
types_gen.SnapshotResponse(
cid=6,
gym_element_type="arm",
gym_config_name="test-arm",
device_data_ref=types_gen.DeviceDataRef(ts=7000),
status=types_gen.Status(
status="test-status",
script="test-script",
error="test-error",
progress=8.0,
message="test-message",
code=9)),
types_gen.SnapshotResponse(
cid=10,
gym_element_type="oracle",
gym_config_name="test-oracle",
device_data_ref=types_gen.DeviceDataRef(ts=11000, seq=12))
],
gym_server_ts=1,
gym_actions=[
types_gen.GymAction(
device_type="test-type",
device_name="test-name",
synchronous=True),
types_gen.GymAction(
device_type="test-vacuum",
device_name="vacuum",
synchronous=True,
vacuum_action_params=types_gen.VacuumActionParams(1)),
types_gen.GymAction(
device_type="test-logger",
device_name="logger",
synchronous=False,
logger_action_params=types_gen.LoggerActionParams([
types_gen.KeyValue(key="1", value="2"),
types_gen.KeyValue(key="3", value="4")
], True)),
types_gen.GymAction(
device_type="test-arm",
device_name="arm",
synchronous=True,
arm_action_params=types_gen.ArmActionParams(
command=1,
cid=2,
joint_angles=[1.1, 2.2, 3.3, 4.4, 5.5, 6.6],
pose=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
timeout_sec=6.0,
use_linear=True,
velocity=4.0,
acceleration=5.0,
action_name="test-action",
use_unity_ik=True,
intent="test-intent",
success_type="success",
pick_id="test-id",
apply_tip_adjust_transform=True,
servo=True,
servo_t_secs=7.0,
servo_lookahead_time_secs=8.0,
servo_gain=9.0,
allow_uncalibrated=True,
controller_name="test-controller")),
types_gen.GymAction(
device_type="test-client",
device_name="client",
synchronous=True,
client_annotation_action_params=types_gen
.ClientAnnotationActionParams(
annotation=types_gen.ClientAnnotation(
text_annotation=types_gen.TextAnnotation(
category="test-category", text="test-text")))),
],
gym_env_id="test-env-id",
gym_run_id="test-run-id",
gym_episode=1,
gym_step=2,
gym_reward=3.0,
gym_done=True)
assert snapshot_cmd is not None
self.assertEqual(
json.dumps(snapshot_cmd.to_json(), indent=" "),
json.dumps(expect_snapshot.to_json(), indent=" "))
if __name__ == "__main__":
unittest.main()
| 44.233333 | 80 | 0.457902 | 1,351 | 14,597 | 4.757957 | 0.15248 | 0.05725 | 0.026447 | 0.035781 | 0.845675 | 0.845675 | 0.834785 | 0.821095 | 0.821095 | 0.821095 | 0 | 0.039199 | 0.442488 | 14,597 | 329 | 81 | 44.367781 | 0.750676 | 0.039323 | 0 | 0.788274 | 0 | 0 | 0.087112 | 0 | 0 | 0 | 0 | 0 | 0.022801 | 1 | 0.006515 | false | 0 | 0.022801 | 0 | 0.032573 | 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 |
75edff7319a280ed53c002e562449bd0a8f3e32d | 7,200 | py | Python | agent.py | brunobelluomini/flappy_bird_with_TD_learning | d8d9b8d30c8826b344efa875b7d02f2163a189f1 | [
"MIT"
] | null | null | null | agent.py | brunobelluomini/flappy_bird_with_TD_learning | d8d9b8d30c8826b344efa875b7d02f2163a189f1 | [
"MIT"
] | 16 | 2020-01-28T22:54:11.000Z | 2022-03-11T23:56:22.000Z | agent.py | brunobelluomini/flappy_bird_with_TD_learning | d8d9b8d30c8826b344efa875b7d02f2163a189f1 | [
"MIT"
] | 1 | 2019-09-26T11:46:20.000Z | 2019-09-26T11:46:20.000Z | import numpy as np
from collections import defaultdict
import json
import os
def make_epsilon_greedy_policy(action_space_size, Q_state, epsilon):
epsilon = max(epsilon, 0.10)
policy_state = np.ones(action_space_size) * epsilon / action_space_size
policy_state[np.argmax(Q_state)] = 1 - epsilon + (epsilon / action_space_size)
return policy_state
def choose_action_from_policy(action_space, policy):
available_actions = np.arange(action_space)
return np.random.choice(available_actions, p=policy)
def update_Q_values(alpha, reward, gamma, Q_current_action, Q_next_action):
return Q_current_action + alpha * (reward + gamma * Q_next_action - Q_current_action)
class Sarsa:
def __init__(self, action_space, alpha=0.15, gamma=1.0, epsilon=1.0, force_training=False):
self.action_space = action_space
self.Q = self.load_q_values(force_training)
self.alpha = alpha
self.gamma = gamma
self.epsilon = epsilon
def learn(self, env):
state = env.get_state()
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
while True:
next_state, reward, done = env.step(action)
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[next_state],
self.epsilon
)
next_action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
Q_current_action = self.Q[state][action]
Q_next_action = self.Q[next_state][next_action]
self.Q[next_state][next_action] = update_Q_values(
self.alpha,
reward,
self.gamma,
Q_current_action,
Q_next_action
)
state = next_state
action = next_action
if done:
break
def act(self, state):
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
return action
def load_q_values(self, force_training):
if force_training or not os.path.exists('sarsa_q_values.json'):
return defaultdict(lambda: [0 for action in range(self.action_space)])
else:
q_values_file = open('sarsa_q_values.json', 'r')
q_values = json.load(q_values_file)
q_values_file.close()
return defaultdict(lambda: [0 for action in range(self.action_space)], q_values)
def save_q_values(self):
q_values_file = open('sarsa_q_values.json', 'w')
json.dump(dict(self.Q), q_values_file)
q_values_file.close()
class QLearning:
def __init__(self, action_space, alpha=0.15, gamma=1.0, epsilon=1.0, force_training=False):
self.action_space = action_space
self.Q = self.load_q_values(force_training)
self.alpha = alpha
self.gamma = gamma
self.epsilon = epsilon
def learn(self, env):
state = env.get_state()
while True:
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
next_state, reward, done = env.step(action)
max_Q_a = np.max(
[self.Q[next_state][next_action] for next_action in np.arange(self.action_space)]
)
self.Q[state][action] = update_Q_values(
self.alpha,
reward,
self.gamma,
self.Q[state][action],
max_Q_a
)
state = next_state
if done:
break
def act(self, state):
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
return action
def load_q_values(self, force_training):
if force_training or not os.path.exists('q_learning_q_values.json'):
return defaultdict(lambda: [0 for action in range(self.action_space)])
else:
q_values_file = open('q_learning_q_values.json', 'r')
q_values = json.load(q_values_file)
q_values_file.close()
return defaultdict(lambda: [0 for action in range(self.action_space)], q_values)
def save_q_values(self):
q_values_file = open('q_learning_q_values.json', 'w')
json.dump(dict(self.Q), q_values_file)
q_values_file.close()
class ExpectedSarsa:
def __init__(self, action_space, alpha=0.15, gamma=1.0, epsilon=1.0, force_training=False):
self.action_space = action_space
self.Q = self.load_q_values(force_training)
self.alpha = alpha
self.gamma = gamma
self.epsilon = epsilon
def learn(self, env):
state = env.get_state()
while True:
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
next_state, reward, done = env.step(action)
next_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[next_state],
self.epsilon
)
expected_Q = np.dot(self.Q[next_state], next_policy)
self.Q[state][action] = update_Q_values(
self.alpha,
reward,
self.gamma,
self.Q[state][action],
expected_Q
)
state = next_state
if done:
break
def act(self, state):
epsilon_greedy_policy = make_epsilon_greedy_policy(
self.action_space,
self.Q[state],
self.epsilon
)
action = choose_action_from_policy(self.action_space, epsilon_greedy_policy)
return action
def load_q_values(self, force_training):
if force_training or not os.path.exists('expected_sarsa_q_values.json'):
return defaultdict(lambda: [0 for action in range(self.action_space)])
else:
q_values_file = open('expected_sarsa_q_values.json', 'r')
q_values = json.load(q_values_file)
q_values_file.close()
return defaultdict(lambda: [0 for action in range(self.action_space)], q_values)
def save_q_values(self):
q_values_file = open('expected_sarsa_q_values.json', 'w')
json.dump(dict(self.Q), q_values_file)
q_values_file.close() | 31.441048 | 97 | 0.603333 | 893 | 7,200 | 4.539754 | 0.091825 | 0.079428 | 0.103601 | 0.077701 | 0.839665 | 0.831031 | 0.821411 | 0.799951 | 0.787124 | 0.76813 | 0 | 0.006255 | 0.311667 | 7,200 | 229 | 98 | 31.441048 | 0.811743 | 0 | 0 | 0.705202 | 0 | 0 | 0.030412 | 0.021664 | 0 | 0 | 0 | 0 | 0 | 1 | 0.104046 | false | 0 | 0.023121 | 0.00578 | 0.213873 | 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 |
75f333d35175c349af522154baffc1dbb13420f6 | 27 | py | Python | zhongwen/121212.py | zhangbo2008/transformer | bd627f121478a0467b18766d1e275f4ac7120f9a | [
"Apache-2.0"
] | null | null | null | zhongwen/121212.py | zhangbo2008/transformer | bd627f121478a0467b18766d1e275f4ac7120f9a | [
"Apache-2.0"
] | null | null | null | zhongwen/121212.py | zhangbo2008/transformer | bd627f121478a0467b18766d1e275f4ac7120f9a | [
"Apache-2.0"
] | null | null | null | print((148**2+166**2)**0.5) | 27 | 27 | 0.555556 | 7 | 27 | 2.142857 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.37037 | 0 | 27 | 1 | 27 | 27 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 7 |
f93289bcdaba7697408aa6879dbe7db913d552f6 | 148 | py | Python | pcap3103/using_modules/main.py | owaishanif786/python | 212d626e10bebf161ee123459dc5f0384d9540ac | [
"MIT"
] | null | null | null | pcap3103/using_modules/main.py | owaishanif786/python | 212d626e10bebf161ee123459dc5f0384d9540ac | [
"MIT"
] | null | null | null | pcap3103/using_modules/main.py | owaishanif786/python | 212d626e10bebf161ee123459dc5f0384d9540ac | [
"MIT"
] | null | null | null | import helpers
print(f"Uppercase Letters: {helpers.extract_upper(helpers.NAME)}")
print(f"Lowercase letter: {helpers.extract_lower(helpers.NAME)}") | 37 | 66 | 0.797297 | 20 | 148 | 5.8 | 0.6 | 0.103448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054054 | 148 | 4 | 67 | 37 | 0.828571 | 0 | 0 | 0 | 0 | 0 | 0.744966 | 0.496644 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.666667 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 7 |
f9ae395bee09b1daebade5ce15e737f2fb397aef | 4,985 | py | Python | tests/test_multivariate_def.py | altosaar/deep-exponential-families-gluon | 80d69b54081f622c0012bb181aa6d8ab9a740f15 | [
"MIT"
] | 19 | 2017-10-17T01:04:23.000Z | 2021-11-14T20:50:56.000Z | tests/test_multivariate_def.py | afcarl/deep-exponential-families-gluon | 80d69b54081f622c0012bb181aa6d8ab9a740f15 | [
"MIT"
] | null | null | null | tests/test_multivariate_def.py | afcarl/deep-exponential-families-gluon | 80d69b54081f622c0012bb181aa6d8ab9a740f15 | [
"MIT"
] | 1 | 2018-07-05T21:17:34.000Z | 2018-07-05T21:17:34.000Z | import numpy as np
import tester
def test_one_layer_gaussian():
"""Test variational EM with pathwise gradients."""
config = """
learning_rate: 0.1
n_iterations: 100
gradient:
estimator: pathwise
n_samples: 7
batch_size: 1
layer_1:
latent_distribution: gaussian
p_z_variance: 1.
size: 3
layer_0:
weight_distribution: point_mass
p_w_variance: 1.
data_size: 1
"""
data = np.array([[3.3]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=1e-1)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
def test_one_layer_gaussian_score():
"""Test variational EM with score function gradients."""
config = """
learning_rate: 0.1
n_iterations: 100
print_every: 100
gradient:
estimator: score_function
n_samples: 32
batch_size: 1
layer_1:
latent_distribution: gaussian
size: 7
layer_0:
weight_distribution: point_mass
data_size: 1
"""
data = np.array([[30.3]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=1e-1)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
def test_multivariate_data():
"""Test variational EM with score function gradients."""
config = """
learning_rate: 0.1
n_iterations: 100
print_every: 100
gradient:
estimator: score_function
n_samples: 16
batch_size: 1
layer_1:
latent_distribution: gaussian
size: 1
layer_0:
weight_distribution: point_mass
data_size: 3
"""
# shape [n_data, data_size]
data = np.array([[30.3, -10., 5.]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=1e-1)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
def test_latent_poisson_layer():
"""Test matching q(z) to p(z) where p is Poisson."""
mean = 5.
config = """
n_iterations: 100
learning_rate: 0.1
gradient:
estimator: score_function
n_samples: 16
batch_size: 1
layer_1:
latent_distribution: poisson
size: 3
p_z_mean: {}
""".format(mean)
def test_posterior_predictive(sample: np.array) -> None:
print('posterior predictive sample:', sample)
print('prior mean:', mean)
np.testing.assert_allclose(sample, mean, rtol=1e-1)
tester.test(config, data=np.array([np.nan]),
test_fn=test_posterior_predictive)
def test_one_layer_poisson():
"""Test variational EM with score function gradients and poisson latents."""
config = """
learning_rate: 0.1
n_iterations: 100
print_every: 100
gradient:
estimator: score_function
n_samples: 32
batch_size: 1
layer_1:
latent_distribution: poisson
size: 3
layer_0:
weight_distribution: point_mass
data_size: 1
"""
data = np.array([[30.3]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=0.3)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
def test_two_layer_gaussian_score():
"""Test variational EM with score function gradients and gaussian latents."""
config = """
learning_rate: 0.1
n_iterations: 100
gradient:
estimator: score_function
n_samples: 32
batch_size: 1
layer_2:
latent_distribution: gaussian
size: 2
layer_1:
latent_distribution: gaussian
weight_distribution: point_mass
size: 3
layer_0:
weight_distribution: point_mass
data_size: 1
"""
data = np.array([[8.5]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=1e-1)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
def test_two_layer_poisson_score():
"""Test variational EM with score function gradients and gaussian latents."""
config = """
learning_rate: 0.1
n_iterations: 100
gradient:
estimator: score_function
n_samples: 32
batch_size: 1
layer_2:
latent_distribution: poisson
size: 2
layer_1:
latent_distribution: poisson
weight_distribution: point_mass
size: 3
layer_0:
weight_distribution: point_mass
data_size: 1
"""
data = np.array([[-3.2]])
def test_posterior_predictive(sample: np.array) -> None:
print('data:', data)
print('posterior predictive sample:', sample)
np.testing.assert_allclose(sample, data, rtol=0.3)
tester.test(
config, data=data, test_fn=test_posterior_predictive)
if __name__ == '__main__':
test_latent_poisson_layer()
| 23.851675 | 79 | 0.691675 | 671 | 4,985 | 4.889717 | 0.119225 | 0.121609 | 0.098141 | 0.065834 | 0.895154 | 0.861018 | 0.84334 | 0.828406 | 0.777507 | 0.736361 | 0 | 0.032274 | 0.198195 | 4,985 | 208 | 80 | 23.966346 | 0.788591 | 0.087262 | 0 | 0.828402 | 0 | 0 | 0.481391 | 0 | 0 | 0 | 0 | 0 | 0.04142 | 1 | 0.08284 | false | 0 | 0.011834 | 0 | 0.094675 | 0.100592 | 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 |
ddb42ad55b5f7d355dba44eace7a19ce4612e7d4 | 27,234 | py | Python | sysvet/apps/reserva/views.py | joseiba/SysVetSoft | d1ed13799a5086c880bc45dd153d78bb3a629c7d | [
"Apache-2.0"
] | null | null | null | sysvet/apps/reserva/views.py | joseiba/SysVetSoft | d1ed13799a5086c880bc45dd153d78bb3a629c7d | [
"Apache-2.0"
] | null | null | null | sysvet/apps/reserva/views.py | joseiba/SysVetSoft | d1ed13799a5086c880bc45dd153d78bb3a629c7d | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, redirect, HttpResponse
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib import messages
from django.db.models import Q
from django.core.paginator import Paginator
from django.http import JsonResponse
from datetime import time, datetime, date
import json
from apps.reserva.models import Reserva
from apps.reserva.forms import ReservaForm
from apps.configuracion.models import Servicio, Empleado
from apps.configuracion.forms import ServicioForm
from apps.ventas.mascota.models import Mascota
hora_entrada = "08:00"
hora_salida_lun_vie = "18:00"
hora_salida_sab = "15:00"
today = date.today()
#Reservas
@login_required()
@permission_required('reserva.add_reserva')
def add_reserva(request):
form = ReservaForm
servicios = Servicio.objects.exclude(is_active="N").order_by('-last_modified')
if request.method == 'POST':
form = ReservaForm(request.POST)
if form.is_valid():
form.save()
messages.success(request, 'Se ha agregado correctamente!')
try:
emp = Empleado.objects.get(id=request.POST.get('id_empleado'))
emp.emp_disponible_reserva = 'N'
emp.save()
masc = Mascota.objects.get(id=request.POST.get('id_mascota'))
masc.masc_reservado = 'N'
masc.fecha_reservada = request.POST.get('fecha_reserva')
masc.hora_reserva = request.POST.get('hora_reserva')
masc.save()
except Exception as e:
pass
return redirect('/reserva/listReserva/')
context = {'form' : form}
return render(request, 'reserva/add_reserva_modal.html', context)
@login_required()
@permission_required('reserva.change_reserva')
def edit_reserva(request, id):
reserva = Reserva.objects.get(id=id)
form = ReservaForm(instance=reserva)
if request.method == 'POST':
form = ReservaForm(request.POST, instance=reserva)
if not form.has_changed():
messages.info(request, "No has hecho ningun cambio!")
return redirect('/reserva/listReserva/')
if form.is_valid():
reserva = form.save(commit=False)
emp = Empleado.objects.get(id=request.POST.get('id_empleado'))
masc = Mascota.objects.get(id=request.POST.get('id_mascota'))
estado = request.POST.get('estado_re')
if estado == 'FIN' or estado == 'CAN':
reserva.disponible_emp = "S"
emp.emp_disponible_reserva = 'S'
masc.masc_reservado = 'S'
masc.fecha_reservada = ""
masc.hora_reserva = ""
reserva.save()
emp.save()
masc.save()
messages.success(request, 'Se ha editado correctamente!')
return redirect('/reserva/listReserva/')
context = {'form' : form, 'reserva': reserva}
return render(request, 'reserva/edit_reserva_modal.html', context)
@login_required()
@permission_required('reserva.view_reserva')
def list_reserva(request):
data = []
reserva = Reserva.objects.all()
fechaDate = date(today.year, today.month, today.day)
for r in reserva:
if r.fecha_reserva is not None:
if fechaDate > r.fecha_reserva:
if r.estado_re == 'PEN':
r.estado_re = 'FIN'
r.disponible_emp = "S"
r.color_estado = "green"
try:
masc = Mascota.objects.get(id=r.id_mascota.id)
masc.masc_reservado = "S"
masc.fecha_reservada = ""
masc.hora_reserva = ""
masc.save()
except:
pass
r.save()
paginator = Paginator(reserva, 10)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
context = {'page_obj' : page_obj}
return render(request, "reserva/list_reserva.html", context)
#Metodo para eliminar servicio
@login_required()
@permission_required('reserva.delete_reserva')
def delete_reserva(request, id):
reserva = Reserva.objects.get(id=id)
reserva.delete()
messages.success(request, 'La reserva se ha eliminado!')
return redirect('/reserva/listReserva/')
@login_required()
def search_reserva(request):
query = request.GET.get('q')
if query:
reserva = Reserva.objects.exclude(is_active="N").filter(Q(fecha_reserva__icontains=query))
else:
reserva = Reserva.objects.exclude(is_active="N").order_by('-last_modified')
paginator = Paginator(reserva, 10)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
context = { 'page_obj': page_obj}
return render(request, "reserva/list_reserva.html", context)
def validar_fecha_hora(request):
fecha = request.GET.get('fecha')
hora = request.GET.get('hora')
horaSelected = hora.split(':')
servicio = request.GET.get('servicio')
cliente = request.GET.get('id_cliente')
mascota = request.GET.get('id_mascota')
emp = request.GET.get('empleado')
action = request.GET.get('action')
id_reserva_r = request.GET.get('id_reserva')
diaActual = datetime.now()
mesActual = str(diaActual.month) if diaActual.month > 9 else '0' + str(diaActual.month)
dayActual = str(diaActual.day) if diaActual.day > 9 else '0' + str(diaActual.day)
diaCompare = str(diaActual.year) + "-" + mesActual + "-" + dayActual
messageReponse = ""
isFalse = True
isFalseOtherDay = True
isFalseMascota = True
isFalseEmpleado = True
splitHoraActual = diaActual.hour
empe_dispo = Empleado.objects.get(id=emp)
serviEmpleado = Empleado.objects.filter(id_servicio=servicio).exclude(disponible=False)
countEmpleadoServi = Empleado.objects.filter(id_servicio=servicio).exclude(disponible=False).count()
countEmpleadoDiaServi = Reserva.objects.filter(id_servicio=servicio, fecha_reserva=fecha, hora_reserva=hora).exclude(disponible_emp='S').count()
mas_disponible = Mascota.objects.get(id=mascota)
try:
reserva_compare = Reserva.objects.get(id=id_reserva_r)
except:
pass
if diaCompare == fecha:
if splitHoraActual <= int(horaSelected[0]):
if action == 'A':
if countEmpleadoServi <= countEmpleadoDiaServi:
messageReponse = "Ya no hay disponibilidad del servicio para esa hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
except Exception as e:
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
else:
isFalseEmpleado = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseEmpleado = True
else:
isFalseEmpleado = False
if isFalseEmpleado:
messageReponse = "El empleado ya esta asignado a un trabajo para esa hora y dia"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_servicio=servicio, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota, id_empleado=emp)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
if (int(reserva_compare.id_empleado.id) != int(emp) or int(reserva_compare.id_servicio.id) != int(servicio) and
reserva_compare.hora_reserva != hora):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
except Exception as e:
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
else:
isFalseEmpleado = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseEmpleado = True
else:
isFalseEmpleado = False
if isFalseEmpleado:
messageReponse = "El empleado ya esta asignado a un trabajo para esa hora y dia"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
if (int(reserva_compare.id_servicio.id) != int(servicio)):
if(int(reserva_compare.id_cliente.id) != int(cliente) or int(reserva_compare.id_mascota.id != int(mascota))):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente, id_servicio=servicio)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente, id_servicio=servicio)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
if(int(reserva_compare.id_cliente.id) != int(cliente) and int(reserva_compare.id_mascota.id != int(mascota))):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
isFalseMascota = True
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota, id_servicio=servicio)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
messageReponse = "Has seleccionado un horario que ya a ha pasado"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
if action == 'A':
if countEmpleadoServi <= countEmpleadoDiaServi:
messageReponse = "Ya no hay disponibilidad del servicio para esa hora y dia"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
except Exception as e:
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
else:
isFalseEmpleado = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseEmpleado = True
else:
isFalseEmpleado = False
if isFalseEmpleado:
messageReponse = "El empleado ya esta asignado a un trabajo para esa hora y dia"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except Exception as e:
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
if mas_disponible.fecha_reservada == fecha and mas_disponible.hora_reserva == hora:
isFalseMascota = True
else:
isFalseMascota = False
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_servicio=servicio, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota, id_empleado=emp)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
else:
if (int(reserva_compare.id_empleado.id) != int(emp) or int(reserva_compare.id_servicio.id) != int(servicio) and
reserva_compare.hora_reserva != hora):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
except Exception as e:
if empe_dispo.emp_disponible_reserva == 'S':
isFalseEmpleado = False
else:
isFalseEmpleado = True
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_empleado=emp, id_servicio=servicio)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseEmpleado = True
else:
isFalseEmpleado = False
if isFalseEmpleado:
messageReponse = "El empleado ya esta asignado a un trabajo para esa hora y dia"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
if (int(reserva_compare.id_servicio.id) != int(servicio)):
if(int(reserva_compare.id_cliente.id) != int(cliente) or int(reserva_compare.id_mascota.id != int(mascota))):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente, id_servicio=servicio)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except:
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
if mas_disponible.fecha_reservada == fecha and mas_disponible.hora_reserva == hora:
isFalseMascota = True
else:
isFalseMascota = False
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
if(int(reserva_compare.id_cliente.id) != int(cliente) and int(reserva_compare.id_mascota.id != int(mascota))):
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
except:
reserva = Reserva.objects.filter(fecha_reserva=fecha, hora_reserva=hora, id_mascota=mascota, id_cliente=cliente)
if reserva.count() > 0:
for r in reserva:
if r.estado_re == 'PEN':
isFalseMascota = True
else:
if mas_disponible.masc_reservado == 'S':
isFalseMascota = False
else:
if mas_disponible.fecha_reservada == fecha and mas_disponible.hora_reserva == hora:
isFalseMascota = True
else:
isFalseMascota = False
if isFalseMascota:
messageReponse = "Esta mascota ya tiene una reserva para este dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
try:
reserva = Reserva.objects.get(fecha_reserva=fecha, id_cliente=cliente, hora_reserva=hora, id_mascota=mascota, id_servicio=servicio)
except:
isFalse = False
if isFalse:
messageReponse = "Este cliente ya tiene una reserva para ese dia y hora"
response = { 'mensaje': messageReponse}
return JsonResponse(response)
response = { 'mensaje': messageReponse}
return JsonResponse(response)
def get_mascota_cliente(request):
cliente = request.GET.get('id_cliente')
mascotas = Mascota.objects.filter(id_cliente=cliente)
listMascota = [{'id': mascota.id, 'nombre': mascota.nombre_mascota} for mascota in mascotas]
listJsonMascotas = json.dumps(listMascota)
if listJsonMascotas != '[]':
response = { 'mascota': listJsonMascotas, 'mensaje': "Ok"}
return JsonResponse(response)
response = { 'mascota': listJsonMascotas, 'mensaje': ""}
return JsonResponse(response)
def get_min_service(request):
servicio = request.GET.get('servicio')
emp = Empleado.objects.filter(id_servicio=servicio)
listEmpleado = [{'id': empleado.id, 'nombre': empleado.nombre_emp + " " + empleado.apellido_emp} for empleado in emp]
listJsonEmpleado= json.dumps(listEmpleado)
isFalse = True
try:
minService = Servicio.objects.get(id=servicio)
except:
isFalse = False
if isFalse:
response = { 'tiempo': minService.min_serv, 'mensaje': "Ok", 'empleado': listJsonEmpleado}
return JsonResponse(response)
response = { 'tiempo': minService.min_serv, 'mensaje': "", 'empleado': listJsonEmpleado}
return JsonResponse(response)
def get_mascota_selected(request):
id_reserva = request.GET.get('id_reserva')
cliente = request.GET.get('id_cliente')
hora_reserva = request.GET.get('hora_reserva')
fecha_reserva = request.GET.get('fecha_reserva')
servicio = request.GET.get('servicio')
emp = Empleado.objects.filter(id_servicio=servicio)
mascotas = Mascota.objects.filter(id_cliente=cliente)
listMascota = [{'id': mascota.id, 'nombre': mascota.nombre_mascota} for mascota in mascotas]
listEmpleado = [{'id': empleado.id, 'nombre': empleado.nombre_emp + " " + empleado.apellido_emp} for empleado in emp]
listJsonEmpleado= json.dumps(listEmpleado)
listJsonMascotas = json.dumps(listMascota)
reserva = Reserva.objects.get(id=id_reserva, fecha_reserva=fecha_reserva, id_servicio=servicio, id_cliente=cliente, hora_reserva=hora_reserva)
if listJsonMascotas != '[]':
response = { 'mascota': listJsonMascotas, 'mensaje': "Ok", 'mascota_selected': reserva.id_mascota.id, 'empleado': reserva.id_empleado.id, 'empleados':listJsonEmpleado}
return JsonResponse(response)
response = { 'mascota': listJsonMascotas, 'mensaje': ""}
return JsonResponse(response)
| 53.295499 | 176 | 0.528384 | 2,491 | 27,234 | 5.632276 | 0.084303 | 0.031361 | 0.035282 | 0.031504 | 0.805773 | 0.778261 | 0.745331 | 0.723735 | 0.713115 | 0.679971 | 0 | 0.001871 | 0.391643 | 27,234 | 510 | 177 | 53.4 | 0.844942 | 0.001359 | 0 | 0.778468 | 0 | 0 | 0.078366 | 0.008789 | 0 | 0 | 0 | 0.001961 | 0 | 1 | 0.018634 | false | 0.006211 | 0.026915 | 0 | 0.115942 | 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 |
ddcd592527ae1c2c35b3808f1ba592810226cc4b | 7,966 | py | Python | ATM shell.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | ATM shell.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | ATM shell.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
=== RESTART: C:/Users/HP/Desktop/python genesis bootcamp/ATM assignment.py ===
************************* WELCOME TO KP BANK *************************
Please insert your card and enter your pin
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 1
1 for slip, 2 for no slip
Do you want a slip for this inquiry? 1
your balance as at "2019-11-23" is $2500
Here is your slip! Thanks for using KP bank
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 2
Select your account type
1. Savings
2. Current
3. Credit
Enter your account type 2
Enter amount: 200
Collect your cash! Thanks for using KP bank
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 3
Select your account type
1. Savings
2. Current
3. Credit
Enter your account type 2
Here your bank statement
Thanks for using KP bank
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 4
Select your account type
1. Savings
2. Current
3. Credit
Enter your account type 2
Enter destination account number: 39873874
Enter amount you want to send: 700
Transfer SUCCESFUL!!!
Thanks for using KP bank
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 5
Only 3 international currencies are supported
1. Euro
2. Pounds Sterling
3. Australian Dollars
Select a currency 1-3: 1
Enter destination account number: 9587432094
Enter amount you want to send in Euro: 600
thats $660.0 in USD
Transfer SUCCESFUL!!!
Thanks for using KP bank
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 6
enter price of flight: 900
Your flight has been booked successfully
Vist your airways website for more info
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 7
WELCOME TO BVN REG PAGE
Do you want to generate your BVN now
1. yes 2. no
pick an option 1-2: 1
This is your new BVN number:
60920736968
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 8
SELECT YOUR NETWORK
1. GLO 2. MTN
3. AIRTEL 4. 9MOBILE
select an option 1-4: 4
Enter amount of airtime you want to buy: 600
Insufecient funds
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 9
SELECT YOUR NETWORK
1. NTEL 2. SPECTRANET
3. SMILE 4. SWIFT
select an option 1-4: 4
1. 30mb -->$0.28 2. 100mb -->$0.55
3. 750mb -->$1.38 4. 1.5gb -->$2.76
5. 3.5gb -->$5.52 6. 10gb -->$13.81
7. 22gb -->$27.61
select a data plan 6
Insufecient funds
Enter Your Pin: 2222
incorrect pin, try again
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 1
1 for slip, 2 for no slip
Do you want a slip for this inquiry? 2
your balance as at "2019-11-23" is $-23.0
Enter Your Pin: 0000
Correct pin
Choose your transaction
S/N OPTIONS FEES
1. Check balance -> $2
2. Withdrawal -> $10
3. Bank statement -> $4
4. Local transfers -> $4
5. International transfers -> $8
6. Book flight:less than $100 -> $20
above $100 -> $35
7. Register for BVN -> $0
8. Buy airtime -> $0
9. Buy data -> $0
10. Quit
Select an option 1-10: 10
>>> | 27.756098 | 98 | 0.516445 | 1,076 | 7,966 | 3.82342 | 0.173792 | 0.035002 | 0.030627 | 0.047399 | 0.779047 | 0.768352 | 0.74842 | 0.74842 | 0.736266 | 0.736266 | 0 | 0.128073 | 0.392292 | 7,966 | 287 | 99 | 27.756098 | 0.721752 | 0 | 0 | 0.788 | 0 | 0 | 0.006379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
fb2e9091690cd2086a5bfae79876547126a5a9fe | 133 | py | Python | example_applications/SAR_ML_wetlands/10_Scripts/test_wetlands_insight.py | fangfy/radar | 6bb8a10396513711a507f8298c22df0e0565d4a7 | [
"Apache-2.0"
] | 15 | 2018-08-14T01:46:09.000Z | 2022-03-23T18:41:20.000Z | example_applications/SAR_ML_wetlands/10_Scripts/test_wetlands_insight.py | fangfy/radar | 6bb8a10396513711a507f8298c22df0e0565d4a7 | [
"Apache-2.0"
] | 1 | 2018-09-17T13:14:45.000Z | 2021-05-05T01:43:34.000Z | example_applications/SAR_ML_wetlands/10_Scripts/test_wetlands_insight.py | fangfy/radar | 6bb8a10396513711a507f8298c22df0e0565d4a7 | [
"Apache-2.0"
] | 5 | 2018-11-08T23:17:02.000Z | 2021-03-05T07:29:39.000Z | import pytest
import wetlands_insight
#TODO actually write these tests
def test_WIT_array():
pass
def test_WIT_da():
pass | 12.090909 | 32 | 0.75188 | 20 | 133 | 4.75 | 0.75 | 0.147368 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195489 | 133 | 11 | 33 | 12.090909 | 0.88785 | 0.233083 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0 | 1 | 0.333333 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 8 |
349b01baa31d0086506407c47964ad0efa1e4c9e | 28,887 | py | Python | azure-graphrbac/azure/graphrbac/operations/group_operations_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-graphrbac/azure/graphrbac/operations/group_operations_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-graphrbac/azure/graphrbac/operations/group_operations_operations.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .. import models
class GroupOperationsOperations(object):
"""GroupOperationsOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
"""
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
def remove_member(
self, group_object_id, member_object_id, custom_headers=None, raw=False, **operation_config):
"""
Remove a memeber from a group. Reference:
http://msdn.microsoft.com/en-us/library/azure/dn151607.aspx
:param group_object_id: Group object id
:type group_object_id: str
:param member_object_id: Member Object id
:type member_object_id: 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>`.
:rtype: None
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
# Construct URL
url = '/{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}'
path_format_arguments = {
'groupObjectId': self._serialize.url("group_object_id", group_object_id, 'str', skip_quote=True),
'memberObjectId': self._serialize.url("member_object_id", member_object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.delete(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code not in [204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def add_member(
self, group_object_id, url, custom_headers=None, raw=False, **operation_config):
"""
Add a memeber to a group. Reference:
http://msdn.microsoft.com/en-us/library/azure/dn151676.aspx
:param group_object_id: Group object id
:type group_object_id: str
:param url: Group display name
:type url: 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>`.
:rtype: None
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
parameters = models.GroupAddMemberParameters(url=url)
# Construct URL
url = '/{tenantID}/groups/{groupObjectId}/$links/members'
path_format_arguments = {
'groupObjectId': self._serialize.url("group_object_id", group_object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'GroupAddMemberParameters')
# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
if response.status_code not in [204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def delete(
self, group_object_id, custom_headers=None, raw=False, **operation_config):
"""
Delete a group in the directory. Reference:
http://msdn.microsoft.com/en-us/library/azure/dn151676.aspx
:param group_object_id: Object id
:type group_object_id: 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>`.
:rtype: None
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
# Construct URL
url = '/{tenantID}/groups/{groupObjectId}'
path_format_arguments = {
'groupObjectId': self._serialize.url("group_object_id", group_object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.delete(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code not in [204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def create(
self, parameters, custom_headers=None, raw=False, **operation_config):
"""
Create a group in the directory. Reference:
http://msdn.microsoft.com/en-us/library/azure/dn151676.aspx
:param parameters: Parameters to create a group
:type parameters: :class:`GroupCreateParameters
<azure.graphrbac.models.GroupCreateParameters>`
: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>`.
:rtype: :class:`ADGroup <azure.graphrbac.models.ADGroup>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
# Construct URL
url = '/{tenantID}/groups'
path_format_arguments = {
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'GroupCreateParameters')
# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
if response.status_code not in [201]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('ADGroup', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
def list(
self, filter=None, custom_headers=None, raw=False, **operation_config):
"""
Gets list of groups for the current tenant.
:param filter: The filter to apply on the operation.
:type filter: 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>`.
:rtype: :class:`ADGroupPaged <azure.graphrbac.models.ADGroupPaged>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = '/{tenantID}/groups'
path_format_arguments = {
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
return response
# Deserialize response
deserialized = models.ADGroupPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.ADGroupPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
def get_group_members(
self, object_id, custom_headers=None, raw=False, **operation_config):
"""
Gets the members of a group.
:param object_id: Group object Id who's members should be retrieved.
:type object_id: 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>`.
:rtype: :class:`AADObjectPaged
<azure.graphrbac.models.AADObjectPaged>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = '/{tenantID}/groups/{objectId}/members'
path_format_arguments = {
'objectId': self._serialize.url("object_id", object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
return response
# Deserialize response
deserialized = models.AADObjectPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.AADObjectPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
def get(
self, object_id, custom_headers=None, raw=False, **operation_config):
"""
Gets group information from the directory.
:param object_id: User objectId to get group information.
:type object_id: 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>`.
:rtype: :class:`ADGroup <azure.graphrbac.models.ADGroup>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
"""
# Construct URL
url = '/{tenantID}/groups/{objectId}'
path_format_arguments = {
'objectId': self._serialize.url("object_id", object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ADGroup', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
def get_member_groups(
self, object_id, security_enabled_only, custom_headers=None, raw=False, **operation_config):
"""
Gets a collection that contains the Object IDs of the groups of which
the group is a member.
:param object_id: Group filtering parameters.
:type object_id: str
:param security_enabled_only: If true only membership in security
enabled groups should be checked. Otherwise membership in all groups
should be checked
:type security_enabled_only: bool
: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>`.
:rtype: :class:`strPaged <azure.graphrbac.models.strPaged>`
"""
parameters = models.GroupGetMemberGroupsParameters(security_enabled_only=security_enabled_only)
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = '/{tenantID}/groups/{objectId}/getMemberGroups'
path_format_arguments = {
'objectId': self._serialize.url("object_id", object_id, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(parameters, 'GroupGetMemberGroupsParameters')
# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
return response
# Deserialize response
deserialized = models.strPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.strPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
def list_next(
self, next_link, custom_headers=None, raw=False, **operation_config):
"""
Gets list of groups for the current tenant.
:param next_link: Next link for list operation.
:type next_link: 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>`.
:rtype: :class:`ADGroupPaged <azure.graphrbac.models.ADGroupPaged>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
return response
# Deserialize response
deserialized = models.ADGroupPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.ADGroupPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
def get_group_members_next(
self, next_link, custom_headers=None, raw=False, **operation_config):
"""
Gets the members of a group.
:param next_link: Next link for list operation.
:type next_link: 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>`.
:rtype: :class:`AADObjectPaged
<azure.graphrbac.models.AADObjectPaged>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = '/{tenantID}/{nextLink}'
path_format_arguments = {
'nextLink': self._serialize.url("next_link", next_link, 'str', skip_quote=True),
'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
return response
# Deserialize response
deserialized = models.AADObjectPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.AADObjectPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
| 43.050671 | 144 | 0.635684 | 3,113 | 28,887 | 5.702538 | 0.075169 | 0.045629 | 0.027039 | 0.040559 | 0.878436 | 0.873197 | 0.870043 | 0.864635 | 0.856861 | 0.851453 | 0 | 0.004016 | 0.267214 | 28,887 | 670 | 145 | 43.114925 | 0.834609 | 0.251082 | 0 | 0.84104 | 0 | 0 | 0.127602 | 0.063972 | 0 | 0 | 0 | 0 | 0 | 1 | 0.046243 | false | 0 | 0.011561 | 0 | 0.124277 | 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 |
34a82b14cdc15ede9606015473ec51004f00f114 | 329 | py | Python | lib/config/__init__.py | hplin6/oral_disease_diagnosis | ef0994c3b066a5c5fa61957bdc8460a8a7dbeb45 | [
"MIT"
] | null | null | null | lib/config/__init__.py | hplin6/oral_disease_diagnosis | ef0994c3b066a5c5fa61957bdc8460a8a7dbeb45 | [
"MIT"
] | 1 | 2021-10-15T12:20:01.000Z | 2021-10-15T12:20:01.000Z | lib/config/__init__.py | hplin6/oral_disease_diagnosis | ef0994c3b066a5c5fa61957bdc8460a8a7dbeb45 | [
"MIT"
] | 1 | 2021-10-02T07:04:51.000Z | 2021-10-02T07:04:51.000Z | # ------------------------------------------------------------------------------
# Copy from https://github.com/HRNet/HRNet-Image-Classification
# ------------------------------------------------------------------------------
from .default import _C as config
from .default import update_config
from .models import MODEL_EXTRAS
| 41.125 | 80 | 0.413374 | 25 | 329 | 5.32 | 0.68 | 0.165414 | 0.255639 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069909 | 329 | 7 | 81 | 47 | 0.434641 | 0.665654 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
34abe4fdf93eeef13ac83cf9812137296e856881 | 17,335 | py | Python | pyqt数据库系统/仓库管理/source/apprcc_rc.py | yxg995995/yxg-code | 7dd23f3dfb13d68ebc44bf7d5a344fb661c33136 | [
"MIT"
] | 1 | 2021-03-15T02:07:50.000Z | 2021-03-15T02:07:50.000Z | pyqt数据库系统/仓库管理/source/apprcc_rc.py | yxg995995/yxg-code | 7dd23f3dfb13d68ebc44bf7d5a344fb661c33136 | [
"MIT"
] | null | null | null | pyqt数据库系统/仓库管理/source/apprcc_rc.py | yxg995995/yxg-code | 7dd23f3dfb13d68ebc44bf7d5a344fb661c33136 | [
"MIT"
] | 1 | 2021-03-15T02:07:55.000Z | 2021-03-15T02:07:55.000Z | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\x22\
\x00\
\x00\x23\x38\x78\x9c\xed\xd1\x39\x4c\x14\x51\x18\xc0\xf1\xef\xcd\
\x7b\x73\x3d\x01\x77\xd8\x61\x76\x19\x35\xbb\xb0\x2c\xcc\x12\x37\
\xe1\xf2\x6c\x14\xd4\x55\xb6\x12\xbc\xed\xc0\xdb\x0e\x3c\x50\x13\
\x13\x40\x3c\x3b\xbc\xb5\x92\xf5\x40\xed\x50\x3c\x2b\x51\x3c\x3b\
\x3c\x01\x1b\xf0\xd6\x0a\x14\x2f\x9a\x71\x76\xa3\x34\x36\x4a\xb2\
\x26\x26\xdf\x37\xc5\xef\x4b\x5e\xf1\xde\x3f\x63\x77\xdb\x7d\xe0\
\x8a\x46\xca\x23\x40\x08\x00\x71\x3e\xb0\x9f\x43\x13\x48\x4c\x94\
\x44\x26\x49\xa2\x24\xcb\x92\xc2\x5d\x9c\xab\x2a\xd7\xd3\xc6\xa6\
\xb8\x3c\xba\xd7\xeb\xd1\x0d\xc3\x9c\x10\xf4\x99\xe3\x02\xe3\x0d\
\xc3\x3f\xd1\x1f\xc8\xcd\x0b\xe5\x87\x32\x7d\xe1\x82\xb0\x55\x10\
\xb4\x42\x16\x91\x65\x99\x2b\xdc\xcd\xb9\xdb\x32\x0d\xd3\xfa\xeb\
\xb1\x6f\x80\xa6\x08\xf5\xa4\x8f\x12\x0d\x04\x8d\x50\x8d\xd8\x9d\
\x24\xe6\xbc\x51\x24\x89\x81\x9f\x43\x04\xea\xbc\x55\x56\x54\x3e\
\xc6\x05\x02\xa1\x54\x60\x54\x14\x19\x73\x4e\xb6\x3b\x67\xc0\x34\
\x31\x3d\xab\xb0\x54\x72\x57\x54\xc9\xd9\x35\x7a\x51\x43\x73\x8b\
\x12\x28\x6b\xeb\xc8\xa8\xec\x1a\xc8\x29\xae\xae\x6d\x54\xb9\xe1\
\xf1\x66\x9a\xc1\xdc\x3c\x2b\x94\x5f\x32\x69\xf2\x94\xa9\xd3\xa6\
\xcf\x9a\x3d\x27\x32\x77\x5e\x79\x74\xc1\xc2\x45\x8b\x97\x2c\x5d\
\xb6\x7c\xc5\xca\x55\xab\xd7\xac\x5d\xb7\x7e\xc3\xc6\x4d\x9b\xeb\
\xb6\x6c\xdd\xb6\xa3\x69\xe7\xae\xdd\x7b\xf6\xee\xdb\x7f\xe0\xe0\
\xa1\xc3\x47\x8e\x1e\x3b\x1e\x3b\x79\xea\xf4\x99\xd6\xb3\xe7\xce\
\x5f\xb8\xd8\x7e\xe9\xf2\x95\xab\xd7\xae\xdf\xbc\xd5\x79\xfb\xce\
\xdd\x7b\xf7\x1f\x3c\x7c\xf4\xf8\xc9\xd3\x67\xdd\x3d\xbd\xfd\x2f\
\x5e\xbe\x7a\xfd\xe6\xed\xbb\xf7\x1f\x06\x3f\x7e\x1a\xfa\xfc\xe5\
\xeb\xb7\xef\xc3\x04\x28\xf9\x35\xbf\xf5\x38\xe1\x44\x60\x8c\x32\
\x39\xde\x43\x84\xba\xf8\xa1\xc6\xc4\xac\x42\x29\xbd\xb4\x42\xae\
\xaa\x71\x67\x17\x35\x28\x7a\x59\x73\x4b\x5b\x87\x1a\x28\xae\x1c\
\xc8\xa8\xae\xed\xe2\x46\x4e\x49\x7f\x70\x30\x9e\x94\x28\xfa\xb3\
\xa0\xc6\x51\x15\x8d\x04\x8d\xf4\xd8\xbd\x90\x42\x89\xf3\xc3\xa8\
\x06\x33\x60\x38\x56\xcf\xc1\x82\x13\x02\x82\x20\x08\x82\x20\x08\
\x82\x8c\x1e\xe6\x2c\xc6\x3f\xb9\x2c\x1a\x5f\x44\x67\x4d\x1b\x82\
\xf9\x64\xa6\x08\x7a\x72\x10\x4c\x48\x85\x30\xf8\x13\x77\x25\x37\
\x8c\xa4\x3a\x17\xb6\x27\xb5\x06\x41\x10\x04\x41\x10\x04\x41\x10\
\x04\x41\x10\x04\x41\x10\xe4\x3f\xc5\x67\xf7\xfc\x00\xd6\x77\xf1\
\x75\
\x00\x00\x01\x78\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x00\x59\x00\x00\x00\x59\
\x01\xaa\x9d\xa9\x86\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x00\xf5\x49\x44\
\x41\x54\x38\x8d\xad\xd1\x3d\x4a\x43\x41\x14\x05\xe0\xef\x3d\x03\
\x51\x41\xb1\x8a\x24\x68\x23\x08\x46\x4b\x6d\xec\x74\x07\x96\x76\
\x62\xe7\x02\xa2\xab\x10\x2b\x45\x77\xa0\x9d\x6b\xb0\xd0\xd2\x15\
\xf8\x1a\x45\x0b\x21\xa5\x9d\x26\x16\x33\xc2\x90\xbc\x24\x2f\xe0\
\x81\x0b\x97\x33\xf7\xe7\xdc\x33\xfc\x33\x16\x71\x85\x8f\x18\x97\
\x58\x18\xd7\x90\x27\x79\x86\x3b\xcc\x61\x1b\x3b\x98\xc7\x6d\xd5\
\xed\x5b\x78\xc1\x4c\xc2\xd5\x50\xa0\x5d\x45\xc1\x4a\x1c\xf0\x93\
\x70\xdf\x91\x5b\x4d\xb8\x0e\x8e\xca\x86\x2d\xe3\x13\xcd\x84\x6b\
\x45\xae\x91\x70\xeb\x78\xc3\x89\x01\xb9\x5f\xe8\xe1\x5a\xf0\x63\
\x17\x37\xb8\xc0\x73\x3c\xb1\x85\x3a\x9e\x70\x8e\xd9\xac\x44\xc9\
\x1e\x0e\x62\x7e\x8f\x87\x28\xfb\x70\xa0\xae\x89\xa5\xb2\x53\xaa\
\xe0\x18\xef\xa2\xb9\x39\x4e\x05\xb7\xfb\x23\xa2\x88\x2a\xf2\xa8\
\xe4\x55\xf0\x02\x9c\xe1\x11\x1b\x63\x36\xb6\x85\xbb\x3b\xd8\xc7\
\x5a\xfa\x58\x4c\x68\xfe\xc3\xa6\xf0\xa5\x43\xe8\x09\xae\x4f\x42\
\x16\x6b\x87\xd0\xaf\xd0\x3c\xb2\xb6\x86\xee\x14\x43\xba\x53\x2c\
\xab\x86\x5f\xe3\xfa\x30\x27\x61\x0f\x66\x93\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x79\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x00\xb1\x00\x00\x00\xb1\
\x01\xc6\x2d\x49\x8d\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\xf6\x49\x44\
\x41\x54\x58\x85\xed\xd6\x3b\x68\x14\x51\x14\x06\xe0\x6f\x57\x93\
\x42\x2d\x22\x36\x3e\xd2\xd8\x99\x94\x81\x34\x16\x0a\x31\x06\x41\
\x63\x1a\xed\xd5\xc6\x42\x8c\xa9\x04\x0b\xad\xd5\x42\x90\x34\x3e\
\x4a\x3b\xc5\xc6\x60\x25\x3e\x40\x3b\xf1\x85\x8d\x60\xd0\x3a\x62\
\x54\x82\xcf\x08\xbb\x16\x73\x96\x0c\x71\x67\x67\x32\xcc\x2a\x88\
\x3f\x5c\xee\x65\xce\x7f\xfe\xff\xcc\x3d\x33\x77\x86\xff\xc8\x47\
\x1f\xce\xe0\x29\x3e\xc7\x78\x82\xd3\x11\xeb\x2a\x76\xe2\x1d\x9a\
\x19\x63\x0e\x3b\xba\x65\x3e\x8c\xaf\x61\x74\x0f\xa3\x58\x8b\x75\
\xd8\x8d\xfb\x11\xfb\x82\xa1\xaa\xcd\x57\xe1\x65\x18\x5c\x41\xbd\
\x0d\xa7\x8e\xab\xc1\x79\x91\xc1\x29\x8d\x3d\x21\x3c\x8b\xde\x0e\
\xbc\x5e\xbc\x09\xee\x58\x19\xa3\xac\xaa\x77\xc5\x7c\x0d\x8b\x1d\
\xf2\x17\x83\x93\xce\xa9\xa4\x80\x4d\x31\xcf\x16\xd0\x78\x1d\xf3\
\xe6\x8c\x78\x1f\x2e\x61\x64\x25\x05\x2c\xc4\xbc\xa1\x40\x01\x2d\
\xce\x42\x46\x7c\x08\x47\x71\x5b\xd2\xda\x42\x38\x22\xe9\xeb\x9d\
\x02\xdc\xbb\xc1\x3d\x94\x11\xaf\x61\x3a\x38\xdf\x8a\x16\xb1\x1e\
\x9f\x22\xe9\x40\x07\xde\xc1\xe0\x7c\xd0\xf9\x50\xaa\xe1\x62\x70\
\x7f\x60\xbc\x48\x11\xc7\x22\xe1\x3b\x8e\xa3\x27\x15\xeb\xc1\x89\
\x88\x35\x25\x5b\x9c\x87\xb6\x45\xd4\x72\x92\xce\xe1\x64\xac\xe7\
\xf1\x38\xd6\xc3\x96\x7a\x7f\x16\xa7\x42\x6b\x54\xfe\x4e\x1c\x96\
\xb4\xe1\xa7\xe4\x26\x73\x31\x8e\xe7\x7e\x3f\x86\x9f\x61\x6f\x8a\
\x37\xd2\x86\x93\x37\x1a\x79\x3b\x90\xc6\x56\x6c\x8b\xf5\x2b\xbc\
\x5d\x16\xef\xc3\x79\xf9\x1f\xa8\x8d\xd8\x2e\x39\x6d\x1f\xac\xc0\
\xbf\x12\x8c\x49\xde\x84\x26\x2e\xcb\x7f\x04\xfe\xbc\xf9\x04\x66\
\x24\x9f\xd9\x95\xf6\x73\x2e\x72\xf7\x97\x31\x5f\x83\x9b\x25\x4c\
\xb3\xc6\x8d\xd0\x84\xc1\x94\xf9\x74\xd6\x9d\xb7\xcc\xe7\x31\x89\
\x2d\xed\x48\x39\xe8\xc7\x14\x3e\x86\xd6\xf5\xb8\x3e\x80\xf7\xb8\
\x90\x65\x3e\x91\x32\x1f\x28\x61\xbc\x1c\x83\xa9\x22\xf6\x15\x49\
\x98\x09\xf2\x64\x05\xe6\x2d\x4c\x85\xe6\xad\x22\xe4\xd6\x3f\x5f\
\x99\x6d\xcf\x42\xbf\xa5\x07\x33\x17\x8d\x20\x57\xf9\x4e\xd6\x43\
\xb3\x51\x84\xdc\x7a\x72\xab\x46\x21\xdd\x4a\x7f\x24\xcb\xe0\xaf\
\x17\xb0\x3a\xb5\xee\x46\x1b\x72\x51\xc7\xa3\x2e\xea\x3f\xec\xa2\
\xf6\x3f\x82\x5f\x26\xa5\xa9\x30\xaa\xda\xab\x16\x00\x00\x00\x00\
\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x06\x19\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x80\x00\x00\x00\x80\x08\x03\x00\x00\x00\xf4\xe0\x91\xf9\
\x00\x00\x00\x03\x73\x42\x49\x54\x08\x08\x08\xdb\xe1\x4f\xe0\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x06\x7a\x00\x00\x06\x7a\x01\
\xf2\x51\xe0\xf7\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\
\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\xe0\x50\x4c\x54\
\x45\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x97\x13\x17\x8e\x00\x00\x00\x9f\x74\x52\x4e\x53\x00\x01\x02\
\x03\x04\x05\x06\x07\x08\x0a\x0b\x0c\x0d\x0e\x0f\x10\x12\x13\x14\
\x15\x16\x17\x18\x19\x1a\x1b\x1d\x20\x21\x22\x25\x26\x27\x28\x2c\
\x2e\x2f\x31\x32\x33\x34\x36\x37\x38\x39\x3a\x3c\x3d\x3e\x40\x42\
\x43\x44\x45\x46\x49\x4b\x51\x52\x53\x54\x56\x59\x5b\x5d\x5e\x5f\
\x61\x63\x64\x65\x66\x6b\x6d\x6e\x70\x71\x73\x74\x75\x76\x7b\x7d\
\x7f\x80\x81\x82\x88\x8a\x8b\x8c\x8d\x90\x91\x92\x94\x95\x9a\x9b\
\x9e\x9f\xa0\xa2\xa5\xa9\xaa\xab\xad\xae\xaf\xb3\xb4\xb7\xba\xbb\
\xbe\xbf\xc1\xc3\xc5\xc6\xc7\xc9\xca\xcb\xcd\xce\xd0\xd3\xd5\xd6\
\xd7\xd8\xd9\xda\xdb\xdc\xde\xdf\xe2\xe3\xe4\xe6\xe7\xe8\xea\xef\
\xf0\xf1\xf2\xf3\xf4\xf7\xf9\xfa\xfb\xfc\xfd\xfe\xeb\x4a\x80\xf2\
\x00\x00\x03\x00\x49\x44\x41\x54\x78\xda\xed\x98\xed\x3f\x93\x51\
\x18\xc7\x7f\x13\x9a\x86\x54\xab\x44\x53\x8b\xa2\xd0\xb3\x48\xe9\
\x49\x45\x7a\xa2\x94\xb4\xd2\x13\x8b\xa2\x22\xa9\x94\x08\x25\x14\
\x32\xa1\xa8\xdf\xbf\xda\x8b\xb3\xcd\xee\x7b\x0f\x36\x3e\x3a\xbd\
\xb8\xbe\xaf\xce\xb9\x76\x76\xce\xf7\xde\xe7\xde\x39\xd7\x75\x00\
\x41\x10\x04\x41\x10\x04\x41\x10\x04\x41\x10\x04\x41\x10\x84\xff\
\x83\xc2\x2a\x77\xbf\xe7\x1f\xd2\xef\xae\x2a\x0c\x58\x3e\xa3\x9d\
\x1a\x68\xcf\xf0\xad\x5f\x3e\x45\x2d\x4c\x95\xab\xf5\x2b\xa8\x8d\
\x0a\x00\xc8\x9c\xd6\x27\x30\x9d\x09\x58\x3a\xa9\x91\x4e\x0b\x8a\
\xa8\x95\x22\xd4\xe8\x15\xa8\x41\x9b\x5e\x81\x36\x8c\xea\x15\x18\
\x85\xb1\xef\xce\xb3\x17\xf7\x86\x18\x37\xd8\x70\xca\x69\xb5\xda\
\xf2\x2f\xb8\x27\x0d\xf1\x9e\xfa\x32\x87\xd5\x9a\xb2\xe7\xdc\x83\
\x9f\xfe\x58\x53\xae\xbd\xa4\x4f\x35\xc7\x4a\xf3\x0a\x3a\x02\x1e\
\x37\x7f\xc3\xe1\xb7\xa6\x99\x8d\x02\xf7\x01\x60\xf5\x47\xf3\xf2\
\x73\x37\x12\xfc\xbb\x66\xfa\xb3\x85\xf8\x4c\xa5\xc5\x1f\xdf\xe6\
\xdb\x4d\x5d\x00\x90\x34\x44\x92\x9f\xed\x00\x2c\x37\x7d\xc3\x1f\
\x03\xc0\xaa\xee\x08\x02\x7f\xd2\x00\x00\x27\x4d\xeb\x0f\xef\x34\
\x9c\x1b\xa7\x7f\xf9\x1e\xdf\x61\x88\x5f\x25\x49\xce\xdb\xd4\xee\
\x4a\x92\xd7\xd4\x07\xad\xde\xf1\x5b\x01\x00\xc5\x11\x04\x46\xd4\
\x17\xb2\x8d\x43\x7e\x17\x98\x4e\xae\xeb\xde\xe7\x77\x98\xe2\xaf\
\x48\x72\x40\xb5\x73\x48\x32\x57\xb5\x53\x3e\x91\x24\x27\x55\x6f\
\x63\x04\x81\x41\x35\xc4\x69\x1c\x52\x6f\x3e\x3a\xe3\x3f\x90\x24\
\x2b\x11\x4a\xac\x37\x60\x0e\xa7\xf7\x83\x1d\x33\x24\x39\xa1\x3a\
\x6b\x63\x15\x18\xb3\x06\x1d\xde\xbb\x49\xb2\xc7\x62\x0e\xd7\x85\
\x13\xc0\x89\xe5\x08\x3c\x09\xce\x1e\x2c\x53\xa1\x7e\x98\x84\xc1\
\xb0\x02\x68\x58\x86\x40\xb5\x0a\x3a\x5a\x27\x3d\xe3\x77\xe2\x55\
\xe7\x25\xc9\x32\xd5\xdc\xd5\xe1\xf1\x8c\xba\x36\x01\x49\x6e\x86\
\x17\x48\x78\xbd\x74\x81\x83\x2a\xf8\x90\x24\x79\x4c\x75\x6e\x91\
\xf4\xbe\x82\xea\x6f\x3e\xfd\xbc\xe5\x3b\x23\x08\x20\x7d\x62\xc9\
\x02\xde\x59\xd4\xf6\x54\xa7\x3a\x17\x49\x7a\x5f\x0d\x8f\xe9\x3f\
\x1b\x46\x00\x07\xe6\x35\x0b\xe0\x8a\x6e\x01\xdc\xd3\x2d\x90\xb8\
\x82\x02\xdd\xae\xda\xda\xda\xc6\x6f\x61\x04\x12\x0d\x1e\x2b\x21\
\x70\x56\x35\x93\x9f\x86\x16\xb8\x1b\xbf\xc2\x02\x8f\x7c\x73\x27\
\x4f\x84\x14\xe8\xbd\xbd\xc2\x02\xa5\xfe\xc9\x5b\x42\x0b\xf0\xf8\
\x72\x04\x16\xdf\x88\xce\x2c\x2a\xf0\xc3\x19\x93\x40\x96\xaf\x82\
\x9b\x8d\x6e\x2b\x6e\xf2\x4f\x3e\x1c\x46\x80\xfd\xb6\x58\x04\xfc\
\xc4\x65\xbf\x88\xe1\x30\x02\xd6\x31\x9c\x00\x9b\x97\x24\x00\xc4\
\x75\xc5\x70\x1c\xa3\x2c\xbc\x00\x2f\x2d\x4d\x00\x25\x31\x24\x24\
\xa9\x5f\x23\x08\xcc\xed\x8b\x42\x60\x24\x58\x20\x2b\x86\x94\xac\
\xd1\x9c\x92\xe5\xa8\xf6\x00\x49\x72\x7c\xb3\xea\x6d\x59\x3c\x29\
\x0d\xe4\x68\xd4\x49\x69\x5c\x75\x50\x52\xaa\xca\x6f\xdb\xbc\x1a\
\xde\xa5\xde\xe0\xf3\x8b\xa6\xe5\x86\x2c\xa7\x37\xda\xb4\x7c\xfb\
\x9b\xe0\xb4\x7c\x28\x09\x00\x5c\xfe\xd9\x2d\x00\x52\xde\x45\x12\
\xa0\x3b\x6f\x8d\x75\x81\xb4\x23\xef\xa3\x2a\x4c\x52\xf7\x5f\x6e\
\x9e\x0d\x55\x98\xf4\x95\xd8\x73\x9b\x16\x46\xb7\xee\x5d\x7f\xe8\
\x8b\xb9\x30\xd1\x5e\x9a\x69\x2f\x4e\xb5\x97\xe7\xda\x2f\x28\xb4\
\x5f\xd1\x68\xbf\xa4\xd2\x7f\x4d\xa7\xff\xa2\x52\xff\x55\xad\xfe\
\xcb\x6a\x41\x10\x04\x41\x10\x04\x41\x10\x04\x41\x10\x04\x41\x10\
\x04\x9d\xfc\x05\xd8\xa2\x32\xbc\xf8\x3f\x0b\xac\x00\x00\x00\x00\
\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xd1\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x00\xdd\x00\x00\x00\xdd\
\x01\x70\x53\xa2\x07\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x4e\x49\x44\
\x41\x54\x58\x85\xed\xd6\xb1\x6a\x94\x41\x14\x05\xe0\xef\x2c\x41\
\xb0\xd9\x2a\x10\xb0\x16\x3b\xb5\x49\xd8\x4e\x41\x7c\x81\x74\x29\
\x16\x85\xc5\xd6\x54\xc1\xa7\xb0\x4a\x0a\x21\xd8\x68\xeb\x2b\x88\
\xa0\xa5\xd9\x26\xd8\x89\x58\x8a\x96\x56\x29\xaf\x85\x43\x18\x74\
\x23\xb1\xf9\x37\xc5\x7f\x60\x60\xe6\xdc\x3b\xf7\x1c\x66\x86\x99\
\x49\x55\x59\x27\x26\x6b\x55\x1f\x0d\x8c\x06\x46\x03\x57\xc1\xc0\
\x06\x24\xb9\x8d\x27\xd8\x1a\x48\xf7\x07\x5e\x56\xd5\xa7\x49\x92\
\x39\x4e\x71\x67\x20\x71\x4d\xeb\x34\xc9\x3c\xf8\x88\x0f\x55\x75\
\x30\xa0\x01\x49\x9e\xe3\xde\x04\x3b\x58\x0e\x29\xde\xb0\xc4\xce\
\xca\x43\x98\x64\x96\x64\x76\x41\x6c\x91\x64\xba\x82\x9f\x26\x59\
\xfc\x6f\xbd\x8d\x3f\x12\x6f\xe0\x31\x1e\xb6\xf1\x5b\xbc\xaa\xaa\
\x6f\x49\x1e\xe0\x16\x5e\xe0\x6e\x92\x2f\x55\x75\xd4\xf2\x9e\xe2\
\x26\xf6\x93\x5c\xc3\xe7\xaa\x7a\xf7\xaf\x7a\xbd\x6e\x61\xaf\x3d\
\xcb\x9b\xf8\xda\xb8\x6a\xfd\xcd\x16\xdb\xc5\x59\x17\x3b\xae\x2a\
\x2d\x76\xdc\xf1\x67\xd8\xbd\x44\xbd\x3d\xd4\xd5\xb8\x07\x3a\x5c\
\xc7\x1b\x6c\xb7\xf1\xb2\x71\x10\x3c\xc3\x61\x6b\x3f\xbb\x79\xdf\
\x1b\xb7\xdf\x72\x72\x89\x7a\xe7\x38\xdf\x82\x6e\x49\x67\x98\xf5\
\x5c\x17\x5b\x60\xba\x82\x9f\x62\x71\xc1\x9c\xbf\xea\x69\x5b\xb0\
\xd2\xc0\x10\x4d\x77\x06\x4e\xba\x25\x1a\x12\xdb\x38\x09\xe6\x78\
\x8d\xf7\x7e\xdf\xd1\x43\x60\x0b\xf7\xf1\x28\x55\xb5\xd6\xc7\x28\
\xe3\xb7\x7c\x34\x30\x1a\x18\x0d\xac\xdb\xc0\x2f\x19\x8c\x01\x4b\
\xa7\x83\x74\xbb\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
"
qt_resource_name = b"\
\x00\x03\
\x00\x00\x76\xf3\
\x00\x70\
\x00\x69\x00\x63\
\x00\x07\
\x08\xd0\x55\x07\
\x7a\x7a\
\x76\x7d\x56\xfe\x00\x2e\x00\x6a\x00\x70\x00\x67\
\x00\x08\
\x09\xc5\x58\xc7\
\x00\x75\
\x00\x73\x00\x65\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x04\xab\xdf\x07\
\x00\x75\
\x00\x73\x00\x65\x00\x72\x00\x20\x00\x28\x00\x31\x00\x29\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x0e\x01\xb1\xe7\
\x00\x6c\
\x00\x6f\x00\x67\x00\x69\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x08\x56\x02\x87\
\x00\x70\
\x00\x61\x00\x73\x00\x73\x00\x77\x00\x6f\x00\x72\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x02\
\x00\x00\x00\x36\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\
\x00\x00\x00\x6c\x00\x00\x00\x00\x00\x01\x00\x00\x0c\x3c\
\x00\x00\x00\x0c\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x02\x26\
\x00\x00\x00\x54\x00\x00\x00\x00\x00\x01\x00\x00\x06\x1f\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x36\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\
\x00\x00\x01\x77\xcd\xb0\x00\x4a\
\x00\x00\x00\x6c\x00\x00\x00\x00\x00\x01\x00\x00\x0c\x3c\
\x00\x00\x01\x77\xcd\xb2\x67\xb4\
\x00\x00\x00\x0c\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x77\xca\x59\x00\x9c\
\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x02\x26\
\x00\x00\x01\x77\xcd\xae\xaa\x35\
\x00\x00\x00\x54\x00\x00\x00\x00\x00\x01\x00\x00\x06\x1f\
\x00\x00\x01\x77\xcd\xaa\xa6\x69\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| 54.171875 | 103 | 0.725296 | 4,108 | 17,335 | 3.051363 | 0.074732 | 0.334583 | 0.430076 | 0.502593 | 0.31424 | 0.3073 | 0.301955 | 0.300279 | 0.294535 | 0.288313 | 0 | 0.349244 | 0.023479 | 17,335 | 319 | 104 | 54.341693 | 0.391245 | 0.008768 | 0 | 0.227723 | 0 | 0.79538 | 0.000058 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0.006601 | false | 0 | 0.0033 | 0 | 0.009901 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
9b3be3e8ebca8e18058c1c930e8ddab7c8ef4da0 | 8,166 | py | Python | horoma/experiments/ae.py | eeishaan/ift6759-block2 | be7c870746cbe73cdab6ee63def2263b745d4591 | [
"Apache-2.0"
] | null | null | null | horoma/experiments/ae.py | eeishaan/ift6759-block2 | be7c870746cbe73cdab6ee63def2263b745d4591 | [
"Apache-2.0"
] | null | null | null | horoma/experiments/ae.py | eeishaan/ift6759-block2 | be7c870746cbe73cdab6ee63def2263b745d4591 | [
"Apache-2.0"
] | null | null | null | from types import SimpleNamespace
import torch
from torch.nn import functional as F
from horoma.cfg import DEVICE
from horoma.experiments import HoromaExperiment
class AEExperiment(HoromaExperiment):
def _is_naive(self):
return hasattr(self, 'naive') and self.naive is True
def after_train(self, ctx):
super().after_train(ctx)
epoch = ctx.epoch
bce_loss = ctx.bce.item()
message = "BCE loss: {}".format(bce_loss)
self._summary_writer.add_scalar(
'train_train_bce_loss', bce_loss, epoch)
if not self._is_naive():
cluster_loss = ctx.cluster_error.item()
message = "{} Cluster loss: {}".format(
message, cluster_loss)
self._summary_writer.add_scalar(
'train_train_cluster_loss', cluster_loss, epoch)
print(message)
# compute validation loss
self._embedding_model.eval()
eval_ctx = SimpleNamespace(
bce=0,
running_loss=0
)
if not self._is_naive():
eval_ctx.cluster_error = 0
with torch.no_grad():
for data in ctx.train_valid_loader:
data = data.to(DEVICE)
outputs = self._embedding_model(data)
loss = self.compute_loss(eval_ctx, outputs, data)
eval_ctx.running_loss += loss
eval_ctx.running_loss /= len(ctx.train_valid_loader)
eval_running_loss = eval_ctx.running_loss.item()
eval_bce_loss = eval_ctx.bce.item()
message = "BCE: {} Eval loss:{} "\
.format(eval_bce_loss,
eval_running_loss)
if not self._is_naive():
eval_cluster_loss = eval_ctx.cluster_error.item()
message = "{} Cluster loss: {}".format(message, eval_cluster_loss)
self._summary_writer.add_scalar(
'train_valid_cluster_loss', eval_cluster_loss, epoch)
print(message)
self._summary_writer.add_scalar(
'train_valid_bce_loss', eval_bce_loss, epoch)
self._summary_writer.add_scalar(
'train_valid_loss', eval_running_loss, epoch)
# add validation loss to the list of losses
self._last_validation_loss.append(eval_running_loss)
if len(self._last_validation_loss) < self._patience:
return True
if all(self._last_validation_loss[-i] >= self._last_validation_loss[-i - 1]
for i in range(1, self._patience + 1)):
return False
return True
def before_train(self, ctx, train_train_no_aug_loader):
super().before_train(ctx, train_train_no_aug_loader)
ctx.bce = 0
if not self._is_naive():
ctx.cluster_error = 0
# Add validation loss list attribute
if not hasattr(self, '_last_validation_loss'):
self._last_validation_loss = []
def compute_loss(self, ctx, outputs, x):
recon_x, _, _, output_embedding = outputs
BCE = F.binary_cross_entropy(
recon_x, x.view(-1, 3072), reduction='sum')
loss = BCE
ctx.bce += BCE / len(x)
if not self._is_naive():
numpy_embedding = output_embedding.detach().cpu().numpy()
predicted_clusters = self._cluster_obj.predict(
numpy_embedding).reshape(-1)
cluster_centers = self._cluster_obj.cluster_centers_ \
if hasattr(self._cluster_obj, 'cluster_centers_') \
else self._cluster_obj.means_
predicted_centers = cluster_centers[predicted_clusters]
predicted_centers = torch.Tensor(predicted_centers).to(DEVICE)
_lambda = 50000
cluster_error = _lambda * torch.norm(
output_embedding - predicted_centers).pow(2)
loss += cluster_error
ctx.cluster_error += cluster_error / len(x)
return loss
class VAEExperiment(HoromaExperiment):
def _is_naive(self):
return hasattr(self, 'naive') and self.naive is True
def after_train(self, ctx):
super().after_train(ctx)
epoch = ctx.epoch
bce_loss, kld_loss = ctx.bce.item(), ctx.kld.item()
message = "BCE loss: {} KLD Loss: {}".format(bce_loss, kld_loss)
if not self._is_naive():
cluster_loss = ctx.cluster_error.item()
message = "{} Cluster loss: {}".format(message, cluster_loss)
self._summary_writer.add_scalar(
'train_train_cluster_loss', cluster_loss, epoch)
print(message)
self._summary_writer.add_scalar(
'train_train_bce_loss', bce_loss, epoch)
self._summary_writer.add_scalar(
'train_train_kld_loss', kld_loss, epoch)
# compute validation loss
self._embedding_model.eval()
eval_ctx = SimpleNamespace(
bce=0,
running_loss=0,
kld=0,
)
if not self._is_naive():
eval_ctx.cluster_error = 0
with torch.no_grad():
for data in ctx.train_valid_loader:
data = data.to(DEVICE)
outputs = self._embedding_model(data)
loss = self.compute_loss(eval_ctx, outputs, data)
eval_ctx.running_loss += loss
eval_ctx.running_loss /= len(ctx.train_valid_loader)
eval_running_loss = eval_ctx.running_loss.item()
eval_bce_loss = eval_ctx.bce.item()
eval_kld_loss = eval_ctx.kld.item()
message = "BCE: {} KDL: {} Eval loss:{}" \
.format(eval_bce_loss,
eval_kld_loss,
eval_running_loss)
if not self._is_naive():
eval_cluster_loss = eval_ctx.cluster_error.item()
message = "{} Cluster loss: {}".format(message, eval_cluster_loss)
self._summary_writer.add_scalar(
'train_valid_cluster_loss', eval_cluster_loss, epoch)
self._summary_writer.add_scalar(
'train_valid_bce_loss', eval_bce_loss, epoch)
self._summary_writer.add_scalar(
'train_valid_loss', eval_running_loss, epoch)
self._summary_writer.add_scalar(
'train_valid_kld_loss', eval_kld_loss, epoch)
# add validation loss to the list of losses
self._last_validation_loss.append(eval_running_loss)
if len(self._last_validation_loss) < self._patience:
return True
if all(self._last_validation_loss[-i] >= self._last_validation_loss[-i - 1]
for i in range(1, self._patience + 1)):
return False
return True
def before_train(self, ctx, train_train_no_aug_loader):
super().before_train(ctx, train_train_no_aug_loader)
ctx.bce = 0
ctx.kld = 0
if not self._is_naive():
ctx.cluster_error = 0
# Add validation loss list attribute
if not hasattr(self, '_last_validation_loss'):
self._last_validation_loss = []
def compute_loss(self, ctx, outputs, x):
recon_x, mu, logvar, output_embedding = outputs
BCE = F.binary_cross_entropy(
recon_x, x.view(-1, 3072), reduction='sum')
KLD = -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp())
loss = BCE + KLD
if not self._is_naive():
numpy_embedding = output_embedding.detach().cpu().numpy()
predicted_clusters = self._cluster_obj.predict(
numpy_embedding).reshape(-1)
cluster_centers = self._cluster_obj.cluster_centers_ \
if hasattr(self._cluster_obj, 'cluster_centers_') \
else self._cluster_obj.means_
predicted_centers = cluster_centers[predicted_clusters]
predicted_centers = torch.Tensor(predicted_centers).to(DEVICE)
_lambda = 50000
cluster_error = _lambda * torch.norm(
output_embedding - predicted_centers).pow(2)
loss += cluster_error
ctx.cluster_error += cluster_error / len(x)
ctx.bce += BCE / len(x)
ctx.kld += KLD / len(x)
return loss
| 38.158879 | 83 | 0.608866 | 985 | 8,166 | 4.694416 | 0.111675 | 0.036332 | 0.044118 | 0.051903 | 0.917604 | 0.896843 | 0.895978 | 0.882785 | 0.88192 | 0.867431 | 0 | 0.008025 | 0.298065 | 8,166 | 213 | 84 | 38.338028 | 0.798674 | 0.024614 | 0 | 0.817143 | 0 | 0 | 0.06283 | 0.017341 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045714 | false | 0 | 0.028571 | 0.011429 | 0.142857 | 0.017143 | 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 |
9b87bfbb40cd8c240c651612abadd166148deebb | 2,779 | py | Python | plenum/test/monitoring/test_request_time_tracker.py | rhzs/indy-plenum | a1ee6f3d081e802b404637026dc6f8ef3ec82a40 | [
"Apache-2.0"
] | null | null | null | plenum/test/monitoring/test_request_time_tracker.py | rhzs/indy-plenum | a1ee6f3d081e802b404637026dc6f8ef3ec82a40 | [
"Apache-2.0"
] | null | null | null | plenum/test/monitoring/test_request_time_tracker.py | rhzs/indy-plenum | a1ee6f3d081e802b404637026dc6f8ef3ec82a40 | [
"Apache-2.0"
] | 1 | 2020-01-24T09:36:13.000Z | 2020-01-24T09:36:13.000Z |
from plenum.server.monitor import RequestTimeTracker
INSTANCE_COUNT = 4
def test_request_tracker_start_adds_request():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
assert req in req_tracker
assert req in [req for req, _ in req_tracker.unordered()]
def test_request_tracker_order_by_master_makes_request_ordered_and_returns_time_to_order():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
tto = req_tracker.order(0, req[0], req[1], now + 5)
assert req not in [req for req, _ in req_tracker.unordered()]
assert int(tto) == 5
def test_request_tracker_order_by_backup_returns_time_to_order():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
tto = req_tracker.order(1, req[0], req[1], now + 5)
assert req in [req for req, _ in req_tracker.unordered()]
assert int(tto) == 5
def test_request_tracker_deletes_request_only_when_it_is_ordered_by_all_instances():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
for instId in range(INSTANCE_COUNT - 1):
req_tracker.order(instId, req[0], req[1], now)
assert req in req_tracker
req_tracker.order(INSTANCE_COUNT - 1, req[0], req[1], now)
assert req not in req_tracker
def test_request_tracker_doesnt_wait_for_new_instances_on_old_requests():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
req_tracker.add_instance()
for instId in range(INSTANCE_COUNT):
req_tracker.order(instId, req[0], req[1], now)
assert req not in req_tracker
def test_request_tracker_waits_for_new_instances_on_new_requests():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.add_instance()
req_tracker.start(req[0], req[1], now)
for instId in range(INSTANCE_COUNT):
req_tracker.order(instId, req[0], req[1], now)
assert req in req_tracker
req_tracker.order(INSTANCE_COUNT, req[0], req[1], now)
assert req not in req_tracker
def test_request_tracker_performs_garbage_collection_on_remove_instance():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
req = ("id", 42)
now = 1.0
req_tracker.start(req[0], req[1], now)
req_tracker.order(1, req[0], req[1], now)
req_tracker.order(2, req[0], req[1], now)
req_tracker.remove_instance(0)
assert req in req_tracker
req_tracker.remove_instance(2)
assert req not in req_tracker
| 27.79 | 91 | 0.700612 | 430 | 2,779 | 4.239535 | 0.14186 | 0.208448 | 0.061437 | 0.070214 | 0.81898 | 0.817334 | 0.784421 | 0.755897 | 0.735601 | 0.719693 | 0 | 0.032387 | 0.188917 | 2,779 | 99 | 92 | 28.070707 | 0.776398 | 0 | 0 | 0.712121 | 0 | 0 | 0.00504 | 0 | 0 | 0 | 0 | 0 | 0.19697 | 1 | 0.106061 | false | 0 | 0.015152 | 0 | 0.121212 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
9ba3312c338c3346805cf356370181baa8e84a94 | 3,835 | py | Python | test/test_input.py | storborg/livetest | 63d7fe395a1fa6772a85174d01e78300415a66e0 | [
"MIT"
] | null | null | null | test/test_input.py | storborg/livetest | 63d7fe395a1fa6772a85174d01e78300415a66e0 | [
"MIT"
] | 2 | 2019-05-19T15:42:54.000Z | 2020-07-17T17:02:01.000Z | test/test_input.py | storborg/livetest | 63d7fe395a1fa6772a85174d01e78300415a66e0 | [
"MIT"
] | 3 | 2015-11-06T08:24:56.000Z | 2020-07-11T10:30:49.000Z | from webob import Request
from fixtures import ServerFixture
class TestInput(ServerFixture):
def make_app(self):
def app(environ, start_response):
req = Request(environ)
status = "200 OK"
body =\
"""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="text_input_form">
<input name="foo" type="text" value="bar">
<input name="button" type="submit" value="text">
</form>
<form method="POST" id="radio_input_form">
<input name="foo" type="radio" value="bar">
<input name="foo" type="radio" value="baz" checked>
<input name="button" type="submit" value="radio">
</form>
<form method="POST" id="checkbox_input_form">
<input name="foo" type="checkbox" value="bar" checked>
<input name="button" type="submit" value="text">
</form>
</body>
</html>
"""
headers = [
('Content-Type', 'text/html'),
('Content-Length', str(len(body)))]
start_response(status, headers)
return [body]
return app
def test_input(self):
res = self.app.get('/')
assert res.status_int == 200
assert res.headers['content-type'] == 'text/html'
assert res.content_type == 'text/html'
form = res.forms['text_input_form']
assert form['foo'].value == 'bar'
assert form.submit_fields() == [('foo', 'bar')]
form = res.forms['radio_input_form']
assert form['foo'].value == 'baz'
assert form.submit_fields() == [('foo', 'baz')]
form = res.forms['checkbox_input_form']
assert form['foo'].value == 'bar'
assert form.submit_fields() == [('foo', 'bar')]
class TestInputNoDefault(ServerFixture):
def make_app(self):
def app(environ, start_response):
req = Request(environ)
status = "200 OK"
body =\
"""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="text_input_form">
<input name="foo" type="text">
<input name="button" type="submit" value="text">
</form>
<form method="POST" id="radio_input_form">
<input name="foo" type="radio" value="bar">
<input name="foo" type="radio" value="baz">
<input name="button" type="submit" value="radio">
</form>
<form method="POST" id="checkbox_input_form">
<input name="foo" type="checkbox" value="bar">
<input name="button" type="submit" value="text">
</form>
</body>
</html>
"""
headers = [
('Content-Type', 'text/html'),
('Content-Length', str(len(body)))]
start_response(status, headers)
return [body]
return app
def test_input_no_default(self):
res = self.app.get('/')
assert res.status_int == 200
assert res.headers['content-type'] == 'text/html'
assert res.content_type == 'text/html'
form = res.forms['text_input_form']
assert form['foo'].value == ''
assert form.submit_fields() == [('foo', '')]
form = res.forms['radio_input_form']
assert form['foo'].value is None
assert form.submit_fields() == []
form = res.forms['checkbox_input_form']
assert form['foo'].value is None
assert form.submit_fields() == []
| 35.841121 | 74 | 0.497784 | 400 | 3,835 | 4.6625 | 0.1475 | 0.06756 | 0.051475 | 0.068633 | 0.9437 | 0.91689 | 0.91689 | 0.909383 | 0.909383 | 0.909383 | 0 | 0.004831 | 0.352282 | 3,835 | 106 | 75 | 36.179245 | 0.745974 | 0 | 0 | 0.814815 | 0 | 0 | 0.137283 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.111111 | false | 0 | 0.037037 | 0 | 0.259259 | 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 |
9ba84f29b2f41319a53380f36751fb235d2e6d58 | 5,777 | py | Python | tests/test_user.py | SiriusKoan/shorten-url-with-kv | 55d108a263441cc17dbec2ce3c8419b4b4ea111d | [
"MIT"
] | 3 | 2022-02-16T09:11:39.000Z | 2022-03-25T06:07:34.000Z | tests/test_user.py | SiriusKoan/shorten-url-with-kv | 55d108a263441cc17dbec2ce3c8419b4b4ea111d | [
"MIT"
] | null | null | null | tests/test_user.py | SiriusKoan/shorten-url-with-kv | 55d108a263441cc17dbec2ce3c8419b4b4ea111d | [
"MIT"
] | null | null | null | from flask import url_for
from tests.helper import TestModel
class LoginPageTest(TestModel):
def setUp(self) -> None:
super().setUp()
self.route = url_for("user.login_page")
self.user_data_bad_wrong_password = {"username": "user", "password": "bad"}
self.user_data_bad_empty_field = {"username": "user"}
def test_get_with_no_auth(self):
res = self.get()
self.assertEqual(res.status_code, 200)
self.assertIn(b"Login", res.data)
def test_get_with_auth(self):
res = self.get(login="user")
self.assertEqual(res.status_code, 200)
self.assertIn(b"Dashboard", res.data)
def test_post_ok(self):
res = self.post(data=self.user_data)
self.assertEqual(res.status_code, 200)
self.assertIn(b"Dashboard", res.data)
def test_post_bad_wrong_password(self):
res = self.post(data=self.user_data_bad_wrong_password)
self.assertEqual(res.status_code, 200)
self.assertIn(b"Wrong username or password.", res.data)
def test_post_bad_empty_field(self):
res = self.post(data=self.user_data_bad_empty_field)
self.assertEqual(res.status_code, 200)
self.assertIn(b"This field is required.", res.data)
class RegisterPageTest(TestModel):
def setUp(self) -> None:
super().setUp()
self.route = url_for("user.register_page")
self.register_data_ok = {
"username": "user2",
"password": "useruser",
"repeat_password": "useruser",
"email": "user@a.a",
}
self.register_data_bad_username_duplicate = {
"username": "user",
"password": "useruser",
"repeat_password": "useruser",
"email": "user@a.a",
}
self.register_data_bad_email_duplicate = {
"username": "user2",
"password": "useruser",
"repeat_password": "useruser",
"email": "user@user.com",
}
self.register_data_bad_too_short_password = {
"username": "user2",
"password": "short",
"repeat_password": "short",
"email": "user@a.a",
}
self.register_data_bad_empty_field = {
"username": "user2",
}
def test_get_with_no_auth(self):
res = self.get()
self.assertEqual(res.status_code, 200)
self.assertIn(b"Login", res.data)
def test_get_with_auth(self):
res = self.get(login="user")
self.assertEqual(res.status_code, 200)
self.assertIn(b"Dashboard", res.data)
def test_post_ok(self):
res = self.post(data=self.register_data_ok)
self.assertEqual(res.status_code, 200)
self.assertIn(b"Login", res.data)
def test_post_bad_username_duplicate(self):
res = self.post(data=self.register_data_bad_username_duplicate)
self.assertEqual(res.status_code, 200)
self.assertIn(b"The username or the email has been used.", res.data)
def test_post_bad_email_duplicate(self):
res = self.post(data=self.register_data_bad_email_duplicate)
self.assertEqual(res.status_code, 200)
self.assertIn(b"The username or the email has been used.", res.data)
def test_post_bad_too_short_password(self):
res = self.post(data=self.register_data_bad_too_short_password)
self.assertEqual(res.status_code, 200)
self.assertIn(b"The password must contain at least 6 characters.", res.data)
def test_post_bad_empty_field(self):
res = self.post(data=self.register_data_bad_empty_field)
self.assertEqual(res.status_code, 200)
self.assertIn(b"This field is required.", res.data)
class DashboardPageTest(TestModel):
def setUp(self) -> None:
super().setUp()
self.route = url_for("user.dashboard_page")
def test_get_with_no_auth(self):
res = self.get()
self.assertEqual(res.status_code, 200)
self.assertIn(b"Login", res.data)
def test_get_with_auth(self):
res = self.get(login="user")
self.assertEqual(res.status_code, 200)
self.assertIn(b"Dashboard", res.data)
class SettingPageTest(TestModel):
def setUp(self) -> None:
super().setUp()
self.route = url_for("user.setting_page")
self.data_ok = {"email": "user@a.a"}
self.data_bad_too_short_password = {"email": "user@a.a", "password": "short"}
self.data_bad_empty_field = {"email": ""}
self.data_bad_duplicate_email = {"email": "user2@user.com"}
def test_get_with_no_auth(self):
res = self.get()
self.assertEqual(res.status_code, 200)
self.assertIn(b"Login", res.data)
def test_get_with_auth(self):
res = self.get(login="user")
self.assertEqual(res.status_code, 200)
self.assertIn(b"Setting", res.data)
def test_post_ok(self):
res = self.post(login="user", data=self.data_ok)
self.assertEqual(res.status_code, 200)
self.assertIn(b"OK.", res.data)
def test_post_bad_too_short_password(self):
res = self.post(login="user", data=self.data_bad_too_short_password)
self.assertEqual(res.status_code, 200)
self.assertIn(b"The password must contain at least 6 characters.", res.data)
def test_post_bad_empty_field(self):
res = self.post(login="user", data=self.data_bad_empty_field)
self.assertEqual(res.status_code, 200)
self.assertIn(b"This field is required.", res.data)
def test_post_bad_duplicate_email(self):
res = self.post(login="user", data=self.data_bad_duplicate_email)
self.assertEqual(res.status_code, 200)
self.assertIn(b"The email has been used.", res.data)
| 36.10625 | 85 | 0.639432 | 768 | 5,777 | 4.572917 | 0.089844 | 0.039863 | 0.062642 | 0.136674 | 0.88582 | 0.861048 | 0.814636 | 0.795843 | 0.782745 | 0.739465 | 0 | 0.015162 | 0.23507 | 5,777 | 159 | 86 | 36.333333 | 0.779588 | 0 | 0 | 0.618321 | 0 | 0 | 0.144885 | 0 | 0 | 0 | 0 | 0 | 0.305344 | 1 | 0.183206 | false | 0.152672 | 0.015267 | 0 | 0.229008 | 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 |
9bbc84b5d5e1dd8535bbe4724a9d0fe667d2eb65 | 160,141 | py | Python | TEST3D/GUI/0011202_page_bc/log.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 31 | 2015-04-01T15:59:36.000Z | 2022-03-18T20:21:47.000Z | TEST3D/GUI/0011202_page_bc/log.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 3 | 2015-02-06T19:30:24.000Z | 2017-05-25T14:14:31.000Z | TEST3D/GUI/0011202_page_bc/log.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 7 | 2015-01-23T15:19:22.000Z | 2021-06-09T09:03:59.000Z | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# oof_manager@nist.gov.
import tests
#Testing Boundary Condition creation using Dirichlet on a Displacement Field
#The field component is x here
findWidget('OOF3D').resize(550, 350)
setComboBox(findWidget('OOF3D:Navigation:PageMenu'), 'Microstructure')
checkpoint page installed Microstructure
findWidget('OOF3D:Microstructure Page:Pane').set_position(225)
findWidget('OOF3D:Microstructure Page:Pane').set_position(156)
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint microstructure page sensitized
checkpoint meshable button set
findMenu(findWidget('OOF3D:MenuBar'), 'File:Load:Data').activate()
checkpoint toplevel widget mapped Dialog-Data
findWidget('Dialog-Data').resize(190, 67)
findWidget('Dialog-Data:filename').set_text('TEST_DATA/two_walls.skeleton')
findWidget('Dialog-Data:gtk-ok').clicked()
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint pixel page updated
checkpoint named analysis chooser set
checkpoint active area status updated
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint Field page sensitized
checkpoint Materials page updated
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint pinnodes page sensitized
checkpoint boundary page updated
checkpoint skeleton selection page selection sensitized
checkpoint skeleton selection page updated
checkpoint skeleton selection page groups sensitized
checkpoint skeleton selection page groups sensitized
checkpoint Solver page sensitized
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint meshable button set
checkpoint meshable button set
checkpoint microstructure page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint skeleton selection page selection sensitized
checkpoint skeleton selection page updated
checkpoint skeleton selection page groups sensitized
checkpoint named analysis chooser set
checkpoint Field page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint pinnodes page sensitized
checkpoint boundary page updated
checkpoint skeleton selection page selection sensitized
checkpoint Solver page sensitized
checkpoint skeleton selection page groups sensitized
checkpoint skeleton selection page groups sensitized
checkpoint skeleton selection page updated
checkpoint pinnodes page sensitized
findWidget('OOF3D Activity Viewer').resize(400, 300)
checkpoint pinnodes page sensitized
checkpoint pinnodes page sensitized
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint boundary page updated
checkpoint OOF.File.Load.Data
setComboBox(findWidget('OOF3D:Navigation:PageMenu'), 'FE Mesh')
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint page installed FE Mesh
findWidget('OOF3D:FE Mesh Page:Pane').set_position(304)
findWidget('OOF3D:FE Mesh Page:New').clicked()
checkpoint toplevel widget mapped Dialog-Create a new mesh
findWidget('Dialog-Create a new mesh').resize(345, 153)
findWidget('Dialog-Create a new mesh:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Field page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint mesh page subproblems sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint OOF.Mesh.New
setComboBox(findWidget('OOF3D:Navigation:PageMenu'), 'Fields & Equations')
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint page installed Fields & Equations
findWidget('OOF3D').resize(675, 350)
findWidget('OOF3D:Fields & Equations Page:HPane').set_position(301)
findWidget('OOF3D:Fields & Equations Page:HPane:Fields:Displacement defined').clicked()
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint OOF.Subproblem.Field.Define
findWidget('OOF3D:Fields & Equations Page:HPane:Fields:Displacement active').clicked()
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint OOF.Subproblem.Field.Activate
findWidget('OOF3D:Fields & Equations Page:HPane:Equations:Force_Balance active').clicked()
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint Field page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint mesh page subproblems sensitized
checkpoint mesh page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint OOF.Subproblem.Equation.Activate
setComboBox(findWidget('OOF3D:Navigation:PageMenu'), 'Boundary Conditions')
checkpoint page installed Boundary Conditions
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 289)
findWidget('Dialog-New Boundary Condition:name:Auto').clicked()
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
assert tests.boundaryConditionCheck(['dirichlet_fieldx_componentx_constantXmax'])
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Xmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
assert tests.boundaryConditionCheck(['dirichlet_fieldx_componentx_constantXmax','dirichlet_fieldx_componentx_constantXmin'])
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXmaxYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXmaxYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_constantXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentx_continuumXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 289)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Xmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:eqn_component'), 'y')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Xmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXmaxYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXmaxYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_constantXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componenty_continuumXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 289)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Xmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:eqn_component'), 'z')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Xmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Ymin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'Zmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'YminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmax')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XmaxYminZmin')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXmaxYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXmaxYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYmaxZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYmaxZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYmaxZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmax')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYminZmax')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(467, 309)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:boundary'), 'XminYminZmin')
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Constant Profile')
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_constantXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
findWidget('OOF3D Messages 1').resize(983, 200)
findWidget('OOF3D:Boundary Conditions Page:Condition:New').clicked()
checkpoint toplevel widget mapped Dialog-New Boundary Condition
findWidget('Dialog-New Boundary Condition').resize(412, 265)
setComboBox(findWidget('Dialog-New Boundary Condition:condition:Dirichlet:profile:Chooser'), 'Continuum Profile')
findWidget('Dialog-New Boundary Condition').resize(467, 309)
findWidget('Dialog-New Boundary Condition:name:Text').set_text('dirichlet_fieldx_componentz_continuumXminYminZmin')
findWidget('Dialog-New Boundary Condition:gtk-ok').clicked()
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint Field page sensitized
checkpoint Solver page sensitized
checkpoint named analysis chooser set
checkpoint Solver page sensitized
checkpoint OOF.Mesh.Boundary_Conditions.New
assert tests.boundaryConditionCheck(['dirichlet_fieldx_componentx_constantXmax', 'dirichlet_fieldx_componentx_constantXmaxYmax', 'dirichlet_fieldx_componentx_constantXmaxYmaxZmax', 'dirichlet_fieldx_componentx_constantXmaxYmaxZmin', 'dirichlet_fieldx_componentx_constantXmaxYmin', 'dirichlet_fieldx_componentx_constantXmaxYminZmax', 'dirichlet_fieldx_componentx_constantXmaxYminZmin', 'dirichlet_fieldx_componentx_constantXmaxZmax', 'dirichlet_fieldx_componentx_constantXmaxZmin', 'dirichlet_fieldx_componentx_constantXmin', 'dirichlet_fieldx_componentx_constantXminYmax', 'dirichlet_fieldx_componentx_constantXminYmaxZmax', 'dirichlet_fieldx_componentx_constantXminYmaxZmin', 'dirichlet_fieldx_componentx_constantXminYmin', 'dirichlet_fieldx_componentx_constantXminYminZmax', 'dirichlet_fieldx_componentx_constantXminYminZmin', 'dirichlet_fieldx_componentx_constantXminZmax', 'dirichlet_fieldx_componentx_constantXminZmin', 'dirichlet_fieldx_componentx_constantYmax', 'dirichlet_fieldx_componentx_constantYmaxZmax', 'dirichlet_fieldx_componentx_constantYmaxZmin', 'dirichlet_fieldx_componentx_constantYmin', 'dirichlet_fieldx_componentx_constantYminZmax', 'dirichlet_fieldx_componentx_constantYminZmin', 'dirichlet_fieldx_componentx_constantZmax', 'dirichlet_fieldx_componentx_constantZmin', 'dirichlet_fieldx_componentx_continuumXmaxYmax', 'dirichlet_fieldx_componentx_continuumXmaxYmaxZmax', 'dirichlet_fieldx_componentx_continuumXmaxYmaxZmin', 'dirichlet_fieldx_componentx_continuumXmaxYmin', 'dirichlet_fieldx_componentx_continuumXmaxYminZmax', 'dirichlet_fieldx_componentx_continuumXmaxYminZmin', 'dirichlet_fieldx_componentx_continuumXmaxZmax', 'dirichlet_fieldx_componentx_continuumXmaxZmin', 'dirichlet_fieldx_componentx_continuumXmin', 'dirichlet_fieldx_componentx_continuumXminYmax', 'dirichlet_fieldx_componentx_continuumXminYmaxZmax', 'dirichlet_fieldx_componentx_continuumXminYmaxZmin', 'dirichlet_fieldx_componentx_continuumXminYmin', 'dirichlet_fieldx_componentx_continuumXminYminZmax', 'dirichlet_fieldx_componentx_continuumXminYminZmin', 'dirichlet_fieldx_componentx_continuumXminZmax', 'dirichlet_fieldx_componentx_continuumXminZmin', 'dirichlet_fieldx_componentx_continuumYmax', 'dirichlet_fieldx_componentx_continuumYmaxZmax', 'dirichlet_fieldx_componentx_continuumYmaxZmin', 'dirichlet_fieldx_componentx_continuumYmin', 'dirichlet_fieldx_componentx_continuumYminZmax', 'dirichlet_fieldx_componentx_continuumYminZmin', 'dirichlet_fieldx_componentx_continuumZmax', 'dirichlet_fieldx_componentx_continuumZmin', 'dirichlet_fieldx_componenty_constantXmax', 'dirichlet_fieldx_componenty_constantXmaxYmax', 'dirichlet_fieldx_componenty_constantXmaxYmaxZmax', 'dirichlet_fieldx_componenty_constantXmaxYmaxZmin', 'dirichlet_fieldx_componenty_constantXmaxYmin', 'dirichlet_fieldx_componenty_constantXmaxYminZmax', 'dirichlet_fieldx_componenty_constantXmaxYminZmin', 'dirichlet_fieldx_componenty_constantXmaxZmax', 'dirichlet_fieldx_componenty_constantXmaxZmin', 'dirichlet_fieldx_componenty_constantXmin', 'dirichlet_fieldx_componenty_constantXminYmax', 'dirichlet_fieldx_componenty_constantXminYmaxZmax', 'dirichlet_fieldx_componenty_constantXminYmaxZmin', 'dirichlet_fieldx_componenty_constantXminYmin', 'dirichlet_fieldx_componenty_constantXminYminZmax', 'dirichlet_fieldx_componenty_constantXminYminZmin', 'dirichlet_fieldx_componenty_constantXminZmax', 'dirichlet_fieldx_componenty_constantXminZmin', 'dirichlet_fieldx_componenty_constantYmax', 'dirichlet_fieldx_componenty_constantYmaxZmax', 'dirichlet_fieldx_componenty_constantYmaxZmin', 'dirichlet_fieldx_componenty_constantYmin', 'dirichlet_fieldx_componenty_constantYminZmax', 'dirichlet_fieldx_componenty_constantYminZmin', 'dirichlet_fieldx_componenty_constantZmax', 'dirichlet_fieldx_componenty_constantZmin', 'dirichlet_fieldx_componenty_continuumXmaxYmax', 'dirichlet_fieldx_componenty_continuumXmaxYmaxZmax', 'dirichlet_fieldx_componenty_continuumXmaxYmaxZmin', 'dirichlet_fieldx_componenty_continuumXmaxYmin', 'dirichlet_fieldx_componenty_continuumXmaxYminZmax', 'dirichlet_fieldx_componenty_continuumXmaxYminZmin', 'dirichlet_fieldx_componenty_continuumXmaxZmax', 'dirichlet_fieldx_componenty_continuumXmaxZmin', 'dirichlet_fieldx_componenty_continuumXmin', 'dirichlet_fieldx_componenty_continuumXminYmax', 'dirichlet_fieldx_componenty_continuumXminYmaxZmax', 'dirichlet_fieldx_componenty_continuumXminYmaxZmin', 'dirichlet_fieldx_componenty_continuumXminYmin', 'dirichlet_fieldx_componenty_continuumXminYminZmax', 'dirichlet_fieldx_componenty_continuumXminYminZmin', 'dirichlet_fieldx_componenty_continuumXminZmax', 'dirichlet_fieldx_componenty_continuumXminZmin', 'dirichlet_fieldx_componenty_continuumYmax', 'dirichlet_fieldx_componenty_continuumYmaxZmax', 'dirichlet_fieldx_componenty_continuumYmaxZmin', 'dirichlet_fieldx_componenty_continuumYmin', 'dirichlet_fieldx_componenty_continuumYminZmax', 'dirichlet_fieldx_componenty_continuumYminZmin', 'dirichlet_fieldx_componenty_continuumZmax', 'dirichlet_fieldx_componenty_continuumZmin', 'dirichlet_fieldx_componentz_constantXmax', 'dirichlet_fieldx_componentz_constantXmaxYmax', 'dirichlet_fieldx_componentz_constantXmaxYmaxZmax', 'dirichlet_fieldx_componentz_constantXmaxYmaxZmin', 'dirichlet_fieldx_componentz_constantXmaxYmin', 'dirichlet_fieldx_componentz_constantXmaxYminZmax', 'dirichlet_fieldx_componentz_constantXmaxYminZmin', 'dirichlet_fieldx_componentz_constantXmaxZmax', 'dirichlet_fieldx_componentz_constantXmaxZmin', 'dirichlet_fieldx_componentz_constantXmin', 'dirichlet_fieldx_componentz_constantXminYmax', 'dirichlet_fieldx_componentz_constantXminYmaxZmax', 'dirichlet_fieldx_componentz_constantXminYmaxZmin', 'dirichlet_fieldx_componentz_constantXminYmin', 'dirichlet_fieldx_componentz_constantXminYminZmax', 'dirichlet_fieldx_componentz_constantXminYminZmin', 'dirichlet_fieldx_componentz_constantXminZmax', 'dirichlet_fieldx_componentz_constantXminZmin', 'dirichlet_fieldx_componentz_constantYmax', 'dirichlet_fieldx_componentz_constantYmaxZmax', 'dirichlet_fieldx_componentz_constantYmaxZmin', 'dirichlet_fieldx_componentz_constantYmin', 'dirichlet_fieldx_componentz_constantYminZmax', 'dirichlet_fieldx_componentz_constantYminZmin', 'dirichlet_fieldx_componentz_constantZmax', 'dirichlet_fieldx_componentz_constantZmin', 'dirichlet_fieldx_componentz_continuumXmaxYmax', 'dirichlet_fieldx_componentz_continuumXmaxYmaxZmax', 'dirichlet_fieldx_componentz_continuumXmaxYmaxZmin', 'dirichlet_fieldx_componentz_continuumXmaxYmin', 'dirichlet_fieldx_componentz_continuumXmaxYminZmax', 'dirichlet_fieldx_componentz_continuumXmaxYminZmin', 'dirichlet_fieldx_componentz_continuumXmaxZmax', 'dirichlet_fieldx_componentz_continuumXmaxZmin', 'dirichlet_fieldx_componentz_continuumXmin', 'dirichlet_fieldx_componentz_continuumXminYmax', 'dirichlet_fieldx_componentz_continuumXminYmaxZmax', 'dirichlet_fieldx_componentz_continuumXminYmaxZmin', 'dirichlet_fieldx_componentz_continuumXminYmin', 'dirichlet_fieldx_componentz_continuumXminYminZmax', 'dirichlet_fieldx_componentz_continuumXminYminZmin', 'dirichlet_fieldx_componentz_continuumXminZmax', 'dirichlet_fieldx_componentz_continuumXminZmin', 'dirichlet_fieldx_componentz_continuumYmax', 'dirichlet_fieldx_componentz_continuumYmaxZmax', 'dirichlet_fieldx_componentz_continuumYmaxZmin', 'dirichlet_fieldx_componentz_continuumYmin', 'dirichlet_fieldx_componentz_continuumYminZmax', 'dirichlet_fieldx_componentz_continuumYminZmin', 'dirichlet_fieldx_componentz_continuumZmax', 'dirichlet_fieldx_componentz_continuumZmin'])
findMenu(findWidget('OOF3D:MenuBar'), 'File:Save:Python_Log').activate()
checkpoint toplevel widget mapped Dialog-Python_Log
findWidget('Dialog-Python_Log').resize(190, 92)
findWidget('Dialog-Python_Log:filename').set_text('bcpage.log')
findWidget('Dialog-Python_Log:gtk-ok').clicked()
checkpoint OOF.File.Save.Python_Log
assert tests.filediff('bcpage.log')
widget_2=findWidget('OOF3D')
handled_2=widget_2.event(event(gtk.gdk.DELETE,window=widget_2.window))
postpone if not handled_2: widget_2.destroy()
checkpoint OOF.Graphics_1.File.Close | 55.954228 | 7,516 | 0.846691 | 19,165 | 160,141 | 7.009236 | 0.013566 | 0.152458 | 0.177054 | 0.178066 | 0.942724 | 0.939597 | 0.936992 | 0.935779 | 0.93493 | 0.933396 | 0 | 0.019049 | 0.073623 | 160,141 | 2,862 | 7,517 | 55.954228 | 0.886452 | 0.003297 | 0 | 0.927669 | 0 | 0 | 0.372787 | 0.149671 | 0 | 0 | 0 | 0 | 0.001404 | 0 | null | null | 0 | 0.000351 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
1fae3b6c4afbe83ac58ddfd038418c206fcadd4f | 815 | py | Python | tests/data/fstring.py | qualname/grey | f2ed7cc92c1b15c1b47919caab2787b465e2766b | [
"MIT"
] | 1 | 2019-07-19T21:03:39.000Z | 2019-07-19T21:03:39.000Z | tests/data/fstring.py | qualname/grey | f2ed7cc92c1b15c1b47919caab2787b465e2766b | [
"MIT"
] | 4 | 2020-03-24T17:09:13.000Z | 2021-06-01T23:45:52.000Z | tests/data/fstring.py | qualname/grey | f2ed7cc92c1b15c1b47919caab2787b465e2766b | [
"MIT"
] | null | null | null | f"f-string without formatted values is just a string"
f"{{NOT a formatted value}}"
f"{{NOT 'a' \"formatted\" \"value\"}}"
f"some f-string with {a} {few():.2f} {formatted.values!r}"
f'some f-string with {a} {few(""):.2f} {formatted.values!r}'
f"{f'''{'nested'} inner'''} outer"
f"\"{f'{nested} inner'}\" outer"
f"space between opening braces: { {a for a in (1, 2, 3)}}"
f'Hello \'{tricky + "example"}\''
# output
f'f-string without formatted values is just a string'
f'{{NOT a formatted value}}'
f'{{NOT \'a\' "formatted" "value"}}'
f'some f-string with {a} {few():.2f} {formatted.values!r}'
f'some f-string with {a} {few(""):.2f} {formatted.values!r}'
f"{f'''{'nested'} inner'''} outer"
f"\"{f'{nested} inner'}\" outer"
f'space between opening braces: { {a for a in (1, 2, 3)}}'
f'Hello \'{tricky + "example"}\''
| 37.045455 | 60 | 0.615951 | 137 | 815 | 3.664234 | 0.226277 | 0.023904 | 0.039841 | 0.111554 | 0.988048 | 0.988048 | 0.988048 | 0.988048 | 0.988048 | 0.988048 | 0 | 0.014065 | 0.127607 | 815 | 21 | 61 | 38.809524 | 0.691983 | 0.007362 | 0 | 0.444444 | 0 | 0 | 0.817844 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
9520d254344e19046472103b0a996d0eef465945 | 93 | py | Python | src/stk/molecular/atoms/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 21 | 2018-04-12T16:25:24.000Z | 2022-02-14T23:05:43.000Z | src/stk/molecular/atoms/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 8 | 2019-03-19T12:36:36.000Z | 2020-11-11T12:46:00.000Z | src/stk/molecular/atoms/__init__.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | 5 | 2018-08-07T13:00:16.000Z | 2021-11-01T00:55:10.000Z | from .atom import * # noqa
from .atom_info import * # noqa
from .elements import * # noqa
| 23.25 | 32 | 0.677419 | 13 | 93 | 4.769231 | 0.461538 | 0.483871 | 0.451613 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225806 | 93 | 3 | 33 | 31 | 0.861111 | 0.150538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
952ede37270738be1a784a297266e9e84e3bd15c | 10,198 | py | Python | scripts/results/results-figures.py | nmstreethran/WindTurbineClassification | b0ea6de909ccd5bb425cee291ca3c252c11df4eb | [
"MIT"
] | 34 | 2019-03-01T21:24:40.000Z | 2022-03-20T09:59:17.000Z | scripts/results/results-figures.py | nmstreethran/WindTurbineClassification | b0ea6de909ccd5bb425cee291ca3c252c11df4eb | [
"MIT"
] | null | null | null | scripts/results/results-figures.py | nmstreethran/WindTurbineClassification | b0ea6de909ccd5bb425cee291ca3c252c11df4eb | [
"MIT"
] | 8 | 2019-03-01T21:24:46.000Z | 2021-06-26T15:04:14.000Z | """Plots of results
"""
# import libraries
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# decision trees
d = pd.read_csv('data/DT.csv')
# per turbine
d0 = d.groupby('turbine', as_index=False)['f1'].mean()
d1 = d.groupby('turbine', as_index=False)['f1'].max()
d2 = d.groupby('turbine', as_index=False)['f1'].min()
d3 = d.groupby('turbine', as_index=False)['f'].mean()
d4 = d.groupby('turbine', as_index=False)['f'].max()
d5 = d.groupby('turbine', as_index=False)['f'].min()
x = np.array(d0['turbine'])
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(list(range(1, 26)))
plt.xlabel('Turbine')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# per turbine category
d0 = d.groupby('fault', as_index=False)['f1'].mean()
d1 = d.groupby('fault', as_index=False)['f1'].max()
d2 = d.groupby('fault', as_index=False)['f1'].min()
d3 = d.groupby('fault', as_index=False)['f'].mean()
d4 = d.groupby('fault', as_index=False)['f'].max()
d5 = d.groupby('fault', as_index=False)['f'].min()
x = np.array(list(range(1, 15)))
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(range(1, 15), sorted(d0['fault'].tolist(), key=int))
plt.xlabel('Turbine category')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# random forests
d = pd.read_csv('data/RF.csv')
# per turbine
d0 = d.groupby('turbine', as_index=False)['f1'].mean()
d1 = d.groupby('turbine', as_index=False)['f1'].max()
d2 = d.groupby('turbine', as_index=False)['f1'].min()
d3 = d.groupby('turbine', as_index=False)['f'].mean()
d4 = d.groupby('turbine', as_index=False)['f'].max()
d5 = d.groupby('turbine', as_index=False)['f'].min()
x = np.array(d0['turbine'])
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(list(range(1, 26)))
plt.xlabel('Turbine')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# per turbine category
d0 = d.groupby('fault', as_index=False)['f1'].mean()
d1 = d.groupby('fault', as_index=False)['f1'].max()
d2 = d.groupby('fault', as_index=False)['f1'].min()
d3 = d.groupby('fault', as_index=False)['f'].mean()
d4 = d.groupby('fault', as_index=False)['f'].max()
d5 = d.groupby('fault', as_index=False)['f'].min()
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(range(1, 15), sorted(d0['fault'].tolist(), key=int))
plt.xlabel('Turbine category')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# k nearest neighbours
d = pd.read_csv('data/knn.csv')
# per turbine
d0 = d.groupby('turbine', as_index=False)['f1'].mean()
d1 = d.groupby('turbine', as_index=False)['f1'].max()
d2 = d.groupby('turbine', as_index=False)['f1'].min()
d3 = d.groupby('turbine', as_index=False)['f'].mean()
d4 = d.groupby('turbine', as_index=False)['f'].max()
d5 = d.groupby('turbine', as_index=False)['f'].min()
x = np.array(d0['turbine'])
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(list(range(1, 26)))
plt.xlabel('Turbine')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# per turbine category
d0 = d.groupby('fault', as_index=False)['f1'].mean()
d1 = d.groupby('fault', as_index=False)['f1'].max()
d2 = d.groupby('fault', as_index=False)['f1'].min()
d3 = d.groupby('fault', as_index=False)['f'].mean()
d4 = d.groupby('fault', as_index=False)['f'].max()
d5 = d.groupby('fault', as_index=False)['f'].min()
x = np.array(list(range(1, 15)))
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#098A63', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='#3F2B78', marker='o', label='imbalanced')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None',
ecolor='#3F2B78', capsize=3)
plt.xticks(range(1, 15), sorted(d0['fault'].tolist(), key=int))
plt.xlabel('Turbine category')
plt.ylabel('F1 score')
plt.legend(loc=4)
plt.show()
# kNN optimised k
d_k = pd.read_csv('data/knn-k.csv')
# per turbine
d0 = d_k.groupby('turbine', as_index=False)['f1'].mean()
d1 = d_k.groupby('turbine', as_index=False)['f1'].max()
d2 = d_k.groupby('turbine', as_index=False)['f1'].min()
d3 = d_k.groupby('turbine', as_index=False)['f'].mean()
d4 = d_k.groupby('turbine', as_index=False)['f'].max()
d5 = d_k.groupby('turbine', as_index=False)['f'].min()
x = np.array(d0['turbine'])
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
d6 = d.groupby('turbine', as_index=False)['f1'].mean()
d7 = d.groupby('turbine', as_index=False)['f1'].max()
d8 = d.groupby('turbine', as_index=False)['f1'].min()
y2 = np.array(d6['f1'])
eh2 = np.array(d7['f1'])
el2 = np.array(d8['f1'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y2, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y2, [y2 - el2, eh2 - y2], linestyle='None',
ecolor='#098A63', capsize=3)
plt.errorbar(
x, y, linestyle='None', color='#3F2B78',
marker='o', label='imbalanced, without k optimisation')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#3F2B78', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='C0', marker='o',
label='imbalanced, with k optimisation')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None', ecolor='C0', capsize=3)
plt.xticks(list(range(1, 26)))
plt.xlabel('Turbine')
plt.ylabel('F1 score')
plt.legend()
plt.show()
# per turbine category
d0 = d_k.groupby('fault', as_index=False)['f1'].mean()
d1 = d_k.groupby('fault', as_index=False)['f1'].max()
d2 = d_k.groupby('fault', as_index=False)['f1'].min()
d3 = d_k.groupby('fault', as_index=False)['f'].mean()
d4 = d_k.groupby('fault', as_index=False)['f'].max()
d5 = d_k.groupby('fault', as_index=False)['f'].min()
d6 = d.groupby('fault', as_index=False)['f1'].mean()
d7 = d.groupby('fault', as_index=False)['f1'].max()
d8 = d.groupby('fault', as_index=False)['f1'].min()
y2 = np.array(d6['f1'])
eh2 = np.array(d7['f1'])
el2 = np.array(d8['f1'])
x = np.array(list(range(1, 15)))
y = np.array(d0['f1'])
eh = np.array(d1['f1'])
el = np.array(d2['f1'])
y1 = np.array(d3['f'])
eh1 = np.array(d4['f'])
el1 = np.array(d5['f'])
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.errorbar(
x, y2, linestyle='None', color='#098A63', marker='o', label='balanced')
plt.errorbar(
x, y2, [y2 - el2, eh2 - y2], linestyle='None',
ecolor='#098A63', capsize=3)
plt.errorbar(
x, y, linestyle='None', color='#3F2B78',
marker='o', label='imbalanced, without k optimisation')
plt.errorbar(
x, y, [y - el, eh - y], linestyle='None', ecolor='#3F2B78', capsize=3)
plt.errorbar(
x, y1, linestyle='None', color='C0', marker='o',
label='imbalanced, with k optimisation')
plt.errorbar(
x, y1, [y1 - el1, eh1 - y1], linestyle='None', ecolor='C0', capsize=3)
plt.xticks(range(1, 15), sorted(d0['fault'].tolist(), key=int))
plt.xlabel('Turbine category')
plt.ylabel('F1 score')
plt.legend()
plt.show()
# optimal k
d = pd.read_csv('data/knn-optimal.csv')
x = d['turbine']
y = d['k_p']
y1 = d['k_r']
y2 = d['k_f']
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.plot(x, y, color='c', label='k_precision', marker='o')
plt.plot(x, y1, color='#098A63', label='k_recall', marker='o')
plt.plot(x, y2, color='#3F2B78', label='k_F1-score', marker='o')
plt.xlabel('Turbine')
plt.ylabel('Optimal k value')
plt.xticks(range(1, 26))
plt.legend()
plt.show()
# optimal k - F1 score
fig, ax = plt.subplots(figsize=(10, 4), dpi=500)
plt.plot(x, y2, color='#3F2B78', label='k_F1-score', marker='o')
plt.xlabel('Turbine')
plt.ylabel('Optimal k value')
plt.xticks(range(1, 26))
plt.show()
| 31.86875 | 77 | 0.629731 | 1,706 | 10,198 | 3.718054 | 0.064478 | 0.060697 | 0.10216 | 0.066215 | 0.961375 | 0.948605 | 0.938673 | 0.935047 | 0.903831 | 0.849125 | 0 | 0.061734 | 0.120024 | 10,198 | 319 | 78 | 31.968652 | 0.645086 | 0.025887 | 0 | 0.880597 | 0 | 0 | 0.154157 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.011194 | 0 | 0.011194 | 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 |
20fd36fb3b13c374c22e20d970b6857329f20aba | 143 | py | Python | mvt/blocks/__init__.py | JackMing1986/MultipleVsiualTasks | 7f2bd81c41bcd41af34f6953101038201a4f7d37 | [
"MIT"
] | 2 | 2021-08-29T16:54:42.000Z | 2021-09-27T12:22:10.000Z | mvt/blocks/__init__.py | visriv/multi-visual-tasks | 7f2bd81c41bcd41af34f6953101038201a4f7d37 | [
"MIT"
] | null | null | null | mvt/blocks/__init__.py | visriv/multi-visual-tasks | 7f2bd81c41bcd41af34f6953101038201a4f7d37 | [
"MIT"
] | 1 | 2022-01-16T20:17:50.000Z | 2022-01-16T20:17:50.000Z | from .backbones import *
from .cls_heads import *
from .det_heads import *
from .losses import *
from .necks import *
from .roi_heads import *
| 20.428571 | 24 | 0.748252 | 21 | 143 | 4.952381 | 0.428571 | 0.480769 | 0.288462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.167832 | 143 | 6 | 25 | 23.833333 | 0.87395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
1f132019e95ef30d90b31a00df1bb6fad570cd67 | 6,782 | py | Python | thing_gym_ros/envs/reaching/visual.py | utiasSTARS/thing-gym-ros | 6e8a034ac0d1686f29bd29e2aaa63f39a5b188d4 | [
"MIT"
] | 1 | 2021-12-25T01:10:32.000Z | 2021-12-25T01:10:32.000Z | thing_gym_ros/envs/reaching/visual.py | utiasSTARS/thing-gym-ros | 6e8a034ac0d1686f29bd29e2aaa63f39a5b188d4 | [
"MIT"
] | null | null | null | thing_gym_ros/envs/reaching/visual.py | utiasSTARS/thing-gym-ros | 6e8a034ac0d1686f29bd29e2aaa63f39a5b188d4 | [
"MIT"
] | null | null | null | from thing_gym_ros.envs.reaching.generic import ThingRosReachingGeneric
from thing_gym_ros.envs.thing_ros_mb_generic import ThingRosMBEnv
REACHING_IMAGE_DEFAULTS = dict(
img_in_state=True,
depth_in_state=True,
dense_reward=False,
num_objs=1,
state_data=('pose'),
max_real_time=5,
grip_in_action=False
)
REACH_AND_GRASP_IMAGE_DEFAULTS = dict(**REACHING_IMAGE_DEFAULTS)
REACH_AND_GRASP_IMAGE_DEFAULTS['grip_in_action'] = True
REACH_AND_GRASP_IMAGE_DEFAULTS['state_data'] = ('pose', 'grip_pos', 'prev_grip_pos')
# ------------------------------------------------------------------------------------------------------------
# XY Image Envs
# ------------------------------------------------------------------------------------------------------------
REACHING_XY_DEFAULTS = dict(
valid_act_t_dof=(1, 1, 0),
valid_act_r_dof=(0, 0, 0)
)
REACHING_XY_IMAGE_DEFAULTS = dict(**REACHING_IMAGE_DEFAULTS, **REACHING_XY_DEFAULTS)
REACH_AND_GRASP_XY_IMAGE_DEFAULTS = dict(**REACH_AND_GRASP_IMAGE_DEFAULTS, **REACHING_XY_DEFAULTS)
class ThingRosReachingXYImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_XY_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachingXYImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_XY_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGraspXYImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_XY_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGraspXYImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_XY_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
# ------------------------------------------------------------------------------------------------------------
# XYZ Image Envs
# ------------------------------------------------------------------------------------------------------------
REACHING_XYZ_DEFAULTS = dict(
valid_act_t_dof=(1, 1, 1),
valid_act_r_dof=(0, 0, 0)
)
REACHING_XYZ_IMAGE_DEFAULTS = dict(**REACHING_IMAGE_DEFAULTS, **REACHING_XYZ_DEFAULTS)
REACH_AND_GRASP_XYZ_IMAGE_DEFAULTS = dict(**REACH_AND_GRASP_IMAGE_DEFAULTS, **REACHING_XYZ_DEFAULTS)
class ThingRosReachingXYZImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_XYZ_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachingXYZImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_XYZ_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGraspXYZImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_XYZ_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGraspXYZImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_XYZ_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
# ------------------------------------------------------------------------------------------------------------
# 6Dof Image Envs
# ------------------------------------------------------------------------------------------------------------
REACHING_6DOF_DEFAULTS = dict(
valid_act_t_dof=(1, 1, 1),
valid_act_r_dof=(1, 1, 1)
)
REACHING_6DOF_IMAGE_DEFAULTS = dict(**REACHING_IMAGE_DEFAULTS, **REACHING_6DOF_DEFAULTS)
REACH_AND_GRASP_6DOF_IMAGE_DEFAULTS = dict(**REACH_AND_GRASP_IMAGE_DEFAULTS, **REACHING_6DOF_DEFAULTS)
class ThingRosReaching6DOFImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_6DOF_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReaching6DOFImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACHING_6DOF_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGrasp6DOFImage(ThingRosReachingGeneric):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_6DOF_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs)
class ThingRosReachAndGrasp6DOFImageMB(ThingRosReachingGeneric, ThingRosMBEnv):
def __init__(self, reset_teleop_available=False, success_feedback_available=False, **kwargs):
super().__init__(**REACH_AND_GRASP_6DOF_IMAGE_DEFAULTS,
reset_teleop_available=reset_teleop_available,
success_feedback_available=success_feedback_available, **kwargs) | 49.50365 | 110 | 0.675022 | 647 | 6,782 | 6.448223 | 0.108192 | 0.094919 | 0.172579 | 0.189837 | 0.83629 | 0.795781 | 0.775168 | 0.74209 | 0.727709 | 0.691035 | 0 | 0.00596 | 0.158803 | 6,782 | 137 | 111 | 49.50365 | 0.725329 | 0.102919 | 0 | 0.565217 | 0 | 0 | 0.008724 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.130435 | false | 0 | 0.021739 | 0 | 0.282609 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 7 |
1f8876a54a2bda06bfea60bad2dc4c165d75b998 | 224,402 | py | Python | cast/c_Parser.py | scottfrazer/cAST | a947e20cd76a9cf41b7a5e4998fe1eec31183655 | [
"MIT"
] | 6 | 2017-03-26T05:37:36.000Z | 2021-11-06T15:25:01.000Z | cast/c_Parser.py | scottfrazer/cAST | a947e20cd76a9cf41b7a5e4998fe1eec31183655 | [
"MIT"
] | null | null | null | cast/c_Parser.py | scottfrazer/cAST | a947e20cd76a9cf41b7a5e4998fe1eec31183655 | [
"MIT"
] | 3 | 2015-04-22T11:47:51.000Z | 2019-01-20T09:14:43.000Z | import sys, inspect
from cast.ParserCommon import *
def whoami():
return inspect.stack()[1][3]
def whosdaddy():
return inspect.stack()[2][3]
def parse( iterator, entry ):
p = c_Parser()
return p.parse(iterator, entry)
class c_ExpressionParser__expr:
def __init__(self, parent):
self.__dict__.update(locals())
self.infixBp = {
0: 1000,
2: 5000,
8: 15000,
11: 12000,
12: 15000,
18: 11000,
19: 15000,
21: 1000,
27: 16000,
30: 1000,
31: 1000,
35: 4000,
39: 2000,
40: 1000,
43: 7000,
45: 8000,
46: 1000,
51: 1000,
52: 12000,
55: 8000,
58: 3000,
59: 1000,
63: 15000,
65: 10000,
66: 15000,
69: 15000,
74: 9000,
75: 6000,
76: 1000,
81: 9000,
84: 1000,
88: 9000,
94: 14000,
101: 10000,
103: 9000,
106: 1000,
107: 11000,
111: 12000,
}
self.prefixBp = {
2: 13000,
3: 13000,
5: 13000,
12: 13000,
18: 13000,
19: 13000,
52: 13000,
}
def getInfixBp(self, tokenId):
try:
return self.infixBp[tokenId]
except:
return 0
def getPrefixBp(self, tokenId):
try:
return self.prefixBp[tokenId]
except:
return 0
def getCurrentToken(self):
return self.parent.tokens.current()
def expect(self, token):
return self.parent.expect(token)
def parse(self, rbp = 0):
left = self.nud()
if isinstance(left, ParseTree):
left.isExpr = True
left.isNud = True
while self.getCurrentToken() and rbp < self.getInfixBp(self.getCurrentToken().getId()):
left = self.led(left)
if left:
left.isExpr = True
return left
def nud(self):
tree = ParseTree( NonTerminal(119, '_expr') )
current = self.getCurrentToken()
if not current:
return tree
elif current.getId() in [108]:
tree.astTransform = AstTransformNodeCreator('TypeInitializion', {'type': 1, 'initializer': 4})
tree.nudMorphemeCount = 3
tree.add( self.expect(108) )
tree.add( self.parent.parse_type_name() )
tree.add( self.expect(1) )
elif current.getId() in [63]:
tree.astTransform = AstTransformSubstitution(2)
tree.nudMorphemeCount = 3
tree.add( self.expect(63) )
tree.add( self.parent.parse__expr() )
tree.add( self.expect(1) )
elif current.getId() in [52]:
tree.astTransform = AstTransformNodeCreator('Dereference', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(52) )
tree.add( self.parent.parse__expr( self.getPrefixBp(52) ) )
tree.isPrefix = True
elif current.getId() in [118]:
tree.astTransform = AstTransformNodeCreator('SizeOf', {'var': 1})
tree.nudMorphemeCount = 1
tree.add( self.expect(118) )
elif current.getId() in [12]:
tree.astTransform = AstTransformNodeCreator('PreDecr', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(12) )
tree.add( self.parent.parse__expr( self.getPrefixBp(12) ) )
tree.isPrefix = True
elif current.getId() in [19]:
tree.astTransform = AstTransformNodeCreator('PreIncr', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(19) )
tree.add( self.parent.parse__expr( self.getPrefixBp(19) ) )
tree.isPrefix = True
elif current.getId() in [80]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
elif current.getId() in [2]:
tree.astTransform = AstTransformNodeCreator('AddressOf', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(2) )
tree.add( self.parent.parse__expr( self.getPrefixBp(2) ) )
tree.isPrefix = True
elif current.getId() in [80]:
tree.astTransform = AstTransformNodeCreator('FuncCall', {'params': 2, 'name': 0})
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
elif current.getId() in [44]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.expect(44) )
elif current.getId() in [24, 117, 15, 10, 97, 99]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.parent.parse_constant() )
elif current.getId() in [80]:
tree.astTransform = AstTransformNodeCreator('ArrayIndex', {'params': 2, 'name': 0})
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
return tree
def led(self, left):
tree = ParseTree( NonTerminal(119, '_expr') )
current = self.getCurrentToken()
if current.getId() == 76: # 'addeq'
tree.astTransform = AstTransformNodeCreator('AddAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(76) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(76) - modifier ) )
return tree
if current.getId() == 11: # 'mod'
tree.astTransform = AstTransformNodeCreator('Mod', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(11) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(11) - modifier ) )
return tree
if current.getId() == 94: # 'lbrace'
tree.astTransform = AstTransformNodeCreator('TypeInitializion', {'type': 1, 'initializer': 4})
tree.add(left)
tree.add( self.expect(94) )
tree.add( self.parent.parse__gen12() )
tree.add( self.parent.parse_trailing_comma_opt() )
tree.add( self.expect(100) )
return tree
if current.getId() == 75: # 'bitxor'
tree.astTransform = AstTransformNodeCreator('BitXOR', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(75) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(75) - modifier ) )
return tree
if current.getId() == 103: # 'gt'
tree.astTransform = AstTransformNodeCreator('GreaterThan', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(103) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(103) - modifier ) )
return tree
if current.getId() == 40: # 'bitxoreq'
tree.astTransform = AstTransformNodeCreator('XORAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(40) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(40) - modifier ) )
return tree
if current.getId() == 8: # 'arrow'
tree.astTransform = AstTransformNodeCreator('DerefMemberSelect', {'member': 2, 'object': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(8) )
modifier = 0
tree.add( self.parent.parse__expr( self.getInfixBp(8) - modifier ) )
return tree
if current.getId() == 82: # 'sizeof_separator'
tree.astTransform = AstTransformNodeCreator('SizeOf', {'var': 1})
tree.add(left)
tree.add( self.expect(82) )
tree.add( self.parent.parse_sizeof_body() )
return tree
if current.getId() == 88: # 'lt'
tree.astTransform = AstTransformNodeCreator('LessThan', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(88) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(88) - modifier ) )
return tree
if current.getId() == 21: # 'assign'
tree.astTransform = AstTransformNodeCreator('Assign', {'var': 0, 'value': 2})
tree.add(left)
tree.add( self.expect(21) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(21) - modifier ) )
return tree
if current.getId() == 39: # 'questionmark'
tree.astTransform = AstTransformNodeCreator('TernaryOperator', {'true': 2, 'false': 4, 'cond': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(39) )
modifier = 1
tree.add( self.parent.parse__expr( self.getInfixBp(39) - modifier ) )
tree.add( self.expect(28) )
modifier = 1
tree.add( self.parent.parse__expr( self.getInfixBp(39) - modifier ) )
return tree
if current.getId() == 30: # 'subeq'
tree.astTransform = AstTransformNodeCreator('SubtractAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(30) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(30) - modifier ) )
return tree
if current.getId() == 2: # 'bitand'
tree.astTransform = AstTransformNodeCreator('BitAND', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(2) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(2) - modifier ) )
return tree
if current.getId() == 84: # 'modeq'
tree.astTransform = AstTransformNodeCreator('ModAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(84) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(84) - modifier ) )
return tree
if current.getId() == 101: # 'lshift'
tree.astTransform = AstTransformNodeCreator('LeftShift', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(101) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(101) - modifier ) )
return tree
if current.getId() == 31: # 'bitoreq'
tree.astTransform = AstTransformNodeCreator('ORAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(31) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(31) - modifier ) )
return tree
if current.getId() == 106: # 'muleq'
tree.astTransform = AstTransformNodeCreator('MultiplyAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(106) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(106) - modifier ) )
return tree
if current.getId() == 111: # 'div'
tree.astTransform = AstTransformNodeCreator('Div', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(111) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(111) - modifier ) )
return tree
if current.getId() == 27: # 'comma'
tree.astTransform = AstTransformNodeCreator('Comma', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(27) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(27) - modifier ) )
return tree
if current.getId() == 52: # 'asterisk'
tree.astTransform = AstTransformNodeCreator('Mul', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(52) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(52) - modifier ) )
return tree
if current.getId() == 43: # 'bitor'
tree.astTransform = AstTransformNodeCreator('BitOR', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(43) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(43) - modifier ) )
return tree
if current.getId() == 0: # 'diveq'
tree.astTransform = AstTransformNodeCreator('DivideAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(0) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(0) - modifier ) )
return tree
if current.getId() == 107: # 'add'
tree.astTransform = AstTransformNodeCreator('Add', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(107) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(107) - modifier ) )
return tree
if current.getId() == 19: # 'incr'
tree.astTransform = AstTransformNodeCreator('PostIncr', {'var': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(19) )
return tree
if current.getId() == 18: # 'sub'
tree.astTransform = AstTransformNodeCreator('Sub', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(18) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(18) - modifier ) )
return tree
if current.getId() == 74: # 'lteq'
tree.astTransform = AstTransformNodeCreator('LessThanEq', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(74) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(74) - modifier ) )
return tree
if current.getId() == 69: # 'dot'
tree.astTransform = AstTransformNodeCreator('MemberSelect', {'member': 2, 'object': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(69) )
modifier = 0
tree.add( self.parent.parse__expr( self.getInfixBp(69) - modifier ) )
return tree
if current.getId() == 65: # 'rshift'
tree.astTransform = AstTransformNodeCreator('RightShift', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(65) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(65) - modifier ) )
return tree
if current.getId() == 12: # 'decr'
tree.astTransform = AstTransformNodeCreator('PostDecr', {'var': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(12) )
return tree
if current.getId() == 45: # 'eq'
tree.astTransform = AstTransformNodeCreator('Equals', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(45) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(45) - modifier ) )
return tree
if current.getId() == 63: # 'lparen'
tree.astTransform = AstTransformNodeCreator('FuncCall', {'params': 2, 'name': 0})
tree.add(left)
tree.add( self.expect(63) )
tree.add( self.parent.parse__gen44() )
tree.add( self.expect(1) )
return tree
if current.getId() == 81: # 'gteq'
tree.astTransform = AstTransformNodeCreator('GreaterThanEq', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(81) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(81) - modifier ) )
return tree
if current.getId() == 51: # 'lshifteq'
tree.astTransform = AstTransformNodeCreator('LeftShiftAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(51) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(51) - modifier ) )
return tree
if current.getId() == 46: # 'bitandeq'
tree.astTransform = AstTransformNodeCreator('ANDAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(46) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(46) - modifier ) )
return tree
if current.getId() == 66: # 'lsquare'
tree.astTransform = AstTransformNodeCreator('ArrayIndex', {'params': 2, 'name': 0})
tree.add(left)
tree.add( self.expect(66) )
tree.add( self.parent.parse__gen44() )
tree.add( self.expect(77) )
return tree
if current.getId() == 59: # 'rshifteq'
tree.astTransform = AstTransformNodeCreator('RightShiftAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(59) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr( self.getInfixBp(59) - modifier ) )
return tree
return tree
class c_ExpressionParser__expr_sans_comma:
def __init__(self, parent):
self.__dict__.update(locals())
self.infixBp = {
0: 1000,
2: 5000,
8: 15000,
11: 12000,
12: 15000,
18: 11000,
19: 15000,
21: 1000,
30: 1000,
31: 1000,
35: 4000,
39: 2000,
40: 1000,
43: 7000,
45: 8000,
46: 1000,
51: 1000,
52: 12000,
55: 8000,
58: 3000,
59: 1000,
63: 15000,
65: 10000,
66: 15000,
69: 15000,
74: 9000,
75: 6000,
76: 1000,
81: 9000,
84: 1000,
88: 9000,
94: 14000,
101: 10000,
103: 9000,
106: 1000,
107: 11000,
111: 12000,
}
self.prefixBp = {
2: 13000,
3: 13000,
5: 13000,
12: 13000,
18: 13000,
19: 13000,
52: 13000,
}
def getInfixBp(self, tokenId):
try:
return self.infixBp[tokenId]
except:
return 0
def getPrefixBp(self, tokenId):
try:
return self.prefixBp[tokenId]
except:
return 0
def getCurrentToken(self):
return self.parent.tokens.current()
def expect(self, token):
return self.parent.expect(token)
def parse(self, rbp = 0):
left = self.nud()
if isinstance(left, ParseTree):
left.isExpr = True
left.isNud = True
while self.getCurrentToken() and rbp < self.getInfixBp(self.getCurrentToken().getId()):
left = self.led(left)
if left:
left.isExpr = True
return left
def nud(self):
tree = ParseTree( NonTerminal(185, '_expr_sans_comma') )
current = self.getCurrentToken()
if not current:
return tree
if current.getId() in [2]:
tree.astTransform = AstTransformNodeCreator('AddressOf', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(2) )
tree.add( self.parent.parse__expr_sans_comma( self.getPrefixBp(2) ) )
tree.isPrefix = True
elif current.getId() in [44]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.expect(44) )
elif current.getId() in [108]:
tree.astTransform = AstTransformNodeCreator('TypeInitializion', {'type': 1, 'initializer': 4})
tree.nudMorphemeCount = 3
tree.add( self.expect(108) )
tree.add( self.parent.parse_type_name() )
tree.add( self.expect(1) )
elif current.getId() in [63]:
tree.astTransform = AstTransformSubstitution(2)
tree.nudMorphemeCount = 3
tree.add( self.expect(63) )
tree.add( self.parent.parse__expr_sans_comma() )
tree.add( self.expect(1) )
elif current.getId() in [52]:
tree.astTransform = AstTransformNodeCreator('Dereference', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(52) )
tree.add( self.parent.parse__expr_sans_comma( self.getPrefixBp(52) ) )
tree.isPrefix = True
elif current.getId() in [80]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
elif current.getId() in [118]:
tree.astTransform = AstTransformNodeCreator('SizeOf', {'var': 1})
tree.nudMorphemeCount = 1
tree.add( self.expect(118) )
elif current.getId() in [12]:
tree.astTransform = AstTransformNodeCreator('PreDecr', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(12) )
tree.add( self.parent.parse__expr_sans_comma( self.getPrefixBp(12) ) )
tree.isPrefix = True
elif current.getId() in [19]:
tree.astTransform = AstTransformNodeCreator('PreIncr', {'var': 1})
tree.nudMorphemeCount = 2
tree.add( self.expect(19) )
tree.add( self.parent.parse__expr_sans_comma( self.getPrefixBp(19) ) )
tree.isPrefix = True
elif current.getId() in [80]:
tree.astTransform = AstTransformNodeCreator('ArrayIndex', {'params': 2, 'name': 0})
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
elif current.getId() in [24, 117, 15, 10, 97, 99]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.parent.parse_constant() )
elif current.getId() in [80]:
tree.astTransform = AstTransformNodeCreator('FuncCall', {'params': 2, 'name': 0})
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
return tree
def led(self, left):
tree = ParseTree( NonTerminal(185, '_expr_sans_comma') )
current = self.getCurrentToken()
if current.getId() == 103: # 'gt'
tree.astTransform = AstTransformNodeCreator('GreaterThan', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(103) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(103) - modifier ) )
return tree
if current.getId() == 19: # 'incr'
tree.astTransform = AstTransformNodeCreator('PostIncr', {'var': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(19) )
return tree
if current.getId() == 40: # 'bitxoreq'
tree.astTransform = AstTransformNodeCreator('XORAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(40) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(40) - modifier ) )
return tree
if current.getId() == 39: # 'questionmark'
tree.astTransform = AstTransformNodeCreator('TernaryOperator', {'true': 2, 'false': 4, 'cond': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(39) )
modifier = 1
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(39) - modifier ) )
tree.add( self.expect(28) )
modifier = 1
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(39) - modifier ) )
return tree
if current.getId() == 21: # 'assign'
tree.astTransform = AstTransformNodeCreator('Assign', {'var': 0, 'value': 2})
tree.add(left)
tree.add( self.expect(21) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(21) - modifier ) )
return tree
if current.getId() == 30: # 'subeq'
tree.astTransform = AstTransformNodeCreator('SubtractAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(30) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(30) - modifier ) )
return tree
if current.getId() == 107: # 'add'
tree.astTransform = AstTransformNodeCreator('Add', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(107) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(107) - modifier ) )
return tree
if current.getId() == 75: # 'bitxor'
tree.astTransform = AstTransformNodeCreator('BitXOR', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(75) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(75) - modifier ) )
return tree
if current.getId() == 88: # 'lt'
tree.astTransform = AstTransformNodeCreator('LessThan', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(88) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(88) - modifier ) )
return tree
if current.getId() == 94: # 'lbrace'
tree.astTransform = AstTransformNodeCreator('TypeInitializion', {'type': 1, 'initializer': 4})
tree.add(left)
tree.add( self.expect(94) )
tree.add( self.parent.parse__gen12() )
tree.add( self.parent.parse_trailing_comma_opt() )
tree.add( self.expect(100) )
return tree
if current.getId() == 51: # 'lshifteq'
tree.astTransform = AstTransformNodeCreator('LeftShiftAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(51) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(51) - modifier ) )
return tree
if current.getId() == 101: # 'lshift'
tree.astTransform = AstTransformNodeCreator('LeftShift', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(101) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(101) - modifier ) )
return tree
if current.getId() == 11: # 'mod'
tree.astTransform = AstTransformNodeCreator('Mod', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(11) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(11) - modifier ) )
return tree
if current.getId() == 0: # 'diveq'
tree.astTransform = AstTransformNodeCreator('DivideAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(0) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(0) - modifier ) )
return tree
if current.getId() == 18: # 'sub'
tree.astTransform = AstTransformNodeCreator('Sub', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(18) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(18) - modifier ) )
return tree
if current.getId() == 2: # 'bitand'
tree.astTransform = AstTransformNodeCreator('BitAND', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(2) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(2) - modifier ) )
return tree
if current.getId() == 82: # 'sizeof_separator'
tree.astTransform = AstTransformNodeCreator('SizeOf', {'var': 1})
tree.add(left)
tree.add( self.expect(82) )
tree.add( self.parent.parse_sizeof_body() )
return tree
if current.getId() == 8: # 'arrow'
tree.astTransform = AstTransformNodeCreator('DerefMemberSelect', {'member': 2, 'object': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(8) )
modifier = 0
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(8) - modifier ) )
return tree
if current.getId() == 106: # 'muleq'
tree.astTransform = AstTransformNodeCreator('MultiplyAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(106) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(106) - modifier ) )
return tree
if current.getId() == 74: # 'lteq'
tree.astTransform = AstTransformNodeCreator('LessThanEq', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(74) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(74) - modifier ) )
return tree
if current.getId() == 12: # 'decr'
tree.astTransform = AstTransformNodeCreator('PostDecr', {'var': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(12) )
return tree
if current.getId() == 81: # 'gteq'
tree.astTransform = AstTransformNodeCreator('GreaterThanEq', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(81) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(81) - modifier ) )
return tree
if current.getId() == 66: # 'lsquare'
tree.astTransform = AstTransformNodeCreator('ArrayIndex', {'params': 2, 'name': 0})
tree.add(left)
tree.add( self.expect(66) )
tree.add( self.parent.parse__gen44() )
tree.add( self.expect(77) )
return tree
if current.getId() == 31: # 'bitoreq'
tree.astTransform = AstTransformNodeCreator('ORAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(31) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(31) - modifier ) )
return tree
if current.getId() == 59: # 'rshifteq'
tree.astTransform = AstTransformNodeCreator('RightShiftAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(59) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(59) - modifier ) )
return tree
if current.getId() == 52: # 'asterisk'
tree.astTransform = AstTransformNodeCreator('Mul', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(52) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(52) - modifier ) )
return tree
if current.getId() == 84: # 'modeq'
tree.astTransform = AstTransformNodeCreator('ModAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(84) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(84) - modifier ) )
return tree
if current.getId() == 43: # 'bitor'
tree.astTransform = AstTransformNodeCreator('BitOR', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(43) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(43) - modifier ) )
return tree
if current.getId() == 45: # 'eq'
tree.astTransform = AstTransformNodeCreator('Equals', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(45) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(45) - modifier ) )
return tree
if current.getId() == 69: # 'dot'
tree.astTransform = AstTransformNodeCreator('MemberSelect', {'member': 2, 'object': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(69) )
modifier = 0
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(69) - modifier ) )
return tree
if current.getId() == 63: # 'lparen'
tree.astTransform = AstTransformNodeCreator('FuncCall', {'params': 2, 'name': 0})
tree.add(left)
tree.add( self.expect(63) )
tree.add( self.parent.parse__gen44() )
tree.add( self.expect(1) )
return tree
if current.getId() == 76: # 'addeq'
tree.astTransform = AstTransformNodeCreator('AddAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(76) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(76) - modifier ) )
return tree
if current.getId() == 46: # 'bitandeq'
tree.astTransform = AstTransformNodeCreator('ANDAssign', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(46) )
modifier = 1
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(46) - modifier ) )
return tree
if current.getId() == 65: # 'rshift'
tree.astTransform = AstTransformNodeCreator('RightShift', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(65) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(65) - modifier ) )
return tree
if current.getId() == 111: # 'div'
tree.astTransform = AstTransformNodeCreator('Div', {'right': 2, 'left': 0})
tree.add(left)
tree.add( self.expect(111) )
modifier = 0
tree.isInfix = True
tree.add( self.parent.parse__expr_sans_comma( self.getInfixBp(111) - modifier ) )
return tree
return tree
class c_ExpressionParser__direct_declarator:
def __init__(self, parent):
self.__dict__.update(locals())
self.infixBp = {
63: 1000,
66: 1000,
}
self.prefixBp = {
}
def getInfixBp(self, tokenId):
try:
return self.infixBp[tokenId]
except:
return 0
def getPrefixBp(self, tokenId):
try:
return self.prefixBp[tokenId]
except:
return 0
def getCurrentToken(self):
return self.parent.tokens.current()
def expect(self, token):
return self.parent.expect(token)
def parse(self, rbp = 0):
left = self.nud()
if isinstance(left, ParseTree):
left.isExpr = True
left.isNud = True
while self.getCurrentToken() and rbp < self.getInfixBp(self.getCurrentToken().getId()):
left = self.led(left)
if left:
left.isExpr = True
return left
def nud(self):
tree = ParseTree( NonTerminal(247, '_direct_declarator') )
current = self.getCurrentToken()
if not current:
return tree
elif current.getId() in [80]:
tree.astTransform = AstTransformSubstitution(0)
tree.nudMorphemeCount = 1
tree.add( self.expect(80) )
elif current.getId() in [63]:
tree.astTransform = AstTransformSubstitution(1)
tree.nudMorphemeCount = 3
tree.add( self.expect(63) )
tree.add( self.parent.parse_declarator() )
tree.add( self.expect(1) )
return tree
def led(self, left):
tree = ParseTree( NonTerminal(247, '_direct_declarator') )
current = self.getCurrentToken()
if current.getId() == 66: # 'lsquare'
tree.astTransform = AstTransformNodeCreator('Array', {'name': 0, 'size': 2})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(66) )
tree.add( self.parent.parse_direct_declarator_expr() )
tree.add( self.expect(77) )
return tree
if current.getId() == 63: # 'lparen'
tree.astTransform = AstTransformNodeCreator('FunctionSignature', {'params': 2, 'declarator': 0})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(63) )
tree.add( self.parent.parse_direct_declarator_parameter_list() )
tree.add( self.expect(1) )
return tree
return tree
class c_ExpressionParser__direct_abstract_declarator:
def __init__(self, parent):
self.__dict__.update(locals())
self.infixBp = {
63: 1000,
66: 1000,
}
self.prefixBp = {
63: 2000,
}
def getInfixBp(self, tokenId):
try:
return self.infixBp[tokenId]
except:
return 0
def getPrefixBp(self, tokenId):
try:
return self.prefixBp[tokenId]
except:
return 0
def getCurrentToken(self):
return self.parent.tokens.current()
def expect(self, token):
return self.parent.expect(token)
def parse(self, rbp = 0):
left = self.nud()
if isinstance(left, ParseTree):
left.isExpr = True
left.isNud = True
while self.getCurrentToken() and rbp < self.getInfixBp(self.getCurrentToken().getId()):
left = self.led(left)
if left:
left.isExpr = True
return left
def nud(self):
tree = ParseTree( NonTerminal(228, '_direct_abstract_declarator') )
current = self.getCurrentToken()
if not current:
return tree
elif current.getId() in [63]:
tree.astTransform = AstTransformSubstitution(1)
tree.nudMorphemeCount = 3
tree.add( self.expect(63) )
tree.add( self.parent.parse_abstract_declarator() )
tree.add( self.expect(1) )
return tree
def led(self, left):
tree = ParseTree( NonTerminal(228, '_direct_abstract_declarator') )
current = self.getCurrentToken()
if current.getId() == 63: # 'lparen'
tree.astTransform = AstTransformNodeCreator('AbstractFunction', {'object': '$', 'params': 2})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(63) )
tree.add( self.parent.parse__gen46() )
tree.add( self.expect(1) )
return tree
if current.getId() == 66: # 'lsquare'
tree.astTransform = AstTransformNodeCreator('AbstractArray', {'object': '$', 'size': 2})
tree.isExprNud = True
tree.add(left)
tree.add( self.expect(66) )
tree.add( self.parent.parse_direct_abstract_declarator_expr() )
tree.add( self.expect(77) )
return tree
return tree
class c_Parser:
# Quark - finite string set maps one string to exactly one int, and vice versa
terminals = {
0: 'diveq',
1: 'rparen',
2: 'bitand',
3: 'not',
4: 'register',
5: 'bitnot',
6: 'pound',
7: 'defined_separator',
8: 'arrow',
9: 'if',
10: 'integer_constant',
11: 'mod',
12: 'decr',
13: 'pp_number',
14: 'elipsis',
15: 'floating_constant',
16: 'continue',
17: 'comma_va_args',
18: 'sub',
19: 'incr',
20: 'poundpound',
21: 'assign',
22: 'union',
23: 'else_if',
24: 'enumeration_constant',
25: '_direct_abstract_declarator',
26: 'semi',
27: 'comma',
28: 'colon',
29: 'label_hint',
30: 'subeq',
31: 'bitoreq',
32: 'ampersand',
33: '_expr_sans_comma',
34: 'inline',
35: 'and',
36: 'tilde',
37: 'enum',
38: 'struct',
39: 'questionmark',
40: 'bitxoreq',
41: 'long',
42: 'variable_length_array',
43: 'bitor',
44: 'string_literal',
45: 'eq',
46: 'bitandeq',
47: 'restrict',
48: 'complex',
49: 'int',
50: 'const',
51: 'lshifteq',
52: 'asterisk',
53: 'short',
54: 'typedef_identifier',
55: 'neq',
56: 'break',
57: 'typedef',
58: 'or',
59: 'rshifteq',
60: 'signed',
61: 'for',
62: 'float',
63: 'lparen',
64: 'abstract_parameter_hint',
65: 'rshift',
66: 'lsquare',
67: 'endif',
68: 'else',
69: 'dot',
70: 'default',
71: 'function_definition_hint',
72: 'double',
73: '_expr',
74: 'lteq',
75: 'bitxor',
76: 'addeq',
77: 'rsquare',
78: 'bool',
79: 'unsigned',
80: 'identifier',
81: 'gteq',
82: 'sizeof_separator',
83: 'volatile',
84: 'modeq',
85: 'while',
86: 'defined',
87: 'goto',
88: 'lt',
89: '_direct_declarator',
90: 'static',
91: 'imaginary',
92: 'do',
93: 'declarator_hint',
94: 'lbrace',
95: 'named_parameter_hint',
96: 'void',
97: 'hexadecimal_floating_constant',
98: 'extern',
99: 'decimal_floating_constant',
100: 'rbrace',
101: 'lshift',
102: 'external_declaration_hint',
103: 'gt',
104: 'trailing_comma',
105: 'universal_character_name',
106: 'muleq',
107: 'add',
108: 'lparen_cast',
109: 'exclamation_point',
110: 'return',
111: 'div',
112: 'case',
113: 'switch',
114: 'char',
115: 'auto',
116: 'function_prototype_hint',
117: 'character_constant',
118: 'sizeof',
'diveq': 0,
'rparen': 1,
'bitand': 2,
'not': 3,
'register': 4,
'bitnot': 5,
'pound': 6,
'defined_separator': 7,
'arrow': 8,
'if': 9,
'integer_constant': 10,
'mod': 11,
'decr': 12,
'pp_number': 13,
'elipsis': 14,
'floating_constant': 15,
'continue': 16,
'comma_va_args': 17,
'sub': 18,
'incr': 19,
'poundpound': 20,
'assign': 21,
'union': 22,
'else_if': 23,
'enumeration_constant': 24,
'_direct_abstract_declarator': 25,
'semi': 26,
'comma': 27,
'colon': 28,
'label_hint': 29,
'subeq': 30,
'bitoreq': 31,
'ampersand': 32,
'_expr_sans_comma': 33,
'inline': 34,
'and': 35,
'tilde': 36,
'enum': 37,
'struct': 38,
'questionmark': 39,
'bitxoreq': 40,
'long': 41,
'variable_length_array': 42,
'bitor': 43,
'string_literal': 44,
'eq': 45,
'bitandeq': 46,
'restrict': 47,
'complex': 48,
'int': 49,
'const': 50,
'lshifteq': 51,
'asterisk': 52,
'short': 53,
'typedef_identifier': 54,
'neq': 55,
'break': 56,
'typedef': 57,
'or': 58,
'rshifteq': 59,
'signed': 60,
'for': 61,
'float': 62,
'lparen': 63,
'abstract_parameter_hint': 64,
'rshift': 65,
'lsquare': 66,
'endif': 67,
'else': 68,
'dot': 69,
'default': 70,
'function_definition_hint': 71,
'double': 72,
'_expr': 73,
'lteq': 74,
'bitxor': 75,
'addeq': 76,
'rsquare': 77,
'bool': 78,
'unsigned': 79,
'identifier': 80,
'gteq': 81,
'sizeof_separator': 82,
'volatile': 83,
'modeq': 84,
'while': 85,
'defined': 86,
'goto': 87,
'lt': 88,
'_direct_declarator': 89,
'static': 90,
'imaginary': 91,
'do': 92,
'declarator_hint': 93,
'lbrace': 94,
'named_parameter_hint': 95,
'void': 96,
'hexadecimal_floating_constant': 97,
'extern': 98,
'decimal_floating_constant': 99,
'rbrace': 100,
'lshift': 101,
'external_declaration_hint': 102,
'gt': 103,
'trailing_comma': 104,
'universal_character_name': 105,
'muleq': 106,
'add': 107,
'lparen_cast': 108,
'exclamation_point': 109,
'return': 110,
'div': 111,
'case': 112,
'switch': 113,
'char': 114,
'auto': 115,
'function_prototype_hint': 116,
'character_constant': 117,
'sizeof': 118,
}
# Quark - finite string set maps one string to exactly one int, and vice versa
nonterminals = {
119: '_expr',
120: 'struct_declarator_body',
121: 'direct_declarator_size',
122: '_gen7',
123: '_gen44',
124: '_gen21',
125: '_gen45',
126: 'struct_or_union_sub',
127: 'type_name',
128: 'for_init',
129: 'direct_declarator_modifier',
130: 'keyword',
131: 'block_item',
132: 'external_declaration',
133: 'init_declarator_list',
134: '_gen8',
135: 'struct_or_union_body',
136: 'sizeof_body',
137: '_gen16',
138: '_gen28',
139: 'constant',
140: '_gen0',
141: 'enum_specifier_sub',
142: 'storage_class_specifier',
143: 'typedef_name',
144: '_gen18',
145: 'identifier',
146: 'enum_specifier_body',
147: '_gen11',
148: 'type_specifier',
149: 'struct_declaration',
150: 'block_item_list',
151: '_gen17',
152: 'declaration',
153: 'type_qualifier',
154: 'misc',
155: 'struct_specifier',
156: 'function_specifier',
157: '_gen39',
158: 'else_if_statement_list',
159: 'type_qualifier_list_opt',
160: 'specifier_qualifier',
161: '_gen9',
162: '_gen24',
163: 'translation_unit',
164: 'else_statement',
165: '_gen42',
166: '_gen22',
167: 'struct_declarator',
168: '_gen19',
169: '_gen20',
170: '_gen10',
171: 'enumeration_constant',
172: '_gen15',
173: 'punctuator',
174: '_gen43',
175: '_gen27',
176: 'external_declarator',
177: 'else_if_statement',
178: 'init_declarator',
179: 'parameter_type_list',
180: 'initializer',
181: 'designation',
182: 'initializer_list_item',
183: 'external_declaration_sub',
184: 'declarator_initializer',
185: '_expr_sans_comma',
186: 'external_function',
187: 'expression_opt',
188: 'direct_abstract_declarator_expr',
189: 'enumerator_assignment',
190: '_gen12',
191: '_gen13',
192: 'external_declaration_sub_sub',
193: 'named_parameter_declaration',
194: '_gen3',
195: 'designator',
196: '_gen4',
197: '_gen14',
198: 'direct_declarator_parameter_list',
199: 'abstract_parameter_declaration',
200: 'trailing_comma_opt',
201: '_gen25',
202: 'statement',
203: 'for_cond',
204: 'for_incr',
205: '_gen34',
206: '_gen46',
207: 'static_opt',
208: '_gen41',
209: 'parameter_declaration',
210: 'declaration_specifier',
211: '_gen29',
212: '_gen30',
213: 'direct_declarator_expr',
214: '_gen40',
215: 'labeled_statement',
216: 'external_prototype',
217: 'union_specifier',
218: 'abstract_declarator',
219: 'pointer',
220: '_gen35',
221: 'va_args',
222: 'declarator',
223: 'expression_statement',
224: 'pointer_sub',
225: '_gen5',
226: '_gen26',
227: 'selection_statement',
228: '_direct_abstract_declarator',
229: 'compound_statement',
230: 'iteration_statement',
231: '_gen31',
232: '_gen36',
233: 'direct_declarator_modifier_list',
234: 'jump_statement',
235: 'token',
236: '_gen38',
237: '_gen32',
238: 'declaration_list',
239: '_gen33',
240: 'enumerator',
241: 'pp',
242: '_gen1',
243: '_gen2',
244: '_gen6',
245: '_gen37',
246: '_gen23',
247: '_direct_declarator',
248: 'enum_specifier',
'_expr': 119,
'struct_declarator_body': 120,
'direct_declarator_size': 121,
'_gen7': 122,
'_gen44': 123,
'_gen21': 124,
'_gen45': 125,
'struct_or_union_sub': 126,
'type_name': 127,
'for_init': 128,
'direct_declarator_modifier': 129,
'keyword': 130,
'block_item': 131,
'external_declaration': 132,
'init_declarator_list': 133,
'_gen8': 134,
'struct_or_union_body': 135,
'sizeof_body': 136,
'_gen16': 137,
'_gen28': 138,
'constant': 139,
'_gen0': 140,
'enum_specifier_sub': 141,
'storage_class_specifier': 142,
'typedef_name': 143,
'_gen18': 144,
'identifier': 145,
'enum_specifier_body': 146,
'_gen11': 147,
'type_specifier': 148,
'struct_declaration': 149,
'block_item_list': 150,
'_gen17': 151,
'declaration': 152,
'type_qualifier': 153,
'misc': 154,
'struct_specifier': 155,
'function_specifier': 156,
'_gen39': 157,
'else_if_statement_list': 158,
'type_qualifier_list_opt': 159,
'specifier_qualifier': 160,
'_gen9': 161,
'_gen24': 162,
'translation_unit': 163,
'else_statement': 164,
'_gen42': 165,
'_gen22': 166,
'struct_declarator': 167,
'_gen19': 168,
'_gen20': 169,
'_gen10': 170,
'enumeration_constant': 171,
'_gen15': 172,
'punctuator': 173,
'_gen43': 174,
'_gen27': 175,
'external_declarator': 176,
'else_if_statement': 177,
'init_declarator': 178,
'parameter_type_list': 179,
'initializer': 180,
'designation': 181,
'initializer_list_item': 182,
'external_declaration_sub': 183,
'declarator_initializer': 184,
'_expr_sans_comma': 185,
'external_function': 186,
'expression_opt': 187,
'direct_abstract_declarator_expr': 188,
'enumerator_assignment': 189,
'_gen12': 190,
'_gen13': 191,
'external_declaration_sub_sub': 192,
'named_parameter_declaration': 193,
'_gen3': 194,
'designator': 195,
'_gen4': 196,
'_gen14': 197,
'direct_declarator_parameter_list': 198,
'abstract_parameter_declaration': 199,
'trailing_comma_opt': 200,
'_gen25': 201,
'statement': 202,
'for_cond': 203,
'for_incr': 204,
'_gen34': 205,
'_gen46': 206,
'static_opt': 207,
'_gen41': 208,
'parameter_declaration': 209,
'declaration_specifier': 210,
'_gen29': 211,
'_gen30': 212,
'direct_declarator_expr': 213,
'_gen40': 214,
'labeled_statement': 215,
'external_prototype': 216,
'union_specifier': 217,
'abstract_declarator': 218,
'pointer': 219,
'_gen35': 220,
'va_args': 221,
'declarator': 222,
'expression_statement': 223,
'pointer_sub': 224,
'_gen5': 225,
'_gen26': 226,
'selection_statement': 227,
'_direct_abstract_declarator': 228,
'compound_statement': 229,
'iteration_statement': 230,
'_gen31': 231,
'_gen36': 232,
'direct_declarator_modifier_list': 233,
'jump_statement': 234,
'token': 235,
'_gen38': 236,
'_gen32': 237,
'declaration_list': 238,
'_gen33': 239,
'enumerator': 240,
'pp': 241,
'_gen1': 242,
'_gen2': 243,
'_gen6': 244,
'_gen37': 245,
'_gen23': 246,
'_direct_declarator': 247,
'enum_specifier': 248,
}
# table[nonterminal][terminal] = rule
table = [
[-1, 23, 331, -1, -1, -1, -1, -1, 23, -1, 331, -1, 23, -1, -1, 331, -1, -1, -1, 23, -1, 390, -1, -1, 331, -1, 23, 23, 23, -1, -1, -1, -1, 331, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, 331, -1, -1, -1, -1, -1, -1, -1, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331, -1, -1, 390, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, 331, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 390, -1, -1, 331, -1, 331, -1, -1, -1, -1, 23, -1, -1, -1, 331, -1, -1, -1, -1, -1, -1, -1, -1, 331, 331],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 360, -1, -1, -1, -1, -1, -1, -1, 360, -1, 360, -1, -1, 360, -1, -1, -1, 360, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 217, -1, 360, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 360, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, 360, -1, -1, -1, -1, -1, -1, -1, -1, 360, 360],
[-1, -1, -1, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, -1, 86, 86, -1, -1, -1, -1, -1, -1, 183, -1, -1, 183, 183, -1, -1, 183, -1, -1, -1, -1, -1, 183, 183, 183, 183, -1, -1, 183, 183, -1, -1, 183, -1, -1, 183, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, -1, 183, 183, -1, -1, -1, 183, -1, -1, -1, -1, -1, -1, 183, 183, -1, -1, 86, -1, 183, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, 183, -1, -1, -1],
[-1, -1, 105, -1, -1, -1, -1, -1, -1, -1, 105, -1, 105, -1, -1, 105, -1, -1, -1, 105, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, 105, 105],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, 339, 211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, -1, -1, -1, -1],
[-1, -1, 132, -1, 187, -1, -1, -1, -1, -1, 132, -1, 132, -1, -1, 132, -1, -1, -1, 132, -1, -1, 187, -1, 132, -1, 14, -1, -1, -1, -1, -1, -1, -1, 187, -1, -1, 187, 187, -1, -1, 187, -1, -1, 132, -1, -1, 187, 187, 187, 187, -1, 132, 187, 187, -1, -1, 187, -1, -1, 187, -1, 187, 132, -1, -1, -1, -1, -1, -1, -1, -1, 187, 132, -1, -1, -1, -1, 187, 187, 132, -1, -1, 187, -1, -1, -1, -1, -1, -1, 187, 187, -1, -1, -1, -1, 187, 132, 187, 132, -1, -1, -1, -1, -1, -1, -1, -1, 132, -1, -1, -1, -1, -1, 187, 187, -1, 132, 132],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, 230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 330, -1, -1, -1, -1, 121, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, -1, 249, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, 410, 397, -1, -1, 138, -1, -1, -1, -1, -1, 344, 5, 30, 395, -1, -1, 185, -1, -1, 325, 37, -1, -1, 178, 348, 338, -1, -1, -1, -1, -1, 123, -1, 106, -1, 35, -1, -1, -1, -1, -1, 416, 327, -1, -1, -1, 372, -1, 310, -1, 116, -1, -1, 259, 21, 115, -1, -1, -1, 357, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, 413, 219, 136, 314, -1, -1, 34],
[-1, -1, 55, -1, 46, -1, -1, -1, -1, 55, 55, -1, 55, -1, -1, 55, 55, -1, -1, 55, -1, -1, 46, -1, 55, -1, 55, -1, -1, 55, -1, -1, -1, -1, 46, -1, -1, 46, 46, -1, -1, 46, -1, -1, 55, -1, -1, 46, 46, 46, 46, -1, 55, 46, 46, -1, 55, 46, -1, -1, 46, 55, 46, 55, -1, -1, -1, -1, -1, -1, 55, -1, 46, 55, -1, -1, -1, -1, 46, 46, 55, -1, -1, 46, -1, 55, -1, 55, -1, -1, 46, 46, 55, -1, 55, -1, 46, 55, 46, 55, -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, 55, -1, 55, 55, 46, 46, -1, 55, 55],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 248, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 248, -1, -1, -1, -1, 248, -1, -1, 248, 248, 248, 248, -1, -1, -1, -1, -1, 248, -1, -1, 248, 248, -1, -1, 248, -1, -1, -1, -1, -1, 248, 248, 248, 248, -1, 248, 248, 248, -1, -1, 248, -1, -1, 248, -1, 248, 248, -1, -1, -1, -1, -1, -1, -1, 248, 248, -1, -1, -1, -1, -1, 248, 248, 248, -1, -1, 248, -1, -1, -1, -1, -1, 248, 248, 248, -1, 248, 231, -1, 248, -1, 248, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 248, 248, 248, -1, -1],
[-1, -1, 108, -1, -1, -1, -1, -1, -1, -1, 108, -1, 108, -1, -1, 108, -1, -1, -1, 108, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, 108, -1, -1, 243, -1, -1, 243, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, 108, -1, -1, 243, -1, -1, -1, -1, -1, -1, 243, -1, -1, -1, -1, -1, -1, 108, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, 108, 108],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 294, -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, 207, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 306, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, -1, -1, -1, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, 262, 262, -1, -1, 262, -1, -1, -1, -1, -1, 262, 262, 262, 262, -1, 266, 262, 262, -1, -1, -1, -1, -1, 262, -1, 262, 266, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, -1, -1, -1, -1, 262, 262, 266, -1, -1, 262, -1, -1, -1, -1, -1, 266, -1, 262, -1, -1, -1, -1, 262, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 134, -1, -1, -1, -1, 92, 92, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 308, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 375, 153, -1, -1, 75, -1, -1, -1, -1, -1, -1, 150, 316, -1, -1, -1, 96, 16, -1, -1, -1, -1, -1, 301, -1, 346, -1, -1, -1, -1, -1, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, 305, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, 352, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, 36, 36, -1, -1, 36, -1, -1, -1, -1, -1, 36, 36, 36, 36, -1, 36, 36, 36, -1, -1, -1, -1, -1, 36, -1, 36, 36, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 36, 36, 36, -1, -1, 36, -1, -1, -1, -1, -1, 36, -1, 36, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1],
[-1, -1, 281, -1, 281, -1, -1, -1, -1, 281, 281, -1, 281, -1, -1, 281, 281, -1, -1, 281, -1, -1, 281, -1, 281, -1, 281, -1, -1, 281, -1, -1, -1, -1, 281, -1, -1, 281, 281, -1, -1, 281, -1, -1, 281, -1, -1, 281, 281, 281, 281, -1, 281, 281, 281, -1, 281, 281, -1, -1, 281, 281, 281, 281, -1, -1, -1, -1, -1, -1, 281, -1, 281, 281, -1, -1, -1, -1, 281, 281, 281, -1, -1, 281, -1, 281, -1, 281, -1, -1, 281, 281, 281, -1, 281, -1, 281, 281, 281, 281, 281, -1, -1, -1, -1, -1, -1, -1, 281, -1, 281, -1, 281, 281, 281, 281, -1, 281, 281],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1, -1, -1, -1, -1, 258, 258, -1, -1, 258, -1, -1, -1, -1, -1, 258, 258, 258, 258, -1, 258, 258, 258, -1, -1, -1, -1, -1, 258, -1, 258, 258, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1, -1, 258, 258, 258, -1, -1, 258, -1, -1, -1, -1, -1, 258, -1, 258, -1, -1, -1, -1, 258, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, -1, -1, -1],
[-1, -1, -1, -1, 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 412, -1, -1, 412, 412, -1, -1, 412, -1, -1, -1, -1, -1, 412, 412, 412, 412, -1, -1, 412, 412, -1, -1, 412, -1, -1, 412, -1, 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, 412, -1, -1, -1, -1, -1, 412, 412, -1, -1, -1, 412, -1, -1, -1, -1, -1, -1, 412, 412, -1, -1, -1, -1, 412, -1, 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 412, 412, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 240, -1, -1, 286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 10, -1, 10, -1, -1, -1, -1, 10, 10, -1, 10, -1, -1, 10, 10, -1, -1, 10, -1, -1, 10, -1, 10, -1, 10, -1, -1, 10, -1, -1, -1, -1, 10, -1, -1, 10, 10, -1, -1, 10, -1, -1, 10, -1, -1, 10, 10, 10, 10, -1, 10, 10, 10, -1, 10, 10, -1, -1, 10, 10, 10, 10, -1, -1, -1, -1, -1, -1, 10, -1, 10, 10, -1, -1, -1, -1, 10, 10, 10, -1, -1, 10, -1, 10, -1, 10, -1, -1, 10, 10, 10, -1, 10, -1, 10, 10, 10, 10, 10, -1, -1, -1, -1, -1, -1, -1, 10, -1, 10, -1, 10, 10, 10, 10, -1, 10, 10],
[-1, -1, 147, -1, 147, -1, -1, -1, -1, 147, 147, -1, 147, -1, -1, 147, 147, -1, -1, 147, -1, -1, 147, 147, 147, -1, 147, -1, -1, 147, -1, -1, -1, -1, 147, -1, -1, 147, 147, -1, -1, 147, -1, -1, 147, -1, -1, 147, 147, 147, 147, -1, 147, 147, 147, -1, 147, 147, -1, -1, 147, 147, 147, 147, -1, -1, -1, 147, 147, -1, 147, -1, 147, 147, -1, -1, -1, -1, 147, 147, 147, -1, -1, 147, -1, 147, -1, 147, -1, -1, 147, 147, 147, -1, 147, -1, 147, 147, 147, 147, 147, -1, -1, -1, -1, -1, -1, -1, 147, -1, 147, -1, 147, 147, 147, 147, -1, 147, 147],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, 19, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, 19, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, 19, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, 273, -1, -1, 273, -1, -1, -1, -1, -1, 426, 273, 273, 426, -1, -1, 273, 273, -1, -1, -1, -1, -1, 273, -1, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, 273, 273, -1, -1, -1, 426, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 367, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 419, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 69, -1, 69, -1, -1, -1, -1, 69, 69, -1, 69, -1, -1, 69, 69, -1, -1, 69, -1, -1, 69, -1, 69, -1, 69, -1, -1, 69, -1, -1, -1, -1, 69, -1, -1, 69, 69, -1, -1, 69, -1, -1, 69, -1, -1, 69, 69, 69, 69, -1, 69, 69, 69, -1, 69, 69, -1, -1, 69, 69, 69, 69, -1, -1, -1, 69, 51, -1, 69, -1, 69, 69, -1, -1, -1, -1, 69, 69, 69, -1, -1, 69, -1, 69, -1, 69, -1, -1, 69, 69, 69, -1, 69, -1, 69, 69, 69, 69, 69, -1, -1, -1, -1, -1, -1, -1, 69, -1, 69, -1, 69, 69, 69, 69, -1, 69, 69],
[-1, -1, -1, -1, 245, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 245, -1, -1, -1, -1, 245, -1, -1, 245, 245, 245, 245, -1, -1, -1, -1, -1, 245, -1, -1, 245, 245, -1, -1, 245, -1, -1, -1, -1, -1, 245, 245, 245, 245, -1, 245, 245, 245, -1, -1, 245, -1, -1, 245, -1, 245, 245, -1, -1, -1, -1, -1, -1, -1, 245, 245, -1, -1, -1, -1, -1, 245, 245, 245, -1, -1, 245, -1, -1, -1, -1, -1, 245, 245, 245, -1, 245, 242, -1, 245, -1, 245, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 245, 245, 245, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 284, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 278, -1, -1, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, 128, -1, -1, -1, -1, 241, -1, 40, -1, -1, 269, 261, -1, 189, -1, -1, -1, 391, 28, 370, 374, -1, -1, -1, -1, 152, 162, 312, -1, 354, 288, 177, -1, -1, 250, 270, -1, -1, 366, 287, -1, -1, 65, -1, 77, 53, -1, -1, -1, -1, 130, -1, -1, -1, 22, -1, -1, 199, 25, -1, -1, -1, 415, -1, 145, 292, -1, -1, 64, -1, -1, -1, -1, 208, 32, 300, 362, -1, -1, -1, 201, -1, -1, 244, -1, -1, -1, 329, -1, -1, -1, -1, -1, 411, -1, -1, -1, -1, -1, 114, 192, -1, 1, -1, -1, 47, 214, -1, 251, -1, 157, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 95, -1, 95, -1, -1, -1, -1, 95, 95, -1, 95, -1, -1, 95, 95, -1, -1, 95, -1, -1, 95, 142, 95, -1, 95, -1, -1, 95, -1, -1, -1, -1, 95, -1, -1, 95, 95, -1, -1, 95, -1, -1, 95, -1, -1, 95, 95, 95, 95, -1, 95, 95, 95, -1, 95, 95, -1, -1, 95, 95, 95, 95, -1, -1, -1, 95, 95, -1, 95, -1, 95, 95, -1, -1, -1, -1, 95, 95, 95, -1, -1, 95, -1, 95, -1, 95, -1, -1, 95, 95, 95, -1, 95, -1, 95, 95, 95, 95, 95, -1, -1, -1, -1, -1, -1, -1, 95, -1, 95, -1, 95, 95, 95, 95, -1, 95, 95],
[-1, -1, 318, -1, -1, -1, -1, -1, -1, -1, 318, -1, 318, -1, -1, 318, -1, -1, -1, 318, -1, -1, -1, -1, 318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 318, -1, 318, -1, -1, 408, -1, -1, 408, -1, 318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 318, -1, -1, -1, -1, -1, -1, -1, -1, -1, 318, -1, -1, -1, -1, -1, -1, 318, -1, -1, 408, -1, -1, -1, -1, -1, -1, 408, -1, -1, -1, -1, -1, -1, 318, -1, 318, -1, -1, -1, -1, -1, -1, -1, -1, 318, -1, -1, -1, -1, -1, -1, -1, -1, 318, 318],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 382, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 309, -1, -1, -1, -1, -1, -1, -1, 309, -1, 309, -1, -1, 309, -1, -1, -1, 309, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, -1, -1, 309, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, 309, 309],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 365, -1, -1, 365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 126, -1, -1, -1, -1, -1, -1, -1, 126, -1, 126, -1, -1, 126, -1, -1, -1, 126, -1, 126, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, 126, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, 126, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, 126, 126],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 158, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, 39, 227, -1, -1, -1, -1, -1, -1, -1, 227, -1, 227, -1, -1, 227, -1, -1, -1, 227, -1, -1, -1, -1, 227, -1, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, 227, -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, -1, -1, 227, 227],
[-1, -1, 49, -1, -1, -1, -1, -1, -1, -1, 49, -1, 49, -1, -1, 49, -1, -1, -1, 49, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, -1, 49, -1, -1, 49, -1, -1, 49, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, 49, -1, -1, 49, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, 49, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, 49, 49],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 332, -1, -1, -1, -1, -1, -1, -1, 332, -1, 332, -1, -1, 332, -1, -1, -1, 332, -1, 332, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, 332, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, 332, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, 332, 332],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 336, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 334, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, 347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 295, -1, 295, -1, -1, 295, -1, -1, -1, 295, -1, 299, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, 299, -1, -1, 299, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, 295, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 295, 295],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, -1, -1, -1, 194, -1, 194, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, -1, -1, 26, -1, 194, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, -1, 26, -1, -1, -1, -1, -1, 194, 194, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 218, -1, -1, -1, -1, -1, -1, 166, 218, -1, 218, -1, -1, 218, 151, -1, -1, 218, -1, -1, -1, -1, 218, -1, 218, -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, 151, -1, -1, -1, -1, 264, -1, 218, -1, -1, -1, -1, -1, -1, 265, -1, -1, 218, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, -1, 264, -1, 151, -1, -1, -1, -1, 264, -1, 89, -1, -1, 218, -1, 218, -1, -1, -1, -1, -1, -1, -1, -1, 218, -1, 151, -1, 265, 166, -1, -1, -1, 218, 218],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 255, -1, -1, -1, -1, -1, -1, -1, 255, -1, 255, -1, -1, 255, -1, -1, -1, 255, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, -1, -1, -1, -1, -1, -1, 255, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, -1, -1, 255, 255],
[-1, -1, 234, -1, 234, -1, -1, -1, -1, 234, 234, -1, 234, -1, -1, 234, 234, -1, -1, 234, -1, -1, 234, 234, 234, -1, 234, -1, -1, 234, -1, -1, -1, -1, 234, -1, -1, 234, 234, -1, -1, 234, -1, -1, 234, -1, -1, 234, 234, 234, 234, -1, 234, 234, 234, -1, 234, 234, -1, -1, 234, 234, 234, 234, -1, -1, -1, 234, 234, -1, 234, -1, 234, 234, -1, -1, -1, -1, 234, 234, 234, -1, -1, 234, -1, 234, -1, 234, -1, -1, 234, 234, 234, -1, 234, -1, 234, 234, 234, 234, 234, -1, -1, -1, -1, -1, -1, -1, 234, -1, 234, -1, 234, 234, 234, 234, -1, 234, 234],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1, 186, 186, -1, -1, 186, -1, -1, -1, -1, -1, 167, 186, 186, 167, -1, -1, 186, 186, -1, -1, 350, -1, -1, 186, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, -1, -1, 186, 186, -1, -1, -1, 167, -1, -1, -1, -1, -1, -1, 350, 186, -1, -1, -1, -1, 186, -1, 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, 350, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 99, -1, -1, -1, -1, -1, -1, -1, 99, -1, 99, -1, -1, 99, -1, -1, -1, 99, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, -1, 99, -1, -1, 99, -1, -1, 99, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, 99, -1, -1, 99, -1, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, 99, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, 99, 99],
[-1, -1, 27, -1, 27, -1, -1, -1, -1, 27, 27, -1, 27, -1, -1, 27, 27, -1, -1, 27, -1, -1, 27, -1, 27, -1, 27, -1, -1, 27, -1, -1, -1, -1, 27, -1, -1, 27, 27, -1, -1, 27, -1, -1, 27, -1, -1, 27, 27, 27, 27, -1, 27, 27, 27, -1, 27, 27, -1, -1, 27, 27, 27, 27, -1, -1, -1, -1, -1, -1, 27, -1, 27, 27, -1, -1, -1, -1, 27, 27, 27, -1, -1, 27, -1, 27, -1, 27, -1, -1, 27, 27, 27, -1, 27, -1, 27, 27, 27, 27, 31, -1, -1, -1, -1, -1, -1, -1, 27, -1, 27, -1, 27, 27, 27, 27, -1, 27, 27],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 335, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 215, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, 171, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 403, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 285, -1, -1, -1, -1, -1, -1, -1, 285, -1, 285, -1, -1, 285, -1, -1, -1, 285, -1, -1, -1, -1, 285, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, 285, 285],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 302, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 302, -1, -1, -1, 302, 302, -1, -1, -1, -1, -1, -1, 302, -1, -1, 302, 302, -1, -1, 302, -1, -1, -1, -1, -1, 302, 302, 302, 302, -1, -1, 302, 302, -1, -1, 302, -1, -1, 302, -1, 302, -1, -1, -1, -1, -1, -1, -1, -1, -1, 302, -1, -1, -1, -1, -1, 302, 302, -1, -1, -1, 302, -1, -1, -1, -1, -1, -1, 302, 302, -1, -1, 302, -1, 302, -1, 302, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 302, 302, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 385, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, 423, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 169, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 283, -1, -1, -1, -1, -1, -1, 388, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, 404, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, 272, -1, -1, -1, -1, -1, -1, -1, 272, -1, 272, -1, -1, 272, -1, -1, -1, 272, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, 272, -1, -1, 272, -1, -1, 272, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, 272, -1, -1, 272, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, 272, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, 272, 272],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 311, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 156, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, 102, -1, -1, 0, -1, 102, -1, 102, 0, 100, 102, 102, 131, 102, 100, 0, -1, 102, 102, 102, 102, 0, -1, 100, -1, 102, 102, 102, -1, 102, 102, 102, -1, 0, 102, 102, 0, 0, 102, 102, 0, -1, 102, 392, 102, 102, 0, 0, 0, 0, 102, -1, 0, -1, 102, 0, 0, 102, 102, 0, 0, 0, 102, -1, 102, 102, -1, 0, 102, 0, -1, 0, -1, 102, 102, 102, 102, 0, 0, 345, 102, -1, 0, 102, 0, -1, 0, 102, -1, 0, 0, 0, -1, 102, -1, 0, 100, 0, 100, 102, 102, -1, 102, -1, -1, 102, 102, -1, 102, 0, 102, 0, 0, 0, 0, -1, 100, 0],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, 353, -1, 353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, -1, 353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280, -1, -1, -1, 280, 280, -1, -1, -1, -1, -1, -1, 280, -1, -1, 280, 280, -1, -1, 280, -1, -1, -1, -1, -1, 280, 280, 280, 280, -1, -1, 280, 280, -1, -1, 280, -1, -1, 280, -1, 280, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280, -1, -1, -1, -1, -1, 280, 280, -1, -1, -1, 280, -1, -1, -1, -1, -1, -1, 280, 280, -1, -1, 280, -1, 280, -1, 280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280, 280, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, 364, -1, -1, -1, -1, -1, 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 386, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, 140, 140, -1, -1, 140, -1, -1, -1, -1, -1, 140, 140, 140, 140, -1, -1, 140, 140, -1, -1, 140, -1, -1, 140, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, 140, 140, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, 140, 140, -1, -1, -1, -1, 140, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, 140, -1, -1, -1],
[-1, -1, -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 307, -1, -1, -1, -1, 303, -1, -1, 307, 307, 307, -1, -1, -1, -1, -1, -1, 303, -1, -1, 303, 303, -1, -1, 303, -1, -1, -1, -1, -1, 303, 303, 303, 303, -1, 307, 303, 303, -1, -1, 303, -1, -1, 303, -1, 303, 307, -1, -1, -1, -1, -1, -1, -1, 307, 303, -1, -1, -1, -1, -1, 303, 303, 307, -1, -1, 303, -1, -1, -1, -1, -1, 307, 303, 303, -1, 307, -1, -1, 303, -1, 303, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 303, 303, 307, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 361, 361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 205, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
]
TERMINAL_DIVEQ = 0
TERMINAL_RPAREN = 1
TERMINAL_BITAND = 2
TERMINAL_NOT = 3
TERMINAL_REGISTER = 4
TERMINAL_BITNOT = 5
TERMINAL_POUND = 6
TERMINAL_DEFINED_SEPARATOR = 7
TERMINAL_ARROW = 8
TERMINAL_IF = 9
TERMINAL_INTEGER_CONSTANT = 10
TERMINAL_MOD = 11
TERMINAL_DECR = 12
TERMINAL_PP_NUMBER = 13
TERMINAL_ELIPSIS = 14
TERMINAL_FLOATING_CONSTANT = 15
TERMINAL_CONTINUE = 16
TERMINAL_COMMA_VA_ARGS = 17
TERMINAL_SUB = 18
TERMINAL_INCR = 19
TERMINAL_POUNDPOUND = 20
TERMINAL_ASSIGN = 21
TERMINAL_UNION = 22
TERMINAL_ELSE_IF = 23
TERMINAL_ENUMERATION_CONSTANT = 24
TERMINAL__DIRECT_ABSTRACT_DECLARATOR = 25
TERMINAL_SEMI = 26
TERMINAL_COMMA = 27
TERMINAL_COLON = 28
TERMINAL_LABEL_HINT = 29
TERMINAL_SUBEQ = 30
TERMINAL_BITOREQ = 31
TERMINAL_AMPERSAND = 32
TERMINAL__EXPR_SANS_COMMA = 33
TERMINAL_INLINE = 34
TERMINAL_AND = 35
TERMINAL_TILDE = 36
TERMINAL_ENUM = 37
TERMINAL_STRUCT = 38
TERMINAL_QUESTIONMARK = 39
TERMINAL_BITXOREQ = 40
TERMINAL_LONG = 41
TERMINAL_VARIABLE_LENGTH_ARRAY = 42
TERMINAL_BITOR = 43
TERMINAL_STRING_LITERAL = 44
TERMINAL_EQ = 45
TERMINAL_BITANDEQ = 46
TERMINAL_RESTRICT = 47
TERMINAL_COMPLEX = 48
TERMINAL_INT = 49
TERMINAL_CONST = 50
TERMINAL_LSHIFTEQ = 51
TERMINAL_ASTERISK = 52
TERMINAL_SHORT = 53
TERMINAL_TYPEDEF_IDENTIFIER = 54
TERMINAL_NEQ = 55
TERMINAL_BREAK = 56
TERMINAL_TYPEDEF = 57
TERMINAL_OR = 58
TERMINAL_RSHIFTEQ = 59
TERMINAL_SIGNED = 60
TERMINAL_FOR = 61
TERMINAL_FLOAT = 62
TERMINAL_LPAREN = 63
TERMINAL_ABSTRACT_PARAMETER_HINT = 64
TERMINAL_RSHIFT = 65
TERMINAL_LSQUARE = 66
TERMINAL_ENDIF = 67
TERMINAL_ELSE = 68
TERMINAL_DOT = 69
TERMINAL_DEFAULT = 70
TERMINAL_FUNCTION_DEFINITION_HINT = 71
TERMINAL_DOUBLE = 72
TERMINAL__EXPR = 73
TERMINAL_LTEQ = 74
TERMINAL_BITXOR = 75
TERMINAL_ADDEQ = 76
TERMINAL_RSQUARE = 77
TERMINAL_BOOL = 78
TERMINAL_UNSIGNED = 79
TERMINAL_IDENTIFIER = 80
TERMINAL_GTEQ = 81
TERMINAL_SIZEOF_SEPARATOR = 82
TERMINAL_VOLATILE = 83
TERMINAL_MODEQ = 84
TERMINAL_WHILE = 85
TERMINAL_DEFINED = 86
TERMINAL_GOTO = 87
TERMINAL_LT = 88
TERMINAL__DIRECT_DECLARATOR = 89
TERMINAL_STATIC = 90
TERMINAL_IMAGINARY = 91
TERMINAL_DO = 92
TERMINAL_DECLARATOR_HINT = 93
TERMINAL_LBRACE = 94
TERMINAL_NAMED_PARAMETER_HINT = 95
TERMINAL_VOID = 96
TERMINAL_HEXADECIMAL_FLOATING_CONSTANT = 97
TERMINAL_EXTERN = 98
TERMINAL_DECIMAL_FLOATING_CONSTANT = 99
TERMINAL_RBRACE = 100
TERMINAL_LSHIFT = 101
TERMINAL_EXTERNAL_DECLARATION_HINT = 102
TERMINAL_GT = 103
TERMINAL_TRAILING_COMMA = 104
TERMINAL_UNIVERSAL_CHARACTER_NAME = 105
TERMINAL_MULEQ = 106
TERMINAL_ADD = 107
TERMINAL_LPAREN_CAST = 108
TERMINAL_EXCLAMATION_POINT = 109
TERMINAL_RETURN = 110
TERMINAL_DIV = 111
TERMINAL_CASE = 112
TERMINAL_SWITCH = 113
TERMINAL_CHAR = 114
TERMINAL_AUTO = 115
TERMINAL_FUNCTION_PROTOTYPE_HINT = 116
TERMINAL_CHARACTER_CONSTANT = 117
TERMINAL_SIZEOF = 118
def __init__(self, tokens=None):
self.__dict__.update(locals())
self.expressionParsers = dict()
def isTerminal(self, id):
return 0 <= id <= 118
def isNonTerminal(self, id):
return 119 <= id <= 248
def parse(self, tokens):
self.tokens = tokens
self.start = 'TRANSLATION_UNIT'
tree = self.parse_translation_unit()
if self.tokens.current() != None:
raise SyntaxError( 'Finished parsing without consuming all tokens.' )
return tree
def expect(self, terminalId):
currentToken = self.tokens.current()
if not currentToken:
raise SyntaxError( 'No more tokens. Expecting %s' % (self.terminals[terminalId]) )
if currentToken.getId() != terminalId:
raise SyntaxError( 'Unexpected symbol when parsing %s. Expected %s, got %s.' %(whosdaddy(), self.terminals[terminalId], currentToken if currentToken else 'None') )
nextToken = self.tokens.advance()
if nextToken and not self.isTerminal(nextToken.getId()):
raise SyntaxError( 'Invalid symbol ID: %d (%s)' % (nextToken.getId(), nextToken) )
return currentToken
def parse_struct_declarator_body(self):
current = self.tokens.current()
rule = self.table[1][current.getId()] if current else -1
tree = ParseTree( NonTerminal(120, self.nonterminals[120]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 17:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(28) # colon
tree.add(t)
subtree = self.parse_declarator()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_direct_declarator_size(self):
current = self.tokens.current()
rule = self.table[2][current.getId()] if current else -1
tree = ParseTree( NonTerminal(121, self.nonterminals[121]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 217:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(42) # variable_length_array
tree.add(t)
return tree
elif rule == 360:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen7(self):
current = self.tokens.current()
rule = self.table[3][current.getId()] if current else -1
tree = ParseTree( NonTerminal(122, self.nonterminals[122]))
tree.list = 'nlist'
if current != None and (current.getId() in [94, 26, 27]):
return tree
if current == None:
return tree
if rule == 183:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration()
tree.add( subtree )
subtree = self.parse__gen7()
tree.add( subtree )
return tree
return tree
def parse__gen44(self):
current = self.tokens.current()
rule = self.table[4][current.getId()] if current else -1
tree = ParseTree( NonTerminal(123, self.nonterminals[123]))
tree.list = 'slist'
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 105:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr_sans_comma()
tree.add( subtree )
subtree = self.parse__gen45()
tree.add( subtree )
return tree
return tree
def parse__gen21(self):
current = self.tokens.current()
rule = self.table[5][current.getId()] if current else -1
tree = ParseTree( NonTerminal(124, self.nonterminals[124]))
tree.list = False
if current != None and (current.getId() in [27, 26]):
return tree
if current == None:
return tree
if rule == 211:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declarator_body()
tree.add( subtree )
return tree
return tree
def parse__gen45(self):
current = self.tokens.current()
rule = self.table[6][current.getId()] if current else -1
tree = ParseTree( NonTerminal(125, self.nonterminals[125]))
tree.list = 'slist'
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 18:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse__expr_sans_comma()
tree.add( subtree )
subtree = self.parse__gen45()
tree.add( subtree )
return tree
return tree
def parse_struct_or_union_sub(self):
current = self.tokens.current()
rule = self.table[7][current.getId()] if current else -1
tree = ParseTree( NonTerminal(126, self.nonterminals[126]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 6:
tree.astTransform = AstTransformNodeCreator('StructOrUnion', {'body': 0})
subtree = self.parse_struct_or_union_body()
tree.add( subtree )
return tree
elif rule == 7:
tree.astTransform = AstTransformNodeCreator('StructOrUnion', {'body': 1, 'name': 0})
t = self.expect(80) # identifier
tree.add(t)
subtree = self.parse__gen16()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_type_name(self):
current = self.tokens.current()
rule = self.table[8][current.getId()] if current else -1
tree = ParseTree( NonTerminal(127, self.nonterminals[127]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 291:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(49) # int
tree.add(t)
return tree
elif rule == 359:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(114) # char
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_for_init(self):
current = self.tokens.current()
rule = self.table[9][current.getId()] if current else -1
tree = ParseTree( NonTerminal(128, self.nonterminals[128]))
tree.list = False
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 132:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
return tree
elif rule == 187:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration()
tree.add( subtree )
subtree = self.parse_expression_opt()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
return tree
def parse_direct_declarator_modifier(self):
current = self.tokens.current()
rule = self.table[10][current.getId()] if current else -1
tree = ParseTree( NonTerminal(129, self.nonterminals[129]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 81:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier()
tree.add( subtree )
return tree
elif rule == 230:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(90) # static
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_keyword(self):
current = self.tokens.current()
rule = self.table[11][current.getId()] if current else -1
tree = ParseTree( NonTerminal(130, self.nonterminals[130]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 2:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(110) # return
tree.add(t)
return tree
elif rule == 5:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(48) # complex
tree.add(t)
return tree
elif rule == 21:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(91) # imaginary
tree.add(t)
return tree
elif rule == 29:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(16) # continue
tree.add(t)
return tree
elif rule == 30:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(49) # int
tree.add(t)
return tree
elif rule == 34:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(118) # sizeof
tree.add(t)
return tree
elif rule == 35:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(72) # double
tree.add(t)
return tree
elif rule == 37:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(57) # typedef
tree.add(t)
return tree
elif rule == 106:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(70) # default
tree.add(t)
return tree
elif rule == 115:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(92) # do
tree.add(t)
return tree
elif rule == 116:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(87) # goto
tree.add(t)
return tree
elif rule == 121:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(9) # if
tree.add(t)
return tree
elif rule == 123:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(68) # else
tree.add(t)
return tree
elif rule == 136:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(114) # char
tree.add(t)
return tree
elif rule == 138:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(41) # long
tree.add(t)
return tree
elif rule == 178:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(60) # signed
tree.add(t)
return tree
elif rule == 185:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(53) # short
tree.add(t)
return tree
elif rule == 219:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(113) # switch
tree.add(t)
return tree
elif rule == 249:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(22) # union
tree.add(t)
return tree
elif rule == 259:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(90) # static
tree.add(t)
return tree
elif rule == 310:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(85) # while
tree.add(t)
return tree
elif rule == 314:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(115) # auto
tree.add(t)
return tree
elif rule == 325:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(56) # break
tree.add(t)
return tree
elif rule == 327:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(79) # unsigned
tree.add(t)
return tree
elif rule == 330:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(4) # register
tree.add(t)
return tree
elif rule == 338:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(62) # float
tree.add(t)
return tree
elif rule == 344:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(47) # restrict
tree.add(t)
return tree
elif rule == 348:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(61) # for
tree.add(t)
return tree
elif rule == 357:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(96) # void
tree.add(t)
return tree
elif rule == 372:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(83) # volatile
tree.add(t)
return tree
elif rule == 394:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(98) # extern
tree.add(t)
return tree
elif rule == 395:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(50) # const
tree.add(t)
return tree
elif rule == 397:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(38) # struct
tree.add(t)
return tree
elif rule == 405:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(34) # inline
tree.add(t)
return tree
elif rule == 410:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(37) # enum
tree.add(t)
return tree
elif rule == 413:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(112) # case
tree.add(t)
return tree
elif rule == 416:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(78) # bool
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_block_item(self):
current = self.tokens.current()
rule = self.table[12][current.getId()] if current else -1
tree = ParseTree( NonTerminal(131, self.nonterminals[131]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 46:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration()
tree.add( subtree )
return tree
elif rule == 55:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_statement()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_external_declaration(self):
current = self.tokens.current()
rule = self.table[13][current.getId()] if current else -1
tree = ParseTree( NonTerminal(132, self.nonterminals[132]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 71:
tree.astTransform = AstTransformNodeCreator('ExternalDeclaration', {'declarations': 2, 'declaration_specifiers': 1})
t = self.expect(102) # external_declaration_hint
tree.add(t)
subtree = self.parse__gen1()
tree.add( subtree )
subtree = self.parse_external_declaration_sub()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_init_declarator_list(self):
current = self.tokens.current()
rule = self.table[14][current.getId()] if current else -1
tree = ParseTree( NonTerminal(133, self.nonterminals[133]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 56:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen9()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen9()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen8(self):
current = self.tokens.current()
rule = self.table[15][current.getId()] if current else -1
tree = ParseTree( NonTerminal(134, self.nonterminals[134]))
tree.list = False
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 373:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator_list()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator_list()
tree.add( subtree )
return tree
def parse_struct_or_union_body(self):
current = self.tokens.current()
rule = self.table[16][current.getId()] if current else -1
tree = ParseTree( NonTerminal(135, self.nonterminals[135]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 296:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(94) # lbrace
tree.add(t)
subtree = self.parse__gen17()
tree.add( subtree )
t = self.expect(100) # rbrace
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_sizeof_body(self):
current = self.tokens.current()
rule = self.table[17][current.getId()] if current else -1
tree = ParseTree( NonTerminal(136, self.nonterminals[136]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 52:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(80) # identifier
tree.add(t)
return tree
elif rule == 381:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse_type_name()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen16(self):
current = self.tokens.current()
rule = self.table[18][current.getId()] if current else -1
tree = ParseTree( NonTerminal(137, self.nonterminals[137]))
tree.list = False
if current != None and (current.getId() in [57, 41, 34, 17, 63, 54, 53, 79, 38, 50, 78, 96, 26, 83, 4, 48, 22, 27, 28, 89, 72, 90, 91, 60, 93, 37, 47, 98, 52, 25, 71, 62, 115, 49, 114, 116, 80]):
return tree
if current == None:
return tree
if rule == 231:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_or_union_body()
tree.add( subtree )
return tree
return tree
def parse__gen28(self):
current = self.tokens.current()
rule = self.table[19][current.getId()] if current else -1
tree = ParseTree( NonTerminal(138, self.nonterminals[138]))
tree.list = 'nlist'
if current != None and (current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 42, 15, 97, 19, 118, 117, 24, 108, 44]):
return tree
if current == None:
return tree
if rule == 243:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_direct_declarator_modifier()
tree.add( subtree )
subtree = self.parse__gen28()
tree.add( subtree )
return tree
return tree
def parse_constant(self):
current = self.tokens.current()
rule = self.table[20][current.getId()] if current else -1
tree = ParseTree( NonTerminal(139, self.nonterminals[139]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 48:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(117) # character_constant
tree.add(t)
return tree
elif rule == 57:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(97) # hexadecimal_floating_constant
tree.add(t)
return tree
elif rule == 68:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(24) # enumeration_constant
tree.add(t)
return tree
elif rule == 207:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(99) # decimal_floating_constant
tree.add(t)
return tree
elif rule == 294:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(10) # integer_constant
tree.add(t)
return tree
elif rule == 358:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(15) # floating_constant
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen0(self):
current = self.tokens.current()
rule = self.table[21][current.getId()] if current else -1
tree = ParseTree( NonTerminal(140, self.nonterminals[140]))
tree.list = 'nlist'
if current != None and (current.getId() in [-1]):
return tree
if current == None:
return tree
if rule == 396:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_external_declaration()
tree.add( subtree )
subtree = self.parse__gen0()
tree.add( subtree )
return tree
return tree
def parse_enum_specifier_sub(self):
current = self.tokens.current()
rule = self.table[22][current.getId()] if current else -1
tree = ParseTree( NonTerminal(141, self.nonterminals[141]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 85:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_enum_specifier_body()
tree.add( subtree )
return tree
elif rule == 306:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_identifier()
tree.add( subtree )
subtree = self.parse__gen22()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_storage_class_specifier(self):
current = self.tokens.current()
rule = self.table[23][current.getId()] if current else -1
tree = ParseTree( NonTerminal(142, self.nonterminals[142]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 58:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(115) # auto
tree.add(t)
return tree
elif rule == 84:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(90) # static
tree.add(t)
return tree
elif rule == 276:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(4) # register
tree.add(t)
return tree
elif rule == 326:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(57) # typedef
tree.add(t)
return tree
elif rule == 356:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(98) # extern
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_typedef_name(self):
current = self.tokens.current()
rule = self.table[24][current.getId()] if current else -1
tree = ParseTree( NonTerminal(143, self.nonterminals[143]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 220:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(54) # typedef_identifier
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen18(self):
current = self.tokens.current()
rule = self.table[25][current.getId()] if current else -1
tree = ParseTree( NonTerminal(144, self.nonterminals[144]))
tree.list = 'nlist'
if current != None and (current.getId() in [80, 28, 89, 63, 52]):
return tree
if current == None:
return tree
if rule == 262:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_specifier_qualifier()
tree.add( subtree )
subtree = self.parse__gen18()
tree.add( subtree )
return tree
return tree
def parse_identifier(self):
current = self.tokens.current()
rule = self.table[26][current.getId()] if current else -1
tree = ParseTree( NonTerminal(145, self.nonterminals[145]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 44:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(80) # identifier
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_enum_specifier_body(self):
current = self.tokens.current()
rule = self.table[27][current.getId()] if current else -1
tree = ParseTree( NonTerminal(146, self.nonterminals[146]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 12:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(94) # lbrace
tree.add(t)
subtree = self.parse__gen23()
tree.add( subtree )
subtree = self.parse_trailing_comma_opt()
tree.add( subtree )
t = self.expect(100) # rbrace
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen11(self):
current = self.tokens.current()
rule = self.table[28][current.getId()] if current else -1
tree = ParseTree( NonTerminal(147, self.nonterminals[147]))
tree.list = False
if current != None and (current.getId() in [27, 26]):
return tree
if current == None:
return tree
if rule == 134:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declarator_initializer()
tree.add( subtree )
return tree
return tree
def parse_type_specifier(self):
current = self.tokens.current()
rule = self.table[29][current.getId()] if current else -1
tree = ParseTree( NonTerminal(148, self.nonterminals[148]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 16:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_typedef_name()
tree.add( subtree )
return tree
elif rule == 75:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(41) # long
tree.add(t)
return tree
elif rule == 96:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(53) # short
tree.add(t)
return tree
elif rule == 150:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(48) # complex
tree.add(t)
return tree
elif rule == 153:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_specifier()
tree.add( subtree )
return tree
elif rule == 198:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(72) # double
tree.add(t)
return tree
elif rule == 206:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(79) # unsigned
tree.add(t)
return tree
elif rule == 297:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(91) # imaginary
tree.add(t)
return tree
elif rule == 301:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(60) # signed
tree.add(t)
return tree
elif rule == 305:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(78) # bool
tree.add(t)
return tree
elif rule == 308:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_union_specifier()
tree.add( subtree )
return tree
elif rule == 316:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(49) # int
tree.add(t)
return tree
elif rule == 341:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(114) # char
tree.add(t)
return tree
elif rule == 346:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(62) # float
tree.add(t)
return tree
elif rule == 352:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(96) # void
tree.add(t)
return tree
elif rule == 375:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_enum_specifier()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_struct_declaration(self):
current = self.tokens.current()
rule = self.table[30][current.getId()] if current else -1
tree = ParseTree( NonTerminal(149, self.nonterminals[149]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 36:
tree.astTransform = AstTransformNodeCreator('StructOrUnionDeclaration', {'specifier_qualifiers': 0, 'declarators': 1})
subtree = self.parse__gen18()
tree.add( subtree )
subtree = self.parse__gen19()
tree.add( subtree )
t = self.expect(26) # semi
tree.add(t)
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformNodeCreator('StructOrUnionDeclaration', {'specifier_qualifiers': 0, 'declarators': 1})
subtree = self.parse__gen18()
tree.add( subtree )
subtree = self.parse__gen19()
tree.add( subtree )
tree.add( self.expect(26) ) # semi
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_block_item_list(self):
current = self.tokens.current()
rule = self.table[31][current.getId()] if current else -1
tree = ParseTree( NonTerminal(150, self.nonterminals[150]))
tree.list = False
if current == None:
return tree
if rule == 281:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen40()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen40()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen17(self):
current = self.tokens.current()
rule = self.table[32][current.getId()] if current else -1
tree = ParseTree( NonTerminal(151, self.nonterminals[151]))
tree.list = 'nlist'
if current != None and (current.getId() in [100]):
return tree
if current == None:
return tree
if rule == 258:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declaration()
tree.add( subtree )
subtree = self.parse__gen17()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declaration()
tree.add( subtree )
subtree = self.parse__gen17()
tree.add( subtree )
return tree
def parse_declaration(self):
current = self.tokens.current()
rule = self.table[33][current.getId()] if current else -1
tree = ParseTree( NonTerminal(152, self.nonterminals[152]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 412:
tree.astTransform = AstTransformNodeCreator('Declaration', {'init_declarators': 1, 'declaration_specifiers': 0})
subtree = self.parse__gen1()
tree.add( subtree )
subtree = self.parse__gen8()
tree.add( subtree )
t = self.expect(26) # semi
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_type_qualifier(self):
current = self.tokens.current()
rule = self.table[34][current.getId()] if current else -1
tree = ParseTree( NonTerminal(153, self.nonterminals[153]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 70:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(83) # volatile
tree.add(t)
return tree
elif rule == 240:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(47) # restrict
tree.add(t)
return tree
elif rule == 286:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(50) # const
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_misc(self):
current = self.tokens.current()
rule = self.table[35][current.getId()] if current else -1
tree = ParseTree( NonTerminal(154, self.nonterminals[154]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 225:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(105) # universal_character_name
tree.add(t)
return tree
elif rule == 315:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(67) # endif
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_struct_specifier(self):
current = self.tokens.current()
rule = self.table[36][current.getId()] if current else -1
tree = ParseTree( NonTerminal(155, self.nonterminals[155]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 421:
tree.astTransform = AstTransformNodeCreator('Struct', {'definition': 1})
t = self.expect(38) # struct
tree.add(t)
subtree = self.parse_struct_or_union_sub()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_function_specifier(self):
current = self.tokens.current()
rule = self.table[37][current.getId()] if current else -1
tree = ParseTree( NonTerminal(156, self.nonterminals[156]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 275:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(34) # inline
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen39(self):
current = self.tokens.current()
rule = self.table[38][current.getId()] if current else -1
tree = ParseTree( NonTerminal(157, self.nonterminals[157]))
tree.list = False
if current != None and (current.getId() in [100]):
return tree
if current == None:
return tree
if rule == 10:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_block_item_list()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_block_item_list()
tree.add( subtree )
return tree
def parse_else_if_statement_list(self):
current = self.tokens.current()
rule = self.table[39][current.getId()] if current else -1
tree = ParseTree( NonTerminal(158, self.nonterminals[158]))
tree.list = False
if current == None:
return tree
if rule == 147:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen43()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_type_qualifier_list_opt(self):
current = self.tokens.current()
rule = self.table[40][current.getId()] if current else -1
tree = ParseTree( NonTerminal(159, self.nonterminals[159]))
tree.list = False
if current != None and (current.getId() in [27, 52, 90, 17, 89, 63, 25, 80]):
return tree
if current == None:
return tree
if rule == 19:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen25()
tree.add( subtree )
return tree
return tree
def parse_specifier_qualifier(self):
current = self.tokens.current()
rule = self.table[41][current.getId()] if current else -1
tree = ParseTree( NonTerminal(160, self.nonterminals[160]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 273:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_specifier()
tree.add( subtree )
return tree
elif rule == 426:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen9(self):
current = self.tokens.current()
rule = self.table[42][current.getId()] if current else -1
tree = ParseTree( NonTerminal(161, self.nonterminals[161]))
tree.list = 'slist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 67:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator()
tree.add( subtree )
subtree = self.parse__gen10()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator()
tree.add( subtree )
subtree = self.parse__gen10()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen24(self):
current = self.tokens.current()
rule = self.table[43][current.getId()] if current else -1
tree = ParseTree( NonTerminal(162, self.nonterminals[162]))
tree.list = 'slist'
if current != None and (current.getId() in [104]):
return tree
if current == None:
return tree
if rule == 267:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_enumerator()
tree.add( subtree )
subtree = self.parse__gen24()
tree.add( subtree )
return tree
return tree
def parse_translation_unit(self):
current = self.tokens.current()
rule = self.table[44][current.getId()] if current else -1
tree = ParseTree( NonTerminal(163, self.nonterminals[163]))
tree.list = False
if current == None:
return tree
if rule == 367:
tree.astTransform = AstTransformNodeCreator('TranslationUnit', {'external_declarations': 0})
subtree = self.parse__gen0()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_else_statement(self):
current = self.tokens.current()
rule = self.table[45][current.getId()] if current else -1
tree = ParseTree( NonTerminal(164, self.nonterminals[164]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 419:
tree.astTransform = AstTransformNodeCreator('Else', {'statement': 1})
t = self.expect(68) # else
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
t = self.expect(67) # endif
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen42(self):
current = self.tokens.current()
rule = self.table[46][current.getId()] if current else -1
tree = ParseTree( NonTerminal(165, self.nonterminals[165]))
tree.list = False
if current != None and (current.getId() in [70, 2, 4, 54, 99, 10, 24, 12, 38, 87, 94, 108, 19, 26, 85, 15, 22, 52, 56, 83, 92, 34, 37, 47, 61, 41, 44, 62, 48, 49, 50, 53, 80, 57, 9, 60, 97, 63, 67, 79, 73, 78, 96, 118, 117, 115, 90, 91, 16, 98, 100, 29, 72, 110, 112, 113, 114]):
return tree
if current == None:
return tree
if rule == 51:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_else_statement()
tree.add( subtree )
return tree
return tree
def parse__gen22(self):
current = self.tokens.current()
rule = self.table[47][current.getId()] if current else -1
tree = ParseTree( NonTerminal(166, self.nonterminals[166]))
tree.list = False
if current != None and (current.getId() in [57, 41, 34, 17, 63, 54, 53, 79, 38, 50, 78, 96, 26, 83, 4, 48, 22, 27, 28, 89, 72, 90, 91, 60, 93, 37, 47, 98, 52, 25, 71, 62, 115, 49, 114, 116, 80]):
return tree
if current == None:
return tree
if rule == 242:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_enum_specifier_body()
tree.add( subtree )
return tree
return tree
def parse_struct_declarator(self):
current = self.tokens.current()
rule = self.table[48][current.getId()] if current else -1
tree = ParseTree( NonTerminal(167, self.nonterminals[167]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 79:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declarator_body()
tree.add( subtree )
return tree
elif rule == 223:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen21()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen21()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen19(self):
current = self.tokens.current()
rule = self.table[49][current.getId()] if current else -1
tree = ParseTree( NonTerminal(168, self.nonterminals[168]))
tree.list = 'slist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 277:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declarator()
tree.add( subtree )
subtree = self.parse__gen20()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_struct_declarator()
tree.add( subtree )
subtree = self.parse__gen20()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen20(self):
current = self.tokens.current()
rule = self.table[50][current.getId()] if current else -1
tree = ParseTree( NonTerminal(169, self.nonterminals[169]))
tree.list = 'slist'
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 107:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_struct_declarator()
tree.add( subtree )
subtree = self.parse__gen20()
tree.add( subtree )
return tree
return tree
def parse__gen10(self):
current = self.tokens.current()
rule = self.table[51][current.getId()] if current else -1
tree = ParseTree( NonTerminal(170, self.nonterminals[170]))
tree.list = 'slist'
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 72:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_init_declarator()
tree.add( subtree )
subtree = self.parse__gen10()
tree.add( subtree )
return tree
return tree
def parse_enumeration_constant(self):
current = self.tokens.current()
rule = self.table[52][current.getId()] if current else -1
tree = ParseTree( NonTerminal(171, self.nonterminals[171]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 90:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(80) # identifier
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen15(self):
current = self.tokens.current()
rule = self.table[53][current.getId()] if current else -1
tree = ParseTree( NonTerminal(172, self.nonterminals[172]))
tree.list = 'nlist'
if current != None and (current.getId() in [21]):
return tree
if current == None:
return tree
if rule == 278:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_designator()
tree.add( subtree )
subtree = self.parse__gen15()
tree.add( subtree )
return tree
return tree
def parse_punctuator(self):
current = self.tokens.current()
rule = self.table[54][current.getId()] if current else -1
tree = ParseTree( NonTerminal(173, self.nonterminals[173]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 1:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(103) # gt
tree.add(t)
return tree
elif rule == 22:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(55) # neq
tree.add(t)
return tree
elif rule == 25:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(59) # rshifteq
tree.add(t)
return tree
elif rule == 28:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(19) # incr
tree.add(t)
return tree
elif rule == 32:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(75) # bitxor
tree.add(t)
return tree
elif rule == 40:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(8) # arrow
tree.add(t)
return tree
elif rule == 47:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(106) # muleq
tree.add(t)
return tree
elif rule == 53:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(46) # bitandeq
tree.add(t)
return tree
elif rule == 64:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(69) # dot
tree.add(t)
return tree
elif rule == 65:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(43) # bitor
tree.add(t)
return tree
elif rule == 77:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(45) # eq
tree.add(t)
return tree
elif rule == 114:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(100) # rbrace
tree.add(t)
return tree
elif rule == 128:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(1) # rparen
tree.add(t)
return tree
elif rule == 130:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(51) # lshifteq
tree.add(t)
return tree
elif rule == 145:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(65) # rshift
tree.add(t)
return tree
elif rule == 152:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(26) # semi
tree.add(t)
return tree
elif rule == 157:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(111) # div
tree.add(t)
return tree
elif rule == 162:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
return tree
elif rule == 177:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(32) # ampersand
tree.add(t)
return tree
elif rule == 189:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(14) # elipsis
tree.add(t)
return tree
elif rule == 192:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(101) # lshift
tree.add(t)
return tree
elif rule == 199:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(58) # or
tree.add(t)
return tree
elif rule == 201:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(81) # gteq
tree.add(t)
return tree
elif rule == 208:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(74) # lteq
tree.add(t)
return tree
elif rule == 214:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(107) # add
tree.add(t)
return tree
elif rule == 241:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(6) # pound
tree.add(t)
return tree
elif rule == 244:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(84) # modeq
tree.add(t)
return tree
elif rule == 250:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(35) # and
tree.add(t)
return tree
elif rule == 251:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(109) # exclamation_point
tree.add(t)
return tree
elif rule == 261:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(12) # decr
tree.add(t)
return tree
elif rule == 269:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(11) # mod
tree.add(t)
return tree
elif rule == 270:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(36) # tilde
tree.add(t)
return tree
elif rule == 287:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(40) # bitxoreq
tree.add(t)
return tree
elif rule == 288:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(31) # bitoreq
tree.add(t)
return tree
elif rule == 292:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(66) # lsquare
tree.add(t)
return tree
elif rule == 300:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(76) # addeq
tree.add(t)
return tree
elif rule == 312:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(28) # colon
tree.add(t)
return tree
elif rule == 329:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(88) # lt
tree.add(t)
return tree
elif rule == 354:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(30) # subeq
tree.add(t)
return tree
elif rule == 362:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(77) # rsquare
tree.add(t)
return tree
elif rule == 366:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(39) # questionmark
tree.add(t)
return tree
elif rule == 370:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(20) # poundpound
tree.add(t)
return tree
elif rule == 374:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(21) # assign
tree.add(t)
return tree
elif rule == 391:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(18) # sub
tree.add(t)
return tree
elif rule == 411:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(94) # lbrace
tree.add(t)
return tree
elif rule == 415:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(63) # lparen
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen43(self):
current = self.tokens.current()
rule = self.table[55][current.getId()] if current else -1
tree = ParseTree( NonTerminal(174, self.nonterminals[174]))
tree.list = 'nlist'
if current != None and (current.getId() in [70, 2, 4, 54, 99, 68, 24, 12, 38, 87, 94, 108, 19, 26, 85, 15, 22, 52, 56, 83, 92, 34, 37, 47, 61, 41, 44, 62, 48, 49, 50, 53, 80, 57, 9, 60, 97, 63, 67, 10, 79, 73, 78, 96, 118, 117, 115, 90, 91, 16, 98, 100, 29, 72, 110, 112, 113, 114]):
return tree
if current == None:
return tree
if rule == 142:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_else_if_statement()
tree.add( subtree )
subtree = self.parse__gen43()
tree.add( subtree )
return tree
return tree
def parse__gen27(self):
current = self.tokens.current()
rule = self.table[56][current.getId()] if current else -1
tree = ParseTree( NonTerminal(175, self.nonterminals[175]))
tree.list = False
if current != None and (current.getId() in [73, 2, 63, 52, 80, 10, 99, 44, 12, 42, 15, 97, 19, 118, 117, 24, 108]):
return tree
if current == None:
return tree
if rule == 408:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_direct_declarator_modifier_list()
tree.add( subtree )
return tree
return tree
def parse_external_declarator(self):
current = self.tokens.current()
rule = self.table[57][current.getId()] if current else -1
tree = ParseTree( NonTerminal(176, self.nonterminals[176]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 382:
tree.astTransform = AstTransformNodeCreator('ExternalDeclarator', {'init_declarator': 1})
t = self.expect(93) # declarator_hint
tree.add(t)
subtree = self.parse__gen6()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_else_if_statement(self):
current = self.tokens.current()
rule = self.table[58][current.getId()] if current else -1
tree = ParseTree( NonTerminal(177, self.nonterminals[177]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 165:
tree.astTransform = AstTransformNodeCreator('ElseIf', {'statement': 4, 'condition': 2})
t = self.expect(23) # else_if
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
t = self.expect(67) # endif
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_init_declarator(self):
current = self.tokens.current()
rule = self.table[59][current.getId()] if current else -1
tree = ParseTree( NonTerminal(178, self.nonterminals[178]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 137:
tree.astTransform = AstTransformNodeCreator('InitDeclarator', {'initializer': 1, 'declarator': 0})
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen11()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformNodeCreator('InitDeclarator', {'initializer': 1, 'declarator': 0})
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen11()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_parameter_type_list(self):
current = self.tokens.current()
rule = self.table[60][current.getId()] if current else -1
tree = ParseTree( NonTerminal(179, self.nonterminals[179]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 236:
tree.astTransform = AstTransformNodeCreator('ParameterTypeList', {'parameter_declarations': 0, 'va_args': 1})
subtree = self.parse__gen29()
tree.add( subtree )
subtree = self.parse__gen31()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_initializer(self):
current = self.tokens.current()
rule = self.table[61][current.getId()] if current else -1
tree = ParseTree( NonTerminal(180, self.nonterminals[180]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 309:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr_sans_comma()
tree.add( subtree )
return tree
elif rule == 317:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(94) # lbrace
tree.add(t)
subtree = self.parse__gen12()
tree.add( subtree )
subtree = self.parse_trailing_comma_opt()
tree.add( subtree )
t = self.expect(100) # rbrace
tree.add(t)
return tree
elif current.getId() in [33, 63, 80, 10, 99, 44, 12, 52, 15, 97, 19, 118, 2, 24, 108, 117]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr_sans_comma()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_designation(self):
current = self.tokens.current()
rule = self.table[62][current.getId()] if current else -1
tree = ParseTree( NonTerminal(181, self.nonterminals[181]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 365:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen15()
tree.add( subtree )
t = self.expect(21) # assign
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_initializer_list_item(self):
current = self.tokens.current()
rule = self.table[63][current.getId()] if current else -1
tree = ParseTree( NonTerminal(182, self.nonterminals[182]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 126:
tree.astTransform = AstTransformNodeCreator('Initialization', {'designation': 0, 'initializer': 1})
subtree = self.parse__gen14()
tree.add( subtree )
subtree = self.parse_initializer()
tree.add( subtree )
return tree
elif current.getId() in [33, 63, 80, 10, 99, 44, 12, 52, 15, 97, 19, 118, 2, 24, 108, 117]:
tree.astTransform = AstTransformNodeCreator('Initialization', {'designation': 0, 'initializer': 1})
subtree = self.parse__gen14()
tree.add( subtree )
subtree = self.parse_initializer()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_external_declaration_sub(self):
current = self.tokens.current()
rule = self.table[64][current.getId()] if current else -1
tree = ParseTree( NonTerminal(183, self.nonterminals[183]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 93:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen3()
tree.add( subtree )
t = self.expect(26) # semi
tree.add(t)
return tree
elif rule == 298:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_external_function()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_declarator_initializer(self):
current = self.tokens.current()
rule = self.table[65][current.getId()] if current else -1
tree = ParseTree( NonTerminal(184, self.nonterminals[184]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 158:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(21) # assign
tree.add(t)
subtree = self.parse_initializer()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_external_function(self):
current = self.tokens.current()
rule = self.table[67][current.getId()] if current else -1
tree = ParseTree( NonTerminal(186, self.nonterminals[186]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 377:
tree.astTransform = AstTransformNodeCreator('FunctionDefinition', {'body': 3, 'declaration_list': 2, 'signature': 1})
t = self.expect(71) # function_definition_hint
tree.add(t)
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen5()
tree.add( subtree )
subtree = self.parse_compound_statement()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_expression_opt(self):
current = self.tokens.current()
rule = self.table[68][current.getId()] if current else -1
tree = ParseTree( NonTerminal(187, self.nonterminals[187]))
tree.list = False
if current != None and (current.getId() in [1, 26]):
return tree
if current == None:
return tree
if rule == 227:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__expr()
tree.add( subtree )
return tree
def parse_direct_abstract_declarator_expr(self):
current = self.tokens.current()
rule = self.table[69][current.getId()] if current else -1
tree = ParseTree( NonTerminal(188, self.nonterminals[188]))
tree.list = False
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 49:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier_list_opt()
tree.add( subtree )
subtree = self.parse_static_opt()
tree.add( subtree )
subtree = self.parse__expr()
tree.add( subtree )
return tree
elif rule == 94:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(42) # variable_length_array
tree.add(t)
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier_list_opt()
tree.add( subtree )
subtree = self.parse_static_opt()
tree.add( subtree )
subtree = self.parse__expr()
tree.add( subtree )
return tree
def parse_enumerator_assignment(self):
current = self.tokens.current()
rule = self.table[70][current.getId()] if current else -1
tree = ParseTree( NonTerminal(189, self.nonterminals[189]))
tree.list = False
if current != None and (current.getId() in [27, 104]):
return tree
if current == None:
return tree
if rule == 41:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(21) # assign
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
return tree
return tree
def parse__gen12(self):
current = self.tokens.current()
rule = self.table[71][current.getId()] if current else -1
tree = ParseTree( NonTerminal(190, self.nonterminals[190]))
tree.list = 'slist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 332:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_initializer_list_item()
tree.add( subtree )
subtree = self.parse__gen13()
tree.add( subtree )
return tree
elif current.getId() in [33, 63, 80, 10, 99, 44, 12, 52, 15, 97, 19, 118, 2, 24, 108, 117]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_initializer_list_item()
tree.add( subtree )
subtree = self.parse__gen13()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen13(self):
current = self.tokens.current()
rule = self.table[72][current.getId()] if current else -1
tree = ParseTree( NonTerminal(191, self.nonterminals[191]))
tree.list = 'slist'
if current != None and (current.getId() in [104]):
return tree
if current == None:
return tree
if rule == 336:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_initializer_list_item()
tree.add( subtree )
subtree = self.parse__gen13()
tree.add( subtree )
return tree
return tree
def parse_external_declaration_sub_sub(self):
current = self.tokens.current()
rule = self.table[73][current.getId()] if current else -1
tree = ParseTree( NonTerminal(192, self.nonterminals[192]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 202:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_external_declarator()
tree.add( subtree )
return tree
elif rule == 224:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_external_prototype()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_named_parameter_declaration(self):
current = self.tokens.current()
rule = self.table[74][current.getId()] if current else -1
tree = ParseTree( NonTerminal(193, self.nonterminals[193]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 290:
tree.astTransform = AstTransformNodeCreator('NamedParameter', {'declaration_specifiers': 1, 'declarator': 2})
t = self.expect(95) # named_parameter_hint
tree.add(t)
subtree = self.parse__gen1()
tree.add( subtree )
subtree = self.parse__gen34()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen3(self):
current = self.tokens.current()
rule = self.table[75][current.getId()] if current else -1
tree = ParseTree( NonTerminal(194, self.nonterminals[194]))
tree.list = 'slist'
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 260:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_external_declaration_sub_sub()
tree.add( subtree )
subtree = self.parse__gen4()
tree.add( subtree )
return tree
return tree
def parse_designator(self):
current = self.tokens.current()
rule = self.table[76][current.getId()] if current else -1
tree = ParseTree( NonTerminal(195, self.nonterminals[195]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 13:
tree.astTransform = AstTransformNodeCreator('MemberAccess', {'name': 1})
t = self.expect(69) # dot
tree.add(t)
t = self.expect(80) # identifier
tree.add(t)
return tree
elif rule == 334:
tree.astTransform = AstTransformNodeCreator('ArrayAccess', {'index': 1})
t = self.expect(66) # lsquare
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(77) # rsquare
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen4(self):
current = self.tokens.current()
rule = self.table[77][current.getId()] if current else -1
tree = ParseTree( NonTerminal(196, self.nonterminals[196]))
tree.list = 'slist'
if current != None and (current.getId() in [26]):
return tree
if current == None:
return tree
if rule == 347:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_external_declaration_sub_sub()
tree.add( subtree )
subtree = self.parse__gen4()
tree.add( subtree )
return tree
return tree
def parse__gen14(self):
current = self.tokens.current()
rule = self.table[78][current.getId()] if current else -1
tree = ParseTree( NonTerminal(197, self.nonterminals[197]))
tree.list = False
if current != None and (current.getId() in [15, 33, 63, 80, 10, 99, 44, 12, 52, 94, 97, 19, 118, 2, 24, 108, 117]):
return tree
if current == None:
return tree
if rule == 299:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_designation()
tree.add( subtree )
return tree
return tree
def parse_direct_declarator_parameter_list(self):
current = self.tokens.current()
rule = self.table[79][current.getId()] if current else -1
tree = ParseTree( NonTerminal(198, self.nonterminals[198]))
tree.list = False
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 182:
tree.astTransform = AstTransformNodeCreator('ParameterList', {'identifiers': 0})
subtree = self.parse__gen32()
tree.add( subtree )
return tree
elif rule == 379:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_parameter_type_list()
tree.add( subtree )
return tree
return tree
def parse_abstract_parameter_declaration(self):
current = self.tokens.current()
rule = self.table[80][current.getId()] if current else -1
tree = ParseTree( NonTerminal(199, self.nonterminals[199]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 3:
tree.astTransform = AstTransformNodeCreator('AbstractParameter', {'declaration_specifiers': 1, 'declarator': 2})
t = self.expect(64) # abstract_parameter_hint
tree.add(t)
subtree = self.parse__gen1()
tree.add( subtree )
subtree = self.parse__gen35()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_trailing_comma_opt(self):
current = self.tokens.current()
rule = self.table[81][current.getId()] if current else -1
tree = ParseTree( NonTerminal(200, self.nonterminals[200]))
tree.list = False
if current != None and (current.getId() in [100]):
return tree
if current == None:
return tree
if rule == 9:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(104) # trailing_comma
tree.add(t)
return tree
return tree
def parse__gen25(self):
current = self.tokens.current()
rule = self.table[82][current.getId()] if current else -1
tree = ParseTree( NonTerminal(201, self.nonterminals[201]))
tree.list = 'nlist'
if current != None and (current.getId() in [27, 52, 90, 17, 89, 63, 25, 80]):
return tree
if current == None:
return tree
if rule == 26:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier()
tree.add( subtree )
subtree = self.parse__gen25()
tree.add( subtree )
return tree
return tree
def parse_statement(self):
current = self.tokens.current()
rule = self.table[83][current.getId()] if current else -1
tree = ParseTree( NonTerminal(202, self.nonterminals[202]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 89:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_compound_statement()
tree.add( subtree )
return tree
elif rule == 151:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_jump_statement()
tree.add( subtree )
return tree
elif rule == 166:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_selection_statement()
tree.add( subtree )
return tree
elif rule == 218:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_expression_statement()
tree.add( subtree )
return tree
elif rule == 264:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_iteration_statement()
tree.add( subtree )
return tree
elif rule == 265:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_labeled_statement()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_expression_statement()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_for_cond(self):
current = self.tokens.current()
rule = self.table[84][current.getId()] if current else -1
tree = ParseTree( NonTerminal(203, self.nonterminals[203]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 172:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(26) # semi
tree.add(t)
subtree = self.parse_expression_opt()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_for_incr(self):
current = self.tokens.current()
rule = self.table[85][current.getId()] if current else -1
tree = ParseTree( NonTerminal(204, self.nonterminals[204]))
tree.list = False
if current != None and (current.getId() in [1]):
return tree
if current == None:
return tree
if rule == 179:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(26) # semi
tree.add(t)
subtree = self.parse_expression_opt()
tree.add( subtree )
return tree
return tree
def parse__gen34(self):
current = self.tokens.current()
rule = self.table[86][current.getId()] if current else -1
tree = ParseTree( NonTerminal(205, self.nonterminals[205]))
tree.list = False
if current != None and (current.getId() in [27, 17]):
return tree
if current == None:
return tree
if rule == 61:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declarator()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declarator()
tree.add( subtree )
return tree
def parse__gen46(self):
current = self.tokens.current()
rule = self.table[87][current.getId()] if current else -1
tree = ParseTree( NonTerminal(206, self.nonterminals[206]))
tree.list = False
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 235:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_parameter_type_list()
tree.add( subtree )
return tree
return tree
def parse_static_opt(self):
current = self.tokens.current()
rule = self.table[88][current.getId()] if current else -1
tree = ParseTree( NonTerminal(207, self.nonterminals[207]))
tree.list = False
if current != None and (current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]):
return tree
if current == None:
return tree
if rule == 209:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(90) # static
tree.add(t)
return tree
return tree
def parse__gen41(self):
current = self.tokens.current()
rule = self.table[89][current.getId()] if current else -1
tree = ParseTree( NonTerminal(208, self.nonterminals[208]))
tree.list = False
if current != None and (current.getId() in [70, 2, 4, 54, 99, 68, 24, 12, 38, 94, 108, 19, 26, 85, 15, 22, 52, 56, 83, 92, 34, 37, 47, 61, 41, 44, 62, 87, 49, 53, 80, 57, 9, 60, 97, 63, 67, 10, 115, 79, 73, 78, 96, 118, 117, 48, 90, 91, 16, 98, 100, 29, 113, 72, 110, 112, 50, 114]):
return tree
if current == None:
return tree
if rule == 234:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_else_if_statement_list()
tree.add( subtree )
return tree
return tree
def parse_parameter_declaration(self):
current = self.tokens.current()
rule = self.table[90][current.getId()] if current else -1
tree = ParseTree( NonTerminal(209, self.nonterminals[209]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 141:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_abstract_parameter_declaration()
tree.add( subtree )
return tree
elif rule == 387:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_named_parameter_declaration()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_declaration_specifier(self):
current = self.tokens.current()
rule = self.table[91][current.getId()] if current else -1
tree = ParseTree( NonTerminal(210, self.nonterminals[210]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 24:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_function_specifier()
tree.add( subtree )
return tree
elif rule == 167:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_qualifier()
tree.add( subtree )
return tree
elif rule == 186:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_type_specifier()
tree.add( subtree )
return tree
elif rule == 350:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_storage_class_specifier()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen29(self):
current = self.tokens.current()
rule = self.table[92][current.getId()] if current else -1
tree = ParseTree( NonTerminal(211, self.nonterminals[211]))
tree.list = 'slist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 109:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_parameter_declaration()
tree.add( subtree )
subtree = self.parse__gen30()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen30(self):
current = self.tokens.current()
rule = self.table[93][current.getId()] if current else -1
tree = ParseTree( NonTerminal(212, self.nonterminals[212]))
tree.list = 'slist'
if current != None and (current.getId() in [17]):
return tree
if current == None:
return tree
if rule == 149:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_parameter_declaration()
tree.add( subtree )
subtree = self.parse__gen30()
tree.add( subtree )
return tree
return tree
def parse_direct_declarator_expr(self):
current = self.tokens.current()
rule = self.table[94][current.getId()] if current else -1
tree = ParseTree( NonTerminal(213, self.nonterminals[213]))
tree.list = False
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 99:
tree.astTransform = AstTransformNodeCreator('DirectDeclaratorExpression', {'modifiers': 0, 'value': 1})
subtree = self.parse__gen27()
tree.add( subtree )
subtree = self.parse_direct_declarator_size()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformNodeCreator('DirectDeclaratorExpression', {'modifiers': 0, 'value': 1})
subtree = self.parse__gen27()
tree.add( subtree )
subtree = self.parse_direct_declarator_size()
tree.add( subtree )
return tree
def parse__gen40(self):
current = self.tokens.current()
rule = self.table[95][current.getId()] if current else -1
tree = ParseTree( NonTerminal(214, self.nonterminals[214]))
tree.list = 'nlist'
if current != None and (current.getId() in [100]):
return tree
if current == None:
return tree
if rule == 27:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_block_item()
tree.add( subtree )
subtree = self.parse__gen40()
tree.add( subtree )
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_block_item()
tree.add( subtree )
subtree = self.parse__gen40()
tree.add( subtree )
return tree
def parse_labeled_statement(self):
current = self.tokens.current()
rule = self.table[96][current.getId()] if current else -1
tree = ParseTree( NonTerminal(215, self.nonterminals[215]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 8:
tree.astTransform = AstTransformNodeCreator('DefaultCase', {'statement': 2})
t = self.expect(70) # default
tree.add(t)
t = self.expect(28) # colon
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif rule == 369:
tree.astTransform = AstTransformNodeCreator('Label', {'name': 0, 'statement': 1})
t = self.expect(29) # label_hint
tree.add(t)
t = self.expect(80) # identifier
tree.add(t)
t = self.expect(28) # colon
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif rule == 383:
tree.astTransform = AstTransformNodeCreator('Case', {'expr': 1, 'statement': 3})
t = self.expect(112) # case
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(28) # colon
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_external_prototype(self):
current = self.tokens.current()
rule = self.table[97][current.getId()] if current else -1
tree = ParseTree( NonTerminal(216, self.nonterminals[216]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 335:
tree.astTransform = AstTransformNodeCreator('FunctionPrototype', {'declaration_list': 2, 'declarator': 1})
t = self.expect(116) # function_prototype_hint
tree.add(t)
subtree = self.parse_declarator()
tree.add( subtree )
subtree = self.parse__gen5()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_union_specifier(self):
current = self.tokens.current()
rule = self.table[98][current.getId()] if current else -1
tree = ParseTree( NonTerminal(217, self.nonterminals[217]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 424:
tree.astTransform = AstTransformNodeCreator('Union', {'definition': 1})
t = self.expect(22) # union
tree.add(t)
subtree = self.parse_struct_or_union_sub()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_abstract_declarator(self):
current = self.tokens.current()
rule = self.table[99][current.getId()] if current else -1
tree = ParseTree( NonTerminal(218, self.nonterminals[218]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 173:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_pointer()
tree.add( subtree )
subtree = self.parse__gen36()
tree.add( subtree )
return tree
elif rule == 237:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__direct_abstract_declarator()
tree.add( subtree )
return tree
elif current.getId() in [25, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__direct_abstract_declarator()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_pointer(self):
current = self.tokens.current()
rule = self.table[100][current.getId()] if current else -1
tree = ParseTree( NonTerminal(219, self.nonterminals[219]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 215:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen37()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen35(self):
current = self.tokens.current()
rule = self.table[101][current.getId()] if current else -1
tree = ParseTree( NonTerminal(220, self.nonterminals[220]))
tree.list = False
if current != None and (current.getId() in [27, 17]):
return tree
if current == None:
return tree
if rule == 171:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_abstract_declarator()
tree.add( subtree )
return tree
elif current.getId() in [25, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_abstract_declarator()
tree.add( subtree )
return tree
def parse_va_args(self):
current = self.tokens.current()
rule = self.table[102][current.getId()] if current else -1
tree = ParseTree( NonTerminal(221, self.nonterminals[221]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 403:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(17) # comma_va_args
tree.add(t)
t = self.expect(14) # elipsis
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_declarator(self):
current = self.tokens.current()
rule = self.table[103][current.getId()] if current else -1
tree = ParseTree( NonTerminal(222, self.nonterminals[222]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 122:
tree.astTransform = AstTransformNodeCreator('Declarator', {'direct_declarator': 1, 'pointer': 0})
subtree = self.parse__gen26()
tree.add( subtree )
subtree = self.parse__direct_declarator()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformNodeCreator('Declarator', {'direct_declarator': 1, 'pointer': 0})
subtree = self.parse__gen26()
tree.add( subtree )
subtree = self.parse__direct_declarator()
tree.add( subtree )
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_expression_statement(self):
current = self.tokens.current()
rule = self.table[104][current.getId()] if current else -1
tree = ParseTree( NonTerminal(223, self.nonterminals[223]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 285:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_expression_opt()
tree.add( subtree )
t = self.expect(26) # semi
tree.add(t)
return tree
elif current.getId() in [73, 2, 63, 80, 10, 99, 52, 12, 44, 15, 97, 19, 118, 117, 24, 108]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_expression_opt()
tree.add( subtree )
tree.add( self.expect(26) ) # semi
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_pointer_sub(self):
current = self.tokens.current()
rule = self.table[105][current.getId()] if current else -1
tree = ParseTree( NonTerminal(224, self.nonterminals[224]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 321:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(52) # asterisk
tree.add(t)
subtree = self.parse_type_qualifier_list_opt()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen5(self):
current = self.tokens.current()
rule = self.table[106][current.getId()] if current else -1
tree = ParseTree( NonTerminal(225, self.nonterminals[225]))
tree.list = False
if current != None and (current.getId() in [94, 26, 27]):
return tree
if current == None:
return tree
if rule == 302:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration_list()
tree.add( subtree )
return tree
return tree
def parse__gen26(self):
current = self.tokens.current()
rule = self.table[107][current.getId()] if current else -1
tree = ParseTree( NonTerminal(226, self.nonterminals[226]))
tree.list = False
if current != None and (current.getId() in [63, 89, 80]):
return tree
if current == None:
return tree
if rule == 385:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_pointer()
tree.add( subtree )
return tree
return tree
def parse_selection_statement(self):
current = self.tokens.current()
rule = self.table[108][current.getId()] if current else -1
tree = ParseTree( NonTerminal(227, self.nonterminals[227]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 169:
tree.astTransform = AstTransformNodeCreator('Switch', {'expr': 2, 'statment': 4})
t = self.expect(113) # switch
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif rule == 423:
tree.astTransform = AstTransformNodeCreator('If', {'elseif': 6, 'statement': 4, 'condition': 2, 'else': 7})
t = self.expect(9) # if
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
t = self.expect(67) # endif
tree.add(t)
subtree = self.parse__gen41()
tree.add( subtree )
subtree = self.parse__gen42()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_compound_statement(self):
current = self.tokens.current()
rule = self.table[110][current.getId()] if current else -1
tree = ParseTree( NonTerminal(229, self.nonterminals[229]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 175:
tree.astTransform = AstTransformSubstitution(1)
t = self.expect(94) # lbrace
tree.add(t)
subtree = self.parse__gen39()
tree.add( subtree )
t = self.expect(100) # rbrace
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_iteration_statement(self):
current = self.tokens.current()
rule = self.table[111][current.getId()] if current else -1
tree = ParseTree( NonTerminal(230, self.nonterminals[230]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 256:
tree.astTransform = AstTransformNodeCreator('For', {'init': 2, 'cond': 3, 'incr': 4, 'statement': 6})
t = self.expect(61) # for
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse_for_init()
tree.add( subtree )
subtree = self.parse_for_cond()
tree.add( subtree )
subtree = self.parse_for_incr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif rule == 283:
tree.astTransform = AstTransformNodeCreator('While', {'expr': 2, 'statement': 4})
t = self.expect(85) # while
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
return tree
elif rule == 388:
tree.astTransform = AstTransformNodeCreator('DoWhile', {'expr': 4, 'statement': 1})
t = self.expect(92) # do
tree.add(t)
subtree = self.parse_statement()
tree.add( subtree )
t = self.expect(85) # while
tree.add(t)
t = self.expect(63) # lparen
tree.add(t)
subtree = self.parse__expr()
tree.add( subtree )
t = self.expect(1) # rparen
tree.add(t)
t = self.expect(26) # semi
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen31(self):
current = self.tokens.current()
rule = self.table[112][current.getId()] if current else -1
tree = ParseTree( NonTerminal(231, self.nonterminals[231]))
tree.list = False
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 159:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_va_args()
tree.add( subtree )
return tree
return tree
def parse__gen36(self):
current = self.tokens.current()
rule = self.table[113][current.getId()] if current else -1
tree = ParseTree( NonTerminal(232, self.nonterminals[232]))
tree.list = False
if current != None and (current.getId() in [27, 17]):
return tree
if current == None:
return tree
if rule == 404:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__direct_abstract_declarator()
tree.add( subtree )
return tree
elif current.getId() in [25, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__direct_abstract_declarator()
tree.add( subtree )
return tree
def parse_direct_declarator_modifier_list(self):
current = self.tokens.current()
rule = self.table[114][current.getId()] if current else -1
tree = ParseTree( NonTerminal(233, self.nonterminals[233]))
tree.list = False
if current != None and (current.getId() in [73, 2, 63, 80, 99, 10, 52, 12, 42, 15, 97, 19, 118, 117, 24, 108, 44]):
return tree
if current == None:
return tree
if rule == 272:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen28()
tree.add( subtree )
return tree
return tree
def parse_jump_statement(self):
current = self.tokens.current()
rule = self.table[115][current.getId()] if current else -1
tree = ParseTree( NonTerminal(234, self.nonterminals[234]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 118:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(16) # continue
tree.add(t)
return tree
elif rule == 156:
tree.astTransform = AstTransformNodeCreator('Return', {'expr': 1})
t = self.expect(110) # return
tree.add(t)
subtree = self.parse_expression_opt()
tree.add( subtree )
t = self.expect(26) # semi
tree.add(t)
return tree
elif rule == 254:
tree.astTransform = AstTransformNodeCreator('Goto', {'name': 1})
t = self.expect(87) # goto
tree.add(t)
t = self.expect(80) # identifier
tree.add(t)
t = self.expect(26) # semi
tree.add(t)
return tree
elif rule == 311:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(56) # break
tree.add(t)
t = self.expect(26) # semi
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_token(self):
current = self.tokens.current()
rule = self.table[116][current.getId()] if current else -1
tree = ParseTree( NonTerminal(235, self.nonterminals[235]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 0:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_keyword()
tree.add( subtree )
return tree
elif rule == 100:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_constant()
tree.add( subtree )
return tree
elif rule == 102:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_punctuator()
tree.add( subtree )
return tree
elif rule == 131:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(13) # pp_number
tree.add(t)
return tree
elif rule == 345:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(80) # identifier
tree.add(t)
return tree
elif rule == 392:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(44) # string_literal
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen38(self):
current = self.tokens.current()
rule = self.table[117][current.getId()] if current else -1
tree = ParseTree( NonTerminal(236, self.nonterminals[236]))
tree.list = 'mlist'
if current != None and (current.getId() in [27, 17, 89, 63, 25, 80]):
return tree
if current == None:
return tree
if rule == 104:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_pointer_sub()
tree.add( subtree )
subtree = self.parse__gen38()
tree.add( subtree )
return tree
return tree
def parse__gen32(self):
current = self.tokens.current()
rule = self.table[118][current.getId()] if current else -1
tree = ParseTree( NonTerminal(237, self.nonterminals[237]))
tree.list = 'slist'
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 349:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_identifier()
tree.add( subtree )
subtree = self.parse__gen33()
tree.add( subtree )
return tree
return tree
def parse_declaration_list(self):
current = self.tokens.current()
rule = self.table[119][current.getId()] if current else -1
tree = ParseTree( NonTerminal(238, self.nonterminals[238]))
tree.list = False
if current == None:
return tree
if rule == 280:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse__gen7()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen33(self):
current = self.tokens.current()
rule = self.table[120][current.getId()] if current else -1
tree = ParseTree( NonTerminal(239, self.nonterminals[239]))
tree.list = 'slist'
if current != None and (current.getId() in []):
return tree
if current == None:
return tree
if rule == 184:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(27) # comma
tree.add(t)
tree.listSeparator = t
subtree = self.parse_identifier()
tree.add( subtree )
subtree = self.parse__gen33()
tree.add( subtree )
return tree
return tree
def parse_enumerator(self):
current = self.tokens.current()
rule = self.table[121][current.getId()] if current else -1
tree = ParseTree( NonTerminal(240, self.nonterminals[240]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 111:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_enumeration_constant()
tree.add( subtree )
subtree = self.parse_enumerator_assignment()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_pp(self):
current = self.tokens.current()
rule = self.table[122][current.getId()] if current else -1
tree = ParseTree( NonTerminal(241, self.nonterminals[241]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 247:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(13) # pp_number
tree.add(t)
return tree
elif rule == 364:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(7) # defined_separator
tree.add(t)
return tree
elif rule == 386:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(86) # defined
tree.add(t)
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen1(self):
current = self.tokens.current()
rule = self.table[123][current.getId()] if current else -1
tree = ParseTree( NonTerminal(242, self.nonterminals[242]))
tree.list = 'mlist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 140:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration_specifier()
tree.add( subtree )
subtree = self.parse__gen2()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen2(self):
current = self.tokens.current()
rule = self.table[124][current.getId()] if current else -1
tree = ParseTree( NonTerminal(243, self.nonterminals[243]))
tree.list = 'mlist'
if current != None and (current.getId() in [27, 52, 89, 25, 116, 63, 17, 93, 26, 71, 80]):
return tree
if current == None:
return tree
if rule == 303:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_declaration_specifier()
tree.add( subtree )
subtree = self.parse__gen2()
tree.add( subtree )
return tree
return tree
def parse__gen6(self):
current = self.tokens.current()
rule = self.table[125][current.getId()] if current else -1
tree = ParseTree( NonTerminal(244, self.nonterminals[244]))
tree.list = False
if current != None and (current.getId() in [27, 26]):
return tree
if current == None:
return tree
if rule == 337:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator()
tree.add( subtree )
return tree
elif current.getId() in [80, 89, 63]:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_init_declarator()
tree.add( subtree )
return tree
def parse__gen37(self):
current = self.tokens.current()
rule = self.table[126][current.getId()] if current else -1
tree = ParseTree( NonTerminal(245, self.nonterminals[245]))
tree.list = 'mlist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 205:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_pointer_sub()
tree.add( subtree )
subtree = self.parse__gen38()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__gen23(self):
current = self.tokens.current()
rule = self.table[127][current.getId()] if current else -1
tree = ParseTree( NonTerminal(246, self.nonterminals[246]))
tree.list = 'slist'
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 420:
tree.astTransform = AstTransformSubstitution(0)
subtree = self.parse_enumerator()
tree.add( subtree )
subtree = self.parse__gen24()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse_enum_specifier(self):
current = self.tokens.current()
rule = self.table[129][current.getId()] if current else -1
tree = ParseTree( NonTerminal(248, self.nonterminals[248]))
tree.list = False
if current == None:
raise SyntaxError('Error: unexpected end of file')
if rule == 20:
tree.astTransform = AstTransformSubstitution(0)
t = self.expect(37) # enum
tree.add(t)
subtree = self.parse_enum_specifier_sub()
tree.add( subtree )
return tree
raise SyntaxError('Error: Unexpected symbol (%s) when parsing %s' % (current, whoami()))
def parse__expr( self, rbp = 0):
name = '_expr'
if name not in self.expressionParsers:
self.expressionParsers[name] = c_ExpressionParser__expr(self)
return self.expressionParsers[name].parse(rbp)
def parse__expr_sans_comma( self, rbp = 0):
name = '_expr_sans_comma'
if name not in self.expressionParsers:
self.expressionParsers[name] = c_ExpressionParser__expr_sans_comma(self)
return self.expressionParsers[name].parse(rbp)
def parse__direct_declarator( self, rbp = 0):
name = '_direct_declarator'
if name not in self.expressionParsers:
self.expressionParsers[name] = c_ExpressionParser__direct_declarator(self)
return self.expressionParsers[name].parse(rbp)
def parse__direct_abstract_declarator( self, rbp = 0):
name = '_direct_abstract_declarator'
if name not in self.expressionParsers:
self.expressionParsers[name] = c_ExpressionParser__direct_abstract_declarator(self)
return self.expressionParsers[name].parse(rbp)
| 47.643737 | 540 | 0.533752 | 34,905 | 224,402 | 3.380891 | 0.022518 | 0.21649 | 0.303381 | 0.384239 | 0.85286 | 0.846632 | 0.840971 | 0.779171 | 0.730709 | 0.640081 | 0 | 0.151402 | 0.244178 | 224,402 | 4,709 | 541 | 47.653854 | 0.544379 | 0.011381 | 0 | 0.638547 | 0 | 0 | 0.063154 | 0.007881 | 0 | 0 | 0 | 0 | 0 | 1 | 0.036124 | false | 0 | 0.000425 | 0.00255 | 0.182108 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
2f1e4fa9ebbdfc6ee40d4a1ac111bd1b8e723543 | 3,095 | py | Python | dataloader.py | chengyupku/ml-zoomer | 8c90163f074ec2821f16dba6d3556d5ed8b0ade8 | [
"MIT"
] | null | null | null | dataloader.py | chengyupku/ml-zoomer | 8c90163f074ec2821f16dba6d3556d5ed8b0ade8 | [
"MIT"
] | null | null | null | dataloader.py | chengyupku/ml-zoomer | 8c90163f074ec2821f16dba6d3556d5ed8b0ade8 | [
"MIT"
] | null | null | null | import numpy as np
import random
import torch
from torch.utils.data import Dataset
class GRDataset(Dataset):
def __init__(self, data, m_query_list, m_user_list, q_movie_list, u_movie_list, movie_genre_list):
self.data = data
self.m_query_list = m_query_list
self.m_user_list = m_user_list
self.q_movie_list = q_movie_list
self.u_movie_list = u_movie_list
self.movie_genre_list = movie_genre_list
def __getitem__(self, index):
# print(self.data[1][0])
uid = self.data[index][0]
# print(uid)
mid = self.data[index][1]
# print(mid)
qid = self.data[index][2]
label = self.data[index][3]
m_query = self.m_query_list[mid]
m_user = self.m_user_list[mid]
q_movie = self.q_movie_list[qid]
u_movie = self.u_movie_list[uid]
mg = self.movie_genre_list[mid]
# u_mgenre = []
# for um in u_movie:
# u_mgenre.append(self.movie_genre_list[um[0]])
# q_mgenre = []
# for qm in q_movie:
# q_mgenre.append(self.movie_genre_list[qm[0]])
# u_items = self.u_items_list[uid]
# u_users = self.u_users_list[uid]
# u_users_items = self.u_users_items_list[uid]
# i_users = self.i_users_list[iid]
return (uid, mid, qid, label), m_query, m_user, q_movie, u_movie, mg
# return (uid, mid, qid, label), m_query, m_user, q_movie, u_movie, mg, u_mgenre, q_mgenre
# return (uid, iid, label), u_items, u_users, u_users_items, i_users
def __len__(self):
return len(self.data)
class GRDataset(Dataset):
def __init__(self, data, m_query_list, m_user_list, q_movie_list, u_movie_list, movie_genre_list):
self.data = data
self.m_query_list = m_query_list
self.m_user_list = m_user_list
self.q_movie_list = q_movie_list
self.u_movie_list = u_movie_list
self.movie_genre_list = movie_genre_list
def __getitem__(self, index):
# print(self.data[1][0])
uid = self.data[index][0]
# print(uid)
mid = self.data[index][1]
# print(mid)
qid = self.data[index][2]
label = self.data[index][3]
m_query = self.m_query_list[mid]
m_user = self.m_user_list[mid]
q_movie = self.q_movie_list[qid]
u_movie = self.u_movie_list[uid]
mg = self.movie_genre_list[mid]
u_mgenre = []
for um in u_movie:
u_mgenre.append(self.movie_genre_list[um[0]])
q_mgenre = []
for qm in q_movie:
q_mgenre.append(self.movie_genre_list[qm[0]])
# u_items = self.u_items_list[uid]
# u_users = self.u_users_list[uid]
# u_users_items = self.u_users_items_list[uid]
# i_users = self.i_users_list[iid]
return (uid, mid, qid, label), m_query, m_user, q_movie, u_movie, mg, u_mgenre, q_mgenre
# return (uid, iid, label), u_items, u_users, u_users_items, i_users
def __len__(self):
return len(self.data) | 35.574713 | 102 | 0.615186 | 482 | 3,095 | 3.564315 | 0.09751 | 0.074505 | 0.097788 | 0.083818 | 0.959837 | 0.959837 | 0.959837 | 0.959837 | 0.959837 | 0.959837 | 0 | 0.007152 | 0.277221 | 3,095 | 87 | 103 | 35.574713 | 0.76084 | 0.247496 | 0 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.115385 | false | 0 | 0.076923 | 0.038462 | 0.307692 | 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 |
85db15892a8b141a9483bc5bc9237ea962b0967b | 510,036 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_application_gateways_delete_request_initial(
resource_group_name: str,
application_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_application_gateways_get_request(
resource_group_name: str,
application_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_application_gateways_create_or_update_request_initial(
resource_group_name: str,
application_gateway_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_application_gateways_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_application_gateways_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_application_gateways_start_request_initial(
resource_group_name: str,
application_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
params=_query_parameters,
**kwargs
)
def build_application_gateways_stop_request_initial(
resource_group_name: str,
application_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"applicationGatewayName": _SERIALIZER.url("application_gateway_name", application_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
params=_query_parameters,
**kwargs
)
def build_check_dns_name_availability_request(
location: str,
subscription_id: str,
*,
domain_name_label: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") # pylint: disable=line-too-long
path_format_arguments = {
"location": _SERIALIZER.url("location", location, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if domain_name_label is not None:
_query_parameters['domainNameLabel'] = _SERIALIZER.query("domain_name_label", domain_name_label, 'str')
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuit_authorizations_delete_request_initial(
resource_group_name: str,
circuit_name: str,
authorization_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"authorizationName": _SERIALIZER.url("authorization_name", authorization_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_express_route_circuit_authorizations_get_request(
resource_group_name: str,
circuit_name: str,
authorization_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"authorizationName": _SERIALIZER.url("authorization_name", authorization_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuit_authorizations_create_or_update_request_initial(
resource_group_name: str,
circuit_name: str,
authorization_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"authorizationName": _SERIALIZER.url("authorization_name", authorization_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_express_route_circuit_authorizations_list_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuit_peerings_delete_request_initial(
resource_group_name: str,
circuit_name: str,
peering_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"peeringName": _SERIALIZER.url("peering_name", peering_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_express_route_circuit_peerings_get_request(
resource_group_name: str,
circuit_name: str,
peering_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"peeringName": _SERIALIZER.url("peering_name", peering_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuit_peerings_create_or_update_request_initial(
resource_group_name: str,
circuit_name: str,
peering_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"peeringName": _SERIALIZER.url("peering_name", peering_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_express_route_circuit_peerings_list_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_delete_request_initial(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_express_route_circuits_get_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_create_or_update_request_initial(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_express_route_circuits_list_arp_table_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_list_routes_table_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_list_stats_request(
resource_group_name: str,
circuit_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"circuitName": _SERIALIZER.url("circuit_name", circuit_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_circuits_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_express_route_service_providers_list_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_load_balancers_delete_request_initial(
resource_group_name: str,
load_balancer_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_load_balancers_get_request(
resource_group_name: str,
load_balancer_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_load_balancers_create_or_update_request_initial(
resource_group_name: str,
load_balancer_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_load_balancers_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_load_balancers_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_delete_request_initial(
resource_group_name: str,
network_interface_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_network_interfaces_get_request(
resource_group_name: str,
network_interface_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_create_or_update_request_initial(
resource_group_name: str,
network_interface_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_network_interfaces_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request(
resource_group_name: str,
virtual_machine_scale_set_name: str,
virtualmachine_index: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualMachineScaleSetName": _SERIALIZER.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'),
"virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request(
resource_group_name: str,
virtual_machine_scale_set_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualMachineScaleSetName": _SERIALIZER.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_interfaces_get_virtual_machine_scale_set_network_interface_request(
resource_group_name: str,
virtual_machine_scale_set_name: str,
virtualmachine_index: str,
network_interface_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualMachineScaleSetName": _SERIALIZER.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'),
"virtualmachineIndex": _SERIALIZER.url("virtualmachine_index", virtualmachine_index, 'str'),
"networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_security_groups_delete_request_initial(
resource_group_name: str,
network_security_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_network_security_groups_get_request(
resource_group_name: str,
network_security_group_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_security_groups_create_or_update_request_initial(
resource_group_name: str,
network_security_group_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_network_security_groups_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_network_security_groups_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_security_rules_delete_request_initial(
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_security_rules_get_request(
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_security_rules_create_or_update_request_initial(
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"securityRuleName": _SERIALIZER.url("security_rule_name", security_rule_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_security_rules_list_request(
resource_group_name: str,
network_security_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"networkSecurityGroupName": _SERIALIZER.url("network_security_group_name", network_security_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_public_ip_addresses_delete_request_initial(
resource_group_name: str,
public_ip_address_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_public_ip_addresses_get_request(
resource_group_name: str,
public_ip_address_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_public_ip_addresses_create_or_update_request_initial(
resource_group_name: str,
public_ip_address_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"publicIpAddressName": _SERIALIZER.url("public_ip_address_name", public_ip_address_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_public_ip_addresses_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_public_ip_addresses_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_route_tables_delete_request_initial(
resource_group_name: str,
route_table_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_route_tables_get_request(
resource_group_name: str,
route_table_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_route_tables_create_or_update_request_initial(
resource_group_name: str,
route_table_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_route_tables_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_route_tables_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_routes_delete_request_initial(
resource_group_name: str,
route_table_name: str,
route_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"routeName": _SERIALIZER.url("route_name", route_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_routes_get_request(
resource_group_name: str,
route_table_name: str,
route_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"routeName": _SERIALIZER.url("route_name", route_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_routes_create_or_update_request_initial(
resource_group_name: str,
route_table_name: str,
route_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"routeName": _SERIALIZER.url("route_name", route_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_routes_list_request(
resource_group_name: str,
route_table_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"routeTableName": _SERIALIZER.url("route_table_name", route_table_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_usages_list_request(
location: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") # pylint: disable=line-too-long
path_format_arguments = {
"location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_networks_delete_request_initial(
resource_group_name: str,
virtual_network_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_virtual_networks_get_request(
resource_group_name: str,
virtual_network_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_networks_create_or_update_request_initial(
resource_group_name: str,
virtual_network_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_networks_list_all_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_networks_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_subnets_delete_request_initial(
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subnetName": _SERIALIZER.url("subnet_name", subnet_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_subnets_get_request(
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
subscription_id: str,
*,
expand: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subnetName": _SERIALIZER.url("subnet_name", subnet_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if expand is not None:
_query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_subnets_create_or_update_request_initial(
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subnetName": _SERIALIZER.url("subnet_name", subnet_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_subnets_list_request(
resource_group_name: str,
virtual_network_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkName": _SERIALIZER.url("virtual_network_name", virtual_network_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_network_gateways_create_or_update_request_initial(
resource_group_name: str,
virtual_network_gateway_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayName": _SERIALIZER.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateways_get_request(
resource_group_name: str,
virtual_network_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayName": _SERIALIZER.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_network_gateways_delete_request_initial(
resource_group_name: str,
virtual_network_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayName": _SERIALIZER.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_virtual_network_gateways_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_network_gateways_reset_request_initial(
resource_group_name: str,
virtual_network_gateway_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayName": _SERIALIZER.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateways_generatevpnclientpackage_request_initial(
resource_group_name: str,
virtual_network_gateway_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayName": _SERIALIZER.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateway_connections_create_or_update_request_initial(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateway_connections_get_request(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_network_gateway_connections_delete_request_initial(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_virtual_network_gateway_connections_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_virtual_network_gateway_connections_reset_shared_key_request_initial(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateway_connections_set_shared_key_request_initial(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_virtual_network_gateway_connections_get_shared_key_request(
resource_group_name: str,
virtual_network_gateway_connection_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"virtualNetworkGatewayConnectionName": _SERIALIZER.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_local_network_gateways_create_or_update_request_initial(
resource_group_name: str,
local_network_gateway_name: str,
subscription_id: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"localNetworkGatewayName": _SERIALIZER.url("local_network_gateway_name", local_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
_header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
params=_query_parameters,
headers=_header_parameters,
json=json,
content=content,
**kwargs
)
def build_local_network_gateways_get_request(
resource_group_name: str,
local_network_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"localNetworkGatewayName": _SERIALIZER.url("local_network_gateway_name", local_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
def build_local_network_gateways_delete_request_initial(
resource_group_name: str,
local_network_gateway_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"localNetworkGatewayName": _SERIALIZER.url("local_network_gateway_name", local_network_gateway_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
params=_query_parameters,
**kwargs
)
def build_local_network_gateways_list_request(
resource_group_name: str,
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
accept = "application/json, text/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways") # pylint: disable=line-too-long
path_format_arguments = {
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
class ApplicationGatewaysOperations(object):
"""ApplicationGatewaysOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_application_gateways_delete_request_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified application gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> "_models.ApplicationGateway":
"""Gets the specified application gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ApplicationGateway, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_application_gateways_get_request(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ApplicationGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
application_gateway_name: str,
parameters: "_models.ApplicationGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.ApplicationGateway":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'ApplicationGateway')
request = build_application_gateways_create_or_update_request_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('ApplicationGateway', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('ApplicationGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
application_gateway_name: str,
parameters: "_models.ApplicationGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ApplicationGateway"]:
"""Creates or updates the specified application gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:param parameters: Parameters supplied to the create or update application gateway operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ApplicationGateway or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ApplicationGateway]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ApplicationGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.ApplicationGatewayListResult"]:
"""Lists all application gateways in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ApplicationGatewayListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_application_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_application_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.ApplicationGatewayListResult"]:
"""Gets all the application gateways in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ApplicationGatewayListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_application_gateways_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_application_gateways_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ApplicationGatewayListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways"} # type: ignore
def _start_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_application_gateways_start_request_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._start_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start"} # type: ignore
@distributed_trace
def begin_start( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Starts the specified application gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._start_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start"} # type: ignore
def _stop_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_application_gateways_stop_request_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._stop_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop"} # type: ignore
@distributed_trace
def begin_stop( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
application_gateway_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Stops the specified application gateway in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param application_gateway_name: The name of the application gateway.
:type application_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._stop_initial(
resource_group_name=resource_group_name,
application_gateway_name=application_gateway_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop"} # type: ignore
class NetworkManagementClientOperationsMixin(object):
@distributed_trace
def check_dns_name_availability(
self,
location: str,
domain_name_label: Optional[str] = None,
**kwargs: Any
) -> "_models.DnsNameAvailabilityResult":
"""Checks whether a domain name in the cloudapp.net zone is available for use.
:param location: The location of the domain name.
:type location: str
:param domain_name_label: The domain name to be verified. It must conform to the following
regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Default value is None.
:type domain_name_label: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DnsNameAvailabilityResult, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.DnsNameAvailabilityResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_check_dns_name_availability_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
domain_name_label=domain_name_label,
template_url=self.check_dns_name_availability.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DnsNameAvailabilityResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
check_dns_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability"} # type: ignore
class ExpressRouteCircuitAuthorizationsOperations(object):
"""ExpressRouteCircuitAuthorizationsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
authorization_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuit_authorizations_delete_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
authorization_name=authorization_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
authorization_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified authorization from the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param authorization_name: The name of the authorization.
:type authorization_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
authorization_name=authorization_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
circuit_name: str,
authorization_name: str,
**kwargs: Any
) -> "_models.ExpressRouteCircuitAuthorization":
"""Gets the specified authorization from the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param authorization_name: The name of the authorization.
:type authorization_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExpressRouteCircuitAuthorization, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuit_authorizations_get_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
authorization_name=authorization_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
circuit_name: str,
authorization_name: str,
authorization_parameters: "_models.ExpressRouteCircuitAuthorization",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.ExpressRouteCircuitAuthorization":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization')
request = build_express_route_circuit_authorizations_create_or_update_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
authorization_name=authorization_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
circuit_name: str,
authorization_name: str,
authorization_parameters: "_models.ExpressRouteCircuitAuthorization",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ExpressRouteCircuitAuthorization"]:
"""Creates or updates an authorization in the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param authorization_name: The name of the authorization.
:type authorization_name: str
:param authorization_parameters: Parameters supplied to the create or update express route
circuit authorization operation.
:type authorization_parameters:
~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
authorization_name=authorization_name,
authorization_parameters=authorization_parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> Iterable["_models.AuthorizationListResult"]:
"""Gets all authorizations in an express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AuthorizationListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.AuthorizationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuit_authorizations_list_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuit_authorizations_list_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("AuthorizationListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations"} # type: ignore
class ExpressRouteCircuitPeeringsOperations(object):
"""ExpressRouteCircuitPeeringsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
peering_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuit_peerings_delete_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
peering_name=peering_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
peering_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified peering from the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param peering_name: The name of the peering.
:type peering_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
peering_name=peering_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
circuit_name: str,
peering_name: str,
**kwargs: Any
) -> "_models.ExpressRouteCircuitPeering":
"""Gets the specified authorization from the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param peering_name: The name of the peering.
:type peering_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExpressRouteCircuitPeering, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuit_peerings_get_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
peering_name=peering_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
circuit_name: str,
peering_name: str,
peering_parameters: "_models.ExpressRouteCircuitPeering",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.ExpressRouteCircuitPeering":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering')
request = build_express_route_circuit_peerings_create_or_update_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
peering_name=peering_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
circuit_name: str,
peering_name: str,
peering_parameters: "_models.ExpressRouteCircuitPeering",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ExpressRouteCircuitPeering"]:
"""Creates or updates a peering in the specified express route circuits.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:param peering_name: The name of the peering.
:type peering_name: str
:param peering_parameters: Parameters supplied to the create or update express route circuit
peering operation.
:type peering_parameters: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result
of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
peering_name=peering_name,
peering_parameters=peering_parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"]:
"""Gets all peerings in a specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitPeeringListResult or the result
of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuit_peerings_list_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuit_peerings_list_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitPeeringListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings"} # type: ignore
class ExpressRouteCircuitsOperations(object):
"""ExpressRouteCircuitsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuits_delete_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the express route circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> "_models.ExpressRouteCircuit":
"""Gets information about the specified express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of express route circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExpressRouteCircuit, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_express_route_circuits_get_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
circuit_name: str,
parameters: "_models.ExpressRouteCircuit",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.ExpressRouteCircuit":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'ExpressRouteCircuit')
request = build_express_route_circuits_create_or_update_request_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
circuit_name: str,
parameters: "_models.ExpressRouteCircuit",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ExpressRouteCircuit"]:
"""Creates or updates an express route circuit.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the circuit.
:type circuit_name: str
:param parameters: Parameters supplied to the create or update express route circuit operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}"} # type: ignore
@distributed_trace
def list_arp_table(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitsArpTableListResult"]:
"""The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp
table associated with the ExpressRouteCircuits in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitsArpTableListResult or the
result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsArpTableListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuits_list_arp_table_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_arp_table.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuits_list_arp_table_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitsArpTableListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_arp_table.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable"} # type: ignore
@distributed_trace
def list_routes_table(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitsRoutesTableListResult"]:
"""The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised
routes table associated with the ExpressRouteCircuits in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the circuit.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitsRoutesTableListResult or the
result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsRoutesTableListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuits_list_routes_table_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_routes_table.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuits_list_routes_table_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitsRoutesTableListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_routes_table.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable"} # type: ignore
@distributed_trace
def list_stats(
self,
resource_group_name: str,
circuit_name: str,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitsStatsListResult"]:
"""The ListStats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits
in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param circuit_name: The name of the loadBalancer.
:type circuit_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitsStatsListResult or the result
of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsStatsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsStatsListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuits_list_stats_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_stats.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuits_list_stats_request(
resource_group_name=resource_group_name,
circuit_name=circuit_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitsStatsListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_stats.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitListResult"]:
"""Gets all the express route circuits in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuits_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuits_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.ExpressRouteCircuitListResult"]:
"""Gets all the express route circuits in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteCircuitListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_circuits_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_circuits_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteCircuitListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits"} # type: ignore
class ExpressRouteServiceProvidersOperations(object):
"""ExpressRouteServiceProvidersOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
@distributed_trace
def list(
self,
**kwargs: Any
) -> Iterable["_models.ExpressRouteServiceProviderListResult"]:
"""Gets all the available express route service providers.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ExpressRouteServiceProviderListResult or the
result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteServiceProviderListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_express_route_service_providers_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_express_route_service_providers_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("ExpressRouteServiceProviderListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders"} # type: ignore
class LoadBalancersOperations(object):
"""LoadBalancersOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
load_balancer_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_load_balancers_delete_request_initial(
resource_group_name=resource_group_name,
load_balancer_name=load_balancer_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
load_balancer_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified load balancer.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param load_balancer_name: The name of the load balancer.
:type load_balancer_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
load_balancer_name=load_balancer_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
load_balancer_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.LoadBalancer":
"""Gets the specified load balancer.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param load_balancer_name: The name of the load balancer.
:type load_balancer_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: LoadBalancer, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_load_balancers_get_request(
resource_group_name=resource_group_name,
load_balancer_name=load_balancer_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('LoadBalancer', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
load_balancer_name: str,
parameters: "_models.LoadBalancer",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.LoadBalancer":
cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'LoadBalancer')
request = build_load_balancers_create_or_update_request_initial(
resource_group_name=resource_group_name,
load_balancer_name=load_balancer_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('LoadBalancer', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('LoadBalancer', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
load_balancer_name: str,
parameters: "_models.LoadBalancer",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.LoadBalancer"]:
"""Creates or updates a load balancer.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param load_balancer_name: The name of the load balancer.
:type load_balancer_name: str
:param parameters: Parameters supplied to the create or update load balancer operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either LoadBalancer or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.LoadBalancer]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
load_balancer_name=load_balancer_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('LoadBalancer', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.LoadBalancerListResult"]:
"""Gets all the load balancers in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either LoadBalancerListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_load_balancers_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_load_balancers_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("LoadBalancerListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.LoadBalancerListResult"]:
"""Gets all the load balancers in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either LoadBalancerListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_load_balancers_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_load_balancers_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("LoadBalancerListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers"} # type: ignore
class NetworkInterfacesOperations(object):
"""NetworkInterfacesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_interface_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_network_interfaces_delete_request_initial(
resource_group_name=resource_group_name,
network_interface_name=network_interface_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_interface_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified network interface.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_interface_name: The name of the network interface.
:type network_interface_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
network_interface_name=network_interface_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
network_interface_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.NetworkInterface":
"""Gets information about the specified network interface.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_interface_name: The name of the network interface.
:type network_interface_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: NetworkInterface, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_network_interfaces_get_request(
resource_group_name=resource_group_name,
network_interface_name=network_interface_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('NetworkInterface', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
network_interface_name: str,
parameters: "_models.NetworkInterface",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.NetworkInterface":
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'NetworkInterface')
request = build_network_interfaces_create_or_update_request_initial(
resource_group_name=resource_group_name,
network_interface_name=network_interface_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('NetworkInterface', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('NetworkInterface', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
network_interface_name: str,
parameters: "_models.NetworkInterface",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.NetworkInterface"]:
"""Creates or updates a network interface.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_interface_name: The name of the network interface.
:type network_interface_name: str
:param parameters: Parameters supplied to the create or update network interface operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either NetworkInterface or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.NetworkInterface]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
network_interface_name=network_interface_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('NetworkInterface', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.NetworkInterfaceListResult"]:
"""Gets all network interfaces in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkInterfaceListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_interfaces_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_interfaces_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.NetworkInterfaceListResult"]:
"""Gets all network interfaces in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkInterfaceListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_interfaces_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_interfaces_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces"} # type: ignore
@distributed_trace
def list_virtual_machine_scale_set_vm_network_interfaces(
self,
resource_group_name: str,
virtual_machine_scale_set_name: str,
virtualmachine_index: str,
**kwargs: Any
) -> Iterable["_models.NetworkInterfaceListResult"]:
"""Gets information about all network interfaces in a virtual machine in a virtual machine scale
set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_machine_scale_set_name: The name of the virtual machine scale set.
:type virtual_machine_scale_set_name: str
:param virtualmachine_index: The virtual machine index.
:type virtualmachine_index: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkInterfaceListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request(
resource_group_name=resource_group_name,
virtual_machine_scale_set_name=virtual_machine_scale_set_name,
virtualmachine_index=virtualmachine_index,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_interfaces_list_virtual_machine_scale_set_vm_network_interfaces_request(
resource_group_name=resource_group_name,
virtual_machine_scale_set_name=virtual_machine_scale_set_name,
virtualmachine_index=virtualmachine_index,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces"} # type: ignore
@distributed_trace
def list_virtual_machine_scale_set_network_interfaces(
self,
resource_group_name: str,
virtual_machine_scale_set_name: str,
**kwargs: Any
) -> Iterable["_models.NetworkInterfaceListResult"]:
"""Gets all network interfaces in a virtual machine scale set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_machine_scale_set_name: The name of the virtual machine scale set.
:type virtual_machine_scale_set_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkInterfaceListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request(
resource_group_name=resource_group_name,
virtual_machine_scale_set_name=virtual_machine_scale_set_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_virtual_machine_scale_set_network_interfaces.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_interfaces_list_virtual_machine_scale_set_network_interfaces_request(
resource_group_name=resource_group_name,
virtual_machine_scale_set_name=virtual_machine_scale_set_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkInterfaceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_virtual_machine_scale_set_network_interfaces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces"} # type: ignore
@distributed_trace
def get_virtual_machine_scale_set_network_interface(
self,
resource_group_name: str,
virtual_machine_scale_set_name: str,
virtualmachine_index: str,
network_interface_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.NetworkInterface":
"""Get the specified network interface in a virtual machine scale set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_machine_scale_set_name: The name of the virtual machine scale set.
:type virtual_machine_scale_set_name: str
:param virtualmachine_index: The virtual machine index.
:type virtualmachine_index: str
:param network_interface_name: The name of the network interface.
:type network_interface_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: NetworkInterface, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_network_interfaces_get_virtual_machine_scale_set_network_interface_request(
resource_group_name=resource_group_name,
virtual_machine_scale_set_name=virtual_machine_scale_set_name,
virtualmachine_index=virtualmachine_index,
network_interface_name=network_interface_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get_virtual_machine_scale_set_network_interface.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('NetworkInterface', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_virtual_machine_scale_set_network_interface.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}"} # type: ignore
class NetworkSecurityGroupsOperations(object):
"""NetworkSecurityGroupsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_security_group_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_network_security_groups_delete_request_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_security_group_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified network security group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
network_security_group_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.NetworkSecurityGroup":
"""Gets the specified network security group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: NetworkSecurityGroup, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_network_security_groups_get_request(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
network_security_group_name: str,
parameters: "_models.NetworkSecurityGroup",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.NetworkSecurityGroup":
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'NetworkSecurityGroup')
request = build_network_security_groups_create_or_update_request_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
network_security_group_name: str,
parameters: "_models.NetworkSecurityGroup",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.NetworkSecurityGroup"]:
"""Creates or updates a network security group in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param parameters: Parameters supplied to the create or update network security group
operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.NetworkSecurityGroupListResult"]:
"""Gets all network security groups in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkSecurityGroupListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_security_groups_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_security_groups_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.NetworkSecurityGroupListResult"]:
"""Gets all network security groups in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NetworkSecurityGroupListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_network_security_groups_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_network_security_groups_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("NetworkSecurityGroupListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups"} # type: ignore
class SecurityRulesOperations(object):
"""SecurityRulesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_security_rules_delete_request_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
security_rule_name=security_rule_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified network security rule.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param security_rule_name: The name of the security rule.
:type security_rule_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
security_rule_name=security_rule_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
**kwargs: Any
) -> "_models.SecurityRule":
"""Get the specified network security rule.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param security_rule_name: The name of the security rule.
:type security_rule_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityRule, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.SecurityRule
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_security_rules_get_request(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
security_rule_name=security_rule_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('SecurityRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
security_rule_parameters: "_models.SecurityRule",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.SecurityRule":
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(security_rule_parameters, 'SecurityRule')
request = build_security_rules_create_or_update_request_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
security_rule_name=security_rule_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('SecurityRule', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('SecurityRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
network_security_group_name: str,
security_rule_name: str,
security_rule_parameters: "_models.SecurityRule",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.SecurityRule"]:
"""Creates or updates a security rule in the specified network security group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param security_rule_name: The name of the security rule.
:type security_rule_name: str
:param security_rule_parameters: Parameters supplied to the create or update network security
rule operation.
:type security_rule_parameters: ~azure.mgmt.network.v2015_06_15.models.SecurityRule
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either SecurityRule or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.SecurityRule]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
security_rule_name=security_rule_name,
security_rule_parameters=security_rule_parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('SecurityRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
network_security_group_name: str,
**kwargs: Any
) -> Iterable["_models.SecurityRuleListResult"]:
"""Gets all security rules in a network security group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SecurityRuleListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.SecurityRuleListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_security_rules_list_request(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_security_rules_list_request(
resource_group_name=resource_group_name,
network_security_group_name=network_security_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("SecurityRuleListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules"} # type: ignore
class PublicIPAddressesOperations(object):
"""PublicIPAddressesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
public_ip_address_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_public_ip_addresses_delete_request_initial(
resource_group_name=resource_group_name,
public_ip_address_name=public_ip_address_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
public_ip_address_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified public IP address.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param public_ip_address_name: The name of the subnet.
:type public_ip_address_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
public_ip_address_name=public_ip_address_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
public_ip_address_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.PublicIPAddress":
"""Gets the specified public IP address in a specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param public_ip_address_name: The name of the subnet.
:type public_ip_address_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: PublicIPAddress, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_public_ip_addresses_get_request(
resource_group_name=resource_group_name,
public_ip_address_name=public_ip_address_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('PublicIPAddress', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
public_ip_address_name: str,
parameters: "_models.PublicIPAddress",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.PublicIPAddress":
cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'PublicIPAddress')
request = build_public_ip_addresses_create_or_update_request_initial(
resource_group_name=resource_group_name,
public_ip_address_name=public_ip_address_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('PublicIPAddress', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('PublicIPAddress', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
public_ip_address_name: str,
parameters: "_models.PublicIPAddress",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.PublicIPAddress"]:
"""Creates or updates a static or dynamic public IP address.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param public_ip_address_name: The name of the public IP address.
:type public_ip_address_name: str
:param parameters: Parameters supplied to the create or update public IP address operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either PublicIPAddress or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.PublicIPAddress]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
public_ip_address_name=public_ip_address_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('PublicIPAddress', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.PublicIPAddressListResult"]:
"""Gets all the public IP addresses in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PublicIPAddressListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_public_ip_addresses_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_public_ip_addresses_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.PublicIPAddressListResult"]:
"""Gets all public IP addresses in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PublicIPAddressListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_public_ip_addresses_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_public_ip_addresses_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PublicIPAddressListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses"} # type: ignore
class RouteTablesOperations(object):
"""RouteTablesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
route_table_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_route_tables_delete_request_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
route_table_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
route_table_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.RouteTable":
"""Gets the specified route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RouteTable, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.RouteTable
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_route_tables_get_request(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('RouteTable', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
route_table_name: str,
parameters: "_models.RouteTable",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.RouteTable":
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'RouteTable')
request = build_route_tables_create_or_update_request_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('RouteTable', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('RouteTable', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
route_table_name: str,
parameters: "_models.RouteTable",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.RouteTable"]:
"""Create or updates a route table in a specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param parameters: Parameters supplied to the create or update route table operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.RouteTable
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either RouteTable or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.RouteTable]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('RouteTable', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.RouteTableListResult"]:
"""Gets all route tables in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteTableListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_route_tables_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_route_tables_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("RouteTableListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.RouteTableListResult"]:
"""Gets all route tables in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteTableListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_route_tables_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_route_tables_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("RouteTableListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables"} # type: ignore
class RoutesOperations(object):
"""RoutesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_routes_delete_request_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified route from a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs: Any
) -> "_models.Route":
"""Gets the specified route from a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Route, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.Route
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_routes_get_request(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
route_parameters: "_models.Route",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.Route":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(route_parameters, 'Route')
request = build_routes_create_or_update_request_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Route', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
route_parameters: "_models.Route",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.Route"]:
"""Creates or updates a route in the specified route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:param route_parameters: Parameters supplied to the create or update route operation.
:type route_parameters: ~azure.mgmt.network.v2015_06_15.models.Route
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Route or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.Route]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
route_parameters=route_parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
route_table_name: str,
**kwargs: Any
) -> Iterable["_models.RouteListResult"]:
"""Gets all routes in a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_routes_list_request(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_routes_list_request(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("RouteListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes"} # type: ignore
class UsagesOperations(object):
"""UsagesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
@distributed_trace
def list(
self,
location: str,
**kwargs: Any
) -> Iterable["_models.UsagesListResult"]:
"""Lists compute usages for a subscription.
:param location: The location where resource usage is queried.
:type location: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsagesListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.UsagesListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_usages_list_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_usages_list_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("UsagesListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages"} # type: ignore
class VirtualNetworksOperations(object):
"""VirtualNetworksOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_networks_delete_request_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified virtual network.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
virtual_network_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.VirtualNetwork":
"""Gets the specified virtual network by resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: VirtualNetwork, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_networks_get_request(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('VirtualNetwork', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
virtual_network_name: str,
parameters: "_models.VirtualNetwork",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.VirtualNetwork":
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'VirtualNetwork')
request = build_virtual_networks_create_or_update_request_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('VirtualNetwork', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('VirtualNetwork', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
virtual_network_name: str,
parameters: "_models.VirtualNetwork",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.VirtualNetwork"]:
"""Creates or updates a virtual network in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:param parameters: Parameters supplied to the create or update virtual network operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either VirtualNetwork or the result of
cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetwork]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('VirtualNetwork', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"} # type: ignore
@distributed_trace
def list_all(
self,
**kwargs: Any
) -> Iterable["_models.VirtualNetworkListResult"]:
"""Gets all virtual networks in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either VirtualNetworkListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_virtual_networks_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_all.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_virtual_networks_list_all_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.VirtualNetworkListResult"]:
"""Gets all virtual networks in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either VirtualNetworkListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_virtual_networks_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_virtual_networks_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("VirtualNetworkListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks"} # type: ignore
class SubnetsOperations(object):
"""SubnetsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_subnets_delete_request_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subnet_name=subnet_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified subnet.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:param subnet_name: The name of the subnet.
:type subnet_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subnet_name=subnet_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
expand: Optional[str] = None,
**kwargs: Any
) -> "_models.Subnet":
"""Gets the specified subnet by virtual network and resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:param subnet_name: The name of the subnet.
:type subnet_name: str
:param expand: Expands referenced resources. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Subnet, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.Subnet
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_subnets_get_request(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subnet_name=subnet_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
expand=expand,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Subnet', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"} # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
subnet_parameters: "_models.Subnet",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.Subnet":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(subnet_parameters, 'Subnet')
request = build_subnets_create_or_update_request_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subnet_name=subnet_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Subnet', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Subnet', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
virtual_network_name: str,
subnet_name: str,
subnet_parameters: "_models.Subnet",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.Subnet"]:
"""Creates or updates a subnet in the specified virtual network.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:param subnet_name: The name of the subnet.
:type subnet_name: str
:param subnet_parameters: Parameters supplied to the create or update subnet operation.
:type subnet_parameters: ~azure.mgmt.network.v2015_06_15.models.Subnet
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either Subnet or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.Subnet]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subnet_name=subnet_name,
subnet_parameters=subnet_parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('Subnet', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
virtual_network_name: str,
**kwargs: Any
) -> Iterable["_models.SubnetListResult"]:
"""Gets all subnets in a virtual network.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_name: The name of the virtual network.
:type virtual_network_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SubnetListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.SubnetListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_subnets_list_request(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_subnets_list_request(
resource_group_name=resource_group_name,
virtual_network_name=virtual_network_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("SubnetListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets"} # type: ignore
class VirtualNetworkGatewaysOperations(object):
"""VirtualNetworkGatewaysOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _create_or_update_initial(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VirtualNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.VirtualNetworkGateway":
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'VirtualNetworkGateway')
request = build_virtual_network_gateways_create_or_update_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VirtualNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.VirtualNetworkGateway"]:
"""Creates or updates a virtual network gateway in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network gateway.
:type virtual_network_gateway_name: str
:param parameters: Parameters supplied to create or update virtual network gateway operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
**kwargs: Any
) -> "_models.VirtualNetworkGateway":
"""Gets the specified virtual network gateway by resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network gateway.
:type virtual_network_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: VirtualNetworkGateway, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_network_gateways_get_request(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}"} # type: ignore
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_gateway_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_network_gateways_delete_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_gateway_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified virtual network gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network gateway.
:type virtual_network_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.VirtualNetworkGatewayListResult"]:
"""Gets all virtual network gateways by resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either VirtualNetworkGatewayListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_virtual_network_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_virtual_network_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("VirtualNetworkGatewayListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways"} # type: ignore
def _reset_initial(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VirtualNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> Optional["_models.VirtualNetworkGateway"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'VirtualNetworkGateway')
request = build_virtual_network_gateways_reset_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._reset_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_reset_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset"} # type: ignore
@distributed_trace
def begin_reset(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VirtualNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.VirtualNetworkGateway"]:
"""Resets the primary of the virtual network gateway in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network gateway.
:type virtual_network_gateway_name: str
:param parameters: Virtual network gateway vip address supplied to the begin reset of the
active-active feature enabled gateway.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._reset_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_reset.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset"} # type: ignore
def _generatevpnclientpackage_initial(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VpnClientParameters",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> str:
cls = kwargs.pop('cls', None) # type: ClsType[str]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'VpnClientParameters')
request = build_virtual_network_gateways_generatevpnclientpackage_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._generatevpnclientpackage_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('str', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_generatevpnclientpackage_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage"} # type: ignore
@distributed_trace
def begin_generatevpnclientpackage(
self,
resource_group_name: str,
virtual_network_gateway_name: str,
parameters: "_models.VpnClientParameters",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller[str]:
"""Generates VPN client package for P2S client of the virtual network gateway in the specified
resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_name: The name of the virtual network gateway.
:type virtual_network_gateway_name: str
:param parameters: Parameters supplied to the generate virtual network gateway VPN client
package operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.VpnClientParameters
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either str or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[str]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[str]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._generatevpnclientpackage_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_name=virtual_network_gateway_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('str', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_generatevpnclientpackage.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage"} # type: ignore
class VirtualNetworkGatewayConnectionsOperations(object):
"""VirtualNetworkGatewayConnectionsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _create_or_update_initial(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.VirtualNetworkGatewayConnection",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.VirtualNetworkGatewayConnection":
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection')
request = build_virtual_network_gateway_connections_create_or_update_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.VirtualNetworkGatewayConnection",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.VirtualNetworkGatewayConnection"]:
"""Creates or updates a virtual network gateway connection in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The name of the virtual network gateway
connection.
:type virtual_network_gateway_connection_name: str
:param parameters: Parameters supplied to the create or update virtual network gateway
connection operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
**kwargs: Any
) -> "_models.VirtualNetworkGatewayConnection":
"""Gets the specified virtual network gateway connection by resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The name of the virtual network gateway
connection.
:type virtual_network_gateway_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: VirtualNetworkGatewayConnection, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_network_gateway_connections_get_request(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"} # type: ignore
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_network_gateway_connections_delete_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified virtual network Gateway connection.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The name of the virtual network gateway
connection.
:type virtual_network_gateway_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"]:
"""The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways
connections created.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either VirtualNetworkGatewayConnectionListResult or the
result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnectionListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_virtual_network_gateway_connections_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_virtual_network_gateway_connections_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("VirtualNetworkGatewayConnectionListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections"} # type: ignore
def _reset_shared_key_initial(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.ConnectionResetSharedKey",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> Optional["_models.ConnectionResetSharedKey"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'ConnectionResetSharedKey')
request = build_virtual_network_gateway_connections_reset_shared_key_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._reset_shared_key_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_reset_shared_key_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset"} # type: ignore
@distributed_trace
def begin_reset_shared_key(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.ConnectionResetSharedKey",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ConnectionResetSharedKey"]:
"""The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway
connection shared key for passed virtual network gateway connection in the specified resource
group through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The virtual network gateway connection reset
shared key Name.
:type virtual_network_gateway_connection_name: str
:param parameters: Parameters supplied to the begin reset virtual network gateway connection
shared key operation through network resource provider.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._reset_shared_key_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_reset_shared_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset"} # type: ignore
def _set_shared_key_initial(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.ConnectionSharedKey",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.ConnectionSharedKey":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'ConnectionSharedKey')
request = build_virtual_network_gateway_connections_set_shared_key_request_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._set_shared_key_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('ConnectionSharedKey', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('ConnectionSharedKey', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_set_shared_key_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"} # type: ignore
@distributed_trace
def begin_set_shared_key(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
parameters: "_models.ConnectionSharedKey",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.ConnectionSharedKey"]:
"""The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway
connection shared key for passed virtual network gateway connection in the specified resource
group through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The virtual network gateway connection name.
:type virtual_network_gateway_connection_name: str
:param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection
Shared key operation throughNetwork resource provider.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either ConnectionSharedKey or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._set_shared_key_initial(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ConnectionSharedKey', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_set_shared_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"} # type: ignore
@distributed_trace
def get_shared_key(
self,
resource_group_name: str,
virtual_network_gateway_connection_name: str,
**kwargs: Any
) -> "_models.ConnectionSharedKeyResult":
"""The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the
specified virtual network gateway connection shared key through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The virtual network gateway connection shared
key name.
:type virtual_network_gateway_connection_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ConnectionSharedKeyResult, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKeyResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_virtual_network_gateway_connections_get_shared_key_request(
resource_group_name=resource_group_name,
virtual_network_gateway_connection_name=virtual_network_gateway_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get_shared_key.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ConnectionSharedKeyResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_shared_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"} # type: ignore
class LocalNetworkGatewaysOperations(object):
"""LocalNetworkGatewaysOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2015_06_15.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _create_or_update_initial(
self,
resource_group_name: str,
local_network_gateway_name: str,
parameters: "_models.LocalNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> "_models.LocalNetworkGateway":
cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
_json = self._serialize.body(parameters, 'LocalNetworkGateway')
request = build_local_network_gateways_create_or_update_request_initial(
resource_group_name=resource_group_name,
local_network_gateway_name=local_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('LocalNetworkGateway', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('LocalNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"} # type: ignore
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
local_network_gateway_name: str,
parameters: "_models.LocalNetworkGateway",
*,
content_type: Optional[str] = "application/json",
**kwargs: Any
) -> LROPoller["_models.LocalNetworkGateway"]:
"""Creates or updates a local network gateway in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param local_network_gateway_name: The name of the local network gateway.
:type local_network_gateway_name: str
:param parameters: Parameters supplied to the create or update local network gateway operation.
:type parameters: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway
:keyword content_type: Media type of the body sent to the API. Possible values are:
"application/json" or "text/json". Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either LocalNetworkGateway or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
local_network_gateway_name=local_network_gateway_name,
parameters=parameters,
content_type=content_type,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('LocalNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"} # type: ignore
@distributed_trace
def get(
self,
resource_group_name: str,
local_network_gateway_name: str,
**kwargs: Any
) -> "_models.LocalNetworkGateway":
"""Gets the specified local network gateway in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param local_network_gateway_name: The name of the local network gateway.
:type local_network_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: LocalNetworkGateway, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_local_network_gateways_get_request(
resource_group_name=resource_group_name,
local_network_gateway_name=local_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('LocalNetworkGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"} # type: ignore
def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
local_network_gateway_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
request = build_local_network_gateways_delete_request_initial(
resource_group_name=resource_group_name,
local_network_gateway_name=local_network_gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"} # type: ignore
@distributed_trace
def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
local_network_gateway_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Deletes the specified local network gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param local_network_gateway_name: The name of the local network gateway.
:type local_network_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
operation to not poll, or pass in your own initialized polling object for a personal polling
strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
local_network_gateway_name=local_network_gateway_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"} # type: ignore
@distributed_trace
def list(
self,
resource_group_name: str,
**kwargs: Any
) -> Iterable["_models.LocalNetworkGatewayListResult"]:
"""Gets all the local network gateways in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either LocalNetworkGatewayListResult or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_local_network_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_local_network_gateways_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("LocalNetworkGatewayListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways"} # type: ignore
| 43.142954 | 316 | 0.667796 | 54,185 | 510,036 | 6.014487 | 0.009191 | 0.030869 | 0.040271 | 0.021234 | 0.973992 | 0.972359 | 0.970251 | 0.966649 | 0.963945 | 0.957526 | 0 | 0.010076 | 0.241107 | 510,036 | 11,821 | 317 | 43.146604 | 0.831893 | 0.216812 | 0 | 0.866412 | 0 | 0.005797 | 0.160372 | 0.091514 | 0 | 0 | 0 | 0 | 0 | 1 | 0.044776 | false | 0 | 0.001604 | 0 | 0.105464 | 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 |
c8015eddc27b72082b09a215d9bcb3522b92b0c9 | 270 | py | Python | src/ite/algs/__init__.py | bcebere/ite-api | f01ea235a92bd70e16c776b4ce2ce920ca91fbc0 | [
"Apache-2.0"
] | 1 | 2022-02-15T09:13:45.000Z | 2022-02-15T09:13:45.000Z | src/ite/algs/__init__.py | bcebere/ite-api | f01ea235a92bd70e16c776b4ce2ce920ca91fbc0 | [
"Apache-2.0"
] | null | null | null | src/ite/algs/__init__.py | bcebere/ite-api | f01ea235a92bd70e16c776b4ce2ce920ca91fbc0 | [
"Apache-2.0"
] | 1 | 2021-11-27T12:55:51.000Z | 2021-11-27T12:55:51.000Z | # ite absolute
import ite.algs.causal_multitask_gaussian_processes # noqa: F401,E402
import ite.algs.ganite # noqa: F401,E402
import ite.algs.ganite_torch # noqa: F401,E402
import ite.algs.hyperparam_tuning # noqa: F401,E402
import ite.algs.model # noqa: F401,E402
| 38.571429 | 70 | 0.781481 | 42 | 270 | 4.904762 | 0.380952 | 0.218447 | 0.315534 | 0.349515 | 0.543689 | 0.543689 | 0.300971 | 0 | 0 | 0 | 0 | 0.126582 | 0.122222 | 270 | 6 | 71 | 45 | 0.742616 | 0.340741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
c855e59e3beb387ead12ed11087e5f17130c65a2 | 295 | py | Python | CodonSubstitution/build/biopython/Tests/test_IsoelectricPoint.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 3 | 2017-10-23T21:53:57.000Z | 2019-09-23T05:14:12.000Z | CodonSubstitution/build/biopython/Tests/test_IsoelectricPoint.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | null | null | null | CodonSubstitution/build/biopython/Tests/test_IsoelectricPoint.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 6 | 2020-02-26T16:34:20.000Z | 2020-03-04T15:34:00.000Z | from Bio.SeqUtils import ProtParam
X = ProtParam.ProteinAnalysis("MAEGEITTFTALTEKFNLPPGNYKKPKLLYCSNGGHFLRILPDGTVDGTRDRSDQHIQLQLSAESVGEVYIKSTETGQYLAMDTSGLLYGSQTPSEECLFLERLEENHYNTYTSKKHAEKNWFVGLKKNGSCKRGPRTHYGQKAILFLPLPV")
print "isoelectric point for this protein: %.3f" % X.isoelectric_point()
| 59 | 185 | 0.888136 | 19 | 295 | 13.736842 | 0.789474 | 0.122605 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003597 | 0.057627 | 295 | 4 | 186 | 73.75 | 0.935252 | 0 | 0 | 0 | 0 | 0 | 0.650847 | 0.515254 | 0 | 1 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0.333333 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 8 |
c0c904fd541e0d487da85a649cd84853672e0c16 | 25 | py | Python | bugtests/test088p/foobase.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null | bugtests/test088p/foobase.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null | bugtests/test088p/foobase.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null | def doit(): return "Done" | 25 | 25 | 0.68 | 4 | 25 | 4.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 25 | 1 | 25 | 25 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | true | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 7 |
23e4b229354fb027a98f3371b035e4738247eb2c | 39 | py | Python | cms/test_utils/project/brokenpluginapp/cms_plugins.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | 5,659 | 2015-01-01T02:42:30.000Z | 2020-10-07T02:38:29.000Z | cms/test_utils/project/brokenpluginapp/cms_plugins.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 3,264 | 2015-01-02T10:11:48.000Z | 2020-10-08T13:15:07.000Z | cms/test_utils/project/brokenpluginapp/cms_plugins.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 2,132 | 2015-01-01T11:28:21.000Z | 2020-10-06T09:09:11.000Z | import nonexistingmodule # nopyflakes
| 19.5 | 38 | 0.846154 | 3 | 39 | 11 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128205 | 39 | 1 | 39 | 39 | 0.970588 | 0.25641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
9b1e0ae1a2019d3e1758a8b6dbde9c9472873a1a | 111,457 | py | Python | spinnaker_swagger_client/api/managed_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | spinnaker_swagger_client/api/managed_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | spinnaker_swagger_client/api/managed_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | 2 | 2019-10-17T07:49:21.000Z | 2021-08-10T23:12:41.000Z | # coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
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 spinnaker_swagger_client.api_client import ApiClient
class ManagedControllerApi(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 create_pin_using_post(self, application, pin, **kwargs): # noqa: E501
"""Create a pin for an artifact in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_pin_using_post(application, pin, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param EnvironmentArtifactPin pin: pin (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.create_pin_using_post_with_http_info(application, pin, **kwargs) # noqa: E501
else:
(data) = self.create_pin_using_post_with_http_info(application, pin, **kwargs) # noqa: E501
return data
def create_pin_using_post_with_http_info(self, application, pin, **kwargs): # noqa: E501
"""Create a pin for an artifact in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_pin_using_post_with_http_info(application, pin, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param EnvironmentArtifactPin pin: pin (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'pin'] # 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 create_pin_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `create_pin_using_post`") # noqa: E501
# verify the required parameter 'pin' is set
if ('pin' not in params or
params['pin'] is None):
raise ValueError("Missing the required parameter `pin` when calling `create_pin_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'pin' in params:
body_params = params['pin']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # 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 = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/pin', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 delete_manifest_by_app_using_delete(self, application, **kwargs): # noqa: E501
"""Delete a delivery config manifest for an application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_manifest_by_app_using_delete(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.delete_manifest_by_app_using_delete_with_http_info(application, **kwargs) # noqa: E501
else:
(data) = self.delete_manifest_by_app_using_delete_with_http_info(application, **kwargs) # noqa: E501
return data
def delete_manifest_by_app_using_delete_with_http_info(self, application, **kwargs): # noqa: E501
"""Delete a delivery config manifest for an application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_manifest_by_app_using_delete_with_http_info(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application'] # 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 delete_manifest_by_app_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `delete_manifest_by_app_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/config', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 delete_manifest_using_delete(self, name, **kwargs): # noqa: E501
"""Delete a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_manifest_using_delete(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.delete_manifest_using_delete_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.delete_manifest_using_delete_with_http_info(name, **kwargs) # noqa: E501
return data
def delete_manifest_using_delete_with_http_info(self, name, **kwargs): # noqa: E501
"""Delete a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_manifest_using_delete_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # 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 delete_manifest_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `delete_manifest_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/{name}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 delete_pin_using_delete(self, application, target_environment, **kwargs): # noqa: E501
"""Unpin one or more artifact(s) in an environment. If the `reference` parameter is specified, only the corresponding artifact will be unpinned. If it's omitted, all pinned artifacts in the environment will be unpinned. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pin_using_delete(application, target_environment, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str target_environment: targetEnvironment (required)
:param str reference: reference
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.delete_pin_using_delete_with_http_info(application, target_environment, **kwargs) # noqa: E501
else:
(data) = self.delete_pin_using_delete_with_http_info(application, target_environment, **kwargs) # noqa: E501
return data
def delete_pin_using_delete_with_http_info(self, application, target_environment, **kwargs): # noqa: E501
"""Unpin one or more artifact(s) in an environment. If the `reference` parameter is specified, only the corresponding artifact will be unpinned. If it's omitted, all pinned artifacts in the environment will be unpinned. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_pin_using_delete_with_http_info(application, target_environment, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str target_environment: targetEnvironment (required)
:param str reference: reference
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'target_environment', 'reference'] # 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 delete_pin_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `delete_pin_using_delete`") # noqa: E501
# verify the required parameter 'target_environment' is set
if ('target_environment' not in params or
params['target_environment'] is None):
raise ValueError("Missing the required parameter `target_environment` when calling `delete_pin_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
if 'target_environment' in params:
path_params['targetEnvironment'] = params['target_environment'] # noqa: E501
query_params = []
if 'reference' in params:
query_params.append(('reference', params['reference'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/pin/{targetEnvironment}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 delete_veto_using_delete(self, application, reference, target_environment, version, **kwargs): # noqa: E501
"""Remove veto of an artifact version in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_veto_using_delete(application, reference, target_environment, version, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str reference: reference (required)
:param str target_environment: targetEnvironment (required)
:param str version: version (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.delete_veto_using_delete_with_http_info(application, reference, target_environment, version, **kwargs) # noqa: E501
else:
(data) = self.delete_veto_using_delete_with_http_info(application, reference, target_environment, version, **kwargs) # noqa: E501
return data
def delete_veto_using_delete_with_http_info(self, application, reference, target_environment, version, **kwargs): # noqa: E501
"""Remove veto of an artifact version in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_veto_using_delete_with_http_info(application, reference, target_environment, version, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str reference: reference (required)
:param str target_environment: targetEnvironment (required)
:param str version: version (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'reference', 'target_environment', 'version'] # 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 delete_veto_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `delete_veto_using_delete`") # noqa: E501
# verify the required parameter 'reference' is set
if ('reference' not in params or
params['reference'] is None):
raise ValueError("Missing the required parameter `reference` when calling `delete_veto_using_delete`") # noqa: E501
# verify the required parameter 'target_environment' is set
if ('target_environment' not in params or
params['target_environment'] is None):
raise ValueError("Missing the required parameter `target_environment` when calling `delete_veto_using_delete`") # noqa: E501
# verify the required parameter 'version' is set
if ('version' not in params or
params['version'] is None):
raise ValueError("Missing the required parameter `version` when calling `delete_veto_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
if 'reference' in params:
path_params['reference'] = params['reference'] # noqa: E501
if 'target_environment' in params:
path_params['targetEnvironment'] = params['target_environment'] # noqa: E501
if 'version' in params:
path_params['version'] = params['version'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/veto/{targetEnvironment}/{reference}/{version}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 diff_manifest_using_post(self, manifest, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.diff_manifest_using_post(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (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.diff_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
else:
(data) = self.diff_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
return data
def diff_manifest_using_post_with_http_info(self, manifest, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.diff_manifest_using_post_with_http_info(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['manifest'] # 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 diff_manifest_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'manifest' is set
if ('manifest' not in params or
params['manifest'] is None):
raise ValueError("Missing the required parameter `manifest` when calling `diff_manifest_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'manifest' in params:
body_params = params['manifest']
# 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', 'application/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/diff', '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 diff_resource_using_post(self, resource, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.diff_resource_using_post(resource, async_req=True)
>>> result = thread.get()
:param async_req bool
:param Resource resource: resource (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.diff_resource_using_post_with_http_info(resource, **kwargs) # noqa: E501
else:
(data) = self.diff_resource_using_post_with_http_info(resource, **kwargs) # noqa: E501
return data
def diff_resource_using_post_with_http_info(self, resource, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.diff_resource_using_post_with_http_info(resource, async_req=True)
>>> result = thread.get()
:param async_req bool
:param Resource resource: resource (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource'] # 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 diff_resource_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource' is set
if ('resource' not in params or
params['resource'] is None):
raise ValueError("Missing the required parameter `resource` when calling `diff_resource_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'resource' in params:
body_params = params['resource']
# 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', 'application/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/diff', '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 export_resource_using_get(self, account, cloud_provider, cluster_name, **kwargs): # noqa: E501
"""Generates an artifact definition based on the artifact used in a running cluster # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.export_resource_using_get(account, cloud_provider, cluster_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str account: account (required)
:param str cloud_provider: cloudProvider (required)
:param str cluster_name: clusterName (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.export_resource_using_get_with_http_info(account, cloud_provider, cluster_name, **kwargs) # noqa: E501
else:
(data) = self.export_resource_using_get_with_http_info(account, cloud_provider, cluster_name, **kwargs) # noqa: E501
return data
def export_resource_using_get_with_http_info(self, account, cloud_provider, cluster_name, **kwargs): # noqa: E501
"""Generates an artifact definition based on the artifact used in a running cluster # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.export_resource_using_get_with_http_info(account, cloud_provider, cluster_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str account: account (required)
:param str cloud_provider: cloudProvider (required)
:param str cluster_name: clusterName (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['account', 'cloud_provider', 'cluster_name'] # 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 export_resource_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'account' is set
if ('account' not in params or
params['account'] is None):
raise ValueError("Missing the required parameter `account` when calling `export_resource_using_get`") # noqa: E501
# verify the required parameter 'cloud_provider' is set
if ('cloud_provider' not in params or
params['cloud_provider'] is None):
raise ValueError("Missing the required parameter `cloud_provider` when calling `export_resource_using_get`") # noqa: E501
# verify the required parameter 'cluster_name' is set
if ('cluster_name' not in params or
params['cluster_name'] is None):
raise ValueError("Missing the required parameter `cluster_name` when calling `export_resource_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'account' in params:
path_params['account'] = params['account'] # noqa: E501
if 'cloud_provider' in params:
path_params['cloudProvider'] = params['cloud_provider'] # noqa: E501
if 'cluster_name' in params:
path_params['clusterName'] = params['cluster_name'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/export/artifact/{cloudProvider}/{account}/{clusterName}', 'GET',
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 export_resource_using_get1(self, account, cloud_provider, name, service_account, type, **kwargs): # noqa: E501
"""Generate a keel resource definition for a deployed cloud resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.export_resource_using_get1(account, cloud_provider, name, service_account, type, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str account: account (required)
:param str cloud_provider: cloudProvider (required)
:param str name: name (required)
:param str service_account: serviceAccount (required)
:param str type: type (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.export_resource_using_get1_with_http_info(account, cloud_provider, name, service_account, type, **kwargs) # noqa: E501
else:
(data) = self.export_resource_using_get1_with_http_info(account, cloud_provider, name, service_account, type, **kwargs) # noqa: E501
return data
def export_resource_using_get1_with_http_info(self, account, cloud_provider, name, service_account, type, **kwargs): # noqa: E501
"""Generate a keel resource definition for a deployed cloud resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.export_resource_using_get1_with_http_info(account, cloud_provider, name, service_account, type, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str account: account (required)
:param str cloud_provider: cloudProvider (required)
:param str name: name (required)
:param str service_account: serviceAccount (required)
:param str type: type (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['account', 'cloud_provider', 'name', 'service_account', 'type'] # 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 export_resource_using_get1" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'account' is set
if ('account' not in params or
params['account'] is None):
raise ValueError("Missing the required parameter `account` when calling `export_resource_using_get1`") # noqa: E501
# verify the required parameter 'cloud_provider' is set
if ('cloud_provider' not in params or
params['cloud_provider'] is None):
raise ValueError("Missing the required parameter `cloud_provider` when calling `export_resource_using_get1`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `export_resource_using_get1`") # noqa: E501
# verify the required parameter 'service_account' is set
if ('service_account' not in params or
params['service_account'] is None):
raise ValueError("Missing the required parameter `service_account` when calling `export_resource_using_get1`") # noqa: E501
# verify the required parameter 'type' is set
if ('type' not in params or
params['type'] is None):
raise ValueError("Missing the required parameter `type` when calling `export_resource_using_get1`") # noqa: E501
collection_formats = {}
path_params = {}
if 'account' in params:
path_params['account'] = params['account'] # noqa: E501
if 'cloud_provider' in params:
path_params['cloudProvider'] = params['cloud_provider'] # noqa: E501
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
if 'type' in params:
path_params['type'] = params['type'] # noqa: E501
query_params = []
if 'service_account' in params:
query_params.append(('serviceAccount', params['service_account'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/export/{cloudProvider}/{account}/{type}/{name}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Resource', # 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 get_application_details_using_get(self, application, **kwargs): # noqa: E501
"""Get managed details about an application # 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_application_details_using_get(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param list[str] entities: entities
:param bool include_details: includeDetails
:param int max_artifact_versions: maxArtifactVersions
: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.get_application_details_using_get_with_http_info(application, **kwargs) # noqa: E501
else:
(data) = self.get_application_details_using_get_with_http_info(application, **kwargs) # noqa: E501
return data
def get_application_details_using_get_with_http_info(self, application, **kwargs): # noqa: E501
"""Get managed details about an application # 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_application_details_using_get_with_http_info(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param list[str] entities: entities
:param bool include_details: includeDetails
:param int max_artifact_versions: maxArtifactVersions
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'entities', 'include_details', 'max_artifact_versions'] # 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_application_details_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `get_application_details_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
if 'entities' in params:
query_params.append(('entities', params['entities'])) # noqa: E501
collection_formats['entities'] = 'multi' # noqa: E501
if 'include_details' in params:
query_params.append(('includeDetails', params['include_details'])) # noqa: E501
if 'max_artifact_versions' in params:
query_params.append(('maxArtifactVersions', params['max_artifact_versions'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}', 'GET',
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 get_config_by_using_get(self, application, **kwargs): # noqa: E501
"""Get the delivery config associated with an application # 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_config_by_using_get(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_config_by_using_get_with_http_info(application, **kwargs) # noqa: E501
else:
(data) = self.get_config_by_using_get_with_http_info(application, **kwargs) # noqa: E501
return data
def get_config_by_using_get_with_http_info(self, application, **kwargs): # noqa: E501
"""Get the delivery config associated with an application # 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_config_by_using_get_with_http_info(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application'] # 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_config_by_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `get_config_by_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/config', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 get_constraint_state_using_get(self, application, environment, **kwargs): # noqa: E501
"""List up-to {limit} current constraint states for an environment # 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_constraint_state_using_get(application, environment, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str environment: environment (required)
:param str limit: limit
:return: ConstraintState
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_constraint_state_using_get_with_http_info(application, environment, **kwargs) # noqa: E501
else:
(data) = self.get_constraint_state_using_get_with_http_info(application, environment, **kwargs) # noqa: E501
return data
def get_constraint_state_using_get_with_http_info(self, application, environment, **kwargs): # noqa: E501
"""List up-to {limit} current constraint states for an environment # 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_constraint_state_using_get_with_http_info(application, environment, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str environment: environment (required)
:param str limit: limit
:return: ConstraintState
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'environment', 'limit'] # 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_constraint_state_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `get_constraint_state_using_get`") # noqa: E501
# verify the required parameter 'environment' is set
if ('environment' not in params or
params['environment'] is None):
raise ValueError("Missing the required parameter `environment` when calling `get_constraint_state_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
if 'environment' in params:
path_params['environment'] = params['environment'] # noqa: E501
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/environment/{environment}/constraints', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ConstraintState', # 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 get_manifest_artifacts_using_get(self, name, **kwargs): # noqa: E501
"""Get the status of each version of each artifact in each environment # 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_manifest_artifacts_using_get(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: list[object]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_manifest_artifacts_using_get_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.get_manifest_artifacts_using_get_with_http_info(name, **kwargs) # noqa: E501
return data
def get_manifest_artifacts_using_get_with_http_info(self, name, **kwargs): # noqa: E501
"""Get the status of each version of each artifact in each environment # 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_manifest_artifacts_using_get_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: list[object]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # 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_manifest_artifacts_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `get_manifest_artifacts_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/{name}/artifacts', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[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 get_manifest_using_get(self, name, **kwargs): # noqa: E501
"""Get a delivery config manifest # 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_manifest_using_get(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_manifest_using_get_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.get_manifest_using_get_with_http_info(name, **kwargs) # noqa: E501
return data
def get_manifest_using_get_with_http_info(self, name, **kwargs): # noqa: E501
"""Get a delivery config manifest # 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_manifest_using_get_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # 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_manifest_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `get_manifest_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/{name}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 get_manifest_yaml_using_get(self, name, **kwargs): # noqa: E501
"""Get a delivery config manifest # 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_manifest_yaml_using_get(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_manifest_yaml_using_get_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.get_manifest_yaml_using_get_with_http_info(name, **kwargs) # noqa: E501
return data
def get_manifest_yaml_using_get_with_http_info(self, name, **kwargs): # noqa: E501
"""Get a delivery config manifest # 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_manifest_yaml_using_get_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # 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_manifest_yaml_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `get_manifest_yaml_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
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/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/{name}.yml', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 get_resource_status_using_get(self, resource_id, **kwargs): # noqa: E501
"""Get status of a resource # 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_resource_status_using_get(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (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.get_resource_status_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
else:
(data) = self.get_resource_status_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
return data
def get_resource_status_using_get_with_http_info(self, resource_id, **kwargs): # noqa: E501
"""Get status of a resource # 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_resource_status_using_get_with_http_info(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource_id'] # 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_resource_status_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource_id' is set
if ('resource_id' not in params or
params['resource_id'] is None):
raise ValueError("Missing the required parameter `resource_id` when calling `get_resource_status_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'resource_id' in params:
path_params['resourceId'] = params['resource_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/{resourceId}/status', 'GET',
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 get_resource_using_get(self, resource_id, **kwargs): # noqa: E501
"""Get a resource # 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_resource_using_get(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_resource_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
else:
(data) = self.get_resource_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
return data
def get_resource_using_get_with_http_info(self, resource_id, **kwargs): # noqa: E501
"""Get a resource # 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_resource_using_get_with_http_info(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource_id'] # 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_resource_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource_id' is set
if ('resource_id' not in params or
params['resource_id'] is None):
raise ValueError("Missing the required parameter `resource_id` when calling `get_resource_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'resource_id' in params:
path_params['resourceId'] = params['resource_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/{resourceId}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Resource', # 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 get_resource_yaml_using_get(self, resource_id, **kwargs): # noqa: E501
"""Get a resource # 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_resource_yaml_using_get(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_resource_yaml_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
else:
(data) = self.get_resource_yaml_using_get_with_http_info(resource_id, **kwargs) # noqa: E501
return data
def get_resource_yaml_using_get_with_http_info(self, resource_id, **kwargs): # noqa: E501
"""Get a resource # 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_resource_yaml_using_get_with_http_info(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: Resource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource_id'] # 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_resource_yaml_using_get" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource_id' is set
if ('resource_id' not in params or
params['resource_id'] is None):
raise ValueError("Missing the required parameter `resource_id` when calling `get_resource_yaml_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'resource_id' in params:
path_params['resourceId'] = params['resource_id'] # noqa: E501
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/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/{resourceId}.yml', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Resource', # 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 pause_application_using_post(self, application, **kwargs): # noqa: E501
"""Pause management of an entire application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.pause_application_using_post(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.pause_application_using_post_with_http_info(application, **kwargs) # noqa: E501
else:
(data) = self.pause_application_using_post_with_http_info(application, **kwargs) # noqa: E501
return data
def pause_application_using_post_with_http_info(self, application, **kwargs): # noqa: E501
"""Pause management of an entire application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.pause_application_using_post_with_http_info(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application'] # 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 pause_application_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `pause_application_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # 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 = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/pause', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 pause_resource_using_post(self, resource_id, **kwargs): # noqa: E501
"""Pause management of a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.pause_resource_using_post(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.pause_resource_using_post_with_http_info(resource_id, **kwargs) # noqa: E501
else:
(data) = self.pause_resource_using_post_with_http_info(resource_id, **kwargs) # noqa: E501
return data
def pause_resource_using_post_with_http_info(self, resource_id, **kwargs): # noqa: E501
"""Pause management of a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.pause_resource_using_post_with_http_info(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource_id'] # 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 pause_resource_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource_id' is set
if ('resource_id' not in params or
params['resource_id'] is None):
raise ValueError("Missing the required parameter `resource_id` when calling `pause_resource_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'resource_id' in params:
path_params['resourceId'] = params['resource_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # 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 = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/{resourceId}/pause', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 resume_application_using_delete(self, application, **kwargs): # noqa: E501
"""Resume management of an entire application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.resume_application_using_delete(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.resume_application_using_delete_with_http_info(application, **kwargs) # noqa: E501
else:
(data) = self.resume_application_using_delete_with_http_info(application, **kwargs) # noqa: E501
return data
def resume_application_using_delete_with_http_info(self, application, **kwargs): # noqa: E501
"""Resume management of an entire application # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.resume_application_using_delete_with_http_info(application, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application'] # 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 resume_application_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `resume_application_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/pause', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 resume_resource_using_delete(self, resource_id, **kwargs): # noqa: E501
"""Resume management of a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.resume_resource_using_delete(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.resume_resource_using_delete_with_http_info(resource_id, **kwargs) # noqa: E501
else:
(data) = self.resume_resource_using_delete_with_http_info(resource_id, **kwargs) # noqa: E501
return data
def resume_resource_using_delete_with_http_info(self, resource_id, **kwargs): # noqa: E501
"""Resume management of a resource # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.resume_resource_using_delete_with_http_info(resource_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str resource_id: resourceId (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resource_id'] # 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 resume_resource_using_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resource_id' is set
if ('resource_id' not in params or
params['resource_id'] is None):
raise ValueError("Missing the required parameter `resource_id` when calling `resume_resource_using_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'resource_id' in params:
path_params['resourceId'] = params['resource_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/resources/{resourceId}/pause', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 schema_using_get(self, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.schema_using_get(async_req=True)
>>> result = thread.get()
:param async_req bool
: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.schema_using_get_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.schema_using_get_with_http_info(**kwargs) # noqa: E501
return data
def schema_using_get_with_http_info(self, **kwargs): # noqa: E501
"""Ad-hoc validate and diff a config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.schema_using_get_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: object
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 schema_using_get" % 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', 'application/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/schema', 'GET',
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 update_constraint_status_using_post(self, application, environment, status, **kwargs): # noqa: E501
"""Update the status of an environment constraint # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_constraint_status_using_post(application, environment, status, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str environment: environment (required)
:param ConstraintStatus status: status (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.update_constraint_status_using_post_with_http_info(application, environment, status, **kwargs) # noqa: E501
else:
(data) = self.update_constraint_status_using_post_with_http_info(application, environment, status, **kwargs) # noqa: E501
return data
def update_constraint_status_using_post_with_http_info(self, application, environment, status, **kwargs): # noqa: E501
"""Update the status of an environment constraint # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_constraint_status_using_post_with_http_info(application, environment, status, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param str environment: environment (required)
:param ConstraintStatus status: status (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'environment', 'status'] # 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 update_constraint_status_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `update_constraint_status_using_post`") # noqa: E501
# verify the required parameter 'environment' is set
if ('environment' not in params or
params['environment'] is None):
raise ValueError("Missing the required parameter `environment` when calling `update_constraint_status_using_post`") # noqa: E501
# verify the required parameter 'status' is set
if ('status' not in params or
params['status'] is None):
raise ValueError("Missing the required parameter `status` when calling `update_constraint_status_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
if 'environment' in params:
path_params['environment'] = params['environment'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'status' in params:
body_params = params['status']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # 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 = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/environment/{environment}/constraint', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 upsert_manifest_using_post(self, manifest, **kwargs): # noqa: E501
"""Create or update a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upsert_manifest_using_post(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.upsert_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
else:
(data) = self.upsert_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
return data
def upsert_manifest_using_post_with_http_info(self, manifest, **kwargs): # noqa: E501
"""Create or update a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.upsert_manifest_using_post_with_http_info(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (required)
:return: DeliveryConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['manifest'] # 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 upsert_manifest_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'manifest' is set
if ('manifest' not in params or
params['manifest'] is None):
raise ValueError("Missing the required parameter `manifest` when calling `upsert_manifest_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'manifest' in params:
body_params = params['manifest']
# 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', 'application/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeliveryConfig', # 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 validate_manifest_using_post(self, manifest, **kwargs): # noqa: E501
"""Validate a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.validate_manifest_using_post(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (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.validate_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
else:
(data) = self.validate_manifest_using_post_with_http_info(manifest, **kwargs) # noqa: E501
return data
def validate_manifest_using_post_with_http_info(self, manifest, **kwargs): # noqa: E501
"""Validate a delivery config manifest # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.validate_manifest_using_post_with_http_info(manifest, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeliveryConfig manifest: manifest (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['manifest'] # 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 validate_manifest_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'manifest' is set
if ('manifest' not in params or
params['manifest'] is None):
raise ValueError("Missing the required parameter `manifest` when calling `validate_manifest_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'manifest' in params:
body_params = params['manifest']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/x-yaml']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json', 'application/x-yaml']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/managed/delivery-configs/validate', '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 veto_using_post(self, application, veto, **kwargs): # noqa: E501
"""Veto an artifact version in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.veto_using_post(application, veto, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param EnvironmentArtifactVeto veto: veto (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.veto_using_post_with_http_info(application, veto, **kwargs) # noqa: E501
else:
(data) = self.veto_using_post_with_http_info(application, veto, **kwargs) # noqa: E501
return data
def veto_using_post_with_http_info(self, application, veto, **kwargs): # noqa: E501
"""Veto an artifact version in an environment # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.veto_using_post_with_http_info(application, veto, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str application: application (required)
:param EnvironmentArtifactVeto veto: veto (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['application', 'veto'] # 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 veto_using_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'application' is set
if ('application' not in params or
params['application'] is None):
raise ValueError("Missing the required parameter `application` when calling `veto_using_post`") # noqa: E501
# verify the required parameter 'veto' is set
if ('veto' not in params or
params['veto'] is None):
raise ValueError("Missing the required parameter `veto` when calling `veto_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'application' in params:
path_params['application'] = params['application'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'veto' in params:
body_params = params['veto']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # 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 = [] # noqa: E501
return self.api_client.call_api(
'/managed/application/{application}/veto', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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)
| 41.052302 | 241 | 0.618705 | 12,520 | 111,457 | 5.243211 | 0.01885 | 0.045091 | 0.023033 | 0.029614 | 0.976007 | 0.962983 | 0.957773 | 0.949882 | 0.937787 | 0.930703 | 0 | 0.014343 | 0.292498 | 111,457 | 2,714 | 242 | 41.067428 | 0.818124 | 0.308989 | 0 | 0.803571 | 1 | 0 | 0.205969 | 0.067078 | 0 | 0 | 0 | 0 | 0 | 1 | 0.036376 | false | 0 | 0.002646 | 0 | 0.093254 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
f1df8053418b6841f30010f930acd0355c35ed52 | 793 | py | Python | tests/test_regex.py | eBay/wextracto | 9c789b1c98d95a1e87dbedfd1541a8688d128f5c | [
"BSD-3-Clause"
] | 19 | 2015-01-07T01:13:18.000Z | 2020-07-31T04:51:39.000Z | tests/test_regex.py | afcarl/wextracto | 9c789b1c98d95a1e87dbedfd1541a8688d128f5c | [
"BSD-3-Clause"
] | 2 | 2017-02-02T17:14:14.000Z | 2018-05-02T23:19:36.000Z | tests/test_regex.py | gilessbrown/wextracto | 7215b90a7c022c50cbef9a1e7a67e2fb48432b47 | [
"BSD-3-Clause"
] | 13 | 2015-07-21T20:29:19.000Z | 2021-01-15T10:36:26.000Z | from wex import regex as r
def test_regroup():
f = r.re_group('(\d+)') | list
assert f('a1 b23') == ['1', '23']
def test_regroup_iterable():
f = r.re_group('(\d+)') | list
assert f(['a1 b23']) == ['1', '23']
def test_regroup_nested_iterable():
f = r.re_group('(\d+)') | list
assert f([['a1 b23'], 'c3']) == ['1', '23', '3']
def test_re_groupdict():
f = r.re_groupdict('(?P<num>\d+)') | list
assert f('a1 b23') == [{'num': '1'}, {'num': '23'}]
def test_re_groupdict_iterable():
f = r.re_groupdict('(?P<num>\d+)') | list
assert f(['a1 b23']) == [{'num': '1'}, {'num': '23'}]
def test_re_groupdict_nested_iterable():
f = r.re_groupdict('(?P<num>\d+)') | list
assert f([['a1 b23'], 'c3']) == [{'num': '1'}, {'num': '23'}, {'num': '3'}]
| 24.030303 | 79 | 0.513241 | 122 | 793 | 3.163934 | 0.213115 | 0.108808 | 0.062176 | 0.186529 | 0.818653 | 0.787565 | 0.787565 | 0.777202 | 0.777202 | 0.777202 | 0 | 0.062794 | 0.196721 | 793 | 32 | 80 | 24.78125 | 0.543171 | 0 | 0 | 0.315789 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0.315789 | 1 | 0.315789 | false | 0 | 0.052632 | 0 | 0.368421 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
f1e3d423ac41fc4db5503d01f312d6bead824233 | 4,510 | py | Python | pyqt_style_setter/styleSetter.py | yjg30737/pyqt_style_setter | 2d3db7fd7ed71dd4b2644c868029f9913841b648 | [
"MIT"
] | null | null | null | pyqt_style_setter/styleSetter.py | yjg30737/pyqt_style_setter | 2d3db7fd7ed71dd4b2644c868029f9913841b648 | [
"MIT"
] | null | null | null | pyqt_style_setter/styleSetter.py | yjg30737/pyqt_style_setter | 2d3db7fd7ed71dd4b2644c868029f9913841b648 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QWidget, QAbstractButton, QMainWindow, QDialog
from pyqt_dark_gray_theme import darkGrayTheme
# from pyqt_light_gray_theme import lightGrayTheme
from pyqt_svg_button import SvgButton
class StyleSetter:
@staticmethod
def setWindowStyle(main_window: QWidget, theme: str = 'dark', exclude_type_lst: list = []):
if theme == 'dark':
theme_style = darkGrayTheme.getThemeStyle()
if isinstance(main_window, QMainWindow) or isinstance(main_window, QDialog):
main_window.setStyleSheet(theme_style)
else:
main_window.setObjectName('mainWidget')
main_window.setStyleSheet(theme_style + darkGrayTheme.getMainWidgetStyle())
# button
def setButtonStyle(main_window):
btns = main_window.findChildren(QAbstractButton)
for btn in btns:
# check if text exists
if btn.text().strip() == '':
# if button type is SvgButton, let it maintain its own style
if isinstance(btn, SvgButton):
pass
else:
btn.setStyleSheet(darkGrayTheme.getIconButtonStyle()) # no text - icon button style
else:
# if button type is SvgButton, let it maintain its own style
if isinstance(btn, SvgButton):
pass
else:
btn.setStyleSheet(darkGrayTheme.getIconTextButtonStyle()) # text - icon-text button style
# check exclusion of QAbstractButton
if QAbstractButton in exclude_type_lst:
pass
else:
setButtonStyle(main_window)
# todo check exclusion of other types
if len(exclude_type_lst) > 0:
for _type in exclude_type_lst:
widgets = main_window.findChildren(_type)
if isinstance(_type, QAbstractButton):
print(_type)
if isinstance(main_window, QMainWindow):
menu_bar = main_window.menuBar() # menu bar
menu_bar_style = darkGrayTheme.getMenuBarStyle(menu_bar)
menu_bar.setStyleSheet(menu_bar_style)
# i will be working on this
light_code = '''
elif theme == 'light':
theme_style = lightGrayTheme.getThemeStyle()
if isinstance(main_window, QMainWindow) or isinstance(main_window, QDialog):
main_window.setStyleSheet(theme_style)
else:
main_window.setObjectName('mainWidget')
main_window.setStyleSheet(theme_style + lightGrayTheme.getMainWidgetStyle())
# button
def setButtonStyle(main_window):
btns = main_window.findChildren(QAbstractButton)
for btn in btns:
# check if text exists
if btn.text().strip() == '':
# if button type is SvgButton, let it maintain its own style
if isinstance(btn, SvgButton):
pass
else:
btn.setStyleSheet(lightGrayTheme.getIconButtonStyle()) # no text - icon button style
else:
# if button type is SvgButton, let it maintain its own style
if isinstance(btn, SvgButton):
pass
else:
btn.setStyleSheet(lightGrayTheme.getIconTextButtonStyle()) # text - icon-text button style
# check exclusion of QAbstractButton
if QAbstractButton in exclude_type_lst:
pass
else:
setButtonStyle(main_window)
# todo check exclusion of other types
if len(exclude_type_lst) > 0:
for _type in exclude_type_lst:
widgets = main_window.findChildren(_type)
if isinstance(_type, QAbstractButton):
print(_type)
if isinstance(main_window, QMainWindow):
menu_bar = main_window.menuBar() # menu bar
menu_bar_style = lightGrayTheme.getMenuBarStyle(menu_bar)
menu_bar.setStyleSheet(menu_bar_style)
'''
| 45.1 | 119 | 0.549667 | 407 | 4,510 | 5.909091 | 0.201474 | 0.095634 | 0.040748 | 0.03659 | 0.823285 | 0.823285 | 0.823285 | 0.823285 | 0.823285 | 0.778378 | 0 | 0.00109 | 0.3898 | 4,510 | 99 | 120 | 45.555556 | 0.87282 | 0.079379 | 0 | 0.675 | 0 | 0 | 0.50157 | 0.146895 | 0 | 0 | 0 | 0.010101 | 0 | 1 | 0.025 | false | 0.075 | 0.0375 | 0 | 0.075 | 0.025 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 8 |
7b0c1116beb8727670c7fdc2ea16e32c8d70e520 | 183 | py | Python | crowdstrikeclient/_CrowdstrikeIoC.py | pyperanger/crowdstrike-client | 43e2067c2573834eae9baa35f5b4b78b4cda97be | [
"MIT"
] | null | null | null | crowdstrikeclient/_CrowdstrikeIoC.py | pyperanger/crowdstrike-client | 43e2067c2573834eae9baa35f5b4b78b4cda97be | [
"MIT"
] | null | null | null | crowdstrikeclient/_CrowdstrikeIoC.py | pyperanger/crowdstrike-client | 43e2067c2573834eae9baa35f5b4b78b4cda97be | [
"MIT"
] | null | null | null | import json
# Ioc
def IndicatorsQueriesDevices(self, payload):
'''/indicators/queries/devices/v1'''
return json.loads(self.GetAPI("indicators/queries/devices/v1?"+payload))
| 22.875 | 76 | 0.737705 | 21 | 183 | 6.428571 | 0.666667 | 0.251852 | 0.355556 | 0.385185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01227 | 0.10929 | 183 | 7 | 77 | 26.142857 | 0.815951 | 0.191257 | 0 | 0 | 0 | 0 | 0.212766 | 0.212766 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 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 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 8 |
7b1be11b404e94fa96891a66167e79680bc2536d | 10,269 | py | Python | tests/unit_tests/olio/test_olio_write_data.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | 35 | 2021-05-24T17:43:55.000Z | 2022-03-15T15:47:59.000Z | tests/unit_tests/olio/test_olio_write_data.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | 355 | 2021-05-24T16:28:16.000Z | 2022-03-14T14:43:40.000Z | tests/unit_tests/olio/test_olio_write_data.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | 12 | 2021-06-02T09:50:46.000Z | 2022-03-02T20:29:56.000Z | import numpy as np
import pytest
import resqpy.olio.write_data as wd
from pytest_mock import MockerFixture
def test_write_pure_binary_data(mocker: MockerFixture, caplog):
# Arrange
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
fileno_mock = mocker.Mock(return_value = 1, name = 'fileno_mock')
open_mock.return_value.fileno = fileno_mock
mocker.patch("builtins.open", open_mock)
expected_calls = [mocker.call('test', 'wb'), mocker.call().__enter__()]
# Act
wd.write_pure_binary_data('test', test_array)
# Assert
open_mock.assert_has_calls(expected_calls)
assert 'Binary data file test created' in caplog.text
def test_write_array_to_ascii_file_decimals_equal_0(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [
mocker.call('test', 'w'),
mocker.call().__enter__(),
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().__exit__(None, None, None)
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, decimals = 0)
# Assert
open_mock.assert_has_calls(expected_calls)
def test_write_array_to_ascii_file_binary(mocker: MockerFixture, caplog):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
fileno_mock = mocker.Mock(return_value = 1, name = 'fileno_mock')
open_mock.return_value.fileno = fileno_mock
mocker.patch("builtins.open", open_mock)
expected_calls = [mocker.call('test.db', 'wb'), mocker.call().__enter__()]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, use_binary = True, binary_only = True)
# Assert
open_mock.assert_has_calls(expected_calls)
assert 'Failed to write data to binary file test' not in caplog.text
def test_write_array_to_ascii_file_no_headers(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
unexpected_calls = [
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n')
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, headers = False)
# Assert
assert unexpected_calls not in open_mock.mock_calls
def test_write_array_to_ascii_file_bool(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 1], [0, 0]], [[1, 0], [1, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [
mocker.call('test', 'w'),
mocker.call().__enter__(),
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('1'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('1'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('1'),
mocker.call().write('\t'),
mocker.call().write('0'),
mocker.call().write('\n'),
mocker.call().__exit__(None, None, None)
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, data_type = 'bool')
# Assert
open_mock.assert_has_calls(expected_calls)
def test_write_array_to_ascii_file_append(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [mocker.call('test', 'a')]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, append = True)
# Assert
open_mock.assert_has_calls(expected_calls)
def test_write_array_to_ascii_file_space_separated(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [
mocker.call('test', 'w'),
mocker.call().__enter__(),
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write(' '),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write(' '),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write(' '),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write(' '),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().__exit__(None, None, None)
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, space_separated = True)
# Assert
open_mock.assert_has_calls(expected_calls)
def test_write_array_to_ascii_file_nan_substitute(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[1, np.nan], [3, 2]], [[1, 5], [np.nan, np.nan]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [
mocker.call('test', 'w'),
mocker.call().__enter__(),
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n'),
mocker.call().write('\n'),
mocker.call().write('1.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('3.000'),
mocker.call().write('\t'),
mocker.call().write('2.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('1.000'),
mocker.call().write('\t'),
mocker.call().write('5.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().__exit__(None, None, None)
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, nan_substitute_value = 0)
# Assert
open_mock.assert_has_calls(expected_calls)
def test_write_array_to_ascii_file_blank_line_after_j_block(mocker: MockerFixture):
# Arrange
test_extent = np.array([2, 2, 2])
test_array = np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])
open_mock = mocker.mock_open()
mocker.patch("builtins.open", open_mock)
expected_calls = [
mocker.call('test', 'w'),
mocker.call().__enter__(),
mocker.call().write('! Data written by write_array_to_ascii_file() python function\n'),
mocker.call().write('! Extent of array is: [2, 2, 2]\n'),
mocker.call().write('! Maximum 20 data items per line\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().write('0.000'),
mocker.call().write('\t'),
mocker.call().write('0.000'),
mocker.call().write('\n'),
mocker.call().write('\n'),
mocker.call().__exit__(None, None, None)
]
# Act
wd.write_array_to_ascii_file('test', test_extent, test_array, blank_line_after_j_block = True)
# Assert
open_mock.assert_has_calls(expected_calls)
| 35.65625 | 104 | 0.588275 | 1,395 | 10,269 | 4.117563 | 0.063799 | 0.243733 | 0.31337 | 0.150418 | 0.921135 | 0.904248 | 0.904248 | 0.896414 | 0.884749 | 0.859854 | 0 | 0.029773 | 0.215016 | 10,269 | 287 | 105 | 35.780488 | 0.682794 | 0.016555 | 0 | 0.815315 | 0 | 0 | 0.131963 | 0.016086 | 0 | 0 | 0 | 0 | 0.04955 | 1 | 0.040541 | false | 0 | 0.018018 | 0 | 0.058559 | 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 |
7b58517e89a86a814d343814becc6536570ba0b7 | 10,563 | py | Python | cifar10/utils_data.py | phymhan/essl | 23a4bfb1ef1e298cea7a2a392097a1097863d8ac | [
"MIT"
] | null | null | null | cifar10/utils_data.py | phymhan/essl | 23a4bfb1ef1e298cea7a2a392097a1097863d8ac | [
"MIT"
] | null | null | null | cifar10/utils_data.py | phymhan/essl | 23a4bfb1ef1e298cea7a2a392097a1097863d8ac | [
"MIT"
] | null | null | null | import os
import pickle
import numpy as np
import torch
import torchvision
import torchvision.transforms as T
import torchvision.transforms.functional as TF
# from torch.utils.data.dataset import Subset
# from torchvision.transforms import (CenterCrop, Compose, RandomHorizontalFlip, Resize, ToTensor)
import pdb
st = pdb.set_trace
class MultiViewDataset(torch.utils.data.Dataset):
def __init__(
self,
data_path='data.pkl',
latent_path='latent.pkl',
view_paths=['view.pkl'],
transform0=None,
transform1=None,
transform2=None,
transform3=None,
n_views=1,
train=True,
subset_index=None,
sample_from_mixed=False,
sample_original=False,
n_cache=8,
uint8=False,
):
"""
images: [x0, x1, x2, x3, ...]
x0, x1 are two expert views
x2 are rotation views reserved for essl
x3 and after are for (cached) GAN generated views
returns: (images, latents, labels)
"""
# self.data_transform = lambda x: (x + 1) / 2 # NOTE: to [0, 1]
self.transform0 = transform0
self.transform1 = transform1
self.transform2 = transform2
self.transform3 = transform3
self.uint8 = uint8
# load data
assert os.path.exists(data_path), f'data_path {data_path} does not exist'
with open(data_path, 'rb') as f:
data = pickle.load(f)
# load latent
assert os.path.exists(latent_path), f'latent_path {latent_path} does not exist'
with open(latent_path, 'rb') as f:
latents = pickle.load(f)
if subset_index is None:
if 'index' in data:
subset_index = data['index']['train'] if train else data['index']['test']
else:
subset_index = np.arange(len(data['images']))
self.data = {
'images': data['images'][subset_index],
'labels': torch.tensor(data['labels'])[subset_index],
'latents': latents['latents'][subset_index],
}
# load views
if isinstance(view_paths, str):
view_paths = [view_paths]
views = []
for view_path in view_paths:
assert os.path.exists(view_path), f'view_path {view_path} does not exist'
with open(view_path, 'rb') as f:
view = pickle.load(f)
views.append(view['views'][:n_cache, subset_index])
# NOTE: original data is view_0 (this is convenient if we want to sample from mixed pool)
self.views = torch.cat([self.data['images'].unsqueeze(0)] + views, dim=0)
self.total_views = self.views.shape[0] # NOTE: including original data view_0
self.n_views = n_views # NOTE: number of generated views to sample
self.n_cache = n_cache
assert sample_original or self.n_views <= self.total_views - int(not sample_from_mixed)
self.sample_from_mixed = sample_from_mixed
self.sample_original = sample_original
self.dataset_len = len(subset_index)
# def data_transform(self, image_tensor):
# image_tensor = (image_tensor + 1) / 2
# return image_tensor
def data_transform(self, image_tensor):
if self.uint8:
image_tensor = TF.to_tensor(image_tensor)
else:
image_tensor = (image_tensor + 1) / 2
return image_tensor
def __getitem__(self, index):
# view_0
img0 = self.data_transform(self.data['images'][index])
if self.transform0 is not None:
img0 = self.transform0(img0)
# view_1
img1 = self.data_transform(self.data['images'][index])
if self.transform1 is not None:
img1 = self.transform1(img1)
# view_2
img2 = self.data_transform(self.data['images'][index])
if self.transform2 is not None:
img2 = self.transform2(img2)
# view_3 and ...
views = []
if self.sample_original:
inds = [0] * self.n_views
else:
if self.sample_from_mixed:
inds = list(np.random.choice(np.arange(0, self.total_views), size=self.n_views, replace=False))
else:
inds = list(np.random.choice(np.arange(1, self.total_views), size=self.n_views, replace=False))
for i in inds:
img = self.data_transform(self.views[i, index])
if self.transform3 is not None:
img = self.transform3(img)
views.append(img)
# latent
latents = self.data['latents'][index]
# label
labels = self.data['labels'][index]
images = [img0, img1, img2] + views
return images, latents, labels
def __len__(self):
return self.dataset_len
class PosNegViewDataset(torch.utils.data.Dataset):
def __init__(
self,
data_path='data.pkl',
latent_path='latent.pkl',
pos_view_paths=['view_pos.pkl'],
neg_view_paths=['view_neg.pkl'],
transform0=None,
transform1=None,
transform2=None,
transform3=None,
n_views=1,
train=True,
subset_index=None,
sample_from_mixed=False,
sample_original=False,
):
"""
images: [x0, x1, x2, x3, ...]
x0, x1 are two expert views
x2 are rotation views reserved for essl
x3 and after are for (cached) GAN generated views
returns: (images, latents, labels)
"""
# self.data_transform = lambda x: (x + 1) / 2 # NOTE: to [0, 1]
self.transform0 = transform0
self.transform1 = transform1
self.transform2 = transform2
self.transform3 = transform3
# load data
assert os.path.exists(data_path), f'data_path {data_path} does not exist'
with open(data_path, 'rb') as f:
data = pickle.load(f)
# load latent
assert os.path.exists(latent_path), f'latent_path {latent_path} does not exist'
with open(latent_path, 'rb') as f:
latents = pickle.load(f)
if subset_index is None:
if 'index' in data:
subset_index = data['index']['train'] if train else data['index']['test']
else:
subset_index = np.arange(len(data['images']))
self.data = {
'images': data['images'][subset_index],
'labels': torch.tensor(data['labels'])[subset_index],
'latents': latents['latents'][subset_index],
}
# load views
if isinstance(pos_view_paths, str):
pos_view_paths = [pos_view_paths]
views = []
for view_path in pos_view_paths:
assert os.path.exists(view_path), f'pos_view_path {view_path} does not exist'
with open(view_path, 'rb') as f:
view = pickle.load(f)
views.append(view['views'][:, subset_index])
# NOTE: original data is view_0 (this is convenient if we want to sample from mixed pool)
self.views_pos = torch.cat([self.data['images'].unsqueeze(0)] + views, dim=0)
self.total_views_pos = self.views_pos.shape[0] # NOTE: including original data view_0
if isinstance(neg_view_paths, str):
neg_view_paths = [neg_view_paths]
views = []
for view_path in neg_view_paths:
assert os.path.exists(view_path), f'neg_view_path {view_path} does not exist'
with open(view_path, 'rb') as f:
view = pickle.load(f)
views.append(view['views'][:, subset_index])
# NOTE: original data is view_0 (this is convenient if we want to sample from mixed pool)
self.views_neg = torch.cat([self.data['images'].unsqueeze(0)] + views, dim=0)
self.total_views_neg = self.views_neg.shape[0] # NOTE: including original data view_0
# NOTE: n_views is number of views for both pos and neg
assert n_views % 2 == 0, f'n_views should be even, but got {n_views}'
n_views = n_views // 2
self.n_views = n_views # NOTE: number of generated views to sample
assert sample_original or self.n_views <= self.total_views_pos - int(not sample_from_mixed)
assert sample_original or self.n_views <= self.total_views_neg - int(not sample_from_mixed)
self.sample_from_mixed = sample_from_mixed
self.sample_original = sample_original
self.dataset_len = len(subset_index)
def data_transform(self, image_tensor):
image_tensor = (image_tensor + 1) / 2
return image_tensor
def __getitem__(self, index):
# view_0
img0 = self.data_transform(self.data['images'][index])
if self.transform0 is not None:
img0 = self.transform0(img0)
# view_1
img1 = self.data_transform(self.data['images'][index])
if self.transform1 is not None:
img1 = self.transform1(img1)
# view_2
img2 = self.data_transform(self.data['images'][index])
if self.transform2 is not None:
img2 = self.transform2(img2)
# view_3 and ...
views = []
if self.sample_original:
inds_pos = [0] * self.n_views
inds_neg = [0] * self.n_views
else:
if self.sample_from_mixed:
inds_pos = list(np.random.choice(np.arange(0, self.total_views_pos), size=self.n_views, replace=False))
inds_neg = list(np.random.choice(np.arange(0, self.total_views_neg), size=self.n_views, replace=False))
else:
inds_pos = list(np.random.choice(np.arange(1, self.total_views_pos), size=self.n_views, replace=False))
inds_neg = list(np.random.choice(np.arange(1, self.total_views_neg), size=self.n_views, replace=False))
for i in inds_pos:
img = self.data_transform(self.views_pos[i, index])
if self.transform3 is not None:
img = self.transform3(img)
views.append(img)
for i in inds_neg:
img = self.data_transform(self.views_neg[i, index])
if self.transform3 is not None:
img = self.transform3(img)
views.append(img)
# latent
latents = self.data['latents'][index]
# label
labels = self.data['labels'][index]
images = [img0, img1, img2] + views
return images, latents, labels
def __len__(self):
return self.dataset_len
| 40.163498 | 119 | 0.597084 | 1,370 | 10,563 | 4.421168 | 0.10365 | 0.036982 | 0.034671 | 0.031204 | 0.87469 | 0.870233 | 0.851246 | 0.837874 | 0.816411 | 0.794288 | 0 | 0.018596 | 0.297453 | 10,563 | 262 | 120 | 40.316794 | 0.797601 | 0.136136 | 0 | 0.70098 | 0 | 0 | 0.069273 | 0 | 0 | 0 | 0 | 0 | 0.053922 | 1 | 0.039216 | false | 0 | 0.039216 | 0.009804 | 0.117647 | 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 |
7b9a2875d56576231293d87066f55b598adf109c | 146 | py | Python | theverse/version.py | jesearl/theverse | ae201d8040358dd76cf82cea0fd3d879d4bd0faa | [
"BSD-3-Clause"
] | 1 | 2020-07-07T13:42:21.000Z | 2020-07-07T13:42:21.000Z | theverse/version.py | jesearl/theverse | ae201d8040358dd76cf82cea0fd3d879d4bd0faa | [
"BSD-3-Clause"
] | null | null | null | theverse/version.py | jesearl/theverse | ae201d8040358dd76cf82cea0fd3d879d4bd0faa | [
"BSD-3-Clause"
] | 1 | 2020-07-06T19:49:53.000Z | 2020-07-06T19:49:53.000Z | # -*- coding: utf-8 -*-
from .fmtversion import get_version_plus_info
__version__, __version_info__ = get_version_plus_info(0, 1, 1, 'final', 0)
| 29.2 | 74 | 0.739726 | 22 | 146 | 4.227273 | 0.590909 | 0.215054 | 0.301075 | 0.387097 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039063 | 0.123288 | 146 | 4 | 75 | 36.5 | 0.6875 | 0.143836 | 0 | 0 | 0 | 0 | 0.04065 | 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 |
7bc091c5b99a3a318e12eacdb800452fcb7b5ac7 | 183 | py | Python | event_handler.py | behenate/Blackboard | f3407e8506033f87784b1a762998e03728b11f67 | [
"MIT"
] | null | null | null | event_handler.py | behenate/Blackboard | f3407e8506033f87784b1a762998e03728b11f67 | [
"MIT"
] | null | null | null | event_handler.py | behenate/Blackboard | f3407e8506033f87784b1a762998e03728b11f67 | [
"MIT"
] | null | null | null | # Function for handling events
class EventHandler:
def __init__(self):
self.mouse_down = False
def on_mouse_down(self):
self.mouse_down = not self.mouse_down | 22.875 | 45 | 0.693989 | 25 | 183 | 4.72 | 0.56 | 0.305085 | 0.330508 | 0.288136 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.234973 | 183 | 8 | 45 | 22.875 | 0.842857 | 0.153005 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0 | 0.6 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 7 |
cdc5205959dbddb5ca5c9cfbb1ba129c5ff9f08c | 135 | py | Python | boa3_test/test_sc/native_test/gas/Decimals.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/native_test/gas/Decimals.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/native_test/gas/Decimals.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import public
from boa3.builtin.nativecontract.gas import GAS
@public
def main() -> int:
return GAS.decimals()
| 16.875 | 47 | 0.748148 | 19 | 135 | 5.315789 | 0.631579 | 0.158416 | 0.29703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017544 | 0.155556 | 135 | 7 | 48 | 19.285714 | 0.868421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0.2 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 7 |
cdd06f7ea9bca064a544dda9b0e0c211af4e0efa | 402 | py | Python | other/api/__init__.py | hrmorley34/AdventofCode | 74590422717fb5c6b80ef3fca226359d354c4aec | [
"MIT"
] | null | null | null | other/api/__init__.py | hrmorley34/AdventofCode | 74590422717fb5c6b80ef3fca226359d354c4aec | [
"MIT"
] | null | null | null | other/api/__init__.py | hrmorley34/AdventofCode | 74590422717fb5c6b80ef3fca226359d354c4aec | [
"MIT"
] | null | null | null | __all__ = [
"LeaderboardYear",
"LeaderboardYearMember",
"MemberDays",
"is_day_unlocked",
"get_cookiejar",
"get_leaderboard_json",
"UserId",
"Event",
"Day",
"Part",
]
from .api import (
LeaderboardYear,
LeaderboardYearMember,
MemberDays,
is_day_unlocked,
get_cookiejar,
get_leaderboard_json,
)
from .types import UserId, Event, Day, Part
| 17.478261 | 43 | 0.644279 | 37 | 402 | 6.621622 | 0.486486 | 0.293878 | 0.37551 | 0.391837 | 0.726531 | 0.726531 | 0.726531 | 0.726531 | 0.726531 | 0.726531 | 0 | 0 | 0.241294 | 402 | 22 | 44 | 18.272727 | 0.803279 | 0 | 0 | 0 | 0 | 0 | 0.278607 | 0.052239 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.095238 | 0 | 0.095238 | 0 | 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 |
b582420aa1cfcfc3e5936c8d8df4e1012ee973f0 | 40,014 | py | Python | sdk/python/pulumi_cloudflare/access_policy.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 35 | 2019-03-14T21:29:29.000Z | 2022-03-30T00:00:59.000Z | sdk/python/pulumi_cloudflare/access_policy.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 128 | 2019-03-08T23:45:58.000Z | 2022-03-31T21:05:22.000Z | sdk/python/pulumi_cloudflare/access_policy.py | pulumi/pulumi-cloudflare | d444af2fab6101b388a15cf2e3933e45e9935cc6 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2019-05-10T12:52:56.000Z | 2020-03-24T15:02:14.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *
__all__ = ['AccessPolicyArgs', 'AccessPolicy']
@pulumi.input_type
class AccessPolicyArgs:
def __init__(__self__, *,
application_id: pulumi.Input[str],
decision: pulumi.Input[str],
includes: pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]],
name: pulumi.Input[str],
precedence: pulumi.Input[int],
account_id: Optional[pulumi.Input[str]] = None,
approval_groups: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]] = None,
excludes: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]] = None,
purpose_justification_prompt: Optional[pulumi.Input[str]] = None,
purpose_justification_required: Optional[pulumi.Input[bool]] = None,
requires: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]] = None,
zone_id: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a AccessPolicy resource.
:param pulumi.Input[str] application_id: The ID of the application the policy is associated with.
:param pulumi.Input[str] decision: Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]] includes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] name: Friendly name of the Access Application.
:param pulumi.Input[int] precedence: The unique precedence for policies on a single application. Integer.
:param pulumi.Input[str] account_id: The account to which the access rule should be added. Conflicts with `zone_id`.
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]] approval_groups: List of approval group blocks for configuring additional approvals (refer to the nested schema).
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]] excludes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] purpose_justification_prompt: String to present to the user when purpose justification is enabled.
:param pulumi.Input[bool] purpose_justification_required: Boolean of whether to prompt the user for a justification for accessing the resource.
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]] requires: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
pulumi.set(__self__, "application_id", application_id)
pulumi.set(__self__, "decision", decision)
pulumi.set(__self__, "includes", includes)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "precedence", precedence)
if account_id is not None:
pulumi.set(__self__, "account_id", account_id)
if approval_groups is not None:
pulumi.set(__self__, "approval_groups", approval_groups)
if excludes is not None:
pulumi.set(__self__, "excludes", excludes)
if purpose_justification_prompt is not None:
pulumi.set(__self__, "purpose_justification_prompt", purpose_justification_prompt)
if purpose_justification_required is not None:
pulumi.set(__self__, "purpose_justification_required", purpose_justification_required)
if requires is not None:
pulumi.set(__self__, "requires", requires)
if zone_id is not None:
pulumi.set(__self__, "zone_id", zone_id)
@property
@pulumi.getter(name="applicationId")
def application_id(self) -> pulumi.Input[str]:
"""
The ID of the application the policy is associated with.
"""
return pulumi.get(self, "application_id")
@application_id.setter
def application_id(self, value: pulumi.Input[str]):
pulumi.set(self, "application_id", value)
@property
@pulumi.getter
def decision(self) -> pulumi.Input[str]:
"""
Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
"""
return pulumi.get(self, "decision")
@decision.setter
def decision(self, value: pulumi.Input[str]):
pulumi.set(self, "decision", value)
@property
@pulumi.getter
def includes(self) -> pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "includes")
@includes.setter
def includes(self, value: pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]]):
pulumi.set(self, "includes", value)
@property
@pulumi.getter
def name(self) -> pulumi.Input[str]:
"""
Friendly name of the Access Application.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: pulumi.Input[str]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def precedence(self) -> pulumi.Input[int]:
"""
The unique precedence for policies on a single application. Integer.
"""
return pulumi.get(self, "precedence")
@precedence.setter
def precedence(self, value: pulumi.Input[int]):
pulumi.set(self, "precedence", value)
@property
@pulumi.getter(name="accountId")
def account_id(self) -> Optional[pulumi.Input[str]]:
"""
The account to which the access rule should be added. Conflicts with `zone_id`.
"""
return pulumi.get(self, "account_id")
@account_id.setter
def account_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "account_id", value)
@property
@pulumi.getter(name="approvalGroups")
def approval_groups(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]]:
"""
List of approval group blocks for configuring additional approvals (refer to the nested schema).
"""
return pulumi.get(self, "approval_groups")
@approval_groups.setter
def approval_groups(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]]):
pulumi.set(self, "approval_groups", value)
@property
@pulumi.getter
def excludes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "excludes")
@excludes.setter
def excludes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]]):
pulumi.set(self, "excludes", value)
@property
@pulumi.getter(name="purposeJustificationPrompt")
def purpose_justification_prompt(self) -> Optional[pulumi.Input[str]]:
"""
String to present to the user when purpose justification is enabled.
"""
return pulumi.get(self, "purpose_justification_prompt")
@purpose_justification_prompt.setter
def purpose_justification_prompt(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "purpose_justification_prompt", value)
@property
@pulumi.getter(name="purposeJustificationRequired")
def purpose_justification_required(self) -> Optional[pulumi.Input[bool]]:
"""
Boolean of whether to prompt the user for a justification for accessing the resource.
"""
return pulumi.get(self, "purpose_justification_required")
@purpose_justification_required.setter
def purpose_justification_required(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "purpose_justification_required", value)
@property
@pulumi.getter
def requires(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "requires")
@requires.setter
def requires(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]]):
pulumi.set(self, "requires", value)
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> Optional[pulumi.Input[str]]:
"""
The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
return pulumi.get(self, "zone_id")
@zone_id.setter
def zone_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "zone_id", value)
@pulumi.input_type
class _AccessPolicyState:
def __init__(__self__, *,
account_id: Optional[pulumi.Input[str]] = None,
application_id: Optional[pulumi.Input[str]] = None,
approval_groups: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]] = None,
decision: Optional[pulumi.Input[str]] = None,
excludes: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]] = None,
includes: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]]] = None,
name: Optional[pulumi.Input[str]] = None,
precedence: Optional[pulumi.Input[int]] = None,
purpose_justification_prompt: Optional[pulumi.Input[str]] = None,
purpose_justification_required: Optional[pulumi.Input[bool]] = None,
requires: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]] = None,
zone_id: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering AccessPolicy resources.
:param pulumi.Input[str] account_id: The account to which the access rule should be added. Conflicts with `zone_id`.
:param pulumi.Input[str] application_id: The ID of the application the policy is associated with.
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]] approval_groups: List of approval group blocks for configuring additional approvals (refer to the nested schema).
:param pulumi.Input[str] decision: Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]] excludes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]] includes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] name: Friendly name of the Access Application.
:param pulumi.Input[int] precedence: The unique precedence for policies on a single application. Integer.
:param pulumi.Input[str] purpose_justification_prompt: String to present to the user when purpose justification is enabled.
:param pulumi.Input[bool] purpose_justification_required: Boolean of whether to prompt the user for a justification for accessing the resource.
:param pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]] requires: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
if account_id is not None:
pulumi.set(__self__, "account_id", account_id)
if application_id is not None:
pulumi.set(__self__, "application_id", application_id)
if approval_groups is not None:
pulumi.set(__self__, "approval_groups", approval_groups)
if decision is not None:
pulumi.set(__self__, "decision", decision)
if excludes is not None:
pulumi.set(__self__, "excludes", excludes)
if includes is not None:
pulumi.set(__self__, "includes", includes)
if name is not None:
pulumi.set(__self__, "name", name)
if precedence is not None:
pulumi.set(__self__, "precedence", precedence)
if purpose_justification_prompt is not None:
pulumi.set(__self__, "purpose_justification_prompt", purpose_justification_prompt)
if purpose_justification_required is not None:
pulumi.set(__self__, "purpose_justification_required", purpose_justification_required)
if requires is not None:
pulumi.set(__self__, "requires", requires)
if zone_id is not None:
pulumi.set(__self__, "zone_id", zone_id)
@property
@pulumi.getter(name="accountId")
def account_id(self) -> Optional[pulumi.Input[str]]:
"""
The account to which the access rule should be added. Conflicts with `zone_id`.
"""
return pulumi.get(self, "account_id")
@account_id.setter
def account_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "account_id", value)
@property
@pulumi.getter(name="applicationId")
def application_id(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the application the policy is associated with.
"""
return pulumi.get(self, "application_id")
@application_id.setter
def application_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "application_id", value)
@property
@pulumi.getter(name="approvalGroups")
def approval_groups(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]]:
"""
List of approval group blocks for configuring additional approvals (refer to the nested schema).
"""
return pulumi.get(self, "approval_groups")
@approval_groups.setter
def approval_groups(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyApprovalGroupArgs']]]]):
pulumi.set(self, "approval_groups", value)
@property
@pulumi.getter
def decision(self) -> Optional[pulumi.Input[str]]:
"""
Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
"""
return pulumi.get(self, "decision")
@decision.setter
def decision(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "decision", value)
@property
@pulumi.getter
def excludes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "excludes")
@excludes.setter
def excludes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyExcludeArgs']]]]):
pulumi.set(self, "excludes", value)
@property
@pulumi.getter
def includes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "includes")
@includes.setter
def includes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyIncludeArgs']]]]):
pulumi.set(self, "includes", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Friendly name of the Access Application.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def precedence(self) -> Optional[pulumi.Input[int]]:
"""
The unique precedence for policies on a single application. Integer.
"""
return pulumi.get(self, "precedence")
@precedence.setter
def precedence(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "precedence", value)
@property
@pulumi.getter(name="purposeJustificationPrompt")
def purpose_justification_prompt(self) -> Optional[pulumi.Input[str]]:
"""
String to present to the user when purpose justification is enabled.
"""
return pulumi.get(self, "purpose_justification_prompt")
@purpose_justification_prompt.setter
def purpose_justification_prompt(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "purpose_justification_prompt", value)
@property
@pulumi.getter(name="purposeJustificationRequired")
def purpose_justification_required(self) -> Optional[pulumi.Input[bool]]:
"""
Boolean of whether to prompt the user for a justification for accessing the resource.
"""
return pulumi.get(self, "purpose_justification_required")
@purpose_justification_required.setter
def purpose_justification_required(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "purpose_justification_required", value)
@property
@pulumi.getter
def requires(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "requires")
@requires.setter
def requires(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AccessPolicyRequireArgs']]]]):
pulumi.set(self, "requires", value)
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> Optional[pulumi.Input[str]]:
"""
The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
return pulumi.get(self, "zone_id")
@zone_id.setter
def zone_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "zone_id", value)
class AccessPolicy(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
account_id: Optional[pulumi.Input[str]] = None,
application_id: Optional[pulumi.Input[str]] = None,
approval_groups: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyApprovalGroupArgs']]]]] = None,
decision: Optional[pulumi.Input[str]] = None,
excludes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyExcludeArgs']]]]] = None,
includes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyIncludeArgs']]]]] = None,
name: Optional[pulumi.Input[str]] = None,
precedence: Optional[pulumi.Input[int]] = None,
purpose_justification_prompt: Optional[pulumi.Input[str]] = None,
purpose_justification_required: Optional[pulumi.Input[bool]] = None,
requires: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyRequireArgs']]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Provides a Cloudflare Access Policy resource. Access Policies are used
in conjunction with Access Applications to restrict access to a
particular resource.
## Example Usage
```python
import pulumi
import pulumi_cloudflare as cloudflare
# Allowing access to `test@example.com` email address only
test_policy_access_policy = cloudflare.AccessPolicy("testPolicyAccessPolicy",
application_id="cb029e245cfdd66dc8d2e570d5dd3322",
zone_id="d41d8cd98f00b204e9800998ecf8427e",
name="staging policy",
precedence=1,
decision="allow",
includes=[cloudflare.AccessPolicyIncludeArgs(
emails=["test@example.com"],
)],
requires=[cloudflare.AccessPolicyRequireArgs(
emails=["test@example.com"],
)])
# Allowing `test@example.com` to access but only when coming from a
# specific IP.
test_policy_index_access_policy_access_policy = cloudflare.AccessPolicy("testPolicyIndex/accessPolicyAccessPolicy",
application_id="cb029e245cfdd66dc8d2e570d5dd3322",
zone_id="d41d8cd98f00b204e9800998ecf8427e",
name="staging policy",
precedence=1,
decision="allow",
includes=[cloudflare.AccessPolicyIncludeArgs(
emails=["test@example.com"],
)],
requires=[cloudflare.AccessPolicyRequireArgs(
ips=[var["office_ip"]],
)])
```
## Import
Access Policies can be imported using a composite ID formed of identifier type (`zone` or `account`), identifier ID (`zone_id` or `account_id`), application ID and policy ID. # import a zone level Access policy
```sh
$ pulumi import cloudflare:index/accessPolicy:AccessPolicy staging zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d
```
# import an account level Access policy
```sh
$ pulumi import cloudflare:index/accessPolicy:AccessPolicy production account/0d599f0ec05c3bda8c3b8a68c32a1b47/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] account_id: The account to which the access rule should be added. Conflicts with `zone_id`.
:param pulumi.Input[str] application_id: The ID of the application the policy is associated with.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyApprovalGroupArgs']]]] approval_groups: List of approval group blocks for configuring additional approvals (refer to the nested schema).
:param pulumi.Input[str] decision: Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyExcludeArgs']]]] excludes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyIncludeArgs']]]] includes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] name: Friendly name of the Access Application.
:param pulumi.Input[int] precedence: The unique precedence for policies on a single application. Integer.
:param pulumi.Input[str] purpose_justification_prompt: String to present to the user when purpose justification is enabled.
:param pulumi.Input[bool] purpose_justification_required: Boolean of whether to prompt the user for a justification for accessing the resource.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyRequireArgs']]]] requires: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: AccessPolicyArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Provides a Cloudflare Access Policy resource. Access Policies are used
in conjunction with Access Applications to restrict access to a
particular resource.
## Example Usage
```python
import pulumi
import pulumi_cloudflare as cloudflare
# Allowing access to `test@example.com` email address only
test_policy_access_policy = cloudflare.AccessPolicy("testPolicyAccessPolicy",
application_id="cb029e245cfdd66dc8d2e570d5dd3322",
zone_id="d41d8cd98f00b204e9800998ecf8427e",
name="staging policy",
precedence=1,
decision="allow",
includes=[cloudflare.AccessPolicyIncludeArgs(
emails=["test@example.com"],
)],
requires=[cloudflare.AccessPolicyRequireArgs(
emails=["test@example.com"],
)])
# Allowing `test@example.com` to access but only when coming from a
# specific IP.
test_policy_index_access_policy_access_policy = cloudflare.AccessPolicy("testPolicyIndex/accessPolicyAccessPolicy",
application_id="cb029e245cfdd66dc8d2e570d5dd3322",
zone_id="d41d8cd98f00b204e9800998ecf8427e",
name="staging policy",
precedence=1,
decision="allow",
includes=[cloudflare.AccessPolicyIncludeArgs(
emails=["test@example.com"],
)],
requires=[cloudflare.AccessPolicyRequireArgs(
ips=[var["office_ip"]],
)])
```
## Import
Access Policies can be imported using a composite ID formed of identifier type (`zone` or `account`), identifier ID (`zone_id` or `account_id`), application ID and policy ID. # import a zone level Access policy
```sh
$ pulumi import cloudflare:index/accessPolicy:AccessPolicy staging zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d
```
# import an account level Access policy
```sh
$ pulumi import cloudflare:index/accessPolicy:AccessPolicy production account/0d599f0ec05c3bda8c3b8a68c32a1b47/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d
```
:param str resource_name: The name of the resource.
:param AccessPolicyArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(AccessPolicyArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
account_id: Optional[pulumi.Input[str]] = None,
application_id: Optional[pulumi.Input[str]] = None,
approval_groups: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyApprovalGroupArgs']]]]] = None,
decision: Optional[pulumi.Input[str]] = None,
excludes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyExcludeArgs']]]]] = None,
includes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyIncludeArgs']]]]] = None,
name: Optional[pulumi.Input[str]] = None,
precedence: Optional[pulumi.Input[int]] = None,
purpose_justification_prompt: Optional[pulumi.Input[str]] = None,
purpose_justification_required: Optional[pulumi.Input[bool]] = None,
requires: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyRequireArgs']]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = AccessPolicyArgs.__new__(AccessPolicyArgs)
__props__.__dict__["account_id"] = account_id
if application_id is None and not opts.urn:
raise TypeError("Missing required property 'application_id'")
__props__.__dict__["application_id"] = application_id
__props__.__dict__["approval_groups"] = approval_groups
if decision is None and not opts.urn:
raise TypeError("Missing required property 'decision'")
__props__.__dict__["decision"] = decision
__props__.__dict__["excludes"] = excludes
if includes is None and not opts.urn:
raise TypeError("Missing required property 'includes'")
__props__.__dict__["includes"] = includes
if name is None and not opts.urn:
raise TypeError("Missing required property 'name'")
__props__.__dict__["name"] = name
if precedence is None and not opts.urn:
raise TypeError("Missing required property 'precedence'")
__props__.__dict__["precedence"] = precedence
__props__.__dict__["purpose_justification_prompt"] = purpose_justification_prompt
__props__.__dict__["purpose_justification_required"] = purpose_justification_required
__props__.__dict__["requires"] = requires
__props__.__dict__["zone_id"] = zone_id
super(AccessPolicy, __self__).__init__(
'cloudflare:index/accessPolicy:AccessPolicy',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
account_id: Optional[pulumi.Input[str]] = None,
application_id: Optional[pulumi.Input[str]] = None,
approval_groups: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyApprovalGroupArgs']]]]] = None,
decision: Optional[pulumi.Input[str]] = None,
excludes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyExcludeArgs']]]]] = None,
includes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyIncludeArgs']]]]] = None,
name: Optional[pulumi.Input[str]] = None,
precedence: Optional[pulumi.Input[int]] = None,
purpose_justification_prompt: Optional[pulumi.Input[str]] = None,
purpose_justification_required: Optional[pulumi.Input[bool]] = None,
requires: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyRequireArgs']]]]] = None,
zone_id: Optional[pulumi.Input[str]] = None) -> 'AccessPolicy':
"""
Get an existing AccessPolicy resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] account_id: The account to which the access rule should be added. Conflicts with `zone_id`.
:param pulumi.Input[str] application_id: The ID of the application the policy is associated with.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyApprovalGroupArgs']]]] approval_groups: List of approval group blocks for configuring additional approvals (refer to the nested schema).
:param pulumi.Input[str] decision: Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyExcludeArgs']]]] excludes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyIncludeArgs']]]] includes: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] name: Friendly name of the Access Application.
:param pulumi.Input[int] precedence: The unique precedence for policies on a single application. Integer.
:param pulumi.Input[str] purpose_justification_prompt: String to present to the user when purpose justification is enabled.
:param pulumi.Input[bool] purpose_justification_required: Boolean of whether to prompt the user for a justification for accessing the resource.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccessPolicyRequireArgs']]]] requires: A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
:param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _AccessPolicyState.__new__(_AccessPolicyState)
__props__.__dict__["account_id"] = account_id
__props__.__dict__["application_id"] = application_id
__props__.__dict__["approval_groups"] = approval_groups
__props__.__dict__["decision"] = decision
__props__.__dict__["excludes"] = excludes
__props__.__dict__["includes"] = includes
__props__.__dict__["name"] = name
__props__.__dict__["precedence"] = precedence
__props__.__dict__["purpose_justification_prompt"] = purpose_justification_prompt
__props__.__dict__["purpose_justification_required"] = purpose_justification_required
__props__.__dict__["requires"] = requires
__props__.__dict__["zone_id"] = zone_id
return AccessPolicy(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="accountId")
def account_id(self) -> pulumi.Output[str]:
"""
The account to which the access rule should be added. Conflicts with `zone_id`.
"""
return pulumi.get(self, "account_id")
@property
@pulumi.getter(name="applicationId")
def application_id(self) -> pulumi.Output[str]:
"""
The ID of the application the policy is associated with.
"""
return pulumi.get(self, "application_id")
@property
@pulumi.getter(name="approvalGroups")
def approval_groups(self) -> pulumi.Output[Optional[Sequence['outputs.AccessPolicyApprovalGroup']]]:
"""
List of approval group blocks for configuring additional approvals (refer to the nested schema).
"""
return pulumi.get(self, "approval_groups")
@property
@pulumi.getter
def decision(self) -> pulumi.Output[str]:
"""
Defines the action Access will take if the policy matches the user.
Allowed values: `allow`, `deny`, `non_identity`, `bypass`
"""
return pulumi.get(self, "decision")
@property
@pulumi.getter
def excludes(self) -> pulumi.Output[Optional[Sequence['outputs.AccessPolicyExclude']]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "excludes")
@property
@pulumi.getter
def includes(self) -> pulumi.Output[Sequence['outputs.AccessPolicyInclude']]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "includes")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
Friendly name of the Access Application.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def precedence(self) -> pulumi.Output[int]:
"""
The unique precedence for policies on a single application. Integer.
"""
return pulumi.get(self, "precedence")
@property
@pulumi.getter(name="purposeJustificationPrompt")
def purpose_justification_prompt(self) -> pulumi.Output[Optional[str]]:
"""
String to present to the user when purpose justification is enabled.
"""
return pulumi.get(self, "purpose_justification_prompt")
@property
@pulumi.getter(name="purposeJustificationRequired")
def purpose_justification_required(self) -> pulumi.Output[Optional[bool]]:
"""
Boolean of whether to prompt the user for a justification for accessing the resource.
"""
return pulumi.get(self, "purpose_justification_required")
@property
@pulumi.getter
def requires(self) -> pulumi.Output[Optional[Sequence['outputs.AccessPolicyRequire']]]:
"""
A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions).
"""
return pulumi.get(self, "requires")
@property
@pulumi.getter(name="zoneId")
def zone_id(self) -> pulumi.Output[str]:
"""
The DNS zone to which the access rule should be added. Conflicts with `account_id`.
"""
return pulumi.get(self, "zone_id")
| 51.234315 | 262 | 0.678338 | 4,359 | 40,014 | 6.052764 | 0.056894 | 0.088387 | 0.066972 | 0.049272 | 0.924689 | 0.910741 | 0.894406 | 0.878449 | 0.870603 | 0.86128 | 0 | 0.012413 | 0.216824 | 40,014 | 780 | 263 | 51.3 | 0.829504 | 0.397561 | 0 | 0.769417 | 1 | 0 | 0.139214 | 0.078419 | 0 | 0 | 0 | 0 | 0 | 1 | 0.162621 | false | 0.002427 | 0.01699 | 0 | 0.276699 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
b592456449aa030a59abd31c495178763eb7dc76 | 68 | py | Python | battle_tested/beta/fuzz_planner.py | CodyKochmann/battle_tested | 6044d5988fdae9d1ead3fe42f2a93cc1a1d04a9b | [
"MIT"
] | 91 | 2017-06-26T14:01:43.000Z | 2022-02-15T11:41:20.000Z | battle_tested/beta/fuzz_planner.py | CodyKochmann/battle_tested | 6044d5988fdae9d1ead3fe42f2a93cc1a1d04a9b | [
"MIT"
] | 47 | 2017-05-20T12:51:05.000Z | 2021-06-11T08:43:35.000Z | battle_tested/beta/fuzz_planner.py | CodyKochmann/battle_tested | 6044d5988fdae9d1ead3fe42f2a93cc1a1d04a9b | [
"MIT"
] | 1 | 2017-08-07T05:18:40.000Z | 2017-08-07T05:18:40.000Z | from battle_tested.beta.input_type_combos import input_type_combos
| 22.666667 | 66 | 0.897059 | 11 | 68 | 5.090909 | 0.727273 | 0.321429 | 0.535714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.073529 | 68 | 2 | 67 | 34 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
b5a3c7873a28cb0e5fd5ad0bf0bcf23355a0e2a0 | 10,183 | py | Python | apps/data.py | Giorgiobientinesi/Decidata | 0f262850561d520a68efa1335378c1be6e397e88 | [
"MIT"
] | null | null | null | apps/data.py | Giorgiobientinesi/Decidata | 0f262850561d520a68efa1335378c1be6e397e88 | [
"MIT"
] | null | null | null | apps/data.py | Giorgiobientinesi/Decidata | 0f262850561d520a68efa1335378c1be6e397e88 | [
"MIT"
] | null | null | null | import streamlit as st
import pandas as pd
#SESSION STATE INITIALIZATION
if 'df' not in st.session_state:
st.session_state.df = 0
if "light" not in st.session_state:
st.session_state.light = "red"
if "warning" not in st.session_state:
st.session_state.warning = "Undefined Error"
if "selected_var" not in st.session_state:
st.session_state.selected_var=[]
def app():
st.session_state.light = "red"
st.session_state.warning = "Please select at least one predictor."
st.markdown(
"""
<style>
.stProgress > div > div > div > div {
background-image: linear-gradient(to right, #5b61f9 , #5b61f9);
}
</style>""",
unsafe_allow_html=True,
)
my_bar = st.progress(50)
if 'df' not in st.session_state:
st.session_state.df = 0
df = st.session_state.df
df1 = st.session_state.df
st.markdown('<h1 style="color: #5b61f9;">Null Values Detection</h1>',
unsafe_allow_html=True)
st.write("These are the percentage of Null Values in your Dataset. Please Select the variables you want to include in the analysis!")
variables = []
All = st.checkbox("Select All", key=0)
if All == True:
variables.append(list(df.columns))
variables = variables[0]
percent_missing = df.isnull().sum() * 100 / len(df)
missing_values = pd.DataFrame({"percent_missing": percent_missing})
cols = st.columns(3)
i = 1
if len(df.columns) % 2 == 0:
k = len(df.columns) / 2
k = int(k)
else:
k = len(df.columns)
k = k - 1
k = k / 2
k = int(k)
for el in list(df1.columns[:k]):
with st.container():
percent_missing = str(df1[el].isnull().sum() * 100 / len(df1))
for j in ["Target","Customer ID","Month"]:
if el ==j:
cols[2].markdown('<h6 style="color: #5b61f9;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i,disabled=True,value=True)
df1 = df1.drop([el],axis=1)
if float(percent_missing) == 0:
if el not in ["Target","Customer ID","Month"]:
cols[0].markdown('<h6 style="color: green;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[0].checkbox("", key=i,disabled=True,value=True)
elif float(percent_missing) < 20 and float(percent_missing) > 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[1].markdown('<h6 style="color: orange;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[1].checkbox("", key=i,disabled=True,value=True)
else:
if el not in ["Target", "Customer ID", "Month"]:
cols[2].markdown('<h6 style="color: red;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i,disabled=True,value=True)
i += 1
for el in list(df1.columns[k:]):
with st.container():
percent_missing = str(df1[el].isnull().sum() * 100 / len(df1))
for j in ["Target","Customer ID","Month"]:
if el == j:
cols[2].markdown('<h6 style="color: #5b61f9;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i,disabled=True,value=True)
df1 = df1.drop([el],axis=1)
if float(percent_missing) == 0:
if el not in ["Target","Customer ID","Month"]:
cols[1].markdown('<h6 style="color: green;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[1].checkbox("", key=i,disabled=True,value=True)
elif float(percent_missing) < 20 and float(percent_missing) > 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[0].markdown(
'<h6 style="color: orange;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[0].checkbox("", key=i,disabled=True,value=True)
else:
if el not in ["Target", "Customer ID", "Month"]:
cols[2].markdown('<h6 style="color: red;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i,disabled=True,value=True)
i += 1
else:
percent_missing = df.isnull().sum() * 100 / len(df)
missing_values = pd.DataFrame({"percent_missing": percent_missing})
variables = []
cols = st.columns(3)
i = 1
if len(df.columns) % 2 == 0:
k = len(df.columns) / 2
k = int(k)
else:
k = len(df.columns)
k = k - 1
k = k / 2
k = int(k)
for el in list(df1.columns[:k]):
with st.container():
percent_missing = str(df1[el].isnull().sum() * 100 / len(df1))
for j in ["Target", "Customer ID", "Month"]:
if el == j:
cols[2].markdown(
'<h6 style="color: #5b61f9;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i, disabled=True, value=True)
df1 = df1.drop([el], axis=1)
variables.append(el)
if float(percent_missing) == 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[0].markdown(
'<h6 style="color: green;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[0].checkbox("", key=i)
if a == True:
variables.append(el)
elif float(percent_missing) < 20 and float(percent_missing) > 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[1].markdown(
'<h6 style="color: orange;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[1].checkbox("", key=i)
if a == True:
variables.append(el)
else:
if el not in ["Target", "Customer ID", "Month"]:
cols[2].markdown(
'<h6 style="color: red;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i)
if a == True:
variables.append(el)
i += 1
for el in list(df1.columns[k:]):
with st.container():
percent_missing = str(df1[el].isnull().sum() * 100 / len(df1))
for j in ["Target", "Customer ID", "Month"]:
if el == j:
cols[2].markdown(
'<h6 style="color: #5b61f9;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i, disabled=True, value=True)
df1 = df1.drop([el], axis=1)
variables.append(el)
if float(percent_missing) == 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[1].markdown(
'<h6 style="color: green;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[1].checkbox("", key=i)
if a == True:
variables.append(el)
elif float(percent_missing) < 20 and float(percent_missing) > 0:
if el not in ["Target", "Customer ID", "Month"]:
cols[0].markdown(
'<h6 style="color: orange;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[0].checkbox("", key=i)
if a == True:
variables.append(el)
else:
if el not in ["Target", "Customer ID", "Month"]:
cols[2].markdown(
'<h6 style="color: red;">{}</h6>'.format(str(el) + " " + percent_missing[0:4] + "%"),
unsafe_allow_html=True)
a = cols[2].checkbox("", key=i)
if a == True:
variables.append(el)
i += 1
variables.remove("Month")
variables.remove("Customer ID")
st.session_state.selected_var= variables
df = df[st.session_state.selected_var]
st.dataframe(df)
if len(variables)>1:
st.session_state.light = "green"
#Passing list of selected var to next step
| 38.866412 | 137 | 0.446038 | 1,118 | 10,183 | 3.974955 | 0.103757 | 0.119712 | 0.081008 | 0.076958 | 0.830333 | 0.809856 | 0.809856 | 0.809856 | 0.787579 | 0.787579 | 0 | 0.034705 | 0.405774 | 10,183 | 261 | 138 | 39.015326 | 0.699719 | 0.006776 | 0 | 0.827957 | 0 | 0.005376 | 0.124685 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005376 | false | 0 | 0.010753 | 0 | 0.016129 | 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 |
8d3b5529732cf82cf026f1a015dd625b0829a160 | 108 | py | Python | src/office31/__init__.py | LukasHedegaard/office31-train-test-splits | cfd19c3bfeccf23ca905ec10b85806778d84e548 | [
"MIT"
] | 1 | 2020-09-18T03:36:22.000Z | 2020-09-18T03:36:22.000Z | src/office31/__init__.py | LukasHedegaard/office31-train-test-splits | cfd19c3bfeccf23ca905ec10b85806778d84e548 | [
"MIT"
] | 1 | 2021-03-21T03:19:36.000Z | 2021-03-30T12:14:16.000Z | src/office31/__init__.py | LukasHedegaard/office31 | cfd19c3bfeccf23ca905ec10b85806778d84e548 | [
"MIT"
] | null | null | null | from .split import office31 # noqa: F401
from .download import download_and_extract_office31 # noqa: F401
| 36 | 65 | 0.796296 | 15 | 108 | 5.533333 | 0.6 | 0.289157 | 0.385542 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108696 | 0.148148 | 108 | 2 | 66 | 54 | 0.793478 | 0.194444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
571e286cebd1bb4dc6b6748d631536cd7d9b5860 | 185,943 | py | Python | module_troops.py | infobeisel/mbnwcModSys | 6e05ec53cfb840a4962c3cb5387f505afefd9157 | [
"BSD-2-Clause"
] | null | null | null | module_troops.py | infobeisel/mbnwcModSys | 6e05ec53cfb840a4962c3cb5387f505afefd9157 | [
"BSD-2-Clause"
] | null | null | null | module_troops.py | infobeisel/mbnwcModSys | 6e05ec53cfb840a4962c3cb5387f505afefd9157 | [
"BSD-2-Clause"
] | null | null | null | import random
from header_common import *
from header_items import *
from header_troops import *
from header_skills import *
from ID_factions import *
from ID_items import *
from ID_scenes import *
####################################################################################################################
# Each troop contains the following fields:
# 1) Troop id (string): used for referencing troops in other files. The prefix trp_ is automatically added before each troop-id .
# 2) Toop name (string).
# 3) Plural troop name (string).
# 4) Troop flags (int). See header_troops.py for a list of available flags
# 5) Scene (int) (only applicable to heroes) For example: scn_reyvadin_castle|entry(1) puts troop in reyvadin castle's first entry point
# 6) Reserved (int). Put constant "reserved" or 0.
# 7) Faction (int)
# 8) Inventory (list): Must be a list of items
# 9) Attributes (int): Example usage:
# str_6|agi_6|int_4|cha_5|level(5)
# 10) Weapon proficiencies (int): Example usage:
# wp_one_handed(55)|wp_two_handed(90)|wp_polearm(36)|wp_archery(80)|wp_crossbow(24)|wp_throwing(45)
# The function wp(x) will create random weapon proficiencies close to value x.
# To make an expert archer with other weapon proficiencies close to 60 you can use something like:
# wp_archery(160) | wp(60)
# 11) Skills (int): See header_skills.py to see a list of skills. Example:
# knows_ironflesh_3|knows_power_strike_2|knows_riding_2
# 12) Face code (int): You can obtain the face code by pressing ctrl+E in face generator screen
# 13) Face code (int)(2) (only applicable to regular troops, can be omitted for heroes):
# The game will create random faces between Face code 1 and face code 2 for generated troops
# 14) Troop image (string): If this variable is set, the troop will use an image rather than its 3D visual during the conversations
# town_1 Sargoth
# town_2 Tihr
# town_3 Veluca
# town_4 Suno
# town_5 Jelkala
# town_6 Praven
# town_7 Uxkhal
# town_8 Reyvadin
# town_9 Khudan
# town_10 Tulga
# town_11 Curaw
# town_12 Wercheg
# town_13 Rivacheg
# town_14 Halmar
####################################################################################################################
# Some constant and function declarations to be used below...
# wp_one_handed () | wp_two_handed () | wp_polearm () | wp_archery () | wp_crossbow () | wp_throwing ()
def wp(x):
n = 0
r = 10 + int(x / 10)
# n |= wp_one_handed(x + random.randrange(r))
# n |= wp_two_handed(x + random.randrange(r))
# n |= wp_polearm(x + random.randrange(r))
# n |= wp_archery(x + random.randrange(r))
# n |= wp_crossbow(x + random.randrange(r))
# n |= wp_throwing(x + random.randrange(r))
n |= wp_one_handed(x)
n |= wp_two_handed(x)
n |= wp_polearm(x)
n |= wp_archery(x)
n |= wp_crossbow(x)
n |= wp_throwing(x)
return n
def wpe(m,a,c,t):
n = 0
n |= wp_one_handed(m)
n |= wp_two_handed(m)
n |= wp_polearm(m)
n |= wp_archery(a)
n |= wp_crossbow(c)
n |= wp_throwing(t)
return n
def wpex(o,w,p,a,c,t):
n = 0
n |= wp_one_handed(o)
n |= wp_two_handed(w)
n |= wp_polearm(p)
n |= wp_archery(a)
n |= wp_crossbow(c)
n |= wp_throwing(t)
n |= wp_firearm(10)
return n
def wp_melee(x):
n = 0
r = 10 + int(x / 10)
# n |= wp_one_handed(x + random.randrange(r))
# n |= wp_two_handed(x + random.randrange(r))
# n |= wp_polearm(x + random.randrange(r))
n |= wp_one_handed(x + 20)
n |= wp_two_handed(x)
n |= wp_polearm(x + 10)
return n
#Skills
knows_common = knows_trade_2|knows_inventory_management_2|knows_prisoner_management_1|knows_leadership_1
def_attrib = str_7 | agi_5 | int_4 | cha_4
def_attrib_multiplayer = str_14 | agi_14 | int_4 | cha_4
#These face codes are generated by the in-game face generator.
#Enable edit mode and press ctrl+E in face generator screen to obtain face codes.
reserved = 0
no_scene = 0
swadian_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
swadian_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
swadian_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
swadian_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
swadian_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
swadian_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
swadian_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
vaegir_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
vaegir_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
vaegir_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
vaegir_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
vaegir_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
vaegir_face_younger_2 = 0x000000003f00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_young_2 = 0x00000003bf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_middle_2 = 0x00000007bf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_old_2 = 0x0000000cbf00230c4deeffffffffffff00000000001efff90000000000000000
vaegir_face_older_2 = 0x0000000ff100230c4deeffffffffffff00000000001efff90000000000000000
khergit_face_younger_1 = 0x0000000009003109207000000000000000000000001c80470000000000000000
khergit_face_young_1 = 0x00000003c9003109207000000000000000000000001c80470000000000000000
khergit_face_middle_1 = 0x00000007c9003109207000000000000000000000001c80470000000000000000
khergit_face_old_1 = 0x0000000b89003109207000000000000000000000001c80470000000000000000
khergit_face_older_1 = 0x0000000fc9003109207000000000000000000000001c80470000000000000000
khergit_face_younger_2 = 0x000000003f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_young_2 = 0x00000003bf0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_middle_2 = 0x000000077f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_old_2 = 0x0000000b3f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
khergit_face_older_2 = 0x0000000fff0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000
nord_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
nord_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
nord_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
nord_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
nord_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
nord_face_younger_2 = 0x00000000310023084deeffffffffffff00000000001efff90000000000000000
nord_face_young_2 = 0x00000003b10023084deeffffffffffff00000000001efff90000000000000000
nord_face_middle_2 = 0x00000008310023084deeffffffffffff00000000001efff90000000000000000
nord_face_old_2 = 0x0000000c710023084deeffffffffffff00000000001efff90000000000000000
nord_face_older_2 = 0x0000000ff10023084deeffffffffffff00000000001efff90000000000000000
rhodok_face_younger_1 = 0x0000000009002003140000000000000000000000001c80400000000000000000
rhodok_face_young_1 = 0x0000000449002003140000000000000000000000001c80400000000000000000
rhodok_face_middle_1 = 0x0000000849002003140000000000000000000000001c80400000000000000000
rhodok_face_old_1 = 0x0000000cc9002003140000000000000000000000001c80400000000000000000
rhodok_face_older_1 = 0x0000000fc9002003140000000000000000000000001c80400000000000000000
rhodok_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
rhodok_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000
man_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000
man_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000
man_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000
man_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000
man_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000
man_face_younger_2 = 0x000000003f0052064deeffffffffffff00000000001efff90000000000000000
man_face_young_2 = 0x00000003bf0052064deeffffffffffff00000000001efff90000000000000000
man_face_middle_2 = 0x00000007bf0052064deeffffffffffff00000000001efff90000000000000000
man_face_old_2 = 0x0000000bff0052064deeffffffffffff00000000001efff90000000000000000
man_face_older_2 = 0x0000000fff0052064deeffffffffffff00000000001efff90000000000000000
merchant_face_1 = man_face_young_1
merchant_face_2 = man_face_older_2
woman_face_1 = 0x0000000000000001000000000000000000000000001c00000000000000000000
woman_face_2 = 0x00000003bf0030067ff7fbffefff6dff00000000001f6dbf0000000000000000
swadian_woman_face_1 = 0x0000000180102006124925124928924900000000001c92890000000000000000
swadian_woman_face_2 = 0x00000001bf1000061db6d75db6b6dbad00000000001c92890000000000000000
khergit_woman_face_1 = 0x0000000180103006124925124928924900000000001c92890000000000000000
khergit_woman_face_2 = 0x00000001af1030025b6eb6dd6db6dd6d00000000001eedae0000000000000000
refugee_face1 = woman_face_1
refugee_face2 = woman_face_2
girl_face1 = woman_face_1
girl_face2 = woman_face_2
mercenary_face_1 = 0x0000000000000000000000000000000000000000001c00000000000000000000
mercenary_face_2 = 0x0000000cff00730b6db6db6db7fbffff00000000001efffe0000000000000000
vaegir_face1 = vaegir_face_young_1
vaegir_face2 = vaegir_face_older_2
bandit_face1 = man_face_young_1
bandit_face2 = man_face_older_2
undead_face1 = 0x00000000002000000000000000000000
undead_face2 = 0x000000000020010000001fffffffffff
#NAMES:
#
tf_guarantee_all = tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield|tf_guarantee_ranged
tf_guarantee_all_wo_ranged = tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield
troops = [
["player","Player","Player",tf_hero|tf_unmoveable_in_party_window,no_scene,reserved,fac_player_faction,
[],
str_12|agi_9|int_4|cha_4,wp(100),0,0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000],
["multiplayer_profile_troop_male","multiplayer_profile_troop_male","multiplayer_profile_troop_male", tf_hero|tf_guarantee_all, 0, 0,fac_commoners,
[itm_character_uniform,itm_french_voltigeur_officer_pants,itm_french_versailles,itm_french_briquet_garde],
0, 0, 0, 0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000],
["multiplayer_profile_troop_female","multiplayer_profile_troop_female","multiplayer_profile_troop_female", tf_hero|tf_female|tf_guarantee_all, 0, 0,fac_commoners,
[itm_character_uniform,itm_french_voltigeur_officer_pants,itm_french_versailles,itm_french_briquet_garde],
0, 0, 0, 0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000],
["temp_troop","Temp Troop","Temp Troop",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0],
####################################################################################################################
# Troops before this point are hardwired into the game and their order should not be changed!
####################################################################################################################
# These are used as arrays in the scripts.
["temp_array_a","{!}temp_array_a","{!}temp_array_a",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0],
["multiplayer_data","{!}multiplayer_data","{!}multiplayer_data",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
#Multiplayer ai troops
# MM
["british_infantry_ai","British Line Infantry","Line Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_33_stovepipe,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2_ai","German Line Infantry","German Line Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_kgl_ranker,itm_french_voltigeur_officer_pants,itm_british_kgl_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander_ai","British Highland Infantry","Highland Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_highland_ranker,itm_british_highland_kilt,itm_british_highland_kilt_2,itm_british_highland_bonnet_ranker,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard_ai","British Foot Guard","Foot Guards",tf_guarantee_all,0,0,fac_britain,
[itm_british_guard_ranker,itm_british_coldstream_pants,itm_british_guard_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(70,5,170,5,130,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_infantry_ai","British Light Infantry","Light Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_light_ranker,itm_french_voltigeur_officer_pants,itm_british_light_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(40,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rifle_ai","British Rifleman","Riflemen",tf_guarantee_all,0,0,fac_britain,
[itm_british_rifle_ranker,itm_british_rifle_pants_green,itm_british_rifle_pants_grey,itm_british_rifle_pants_rolled,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_beret,itm_british_rifle_beret_2,itm_british_baker_rifle,itm_bullets,itm_british_baker_bayonet],
def_attrib|level(20),wpex(30,5,90,5,150,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_dragoon_ai","British Light Dragoon","Light Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_light_dragoon,itm_british_light_dragoon_pants,itm_british_lightdragoon_shako_ranker,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_british_carbine,itm_bullets,itm_lightdragoon_horse_britain_1,itm_lightdragoon_horse_britain_2,itm_lightdragoon_horse_britain_3,itm_lightdragoon_horse_britain_4],
def_attrib|level(20),wpex(40,5,30,5,140,5),knows_common|knows_riding_4|knows_ironflesh_2|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_dragoon_ai","British Dragoon","Heavy Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_inniskilling_ranker,itm_british_cav_pants,itm_british_iniskilling_helmet_ranker,itm_br_cavalry_gloves,itm_british_heavy_cav_sword,itm_heavydragoon_horse_britain],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_horseguard_ai","British Horse Guard","Horse Guards",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_blue_ranker,itm_british_cav_pants,itm_british_lifeguard_helmet_ranker,itm_br_horseguard_gloves,itm_british_heavy_cav_sword,itm_heavy_horse_britain],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_ai","British Artillerist","Artillery (Cannon)",tf_guarantee_all,0,0,fac_britain,
[itm_british_artillery_ranker,itm_french_voltigeur_officer_pants,itm_british_artillery_shako_ranker,itm_ramrod,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_alt_ai","British Artillerist","Artillery (Howitzer)",tf_guarantee_all,0,0,fac_britain,
[itm_british_artillery_ranker,itm_french_voltigeur_officer_pants,itm_british_artillery_shako_ranker,itm_ramrod,itm_british_brown_bess,itm_bullets],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rocket_ai","British Rocketeer","Rocket Artillery",tf_guarantee_all,0,0,fac_britain,
[itm_british_rocketeer,itm_british_rocketeer_pants,itm_british_rocket_tarleton,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_rockets],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_ai","French Line Infantry","Line Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2_ai","French Grenadier","Grenadiers",tf_guarantee_all,0,0,fac_france,
[itm_french_84e_body_ranker,itm_french_basic_infantry_pants,itm_french_inf_shako_84_ranker,itm_bullets,itm_french_charleville,itm_french_briquet_fake],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula_ai","Polish Line Infantry","Polish Line Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_vistula_body_ranker,itm_french_vistula_pants,itm_french_vistula_shako_ranker,itm_bullets,itm_french_charleville,itm_french_briquet_fake],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard_ai","French Grenadier Guard","Grenadier Guards",tf_guarantee_all,0,0,fac_france,
[itm_french_gap_body_ranker,itm_french_grap_pants,itm_french_gap_bearskin_ranker,itm_bullets,itm_french_versailles,itm_french_briquet_garde_fake,itm_officer_gloves],
def_attrib|level(20),wpex(70,5,170,5,130,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_voltigeur_ai","French Voltigeur","Voltigeurs",tf_guarantee_all,0,0,fac_france,
[itm_french_voltigeur_body_ranker,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_bullets,itm_french_charleville,itm_french_briquet_fake],
def_attrib|level(20),wpex(40,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_hussar_ai","French Hussar","Hussars",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_hussards_ranker,itm_french_hussards_ranker_pants,itm_french_hussar_shako_ranker,itm_french_light_cav_sabre,itm_hussar_horse_french],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_lancer_ai","Polish Lancer","Polish Lancers",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_lancer_body_ranker,itm_french_lancer_pants,itm_french_ldlg_czapka_ranker,itm_fr_cuirassier_gloves,itm_french_lance,itm_french_light_cav_sabre_garde,itm_lancer_horse_french],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_dragoon_ai","French Dragoon","Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_fr_cuirassier_gloves,itm_french_mousquiton,itm_french_mousquiton_light,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_french],
def_attrib|level(20),wpex(100,5,30,5,100,5),knows_common|knows_riding_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_cuirassier_ai","French Cuirassier","Cuirassiers",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_cuirassier_ranker,itm_rus_horse_guard_pants,itm_french_cuirassier_helmet,itm_fr_cuirassier_gloves,itm_french_line_cav_sabre,itm_cuirassier_horse_french,itm_rus_horse_guard_pants],
def_attrib|level(20),wpex(120,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_carabineer_ai","French Carabinier","Carabiniers",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_carabineer_ranker,itm_rus_horse_guard_pants,itm_french_carabineer_helmet,itm_fr_cuirassier_gloves,itm_french_carabineer_sword,itm_carabineer_horse_french],
def_attrib|level(20),wpex(120,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_grenadier_a_cheval_ai","French Horse Grenadier","Horse Grenadiers",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_grenadiers_a_cheval_body_ranker,itm_french_grenadiers_a_cheval_pants,itm_grach_bearskin_ranker,itm_fr_cuirassier_gloves,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_french],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_ai","French Artillerist","Artillery (Cannon)",tf_guarantee_all,0,0,fac_france,
[itm_french_art_ranker_body,itm_french_art_ranker_body_alt,itm_french_art_ranker_pants,itm_french_artillery_bearskin_ranker,itm_ramrod,itm_bullets,itm_french_charleville],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_alt_ai","French Artillerist","Artillery (Howitzer)",tf_guarantee_all,0,0,fac_france,
[itm_french_art_ranker_body,itm_french_art_ranker_body_alt,itm_french_art_ranker_pants,itm_french_artillery_bearskin_ranker,itm_ramrod,itm_bullets,itm_french_charleville],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_ai","Prussian Line Infantry","Line Infantry (Brandenburg)",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_infantry_ranker,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_2,itm_russian_briquet_1807_black_fake,itm_prussian_potsdam,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2_ai","Prussian Line Infantry","Line Infantry (Rhen)",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_infantry2_ranker,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_2,itm_prussian_infantry2_hat,itm_russian_briquet_1807_black_fake,itm_prussian_potsdam,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark_ai","Prussian Landwehr","Landwehr",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_landwehr_ranker,itm_prussian_landwehr_ranker_alt,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_russian_briquet_1807_landwehr_fake,itm_russian_peasant_axe_landwehr_fake,itm_prussian_potsdam,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps_ai","Prussian Freikorps","Freikorps",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_freikorps_ranker,itm_prussian_freikorps_pants,itm_prussian_shako_2,itm_russian_briquet_1807_black_blackbelt_fake,itm_prussian_potsdam,itm_bullets],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15_ai","Prussian Foot Guard","Foot Guards",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_guard_ranker,itm_austrian_officer_boots,itm_rus_infantry_pants2,itm_prussian_guard_ranker_shako,itm_russian_briquet_1807_black_fake,itm_prussian_potsdam,itm_bullets],
def_attrib|level(20),wpex(70,5,170,5,130,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_rifle_ai","Prussian Jaeger","Jaegers",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_jaeger_ranker,itm_prussian_jaeger_ranker_alt,itm_prussian_jaeger_pants,itm_prussian_shako_2,itm_russian_jaeger_bayonet_jaeger,itm_russian_rifle_1805,itm_bullets],
def_attrib|level(20),wpex(30,5,90,5,150,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_dragoon_ai","Prussian Dragoon","Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_dragoon_ranker,itm_prussian_cavalry_pants,itm_prussian_dragoon_shako_ranker,itm_british_light_cav_sabre,itm_russian_dragoon_musket,itm_bullets,itm_dragoon_horse_prussia_1],
def_attrib|level(20),wpex(100,5,30,5,100,5),knows_common|knows_riding_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_hussar_ai","Prussian Hussar","Hussars",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_hussar_ranker,itm_prussian_hussar_pants,itm_prussian_hussar_shako,itm_british_light_cav_sabre,itm_hussar_horse_prussia_1,itm_hussar_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_landwehr_cav_ai","Prussian Lancer","Lancers",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_landwehr_cav_ranker,itm_prussian_landwehr_pants2,itm_prussian_landwehr_cav_shako,itm_prussian_lance,itm_british_light_cav_sabre,itm_lancer_horse_prussia_1,itm_lancer_horse_prussia_2],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_cuirassier_ai","Prussian Cuirassier","Cuirassiers",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_cuirassier_ranker,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_cuirassier_helmet,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_prussia_1,itm_heavy_horse_prussia_2],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_ai","Prussian Artillerist","Artillery (Cannon)",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_arty_ranker,itm_prussian_infantry_pants,itm_prussian_arty_shako_ranker,itm_ramrod,itm_bullets,itm_prussian_potsdam],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_alt_ai","Prussian Artillerist","Artillery (Howitzer)",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_arty_ranker,itm_prussian_infantry_pants,itm_prussian_arty_shako_ranker,itm_ramrod,itm_bullets,itm_prussian_potsdam],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_partizan_ai","Russian Partisan","Partisans",tf_guarantee_all_wo_ranged,0,0,fac_russia,
[itm_rus_partizan1,itm_rus_partizan2,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_opol_hat_ranker,itm_rus_partisan_hat1,itm_rus_partisan_hat2,itm_rus_partisan_hat3,itm_rus_partisan_hat4,itm_rus_partisan_hat5,itm_rus_opol_hat_ranker,itm_rus_drummer_shako,itm_bullets,itm_russian_dragoon_musket,itm_russian_peasant_fork,itm_russian_peasant_pitchfork,itm_russian_peasant_sap,itm_russian_peasant_kosa,itm_russian_peasant_kosa2,itm_birch_trunk,itm_brokenbottle,itm_russian_peasant_club,itm_russian_peasant_birch_club,itm_russian_peasant_axe,itm_russian_peasant_knife,itm_russian_peasant_serp,itm_russian_peasant_pike,itm_russian_peasant_kuvalda,itm_russian_peasant_2handed_axe,itm_russian_peasant_rogatina,itm_russian_gusarskiy_karabin],
def_attrib|level(20),wpex(40,5,80,5,80,60),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_opol_ai","Russian Militia","Line Militia",tf_guarantee_all_wo_ranged,0,0,fac_russia,
[itm_russian_militia_ranker,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_opol_hat_ranker,itm_bullets,itm_russian_dragoon_musket,itm_russian_opolcheniye_pike,itm_russian_opolcheniye_pike,itm_russian_peasant_axe],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_ai","Russian Line Infantry","Line Infantry",tf_guarantee_all,0,0,fac_russia,
[itm_russian_infantry1,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_drummer_shako,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807_fake],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier_ai","Russian Grenadier","Grenadiers",tf_guarantee_all,0,0,fac_russia,
[itm_russian_gren_ranker,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807_fake,itm_officer_gloves],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard_ai","Russian Foot Guard","Foot Guards",tf_guarantee_all,0,0,fac_russia,
[itm_russian_guard_ranker,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_ranker,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807_fake,itm_officer_gloves],
def_attrib|level(20),wpex(70,5,170,5,130,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_rifle_ai","Russian Jaeger","Jaegers",tf_guarantee_all,0,0,fac_russia,
[itm_russian_jaeger_ranker,itm_rus_jaeger_pants,itm_rus_jaeger_shako_ranker,itm_russian_rifle_1805,itm_bullets,itm_russian_jaeger_bayonet_jaeger],
def_attrib|level(20),wpex(30,5,90,5,150,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_hussar_ai","Russian Hussar","Hussars",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_hussar_ranker,itm_rus_hussar_pants_nco,itm_rus_hussar_shako_ranker,itm_russian_sabre_1809,itm_hussar_horse_russia],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_uhlan_ai","Russian Uhlan","Uhlans",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_uhlan_ranker,itm_rus_uhlan_pants,itm_rus_uhlan_czapka_ranker,itm_russian_lancer_pike,itm_russian_sabre_1798,itm_lancer_horse_russia],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_cossack_ai","Russian Cossack","Cossacks",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_cossack,itm_rus_cossack_off_pants,itm_rus_cossack_hat_ranker,itm_russian_cossack_pike,itm_russian_sabre_1798,itm_cossack_horse_russia_1,itm_cossack_horse_russia_2,itm_cossack_horse_russia_3,itm_cossack_horse_russia_4],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_dragoon_ai","Russian Dragoon","Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_dragoon_ranker,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_kyiv_dragoons_all,itm_russian_dragoon_musket,itm_bullets,itm_russian_sword_1810,itm_dragoon_horse_russia],
def_attrib|level(20),wpex(100,5,30,5,100,5),knows_common|knows_riding_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_horse_guard_ai","Russian Cavalry Guard","Cavalry Guards",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_horse_guard,itm_rus_horse_guard_pants,itm_rus_chevalier_hat,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(120,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_ai","Russian Artillerist","Artillery (Cannon)",tf_guarantee_all,0,0,fac_russia,
[itm_russian_arty_ranker,itm_rus_arty_pants,itm_rus_arty_shako_ranker,itm_ramrod,itm_bullets,itm_russian_musket_1808],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_alt_ai","Russian Artillerist","Artillery (Howitzer)",tf_guarantee_all,0,0,fac_russia,
[itm_russian_arty_ranker,itm_rus_arty_pants,itm_rus_arty_shako_ranker,itm_ramrod,itm_bullets,itm_russian_musket_1808],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_ai","Austrian Line Infantry","Line Infantry",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_infantry,itm_aus_infantry_ranker,itm_austrian_infantry_pants,itm_bullets,itm_austrian_musket],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2_ai","Hungarian Line Infantry","Line Infantry",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_infantry2,itm_aus_infantry_ranker,itm_hungarian_pants,itm_bullets,itm_austrian_musket],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer_ai","Austrian Grenzer","Grenzers",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_grenzer,itm_aus_grenzer_ranker,itm_hungarian_pants,itm_austrian_musket,itm_austrian_musket,itm_austrian_musket,itm_austrian_musket,itm_russian_rifle_1805,itm_russian_rifle_1805,itm_russian_gusarskiy_karabin,itm_bullets,itm_austrian_jaeger_bayonet_invis],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier_ai","Hungarian Grenadier","Grenadiers",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_grenadier,itm_austrian_grenadier_alt,itm_aus_grenadier_bearskin,itm_hungarian_pants,itm_bullets,itm_austrian_musket,itm_austrian_infantry_briquet_fake,itm_officer_gloves],
def_attrib|level(20),wpex(70,5,170,5,130,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_rifle_ai","Austrian Jaeger","Jaegers",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_jaeger,itm_aus_tyrol_hat,itm_austrian_jaeger_pants,itm_russian_rifle_1805,itm_bullets,itm_austrian_jaeger_bayonet],
def_attrib|level(20),wpex(30,5,90,5,150,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_hussar_ai","Austrian Hussar","Hussars",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_hussar,itm_aus_hussard_shako_ranker,itm_hungarian_hussar_pants,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_hussar_horse_austria],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_uhlan_ai","Austrian Uhlan","Uhlans",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_uhlan,itm_aus_uhlan_czapka,itm_hungarian_uhlan_pants,itm_br_cavalry_gloves_short,itm_austrian_lance,itm_british_light_cav_sabre,itm_lancer_horse_austria],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_light_horse_ai","Austrian Chevauleger","Chevaulegers",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_lightcav,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_russian_dragoon_musket,itm_bullets,itm_russian_sword_1810,itm_lightcav_horse_austria],
def_attrib|level(20),wpex(40,5,30,5,140,5),knows_common|knows_riding_4|knows_ironflesh_2|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_dragoon_ai","Austrian Dragoon","Dragoons",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_dragoon,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_russian_dragoon_musket,itm_bullets,itm_russian_sword_1810,itm_dragoon_horse_austria],
def_attrib|level(20),wpex(100,5,30,5,100,5),knows_common|knows_riding_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_cuirassier_ai","Austrian Cuirassier","Cuirassiers",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_cuiraisser,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_rus_chevgarde_gloves,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(120,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_ai","Austrian Artillerist","Artillery (Cannon)",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_arty,itm_aus_arty_bicorn,itm_austrian_officer_boots,itm_ramrod,itm_bullets,itm_austrian_musket],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_alt_ai","Austrian Artillerist","Artillery (Howitzer)",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_arty,itm_aus_arty_bicorn,itm_austrian_officer_boots,itm_ramrod,itm_bullets,itm_austrian_musket],
def_attrib|level(20),wpex(50,5,50,5,80,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
#Multiplayer troops
### BRITAIN ###
#original
#["british_infantry","33rd Regiment of Foot","Line Infantry",tf_guarantee_all,0,0,fac_britain,
#[itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_33_stovepipe,itm_british_brown_bess,itm_bullets],
#def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry","33rd Regiment of Foot","Line Infantry",tf_guarantee_all,0,0,fac_britain,[itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_33_stovepipe,itm_british_brown_bess,itm_bullets], #[itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_independent_kentucky_rifle,itm_native_iroquois_tomahawk,itm_native_iroquois_tomahawk_melee,itm_native_cherokee_tomahawk,itm_native_cherokee_tomahawk_melee,itm_native_headache_club],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,khergit_face_middle_1, khergit_face_old_2],
#New World Conflict Troops
#["british_cherokee_warrior","Cherokee Warrior","Cherokee Warriors",tf_guarantee_all,0,0,fac_britain,
# [itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_independent_kentucky_rifle,itm_native_iroquois_tomahawk,itm_native_iroquois_tomahawk_melee,itm_native_cherokee_tomahawk,itm_native_cherokee_tomahawk_melee,itm_native_headache_club],
# def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,khergit_face_middle_1, khergit_face_old_2],
["british_infantry_nco","33rd Regiment of Foot","Ensign",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_infantry_sarge,itm_rus_dragoon_pants1,itm_33_stovepipe,itm_br_cavalry_gloves_short,itm_britain_colour_33rd_regt,itm_britain_colour_33rd_king,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry_officer","33rd Regiment of Foot","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_infantry_officer,itm_rus_dragoon_pants1,itm_33_stovepipe,itm_br_cavalry_gloves_short,itm_british_officer_sword,itm_british_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry_drum","33rd Regiment of Foot","Drummer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_infantry_drum,itm_french_voltigeur_officer_pants,itm_33_stovepipe,itm_drummer_gloves,itm_drumstick_right,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry_flute","33rd Regiment of Foot","Fifer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_infantry_flute,itm_french_voltigeur_officer_pants,itm_33_stovepipe,itm_flute,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2","5th Line Battalion King's German Legion","Line Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_kgl_ranker,itm_french_voltigeur_officer_pants,itm_british_kgl_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2_nco","Kings German Legion 5th Battalion","Ensign",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_kgl_sarge,itm_rus_dragoon_pants1,itm_british_kgl_shako_officer,itm_br_cavalry_gloves_short,itm_britain_colour_kgl_regt,itm_britain_colour_kgl_king,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2_officer","Kings German Legion 5th Battalion","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_kgl_officer,itm_rus_dragoon_pants1,itm_british_kgl_shako_officer,itm_br_cavalry_gloves_short,itm_british_officer_sword,itm_british_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2_drum","Kings German Legion 5th Battalion","Drummer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_kgl_drum,itm_french_voltigeur_officer_pants,itm_british_kgl_shako_ranker,itm_drummer_gloves,itm_drumstick_right,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_infantry2_flute","Kings German Legion 5th Battalion","Fifer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_kgl_flute,itm_french_voltigeur_officer_pants,itm_british_kgl_shako_ranker,itm_flute,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander","42nd Regiment of Foot (Black Watch)","Line Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_highland_ranker,itm_british_highland_kilt,itm_british_highland_kilt_2,itm_british_highland_bonnet_ranker,itm_british_brown_bess,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,500,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander_nco","42nd Highland Regiment of Foot","Ensign",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_highland_sarge,itm_rus_dragoon_pants1,itm_british_highland_bonnet_ensign,itm_br_cavalry_gloves_short,itm_britain_colour_42nd_regt,itm_britain_colour_42nd_king,itm_british_highlander_officer_sword],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander_officer","42nd Highland Regiment of Foot","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_highland_officer,itm_rus_dragoon_pants1,itm_british_highland_bonnet_officer,itm_br_cavalry_gloves_short,itm_british_highlander_officer_sword,itm_british_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander_drum","42nd Highland Regiment of Foot","Drummer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_highland_drummer,itm_british_highland_kilt_officer,itm_british_highland_bonnet_drummer,itm_drummer_gloves,itm_drumstick_right,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_highlander_pipes","42nd Highland Regiment of Foot","Piper",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_highland_piper,itm_british_highland_piper_2,itm_british_highland_kilt_officer,itm_british_highland_bonnet_ranker,itm_bagpipe,itm_british_highlander_officer_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard","Coldstream Regiment of Foot Guards","Foot Guard",tf_guarantee_all,0,0,fac_britain,
[itm_british_guard_ranker,itm_british_coldstream_pants,itm_british_guard_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,145,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard_nco","2nd Regiment of Foot Guards (Coldstream)","Ensign",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_guard_sarge,itm_rus_dragoon_pants1,itm_british_guard_shako_officer,itm_br_cavalry_gloves_short,itm_britain_colour_2nd_regt,itm_britain_colour_2nd_king,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard_officer","2nd Regiment of Foot Guards (Coldstream)","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_guard_officer,itm_rus_dragoon_pants1,itm_british_guard_shako_officer,itm_br_cavalry_gloves_short,itm_british_pistol,itm_pistol_ammo,itm_british_officer_sword,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard_drum","2nd Regiment of Foot Guards (Coldstream)","Drummer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_guard_drum,itm_british_coldstream_pants,itm_british_guard_shako_ranker,itm_drumstick_right,itm_drummer_gloves,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_foot_guard_flute","2nd Regiment of Foot Guards (Coldstream)","Fifer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_guard_flute,itm_british_coldstream_pants,itm_british_guard_shako_ranker,itm_flute,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_infantry","51st (2nd Yorkshire West Riding) Regiment of Foot","Light Infantry",tf_guarantee_all,0,0,fac_britain,
[itm_british_light_ranker,itm_french_voltigeur_officer_pants,itm_british_light_shako_ranker,itm_british_brown_bess,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_infantry_nco","51st Regiment of Foot","Ensign",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_sarge,itm_rus_dragoon_pants1,itm_british_light_shako_officer,itm_br_cavalry_gloves_short,itm_britain_colour_51st_regt,itm_britain_colour_51st_king,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_infantry_officer","51st Regiment of Foot","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_officer,itm_rus_dragoon_pants1,itm_british_light_shako_officer,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_british_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_infantry_horn","51st Regiment of Foot","Hornist",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_bugler,itm_french_voltigeur_officer_pants,itm_british_light_shako_ranker,itm_horn,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rifle","95th Regiment of Foot (Rifles)","Rifleman",tf_guarantee_all,0,0,fac_britain,
[itm_british_rifle_ranker,itm_british_rifle_pants_green,itm_british_rifle_pants_grey,itm_british_rifle_pants_rolled,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_beret,itm_british_rifle_beret_2,itm_british_baker_rifle,itm_bullets,itm_british_baker_bayonet],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rifle_nco","95th Rifle Regiment of Foot","Sergeant",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_rifle_sarge,itm_british_rifle_pants_green,itm_british_rifle_pants_grey,itm_british_rifle_pants_rolled,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_beret,itm_british_rifle_beret_2,itm_br_cavalry_gloves_short,itm_british_baker_rifle,itm_bullets,itm_british_baker_bayonet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rifle_officer","95th Rifle Regiment of Foot","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_rifle_captain,itm_british_rifle_captain_pants,itm_british_rifle_shako_officer,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_british_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rifle_horn","95th Rifle Regiment of Foot","Hornist",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_rifle_bugler,itm_british_rifle_pants_green,itm_british_rifle_pants_grey,itm_british_rifle_pants_rolled,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_shako_ranker,itm_british_rifle_beret,itm_british_rifle_beret_2,itm_horn,itm_british_baker_bayonet], #,itm_british_baker_rifle,itm_bullets
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_light_dragoon","23rd Light Dragoons","Light Horse",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_light_dragoon,itm_british_light_dragoon_pants,itm_british_lightdragoon_shako_ranker,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_british_carbine,itm_bullets,itm_lightdragoon_horse_britain_1,itm_lightdragoon_horse_britain_2,itm_lightdragoon_horse_britain_3,itm_lightdragoon_horse_britain_4],
def_attrib|level(20),wpex(70,5,30,5,155,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["british_light_dragoon_nco","23rd Light Dragoons","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_dragoon,itm_british_light_dragoon_pants,itm_british_lightdragoon_shako_ranker,itm_br_cavalry_gloves_short,itm_britain_colour_blues,itm_british_light_cav_sabre,itm_british_carbine,itm_bullets,itm_lightdragoon_horse_britain_1,itm_lightdragoon_horse_britain_2,itm_lightdragoon_horse_britain_3,itm_lightdragoon_horse_britain_4],
def_attrib|level(20),wpex(80,5,30,5,155,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["british_light_dragoon_officer","23rd Light Dragoons","Officer",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_dragoon_officer,itm_british_light_dragoon_pants,itm_british_lightdragoon_shako_officer,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_british_pistol,itm_pistol_ammo,itm_lightdragoon_horse_britain_1,itm_lightdragoon_horse_britain_2,itm_lightdragoon_horse_britain_3,itm_lightdragoon_horse_britain_4,itm_spyglass],
def_attrib|level(20),wpex(80,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["british_light_dragoon_bugle","23rd Light Dragoons","Bugler",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_light_dragoon,itm_british_light_dragoon_pants,itm_british_lightdragoon_shako_trumpeter,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_bugle,itm_lightdragoon_horse_britain_1,itm_lightdragoon_horse_britain_2,itm_lightdragoon_horse_britain_3,itm_lightdragoon_horse_britain_4],
def_attrib|level(20),wpex(80,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["british_dragoon","6th (Inniskilling) Dragoons","Heavy Cavalry",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_inniskilling_ranker,itm_british_cav_pants,itm_british_iniskilling_helmet_ranker,itm_br_cavalry_gloves,itm_british_heavy_cav_sword,itm_heavydragoon_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_dragoon_nco","6th (Inniskilling) Dragoons","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_inniskilling_ranker,itm_british_cav_pants,itm_british_iniskilling_helmet_ranker,itm_br_cavalry_gloves,itm_britain_colour_blues,itm_british_heavy_cav_sword,itm_heavydragoon_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_dragoon_officer","6th (Inniskilling) Dragoons","Officer",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_inniskilling_officer,itm_british_cav_pants,itm_british_iniskilling_helmet_officer,itm_br_cavalry_gloves_short,itm_british_heavy_cav_sword,itm_british_pistol,itm_pistol_ammo,itm_heavydragoon_horse_britain,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_dragoon_bugle","6th (Inniskilling) Dragoons","Bugler",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_inniskilling_ranker,itm_british_cav_pants,itm_british_iniskilling_helmet_trumpeter,itm_br_cavalry_gloves,itm_british_heavy_cav_sword,itm_bugle,itm_heavydragoon_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_horseguard","Royal Horse Guards Blue","Heavy Cavalry",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_blue_ranker,itm_british_cav_pants,itm_british_lifeguard_helmet_ranker,itm_br_horseguard_gloves,itm_british_heavy_cav_sword,itm_heavy_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_horseguard_nco","Royal Horse Guards Blue","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_blue_ranker,itm_british_cav_pants,itm_british_lifeguard_helmet_ranker,itm_br_horseguard_gloves,itm_britain_colour_blues,itm_british_heavy_cav_sword,itm_heavy_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_horseguard_officer","Royal Horse Guards Blue","Officer",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_blue_officer,itm_british_cav_pants,itm_british_lifeguard_helmet_officer,itm_br_horseguard_gloves_short,itm_british_heavy_cav_sword,itm_british_pistol,itm_pistol_ammo,itm_heavy_horse_britain,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_horseguard_bugle","Royal Horse Guards Blue","Bugler",tf_mounted|tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_blue_ranker,itm_british_cav_pants,itm_british_lifeguard_helmet_trumpeter,itm_br_horseguard_gloves,itm_british_heavy_cav_sword,itm_bugle,itm_heavy_horse_britain],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty","Royal Foot Artillery","Artillery",tf_guarantee_all,0,0,fac_britain,
[itm_british_artillery_ranker,itm_french_voltigeur_officer_pants,itm_british_artillery_shako_ranker,itm_ramrod,itm_cannon_lighter,itm_british_musician_sword_invis],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_nco","Royal Foot Artillery","Artillery Train",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_artillery_train,itm_british_light_dragoon_pants,itm_british_rocket_tarleton,itm_br_cavalry_gloves_short,itm_cannon_lighter,itm_arty_horse_cannon_british,itm_arty_horse_howitzer_british,itm_british_musician_sword],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_officer","Royal Foot Artillery","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_artillery_officer,itm_rus_dragoon_pants1,itm_british_artillery_shako_officer,itm_br_cavalry_gloves_short,itm_british_officer_sword,itm_cannon_lighter,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_rocket","2nd Rocket Troop","Rocket Artillery",tf_guarantee_all,0,0,fac_britain,
[itm_british_rocketeer,itm_british_rocketeer_pants,itm_british_rocket_tarleton,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_cannon_lighter,itm_rockets],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_sapper","Sapper","Engineer",tf_guarantee_all,0,0,fac_britain,
[itm_british_sapper,itm_british_sapper_pants,itm_british_guard_shako_ranker,itm_sapper_axe,itm_construction_hammer,itm_shovel,itm_russian_sappeur_dagger_invis],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["wellington","Arthur Wellesley, Duke of Wellington","Commander",tf_mounted|tf_guarantee_all,0,0,fac_britain,
[itm_british_wellington,itm_british_wellington_pants,itm_british_wellington_bicorne,itm_br_cavalry_gloves_short,itm_heavy_horse_britain,itm_french_line_cav_sabre,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
### FRANCE ###
["french_infantry","45e Regiment d'Infanterie de ligne","Line Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_nco","45e Regiment d'Infanterie de ligne","Eagle Bearer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_45e_body_colours,itm_french_captain_pants,itm_french_inf_bicorne_45_officer,itm_flag_france_45e,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_officer","45e Regiment d'Infanterie de ligne","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_45e_body_officer,itm_french_captain_pants,itm_french_inf_bicorne_45_officer,itm_french_inf_off_sabre,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_drum","45e Regiment d'Infanterie de ligne","Drummer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_45e_body_drummer,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_drummer_gloves,itm_drumstick_right,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_flute","45e Regiment d'Infanterie de ligne","Fifer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_45e_body_flautist,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_flute,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2","84e Regiment d'Infanterie de ligne","Line Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_84e_body_ranker,itm_french_basic_infantry_pants,itm_french_inf_shako_84_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2_nco","84e Regiment d'Infanterie de ligne","Eagle Bearer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_84e_body_sarge,itm_french_captain_pants,itm_french_inf_shako_84_colours,itm_flag_france_84e,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2_officer","84e Regiment d'Infanterie de ligne","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_84e_body_officer,itm_fr_officer_bottefortes,itm_french_inf_shako_84_officer,itm_french_inf_off_sabre,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2_drum","84e Regiment d'Infanterie de ligne","Drummer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_84e_body_drummer,itm_french_basic_infantry_pants,itm_french_inf_shako_84_ranker,itm_drummer_gloves,itm_drumstick_right,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry2_flute","84e Regiment d'Infanterie de ligne","Fifer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_84e_body_flautist,itm_french_basic_infantry_pants,itm_french_inf_shako_84_ranker,itm_flute,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula","Legion de la Vistule","Line Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_vistula_body_ranker,itm_french_vistula_pants,itm_french_vistula_shako_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula_colours","Legion de la Vistule","Eagle Bearer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_vistula_body_colours,itm_french_vistula_pants,itm_french_vistula_shako_colours,itm_flag_france_vistula,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula_officer","Legion de la Vistule","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_vistula_body_officer,itm_fr_officer_bottefortes,itm_french_vistula_shako_officer,itm_french_inf_off_sabre,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula_drum","Legion de la Vistule","Drummer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_vistula_body_drummer,itm_french_vistula_pants,itm_french_vistula_shako_ranker,itm_drummer_gloves,itm_drumstick_right,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_infantry_vistula_flute","Legion de la Vistule","Fifer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_vistula_body_flautist,itm_french_vistula_pants,itm_french_vistula_shako_ranker,itm_flute,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard","1er Regiment de Grenadiers de la Garde Imperiale","Foot Guard",tf_guarantee_all,0,0,fac_france,
[itm_french_gap_body_ranker,itm_french_grap_pants,itm_french_gap_bearskin_ranker,itm_bullets,itm_french_versailles,itm_french_briquet_garde],
def_attrib_multiplayer|level(20),wpex(50,5,145,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard_nco","1er Regiment de Grenadiers de la Garde Imperiale","Eagle Bearer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_gap_body_colours,itm_french_captain_pants,itm_french_gap_bearskin_colours,itm_flag_france_grenadiers,itm_french_briquet_garde],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard_officer","1er Regiment de Grenadiers de la Garde Imperiale","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_gap_body_officer,itm_french_captain_pants,itm_french_gap_bearskin_officer,itm_french_inf_off_sabre_garde,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard_drum","1er Regiment de Grenadiers de la Garde Imperiale","Drummer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_grap_body_drummer,itm_french_grap_pants,itm_french_gap_bearskin_ranker,itm_drummer_gloves,itm_drumstick_right,itm_french_briquet_garde],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_old_guard_flute","1er Regiment de Grenadiers de la Garde Imperiale","Fifer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_grap_body_flautist,itm_french_grap_pants,itm_french_gap_bearskin_ranker,itm_flute,itm_french_briquet_garde,itm_officer_gloves],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_voltigeur","15eme Regiment d'Infanterie Legere","Light Infantry",tf_guarantee_all,0,0,fac_france,
[itm_french_voltigeur_body_ranker,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_bullets,itm_french_charleville,itm_french_dragoon_musket,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_voltigeur_colours","15eme Regiment d'Infanterie Legere","Eagle Bearer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_voltigeur_body_sarge,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_flag_france_15,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_voltigeur_officer","15eme Regiment d'Infanterie Legere","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_voltigeur_body_officer,itm_french_voltigeur_officer_pants,itm_french_voltigeur_shako_officer,itm_french_light_inf_off_sabre,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_voltigeur_horn","15eme Regiment d'Infanterie Legere","Hornist",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_voltigeur_body_hornist,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_horn,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_hussar","2e Regiment de Hussards","Hussar",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_hussards_ranker,itm_french_hussards_ranker_pants,itm_french_hussar_shako_ranker,itm_french_light_cav_sabre,itm_hussar_horse_french],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_hussar_nco","2e Regiment de Hussards","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_hussards_nco,itm_french_hussards_ranker_pants,itm_french_hussar_shako_colours,itm_flag_france_hussard,itm_french_light_cav_sabre,itm_hussar_horse_french],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_hussar_officer","2e Regiment de Hussards","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_hussards_officer,itm_french_hussards_officer_pants,itm_french_hussar_bearskin_officer,itm_pistol_ammo,itm_french_pistol_1777,itm_french_light_cav_off_sabre,itm_hussar_horse_french,itm_spyglass],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_hussar_trumpet","2e Regiment de Hussards","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_hussards_trumpeter,itm_french_hussards_trumpeter_pants,itm_french_hussar_shako_trumpeter,itm_trumpet,itm_french_light_cav_sabre,itm_hussar_horse_french_trumpet],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_lancer","Regiment de Chevau-Legers Lanciers de la Garde","Lancer",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_lancer_body_ranker,itm_french_lancer_pants,itm_french_ldlg_czapka_ranker,itm_fr_cuirassier_gloves,itm_french_lance,itm_french_light_cav_sabre_garde,itm_lancer_horse_french],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_lancer_nco","Regiment de Chevau-Legers Lanciers de la Garde","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_lancer_body_colours,itm_french_lancer_pants,itm_french_ldlg_czapka_ranker,itm_fr_cuirassier_gloves,itm_flag_france_lancier,itm_french_light_cav_sabre_garde,itm_lancer_horse_french],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_lancer_officer","Regiment de Chevau-Legers Lanciers de la Garde","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_lancer_body_officer,itm_french_lancer_officer_pants,itm_french_ldlg_czapka_officer,itm_fr_cuirassier_gloves,itm_pistol_ammo,itm_french_cav_pistol,itm_french_light_cav_off_sabre,itm_lancer_horse_french,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_lancer_trumpet","Regiment de Chevau-Legers Lanciers de la Garde","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_lancer_trumpeter_body,itm_french_lancer_officer_pants,itm_french_ldlg_czapka_trumpeter,itm_fr_cuirassier_gloves,itm_trumpet,itm_french_light_cav_sabre_garde,itm_lancer_horse_french_trumpet],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_dragoon","Regiment de Dragons de l'Imperatrice","Dragoon",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_fr_cuirassier_gloves,itm_french_mousquiton,itm_french_mousquiton_light,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_french],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_dragoon_nco","Regiment de Dragons de l'Imperatrice","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_dragoon_body_sargent,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_fr_cuirassier_gloves,itm_flag_france_dragon,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_french],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_dragoon_officer","Regiment de Dragons de l'Imperatrice","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_dragoon_body_officer,itm_french_dragoon_pants,itm_french_dragoon_helmet_officer,itm_fr_cuirassier_gloves,itm_pistol_ammo,itm_french_cav_pistol,itm_french_heavy_cav_off_sabre,itm_dragoon_horse_french,itm_spyglass],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_dragoon_trumpet","Regiment de Dragons de l'Imperatrice","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_dragoon_body_trumpeter,itm_french_dragoon_pants,itm_french_dragoon_helmet_trumpeter,itm_fr_cuirassier_gloves,itm_trumpet,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_french_trumpet],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_cuirassier","9eme Regiment de Cuirassiers","Cuirassier",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_cuirassier_ranker,itm_rus_horse_guard_pants,itm_french_cuirassier_helmet,itm_fr_cuirassier_gloves,itm_french_line_cav_sabre,itm_cuirassier_horse_french,itm_rus_horse_guard_pants],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_cuirassier_nco","Cuirassiers","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_cuirassier_colours,itm_rus_horse_guard_pants,itm_french_cuirassier_helmet,itm_fr_cuirassier_gloves,itm_flag_france_cuirassier,itm_french_line_cav_sabre,itm_cuirassier_horse_french],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_cuirassier_officer","Cuirassiers","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_cuirassier_officer,itm_rus_horse_guard_pants,itm_french_cuirassier_helmet_officer,itm_fr_cuirassier_gloves,itm_french_cav_pistol,itm_pistol_ammo,itm_french_heavy_cav_off_sabre,itm_cuirassier_horse_french_officer,itm_spyglass],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_cuirassier_trumpet","Cuirassiers","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_fr_cuirassier_body_trumpeter,itm_rus_horse_guard_pants,itm_french_cuirassier_helmet_trumpeter,itm_fr_cuirassier_gloves,itm_trumpet,itm_french_line_cav_sabre,itm_cuirassier_horse_french_trumpet],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_carabineer","1er Regiment de Carabiniers","Carabinier",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_carabineer_ranker,itm_rus_horse_guard_pants,itm_french_carabineer_helmet,itm_fr_cuirassier_gloves,itm_french_carabineer_sword,itm_carabineer_horse_french],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_carabineer_nco","Carabineers","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_carabineer_colours,itm_rus_horse_guard_pants,itm_french_carabineer_helmet,itm_fr_cuirassier_gloves,itm_flag_france_carab,itm_french_carabineer_sword,itm_carabineer_horse_french],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_carabineer_officer","Carabineers","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_carabineer_officer,itm_rus_horse_guard_pants,itm_french_carabineer_helmet_officer,itm_fr_cuirassier_gloves,itm_french_cav_pistol,itm_pistol_ammo,itm_french_heavy_cav_off_sabre,itm_carabineer_horse_french_officer,itm_spyglass],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_carabineer_trumpet","Carabineers","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_fr_cuirassier_body_trumpeter,itm_rus_horse_guard_pants,itm_french_carabineer_helmet_trumpeter,itm_fr_cuirassier_gloves,itm_trumpet,itm_french_carabineer_sword,itm_carabineer_horse_french_trumpet],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_grenadier_a_cheval","Regiment de Grenadiers a Cheval de la Garde","Heavy Cavalry",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_grenadiers_a_cheval_body_ranker,itm_french_grenadiers_a_cheval_pants,itm_grach_bearskin_ranker,itm_fr_cuirassier_gloves,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_french],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_grenadier_a_cheval_nco","Regiment de Grenadiers a Cheval de la Garde","Eagle Bearer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_grenadiers_a_cheval_body_colours,itm_french_grenadiers_a_cheval_pants,itm_grach_bearskin_trumpeter,itm_fr_cuirassier_gloves,itm_flag_france_cheval,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_french],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_grenadier_a_cheval_officer","Regiment de Grenadiers a Cheval de la Garde","Officer",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_grenadiers_a_cheval_body_officer,itm_french_grenadiers_a_cheval_pants,itm_grach_bearskin_officer,itm_fr_cuirassier_gloves,itm_french_cav_pistol,itm_pistol_ammo,itm_french_heavy_cav_off_sabre,itm_heavy_horse_french,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_grenadier_a_cheval_trumpet","Regiment de Grenadiers a Cheval de la Garde","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_grenadier_a_cheval_body_trumpeter,itm_french_grenadiers_a_cheval_pants,itm_grach_bearskin_trumpeter,itm_fr_cuirassier_gloves,itm_trumpet,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_french_trumpet],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty","L'Artillerie","Artillery",tf_guarantee_all,0,0,fac_france,
[itm_french_art_ranker_body,itm_french_art_ranker_body_alt,itm_french_art_ranker_pants,itm_french_artillery_bearskin_ranker,itm_ramrod,itm_cannon_lighter,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_nco","L'Artillerie","Artillery Train",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_arty_train,itm_fr_arty_train_bottefortes,itm_french_artillery_train_shako,itm_cannon_lighter,itm_french_briquet,itm_arty_horse_cannon_french,itm_arty_horse_howitzer_french],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_officer","L'Artillerie","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_art_officer_body,itm_fr_arty_captain_bottefortes,itm_french_artillery_bearskin_officer,itm_fr_artillery_gloves,itm_french_art_off_sword,itm_cannon_lighter,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_sapper","Sappeur","Engineer",tf_guarantee_all,0,0,fac_france,
[itm_french_sapper,itm_french_sappeur_pants,itm_french_sapper_bearskin,itm_fr_cuirassier_gloves,itm_french_sappeur_sword,itm_sapper_axe,itm_construction_hammer,itm_shovel],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["napoleon","L'Empereur Napoleon Bonaparte","Commander",tf_mounted|tf_guarantee_all,0,0,fac_france,
[itm_french_general_body_boney,itm_french_general_boots,itm_french_nappy_hat,itm_french_line_cav_sabre,itm_carabineer_horse_french_officer,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
### Prussia ###
["prussian_infantry","8. Brandenburgische Infanterie-Regiment","Line Infantry",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_infantry_ranker,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_2,itm_russian_briquet_1807_black,itm_prussian_potsdam,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_nco","8. Infanterie Regiment","Colour Bearer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry_nco,itm_prussian_infantry_pants,itm_prussian_shako_colours,itm_prussian_shako_colours_2,itm_russian_briquet_1807_black,itm_prussia_colour_infantry],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_officer","8. Infanterie Regiment","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry_officer,itm_rus_dragoon_pants1,itm_prussian_infantry_hat_officer,itm_russian_officer_sword,itm_russian_pistol,itm_pistol_ammo,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_drum","8. Infanterie Regiment","Drummer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry_drum,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_colours_2,itm_russian_briquet_1807_black,itm_drummer_gloves,itm_drumstick_right],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_flute","8. Infanterie Regiment","Fifer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry_flute,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_colours_2,itm_russian_briquet_1807_black,itm_flute],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2","23. Rheinische Infanterie-Regiment","Line Infantry",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_infantry2_ranker,itm_prussian_infantry_pants,itm_prussian_shako,itm_prussian_shako_2,itm_prussian_infantry2_hat,itm_russian_briquet_1807_black,itm_prussian_potsdam,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2_nco","23. Rheinische Infanterie-Regiment","Colour Bearer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry2_nco,itm_prussian_infantry_pants,itm_prussian_shako_2,itm_prussia_colour_infantry2,itm_prussian_infantry2_hat,itm_russian_briquet_1807_black],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2_officer","23. Rheinische Infanterie-Regiment","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry2_officer,itm_rus_dragoon_pants1,itm_prussian_inf_off_shako,itm_russian_officer_sword,itm_russian_pistol,itm_pistol_ammo,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2_drum","23. Rheinische Infanterie-Regiment","Drummer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry2_drum,itm_prussian_infantry_pants,itm_prussian_shako_2,itm_prussian_infantry2_hat,itm_russian_briquet_1807_black,itm_drummer_gloves,itm_drumstick_right],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry2_flute","23. Rheinische Infanterie-Regiment","Fifer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_infantry2_flute,itm_prussian_infantry_pants,itm_prussian_shako_2,itm_prussian_infantry2_hat,itm_russian_briquet_1807_black,itm_flute],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark","3. Kurmarkische Landwehr-Regiment","Line Infantry",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_landwehr_ranker,itm_prussian_landwehr_ranker_alt,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_russian_briquet_1807_landwehr,itm_russian_peasant_axe_landwehr,itm_prussian_potsdam,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark_nco","3. Kurmark Landwehr","Colour Bearer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_nco,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_prussia_colour_landwehr,itm_russian_briquet_1807_landwehr],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark_officer","3. Kurmark Landwehr","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_officer,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_russian_sabre_1798,itm_russian_pistol,itm_pistol_ammo,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark_drum","3. Kurmark Landwehr","Drummer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_drum,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_drumstick_right,itm_drummer_gloves,itm_russian_briquet_1807_landwehr],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_kurmark_flute","3. Kurmark Landwehr","Fifer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_flute,itm_prussian_landwehr_pants,itm_prussian_landwehr_hat,itm_prussian_landwehr_hat_2,itm_prussian_landwehr_hat_3,itm_flute,itm_russian_briquet_1807_landwehr],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps","Lutzowsches Freikorps","Line Infantry",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_freikorps_ranker,itm_prussian_freikorps_pants,itm_prussian_shako_2,itm_russian_briquet_1807_black_blackbelt,itm_prussian_potsdam,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps_nco","Lutzowsches Freikorps","Colour Bearer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_freikorps_nco,itm_prussian_freikorps_pants,itm_prussian_shako_2,itm_prussia_colour_landwehr,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps_officer","Lutzowsches Freikorps","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_freikorps_officer,itm_prussian_freikorps_pants,itm_prussian_freikorps_officer_hat,itm_russian_sabre_1798,itm_russian_pistol,itm_pistol_ammo,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps_drum","Lutzowsches Freikorps","Drummer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_freikorps_drum,itm_prussian_freikorps_pants,itm_prussian_shako_2,itm_drumstick_right,itm_drummer_gloves,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_freikorps_flute","Lutzowsches Freikorps","Fifer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_freikorps_flute,itm_prussian_freikorps_pants,itm_prussian_shako_2,itm_flute,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15","1. Garde-Regiment zu Fuss","Foot Guard",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_guard_ranker,itm_austrian_officer_boots,itm_prussian_guard_ranker_shako,itm_russian_briquet_1807_black,itm_prussian_potsdam,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,145,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15_nco","1. Garde-Regiment zu Fuss","Colour Bearer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_guard_nco,itm_austrian_officer_boots,itm_prussian_guard_colours_shako,itm_prussia_colour_guard,itm_russian_briquet_1807_black],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15_officer","1. Garde-Regiment zu Fuss","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_guard_officer,itm_austrian_officer_boots,itm_prussian_guard_officer_shako,itm_russian_officer_sword,itm_russian_pistol,itm_pistol_ammo,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15_drum","1. Garde-Regiment zu Fuss","Drummer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_guard_drummer,itm_austrian_officer_boots,itm_prussian_guard_musician_shako,itm_russian_briquet_1807_black,itm_drumstick_right,itm_drummer_gloves],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["stupid_dummy_troop","{!}dummy_troop","{!}dummy_troop",tf_guarantee_all,0,0,fac_kingdom_6,
[], #Make sure to move this troop upwards if adding new troops above this one!
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_15_flute","1. Garde-Regiment zu Fuss","Fifer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_guard_flute,itm_austrian_officer_boots,itm_prussian_guard_musician_shako,itm_russian_briquet_1807_black,itm_flute],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_rifle","Schlesische Schutzen","Rifleman",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_jaeger_ranker,itm_prussian_jaeger_ranker_alt,itm_prussian_jaeger_pants,itm_prussian_shako_2,itm_russian_jaeger_bayonet_jaeger,itm_russian_rifle_1805,itm_bullets],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_rifle_nco","Schlesische Jaeger","Sergeant",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_jaeger_nco,itm_prussian_jaeger_pants,itm_prussian_shako_2,itm_russian_jaeger_bayonet_jaeger,itm_russian_rifle_1805,itm_bullets],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_rifle_officer","Schlesische Jaeger","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_jaeger_officer,itm_austrian_officer_boots,itm_prussian_jaeger_officer_shako,itm_officer_gloves,itm_russian_officer_sword,itm_russian_pistol,itm_pistol_ammo,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_infantry_rifle_horn","Schlesische Jaeger","Hornist",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_jaeger_hornist,itm_prussian_jaeger_pants,itm_prussian_shako_2,itm_russian_jaeger_bayonet_jaeger,itm_horn],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_dragoon","6. Neumarkische Dragoner","Dragoon",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_dragoon_ranker,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_dragoon_shako_ranker,itm_british_light_cav_sabre,itm_russian_dragoon_musket,itm_bullets,itm_dragoon_horse_prussia_1],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_dragoon_nco","6. Dragoner Regiment","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_dragoon_nco,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_dragoon_shako_ranker,itm_prussia_colour_hussard,itm_british_light_cav_sabre,itm_russian_dragoon_musket,itm_bullets,itm_dragoon_horse_prussia_1],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_dragoon_officer","6. Dragoner Regiment","Officer",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_dragoon_officer,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_dragoon_shako_officer,itm_british_light_cav_sabre,itm_russian_pistol,itm_pistol_ammo,itm_dragoon_horse_prussia_1,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_dragoon_trumpet","6. Dragoner Regiment","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_dragoon_trumpet,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_dragoon_shako_ranker,itm_british_light_cav_sabre,itm_trumpet,itm_dragoon_horse_prussia_2],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_hussar","1. Leib-Husaren-Regiment (Totenkopfhusaren)","Hussar",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_hussar_ranker,itm_prussian_hussar_pants,itm_prussian_hussar_shako,itm_british_light_cav_sabre,itm_hussar_horse_prussia_1,itm_hussar_horse_prussia_2],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_hussar_nco","Death's Head Hussar Regiment","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_hussar_nco,itm_prussian_hussar_pants,itm_prussian_hussar_shako,itm_prussia_colour_hussard,itm_british_light_cav_sabre,itm_hussar_horse_prussia_1,itm_hussar_horse_prussia_2],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_hussar_officer","Death's Head Hussar Regiment","Officer",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_hussar_officer,itm_prussian_hussar_officer_variant,itm_prussian_hussar_pants_officer,itm_prussian_hussar_officer_shako,itm_officer_gloves,itm_russian_pistol,itm_british_light_cav_sabre,itm_pistol_ammo,itm_hussar_horse_prussia_1,itm_hussar_horse_prussia_2,itm_spyglass],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_hussar_trumpet","Death's Head Hussar Regiment","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_hussar_trumpet,itm_prussian_hussar_pants,itm_prussian_hussar_shako,itm_trumpet,itm_british_light_cav_sabre,itm_hussar_horse_prussia_1,itm_hussar_horse_prussia_2],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_landwehr_cav","Westfalische Landwehrkavallerie","Lancer",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_landwehr_cav_ranker,itm_prussian_landwehr_pants2,itm_prussian_landwehr_cav_shako,itm_prussian_lance,itm_british_light_cav_sabre,itm_lancer_horse_prussia_1,itm_lancer_horse_prussia_2],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_landwehr_cav_nco","Westfalische Landwehrkavallerie","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_cav_nco,itm_prussian_landwehr_pants2,itm_prussian_landwehr_cav_shako,itm_prussia_colour_hussard,itm_british_light_cav_sabre,itm_lancer_horse_prussia_1,itm_lancer_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_landwehr_cav_officer","Westfalische Landwehrkavallerie","Officer",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_cav_officer,itm_rus_dragoon_pants1,itm_prussian_landwehr_cav_shako_officer,itm_british_light_cav_sabre,itm_russian_pistol,itm_pistol_ammo,itm_lancer_horse_prussia_1,itm_lancer_horse_prussia_2,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_landwehr_cav_trumpet","Westfalische Landwehrkavallerie","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_landwehr_cav_trumpet,itm_prussian_landwehr_pants2,itm_prussian_landwehr_cav_shako,itm_trumpet,itm_british_light_cav_sabre,itm_lancer_horse_prussia_1,itm_lancer_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_cuirassier","3. Brandenburgische Kurassier Regiment","Heavy Cavalry",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_cuirassier_ranker,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_cuirassier_helmet,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_prussia_1,itm_heavy_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_cuirassier_nco","3. Brandenburgische Kurassier Regiment","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_cuirassier_nco,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_cuirassier_helmet,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_prussia_1,itm_heavy_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_cuirassier_officer","3. Brandenburgische Kurassier Regiment","Officer",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_cuirassier_officer,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_cuirassier_helmet,itm_fr_cuirassier_gloves,itm_french_cav_pistol,itm_pistol_ammo,itm_french_heavy_cav_off_sabre,itm_heavy_horse_prussia_1,itm_heavy_horse_prussia_2,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_cuirassier_trumpet","3. Brandenburgische Kurassier Regiment","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_cuirassier_trumpet,itm_prussian_cavalry_pants,itm_prussian_cavalry_pants2,itm_prussian_cuirassier_helmet_trumpet,itm_trumpet,itm_french_heavy_cav_sabre_garde,itm_heavy_horse_prussia_1,itm_heavy_horse_prussia_2],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty","36. Regiment der Fussartillerie","Artillery",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_arty_ranker,itm_prussian_infantry_pants,itm_prussian_arty_shako_ranker,itm_ramrod,itm_cannon_lighter,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_nco","36. Regiment der Fussartillerie","Artillery Train",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_arty_train,itm_prussian_cavalry_pants,itm_prussian_arty_shako_ranker,itm_cannon_lighter,itm_arty_horse_cannon_prussian,itm_arty_horse_howitzer_prussian,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_officer","36. Regiment der Fussartillerie","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_arty_officer,itm_rus_dragoon_pants1,itm_prussian_arty_shako_officer,itm_russian_officer_sword,itm_cannon_lighter,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_sapper","4. Mansfelder Pionierskorps","Engineer",tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_pioneer,itm_british_coldstream_pants,itm_prussian_pioneer_shako,itm_russian_briquet_1807_black_blackbelt,itm_sapper_axe,itm_construction_hammer,itm_shovel],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_blucher","Generalfeldmarschall Gebhard von Blucher","Commander",tf_mounted|tf_guarantee_all,0,0,fac_prussia,
[itm_prussian_blucher,itm_prussian_blucher_pants,itm_prussian_blucher_hat,itm_russian_guard_sword_1799,itm_heavy_horse_prussia_1,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
### RUSSIA ###
["russian_partizan","Partizani","Partisan Irregulars",tf_guarantee_all,0,0,fac_russia,
[itm_rus_partizan1,itm_rus_partizan2,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_opol_hat_ranker,itm_rus_partisan_hat1,itm_rus_partisan_hat2,itm_rus_partisan_hat3,itm_rus_partisan_hat4,itm_rus_partisan_hat5,itm_rus_opol_hat_ranker,itm_rus_drummer_shako,itm_bullets,itm_russian_dragoon_musket,itm_russian_peasant_fork,itm_russian_peasant_pitchfork,itm_russian_peasant_sap,itm_russian_peasant_kosa,itm_russian_peasant_kosa2,itm_birch_trunk,itm_brokenbottle,itm_russian_peasant_club,itm_russian_peasant_birch_club,itm_russian_peasant_axe,itm_russian_peasant_knife,itm_russian_peasant_serp,itm_russian_peasant_pike,itm_russian_peasant_kuvalda,itm_russian_peasant_2handed_axe,itm_russian_peasant_rogatina,itm_russian_gusarskiy_karabin],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,130,80),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_opol","Sankt-Peterburzhskoye Opolcheniye","Line Militia",tf_guarantee_all,0,0,fac_russia,
[itm_russian_militia_ranker,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_opol_hat_ranker,itm_bullets,itm_russian_dragoon_musket,itm_russian_opolcheniye_pike,itm_russian_peasant_axe],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_opol_nco","St Petersburg Opolcheniye","Colour Bearer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_militia_officer,itm_rus_militia_off_pants,itm_rus_opol_hat_officer,itm_flag_russia_opolcheniye,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_opol_officer","St Petersburg Opolcheniye","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_militia_officer,itm_rus_militia_off_pants,itm_rus_opol_hat_officer,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry","Simbirskiy Pehotniy Polk","Line Infantry",tf_guarantee_all,0,0,fac_russia,
[itm_russian_infantry1,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_drummer_shako,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_nco","Simbirsk Infantry Regiment","Colour Bearer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_infantry_nco,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_infantry_shako_nco,itm_flag_russia_simbirsk_color,itm_flag_russia_simbirsk_white,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_officer","Simbirsk Infantry Regiment","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_infantry_officer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_infantry_officer_shako,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_drum","Simbirsk Infantry Regiment","Drummer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_drummer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_drummer_shako,itm_drummer_gloves,itm_drumstick_right,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_flute","Simbirsk Infantry Regiment","Fifer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_flautist,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_drummer_shako,itm_flute,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier","Pavlovskiy Grenaderskiy Polk","Line Infantry",tf_guarantee_all,0,0,fac_russia,
[itm_russian_gren_ranker,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier_nco","Pavlovskiy Grenadier Regiment","Colour Bearer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_gren_nco,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_flag_russia_pavlovsk_color,itm_flag_russia_pavlovsk_white,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier_officer","Pavlovskiy Grenadier Regiment","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_gren_officer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier_drum","Pavlovskiy Grenadier Regiment","Drummer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_drummer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_drummer_gloves,itm_drumstick_right,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_grenadier_flute","Pavlovskiy Grenadier Regiment","Fifer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_flautist,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_pavlovsk_ranker,itm_flute,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard","Leib-Gvardii Preobrazhenskiy Polk","Foot Guard",tf_guarantee_all,0,0,fac_russia,
[itm_russian_guard_ranker,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_ranker,itm_bullets,itm_russian_musket_1808,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(50,5,145,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard_nco","Preobrazhenskiy Guard Regiment","Colour Bearer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_guard_nco,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_nco,itm_flag_russia_preobragenskiy_color,itm_flag_russia_preobragenskiy_white,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard_officer","Preobrazhenskiy Guard Regiment","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_guard_officer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_officer,itm_russian_guard_off_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard_drum","Preobrazhenskiy Guard Regiment","Drummer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_guard_drummer,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_musician,itm_drummer_gloves,itm_drumstick_right,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_foot_guard_flute","Preobrazhenskiy Guard Regiment","Fifer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_guard_flautist,itm_rus_infantry_pants1,itm_rus_infantry_pants2,itm_rus_guard_shako_musician,itm_flute,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_rifle","21-y Yegerskiy Polk","Rifleman",tf_guarantee_all,0,0,fac_russia,
[itm_russian_jaeger_ranker,itm_rus_jaeger_pants,itm_rus_jaeger_shako_ranker,itm_russian_rifle_1805,itm_russian_dragoon_musket,itm_bullets,itm_russian_jaeger_bayonet_jaeger],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_rifle_nco","21st Jaeger Regiment","Sergeant",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_jaeger_nco,itm_rus_jaeger_pants,itm_rus_jaeger_shako_nco,itm_russian_rifle_1805,itm_russian_dragoon_musket,itm_bullets,itm_russian_jaeger_bayonet_jaeger],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_rifle_officer","21st Jaeger Regiment","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_jaeger_officer,itm_rus_jaeger_pants,itm_rus_infantry_officer_shako,itm_russian_pistol,itm_pistol_ammo,itm_russian_officer_sword_jaeger,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_infantry_rifle_horn","21st Jaeger Regiment","Hornist",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_jaeger_musician,itm_rus_jaeger_pants,itm_rus_jaeger_shako_ranker,itm_horn,itm_russian_briquet_1807_black_blackbelt],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_hussar","Sumskoy Gusarskiy Polk","Hussar",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_hussar_ranker,itm_rus_hussar_pants_nco,itm_rus_hussar_shako_ranker,itm_russian_sabre_1809,itm_hussar_horse_russia],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_hussar_nco","Sumskiy Hussar Regiment","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_hussar_nco,itm_rus_hussar_pants1,itm_rus_hussar_pants2,itm_rus_hussar_shako_nco,itm_flag_russia_kyiv_dragoon,itm_russian_sabre_1809,itm_hussar_horse_russia],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_hussar_officer","Sumskiy Hussar Regiment","Officer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_hussar_officer,itm_rus_hussar_pants_officer,itm_rus_hussar_shako_officer,itm_pistol_ammo,itm_russian_pistol,itm_russian_sabre_1809,itm_hussar_horse_russia,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_hussar_trumpet","Sumskiy Hussar Regiment","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_hussar_trumpeter,itm_rus_hussar_pants1,itm_rus_hussar_pants2,itm_rus_hussar_shako_trumpeter,itm_trumpet,itm_russian_sabre_1809,itm_hussar_horse_russia],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_uhlan","Litovskiy Ulanskiy Polk","Lancer",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_uhlan_ranker,itm_rus_uhlan_pants,itm_rus_uhlan_czapka_ranker,itm_russian_lancer_pike,itm_russian_sabre_1809,itm_lancer_horse_russia],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_uhlan_nco","Lithuanian Uhlans","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_uhlan_nco,itm_rus_uhlan_pants,itm_rus_uhlan_czapka_nco,itm_flag_russia_kyiv_dragoon,itm_russian_sabre_1809,itm_lancer_horse_russia],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_uhlan_officer","Lithuanian Uhlans","Officer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_uhlan_officer,itm_rus_uhlan_pants,itm_rus_uhlan_czapka_officer,itm_pistol_ammo,itm_russian_pistol,itm_russian_sabre_1809,itm_lancer_horse_russia,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_uhlan_trumpet","Lithuanian Uhlans","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_uhlan_trumpeter,itm_rus_uhlan_pants,itm_rus_uhlan_czapka_trumpeter,itm_trumpet,itm_russian_sabre_1809,itm_lancer_horse_russia],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_cossack","Donskoy Kazachiy Polk","Lancer",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_cossack,itm_rus_cossack_off_pants,itm_rus_cossack_hat_ranker,itm_russian_cossack_pike,itm_russian_sabre_1798,itm_russian_kindjal,itm_cossack_horse_russia_1,itm_cossack_horse_russia_2,itm_cossack_horse_russia_3,itm_cossack_horse_russia_4],
def_attrib|level(20),wpex(90,5,130,5,40,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_cossack_nco","Don Cossacks","Sergeant",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_cossack,itm_rus_cossack_off_pants,itm_rus_cossack_hat_nco,itm_russian_sabre_1798,itm_cossack_horse_russia_1,itm_cossack_horse_russia_2,itm_cossack_horse_russia_3,itm_cossack_horse_russia_4],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_cossack_officer","Don Cossacks","Officer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_cossack_officer,itm_rus_cossack_off_pants,itm_rus_cossack_hat_officer,itm_pistol_ammo,itm_russian_pistol,itm_russian_sabre_1798,itm_cossack_horse_russia_1,itm_cossack_horse_russia_2,itm_cossack_horse_russia_3,itm_cossack_horse_russia_4,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_dragoon","Kievskiy Dragunskiy Polk","Dragoon",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_dragoon_ranker,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_kyiv_dragoons_all,itm_russian_dragoon_musket,itm_russian_cavalry_stutzer_1803,itm_russian_gusarskiy_karabin,itm_bullets,itm_russian_sword_1810,itm_dragoon_horse_russia,itm_officer_gloves],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_dragoon_nco","Kiev Dragoon Regiment","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_dragoon_nco,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_kyiv_dragoons_all,itm_flag_russia_kyiv_dragoon,itm_russian_sword_1810,itm_dragoon_horse_russia,itm_officer_gloves],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_dragoon_officer","Kiev Dragoon Regiment","Officer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_dragoon_officer,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_kyiv_dragoons_all,itm_pistol_ammo,itm_russian_pistol,itm_russian_sword_1810,itm_dragoon_horse_russia,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_dragoon_trumpet","Kiev Dragoon Regiment","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_dragoon_trumpeter,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_kyiv_dragoons_trumpeter,itm_trumpet,itm_russian_sword_1810,itm_dragoon_horse_russia,itm_officer_gloves],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_horse_guard","Kavalergardskiy Polk","Cuirassier",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_russian_horse_guard,itm_rus_horse_guard_pants,itm_rus_chevalier_hat,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_horse_guard_nco","Chevaliers-Gardes","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_horse_guard_nco,itm_rus_horse_guard_pants,itm_rus_chevalier_hat,itm_flag_russia_kyiv_dragoon,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_horse_guard_officer","Chevaliers-Gardes","Officer",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_horse_guard_officer,itm_rus_horse_guard_pants,itm_rus_chevalier_hat_officer,itm_pistol_ammo,itm_russian_pistol,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_rus_chevgarde_gloves,itm_spyglass],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_horse_guard_trumpet","Chevaliers-Gardes","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_horse_guard_trumpeter,itm_rus_dragoon_pants1,itm_rus_dragoon_pants2,itm_rus_chevalier_hat_trumpeter,itm_trumpet,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_officer_gloves],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty","8-ya Batarejnaya Rota","Artillery",tf_guarantee_all,0,0,fac_russia,
[itm_russian_arty_ranker,itm_rus_arty_pants,itm_rus_arty_shako_ranker,itm_ramrod,itm_cannon_lighter,itm_russian_briquet_1807],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_nco","Artillery","Artillery Train",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_arty_nco,itm_rus_dragoon_pants2,itm_rus_arty_shako_nco,itm_cannon_lighter,itm_russian_briquet_1807,itm_arty_horse_cannon_russian,itm_arty_horse_howitzer_russian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_officer","Artillery","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_arty_officer,itm_rus_arty_pants,itm_rus_arty_shako_officer,itm_russian_officer_sword,itm_cannon_lighter,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_sapper","Saper","Engineer",tf_guarantee_all,0,0,fac_russia,
[itm_rus_pioneer,itm_austrian_jaeger_pants,itm_rus_pioneer_shako,itm_russian_sappeur_dagger,itm_sapper_axe_rus,itm_construction_hammer,itm_shovel],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["kutuzov","Feldmarshal Mikhail Kutuzov","Commander",tf_mounted|tf_guarantee_all,0,0,fac_russia,
[itm_kutuzov,itm_rus_kutuzov_pants,itm_kutuzov_hat,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
### AUSTRIA ###
["austrian_infantry","Infantrie Regiment Erzherzog Rudolf Nr. 14","Line Infantry",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_infantry,itm_aus_infantry_ranker,itm_austrian_infantry_pants,itm_bullets,itm_austrian_musket],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_nco","Infantrie Regiment Erzherzog Rudolf Nr. 14","Colour Bearer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry_nco,itm_aus_infantry_nco,itm_austrian_infantry_pants,itm_austria_colour_leibfahne,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_officer","Infantrie Regiment Erzherzog Rudolf Nr. 14","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry_officer,itm_aus_infantry_officer,itm_austrian_officer_boots,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_drum","Infantrie Regiment Erzherzog Rudolf Nr. 14","Drummer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry_drummer,itm_aus_infantry_ranker,itm_austrian_infantry_pants,itm_drummer_gloves,itm_drumstick_right,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_flute","Infantrie Regiment Erzherzog Rudolf Nr. 14","Fifer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry_fifer,itm_aus_infantry_ranker,itm_austrian_infantry_pants,itm_flute,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2","Infantrie Regiment Freiherr von Wacquant Nr. 62","Line Infantry",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_infantry2,itm_aus_infantry_ranker,itm_hungarian_pants,itm_bullets,itm_austrian_musket],
def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2_nco","Infantrie Regiment Freiherr von Wacquant Nr. 62","Colour Bearer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry2_nco,itm_aus_infantry_nco,itm_hungarian_pants,itm_austria_colour_leibfahne,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2_officer","Infantrie Regiment Freiherr von Wacquant Nr. 62","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry2_officer,itm_aus_infantry_officer,itm_hungarian_pants_officer,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2_drum","Infantrie Regiment Freiherr von Wacquant Nr. 62","Drummer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry2_drummer,itm_aus_infantry_ranker,itm_hungarian_pants,itm_drummer_gloves,itm_drumstick_right,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry2_flute","Infantrie Regiment Freiherr von Wacquant Nr. 62","Fifer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_infantry2_fifer,itm_aus_infantry_ranker,itm_hungarian_pants,itm_flute,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer","Grenz Regiment Oguliner Nr. 3","Line/Light Infantry",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_grenzer,itm_aus_grenzer_ranker,itm_hungarian_pants,itm_austrian_musket,itm_russian_rifle_1805,itm_russian_gusarskiy_karabin,itm_bullets,itm_austrian_jaeger_bayonet_invis],
def_attrib_multiplayer|level(20),wpex(50,5,105,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer_nco","Grenz Regiment Oguliner Nr. 3","Colour Bearer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenzer_nco,itm_aus_infantry_nco,itm_hungarian_pants,itm_austria_colour_ordinarfahne,itm_austrian_jaeger_bayonet_invis],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer_officer","Grenz Regiment Oguliner Nr. 3","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenzer_officer,itm_aus_grenzer_officer,itm_hungarian_pants_officer,itm_russian_pistol,itm_pistol_ammo,itm_russian_officer_sword_jaeger,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer_drum","Grenz Regiment Oguliner Nr. 3","Drummer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenzer_drummer,itm_aus_grenzer_ranker,itm_hungarian_pants,itm_drummer_gloves,itm_drumstick_right,itm_austrian_jaeger_bayonet_invis],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenzer_flute","Grenz Regiment Oguliner Nr. 3","Fifer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenzer_fifer,itm_aus_grenzer_ranker,itm_hungarian_pants,itm_flute,itm_austrian_jaeger_bayonet_invis],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier","Grenadier Battalion Purcell","Foot Guard",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_grenadier,itm_austrian_grenadier_alt,itm_aus_grenadier_bearskin,itm_hungarian_pants,itm_bullets,itm_austrian_musket,itm_austrian_infantry_briquet,itm_officer_gloves],
def_attrib_multiplayer|level(20),wpex(50,5,145,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier_nco","Grenadier Battalion Purcell","Colour Bearer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenadier_nco,itm_aus_grenadier_bearskin,itm_hungarian_pants,itm_austria_colour_ordinarfahne,itm_austrian_infantry_briquet,itm_officer_gloves],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier_officer","Grenadier Battalion Purcell","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenadier_officer,itm_aus_grenadier_bearskin_officer,itm_hungarian_pants_officer,itm_russian_officer_sword,itm_pistol_ammo,itm_russian_pistol,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier_drum","Grenadier Battalion Purcell","Drummer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenadier_drummer,itm_aus_grenadier_bearskin,itm_hungarian_pants,itm_drummer_gloves,itm_drumstick_right,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_grenadier_flute","Grenadier Battalion Purcell","Fifer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_grenadier_fifer,itm_aus_grenadier_bearskin,itm_hungarian_pants,itm_flute,itm_austrian_infantry_briquet,itm_officer_gloves],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_rifle","Jaeger Battalion 2","Rifleman",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_jaeger,itm_aus_tyrol_hat,itm_austrian_jaeger_pants,itm_russian_rifle_1805,itm_bullets,itm_austrian_jaeger_bayonet],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,206,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_rifle_nco","Jaeger Battalion 2","Sergeant",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_jaeger_nco,itm_aus_tyrol_hat,itm_austrian_jaeger_pants,itm_russian_rifle_1805,itm_bullets,itm_austrian_jaeger_bayonet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_rifle_officer","Jaeger Battalion 2","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_jaeger_officer,itm_aus_tyrol_hat_officer,itm_austrian_jaeger_pants_officer,itm_russian_pistol,itm_pistol_ammo,itm_russian_officer_sword_jaeger,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_infantry_rifle_horn","Jaeger Battalion 2","Hornist",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_jaeger_hornist,itm_aus_tyrol_hat,itm_austrian_jaeger_pants,itm_horn,itm_austrian_jaeger_bayonet],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_hussar","Husar Regiment Graf von Hessen-Homburg Nr. 4","Hussar",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_hussar,itm_aus_hussard_shako_ranker,itm_hungarian_hussar_pants,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_hussar_horse_austria],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_hussar_nco","Husar Regiment Graf von Hessen-Homburg Nr. 4","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_hussar_nco,itm_aus_hussard_shako_nco,itm_hungarian_hussar_pants,itm_br_cavalry_gloves_short,itm_austria_colour_ordinarfahne_cav,itm_british_light_cav_sabre,itm_hussar_horse_austria],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_hussar_officer","Husar Regiment Graf von Hessen-Homburg Nr. 4","Officer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_hussar_officer,itm_aus_hussard_shako_officer,itm_hungarian_hussar_pants,itm_br_cavalry_gloves_short,itm_pistol_ammo,itm_russian_pistol,itm_british_light_cav_sabre,itm_hussar_horse_austria,itm_spyglass],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_hussar_trumpet","Husar Regiment Graf von Hessen-Homburg Nr. 4","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_hussar_trumpet,itm_aus_hussard_shako_trumpeter,itm_hungarian_hussar_pants,itm_br_cavalry_gloves_short,itm_trumpet,itm_british_light_cav_sabre,itm_hussar_horse_austria],
def_attrib|level(20),wpex(160,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_uhlan","Ulan Regiment Schwarzenberg Nr. 2","Lancer",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_uhlan,itm_aus_uhlan_czapka,itm_hungarian_uhlan_pants,itm_br_cavalry_gloves_short,itm_austrian_lance,itm_british_light_cav_sabre,itm_lancer_horse_austria],
def_attrib|level(20),wpex(50,5,130,5,40,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_uhlan_nco","Ulan Regiment Schwarzenberg Nr. 2","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_uhlan,itm_aus_uhlan_czapka,itm_hungarian_uhlan_pants,itm_br_cavalry_gloves_short,itm_austria_colour_ordinarfahne_cav,itm_british_light_cav_sabre,itm_lancer_horse_austria],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_uhlan_officer","Ulan Regiment Schwarzenberg Nr. 2","Officer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_uhlan_officer,itm_aus_uhlan_czapka_officer,itm_hungarian_uhlan_pants,itm_br_cavalry_gloves_short,itm_pistol_ammo,itm_russian_pistol,itm_british_light_cav_sabre,itm_lancer_horse_austria,itm_spyglass],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_uhlan_trumpet","Ulan Regiment Schwarzenberg Nr. 2","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_uhlan,itm_aus_uhlan_czapka_trumpeter,itm_hungarian_uhlan_pants,itm_br_cavalry_gloves_short,itm_trumpet,itm_british_light_cav_sabre,itm_lancer_horse_austria],
def_attrib|level(20),wpex(150,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_light_horse","Chevauleger Regiment Furst von Hohenzollern Nr. 2","Light Horse",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_lightcav,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_russian_dragoon_musket,itm_bullets,itm_russian_sword_1810,itm_lightcav_horse_austria],
def_attrib|level(20),wpex(70,5,30,5,155,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["austrian_light_horse_nco","Chevauleger Regiment Furst von Hohenzollern Nr. 2","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_lightcav_nco,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_austria_colour_ordinarfahne_cav,itm_russian_sword_1810,itm_lightcav_horse_austria],
def_attrib|level(20),wpex(80,5,30,5,155,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["austrian_light_horse_officer","Chevauleger Regiment Furst von Hohenzollern Nr. 2","Officer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_lightcav_officer,itm_aus_cavalry_helmet_officer,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_pistol_ammo,itm_russian_pistol,itm_russian_sword_1810,itm_lightcav_horse_austria,itm_spyglass],
def_attrib|level(20),wpex(80,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["austrian_light_horse_trumpet","Chevauleger Regiment Furst von Hohenzollern Nr. 2","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_lightcav_trumpet,itm_aus_cavalry_helmet_trumpeter,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_trumpet,itm_russian_sword_1810,itm_lightcav_horse_austria],
def_attrib|level(20),wpex(80,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_2|knows_power_strike_1,swadian_face_middle_1, swadian_face_old_2],
["austrian_dragoon","Dragoner Regiment Erzherzog Ferdinand Nr. 5","Dragoon",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_dragoon,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_russian_dragoon_musket,itm_bullets,itm_russian_sword_1810,itm_dragoon_horse_austria],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_dragoon_nco","Dragoner Regiment Erzherzog Ferdinand Nr. 5","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_dragoon_nco,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_austria_colour_ordinarfahne_cav,itm_russian_sword_1810,itm_dragoon_horse_austria],
def_attrib|level(20),wpex(120,5,30,5,125,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_dragoon_officer","Dragoner Regiment Erzherzog Ferdinand Nr. 5","Officer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_dragoon_officer,itm_aus_cavalry_helmet_officer,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_pistol_ammo,itm_russian_pistol,itm_russian_sword_1810,itm_dragoon_horse_austria,itm_spyglass],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_dragoon_trumpet","Dragoner Regiment Erzherzog Ferdinand Nr. 5","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_dragoon_trumpet,itm_aus_cavalry_helmet_trumpeter,itm_austrian_cavalry_boots,itm_br_cavalry_gloves_short,itm_trumpet,itm_russian_sword_1810,itm_dragoon_horse_austria],
def_attrib|level(20),wpex(120,5,30,5,80,5),knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_cuirassier","Kurassier Regiment Kaiser Franz Nr. 1","Cuirassier",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_cuiraisser,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_rus_chevgarde_gloves,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_cuirassier_nco","Kurassier Regiment Kaiser Franz Nr. 1","Colour Bearer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_cuiraisser_nco,itm_aus_cavalry_helmet_ranker,itm_austrian_cavalry_boots,itm_rus_chevgarde_gloves,itm_austria_colour_ordinarfahne_cav,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_rus_chevgarde_gloves],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_cuirassier_officer","Kurassier Regiment Kaiser Franz Nr. 1","Officer",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_cuiraisser_officer,itm_aus_cavalry_helmet_officer,itm_austrian_cavalry_boots,itm_rus_chevgarde_gloves,itm_pistol_ammo,itm_russian_pistol,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_rus_chevgarde_gloves,itm_spyglass],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_cuirassier_trumpet","Kurassier Regiment Kaiser Franz Nr. 1","Trumpeter",tf_mounted|tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_cuiraisser_trumpet,itm_aus_cavalry_helmet_trumpeter,itm_austrian_cavalry_boots,itm_officer_gloves,itm_trumpet,itm_british_heavy_cav_sword,itm_heavy_horse_austria],
def_attrib|level(20),wpex(140,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty","Artillerie Regiment Prinz zu Lothringen Nr. 7","Artillery",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_arty,itm_aus_arty_bicorn,itm_austrian_officer_boots,itm_ramrod,itm_cannon_lighter,itm_austrian_infantry_briquet],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_nco","Artillerie Regiment Prinz zu Lothringen Nr. 7","Artillery Train",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_arty_train,itm_aus_arty_train_hat,itm_austrian_officer_boots,itm_cannon_lighter,itm_austrian_infantry_briquet,itm_arty_horse_cannon_austrian,itm_arty_horse_howitzer_austrian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_officer","Artillerie Regiment Prinz zu Lothringen Nr. 7","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_arty_officer,itm_aus_arty_cap_bicorn,itm_austrian_officer_boots,itm_russian_officer_sword,itm_cannon_lighter,itm_officer_gloves,itm_spyglass],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_sapper","Pionier-Battalion Nr. 1","Engineer",tf_guarantee_all,0,0,fac_austria,
[itm_austrian_pioneer,itm_aus_pioneer_hat,itm_austrian_officer_boots,itm_austrian_infantry_briquet,itm_sapper_axe,itm_construction_hammer,itm_shovel],
def_attrib_multiplayer|level(20),wpex(70,5,30,5,30,5),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["schwarzenberg","Karl Philipp, Furst zu Schwarzenberg","Commander",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_schwarzenberg,itm_austrian_schwarzenberg_pants,itm_aus_shwarzenberg_bicorn,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_commander","Royal Foot Artillery","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_artillery_officer,itm_rus_dragoon_pants1,itm_british_artillery_shako_officer,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_spyglass,itm_ramrod,itm_arty_horse_cannon_british],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["british_arty_alt_commander","Royal Foot Artillery","Officer",tf_guarantee_all,0,0,fac_british_ranks,
[itm_british_artillery_officer,itm_rus_dragoon_pants1,itm_british_artillery_shako_officer,itm_br_cavalry_gloves_short,itm_british_light_cav_sabre,itm_spyglass,itm_ramrod,itm_arty_horse_howitzer_british],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_commander","L'Artillerie","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_art_officer_body,itm_fr_arty_captain_bottefortes,itm_french_artillery_bearskin_officer,itm_fr_artillery_gloves,itm_french_art_off_sword,itm_spyglass,itm_ramrod,itm_arty_horse_cannon_french],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["french_arty_alt_commander","L'Artillerie","Officer",tf_guarantee_all,0,0,fac_french_ranks,
[itm_french_art_officer_body,itm_fr_arty_captain_bottefortes,itm_french_artillery_bearskin_officer,itm_fr_artillery_gloves,itm_french_art_off_sword,itm_spyglass,itm_ramrod,itm_arty_horse_howitzer_french],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_commander","36. Regiment der Fussartillerie","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_arty_officer,itm_rus_dragoon_pants1,itm_prussian_arty_shako_officer,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_cannon_prussian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["prussian_arty_alt_commander","36. Regiment der Fussartillerie","Officer",tf_guarantee_all,0,0,fac_prussian_ranks,
[itm_prussian_arty_officer,itm_rus_dragoon_pants1,itm_prussian_arty_shako_officer,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_howitzer_prussian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_commander","Artillery","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_arty_officer,itm_rus_arty_pants,itm_rus_arty_shako_officer,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_cannon_russian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["russian_arty_alt_commander","Artillery","Officer",tf_guarantee_all,0,0,fac_russian_ranks,
[itm_russian_arty_officer,itm_rus_arty_pants,itm_rus_arty_shako_officer,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_howitzer_russian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_commander","Prinz zu Lothringen Nr. 7 Artillerie","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_arty_officer,itm_aus_arty_cap_bicorn,itm_austrian_officer_boots,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_cannon_austrian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["austrian_arty_alt_commander","Prinz zu Lothringen Nr. 7 Artillerie","Officer",tf_guarantee_all,0,0,fac_austrian_ranks,
[itm_austrian_arty_officer,itm_aus_arty_cap_bicorn,itm_austrian_officer_boots,itm_russian_officer_sword,itm_officer_gloves,itm_spyglass,itm_ramrod,itm_arty_horse_howitzer_austrian],
def_attrib_multiplayer|level(20),wpex(80,5,30,5,30,5),knows_common|knows_riding_1|knows_ironflesh_3|knows_power_strike_2|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["multiplayer_end","{!}multiplayer_end","{!}multiplayer_end", 0, 0, 0, fac_austria, [], 0, 0, 0, 0, 0],
# Vincenzo begin
["admin_dummy","{!}admin_dummy","{!}admin_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["flags_owned_dummy","{!}flags_owned_dummy","{!}flags_owned_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["entrypoints_dummy","{!}flags_owned_dummy","{!}flags_owned_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["entrypoints_per_flag_dummy","{!}entrypoints_per_flag_dummy","{!}entrypoints_per_flag_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["destroyed_props_dummy","{!}destroyed_props_dummy","{!}destroyed_props_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
# Vincenzo end
# Beaver begin
["troop_check_dummy","{!}troop_check_dummy","{!}troop_check_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["flag_select_dummy","{!}flag_select_dummy","{!}flag_select_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
#["conquest_spawn_dummy","{!}conquest_spawn_dummy","{!}conquest_spawn_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["track_select_dummy","{!}track_select_dummy","{!}track_select_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["custom_battle_dummy","{!}custom_battle_dummy","{!}custom_battle_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["ai_tactics_dummy","{!}ai_tactics_dummy","{!}ai_tactics_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["manual_dummy","{!}manual_dummy","{!}manual_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
# Beaver end
# ["agents_to_teleport_dummy","{!}destroyed_props_dummy","{!}destroyed_props_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
#TEMP for presentation design
["x_pos","{!}custom_battle_dummy","{!}custom_battle_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["y_pos","{!}custom_battle_dummy","{!}custom_battle_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["x_size","{!}custom_battle_dummy","{!}custom_battle_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
["y_size","{!}custom_battle_dummy","{!}custom_battle_dummy",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],
# Quick Battle troops.
["quick_battle_troop_britain_1","Arthur Wellesley","General",tf_hero,0,0,fac_britain,
[itm_british_wellington,itm_british_wellington_pants,itm_british_wellington_bicorne,itm_heavy_horse_britain,itm_french_line_cav_sabre,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_10|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["quick_battle_troop_france_1","Napoleon Bonaparte","Emperor",tf_hero,0,0,fac_france,
[itm_french_general_body_boney,itm_french_general_boots,itm_french_nappy_hat,itm_french_line_cav_sabre,itm_carabineer_horse_french_officer,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_10|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
# ["quick_battle_troop_france_2","Marshal Lannes","Marshal",tf_hero,0,0,fac_france,
# [itm_french_art_officer_body,itm_french_voltigeur_officer_pants,itm_french_inf_bicorne_45_officer,itm_french_line_cav_sabre,itm_heavy_horse_placeholder,itm_officer_gloves],
# def_attrib|level(20),wpex(150,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,0x000000002004400436db6db8cba1bafa00000000001eb6db0000000000000000, swadian_face_old_2],
# ["quick_battle_troop_france_3","Marshal Murat","Marshal",tf_hero,0,0,fac_france,
# [itm_french_art_officer_body,itm_french_voltigeur_officer_pants,itm_french_line_cav_sabre,itm_heavy_horse_placeholder,itm_officer_gloves],
# def_attrib|level(20),wpex(150,5,30,5,80,5),knows_common|knows_riding_6|knows_ironflesh_5|knows_power_strike_3,0x000000002004400436db6db8cba1bafa00000000001eb6db0000000000000000, swadian_face_old_2],
["quick_battle_troop_prussia_1","Gebhard von Blucher","General",tf_hero,0,0,fac_prussia,
[itm_prussian_blucher,itm_prussian_blucher_pants,itm_prussian_blucher_hat,itm_russian_guard_sword_1799,itm_heavy_horse_prussia_1,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_10|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["quick_battle_troop_russia_1","Mikhail Kutuzov","General",tf_hero,0,0,fac_russia,
[itm_kutuzov,itm_rus_kutuzov_pants,itm_kutuzov_hat,itm_russian_guard_sword_1799,itm_heavy_horse_russia,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_10|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["quick_battle_troop_austria_1","Karl Philipp","General",tf_mounted|tf_guarantee_all,0,0,fac_austria,
[itm_austrian_schwarzenberg,itm_austrian_schwarzenberg_pants,itm_aus_shwarzenberg_bicorn,itm_british_heavy_cav_sword,itm_heavy_horse_austria,itm_officer_gloves,itm_spyglass],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_6|knows_ironflesh_10|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["quick_battle_troops_end","{!}quick_battle_troops_end","{!}quick_battle_troops_end", 0, 0, 0, fac_austria, [], 0, 0, 0, 0, 0],
# Companions
# Infantry
["companion_1","Raphael Martin","Raphael Martin",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x0000000fed0c14c3449c0238764b126a00000000000ec70c0000000000000000],
["companion_2","Clement Bernard","Clement Bernard",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x0000000fcd04408d459c08d52560a89300000000001557620000000000000000],
["companion_3","Maxim Munnig Schmidt","Maxime Petit",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000007fa00149437156eb6938ea8d600000000000616eb0000000000000000],
["companion_4","Alexandre Durand","Alexandre Durand",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000007d71041072716ab34749339b400000000000f248e0000000000000000],
["companion_5","Antoine Richard","Antoine Richard",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000007dd10158228dc6e2b128e349e000000000004b51a0000000000000000],
["companion_6","Alexis Moreau","Alexis Moreau",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000007f000358b491fc9129c912d7500000000000cc8c30000000000000000],
["companion_7","Jules Dubois","Jules Dubois",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x000000026a044287255d65994a494312000000000011acdc0000000000000000],
["companion_8","Matteo Robert","Matteo Robert",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x0000000e871022496caa66e72be5d8b5000000000009df1c0000000000000000],
["companion_9","Julien Laurent","Julien Laurent",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x0000000e841011c2359275ca9e92390b0000000000124acb0000000000000000],
["companion_10","Samuel Simon","Samuel Simon",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000009300852c936948a32be69aa6d00000000001235220000000000000000],
["companion_11","Noe Michel","Noe Michel",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x0000000d6f040043231c8db524c9dcea00000000000e44d30000000000000000],
["companion_12","Corentin Leroy","Corentin Leroy",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000000121045c854e450b4f5c0993600000000000ac7430000000000000000],
["companion_13","Jeremy Garcia","Jeremy Garcia",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x00000000210420892f0b65aaa432c695000000000011a52e0000000000000000],
["companion_14","Charles Lefebvre","Charles Lefebvre",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x000000002c10248244a98a475d39392300000000000cb5740000000000000000],
["companion_15","Eliott Roux","Eliott Roux",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib|level(20),wpex(50,5,130,5,150,5),
knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,
0x000000048c0801cc44a34e277c6754ec00000000000fc85a0000000000000000],
# Caverly
["companion_16","Theo David","Theo David",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000b960054c559e46b5b8cb9d2ce000000000010d92c0000000000000000],
["companion_17","Romain Bertrand","Romain Bertrand",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000bb80445c8146e843799375cd500000000001337440000000000000000],
["companion_18","Quentin Fournier","Quentin Fournier",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000ba80843d05731719a5255a8910000000000152d530000000000000000],
["companion_19","Girard Baptiste","Girard Baptiste",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000dc40c4193492d6e46e197689200000000000dc3550000000000000000],
["companion_20","Valentin Bonnet","Valentin Bonnet",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000fc404444e5b4a89b65d6dc6ec00000000000916e50000000000000000],
["companion_21","Nico Kamps","Nicolas Morel",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000d870054463b4b2f5c9e8f66d5000000000018b5250000000000000000],
["companion_22","Mael Rousseau","Mael Rousseau",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000dae0011102d6452b892f5355c0000000000165cac0000000000000000],
["companion_23","Pierre Lambert","Pierre Lambert",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x000000097704440f29295268a4b632f3000000000012aaec0000000000000000],
["companion_24","Marius Blanc","Marius Blanc",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x000000097d0c204726fe70b6fb8a671b00000000000dc28a0000000000000000],
["companion_25","Remi Thomas","Remi Thomas",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x000000049600544c58e24a35590e87a3000000000009264c0000000000000000],
["companion_26","Benjamin Aguillon","Benjamin Aguillon",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000d2710310844dd6f559371caf300000000000e170c0000000000000000],
["companion_27","Maxence Beauregard","Maxence Beauregard",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x00000007850c434845266ec85592d2cd000000000009dcad0000000000000000],
["companion_28","Axel Lemieux","Axel Lemieux",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x00000007921043c656a32b34c4498714000000000009a2a30000000000000000],
["companion_29","Jules Plantier","Jules Plantier",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000db30c044f48ed72351a894997000000000009b69c0000000000000000],
["companion_30","Martin Roche","Martin Roche",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_dragoon_body_ranker,itm_french_dragoon_pants,itm_french_dragoon_helmet,itm_french_dragoon_musket,itm_bullets,itm_french_heavy_cav_sabre_garde,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(110,5,30,5,125,5),
knows_common|knows_riding_5|knows_ironflesh_3|knows_power_strike_3,
0x0000000db9082312159536295b653cc600000000001b169c0000000000000000],
["companions_end","companions_end","companions_end",tf_hero|tf_unmoveable_in_party_window,0,reserved,fac_commoners,
[itm_french_hussar_shako_ranker,itm_french_light_cav_sabre,itm_dragoon_horse_placeholder],
def_attrib|level(20),wpex(150,5,30,5,30,5),
knows_common|knows_riding_6|knows_ironflesh_3|knows_power_strike_3,
0x0000000db9082312159536295b653cc600000000001b169c0000000000000000],
["walker_french_infantry","Infantryman","Infantry",tf_guarantee_all,0,0,fac_commoners,
[itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["walker_french_voltigeur","Voltigeur","Voltigeurs",tf_guarantee_all,0,0,fac_commoners,
[itm_french_voltigeur_body_ranker,itm_french_voltigeur_officer_pants,itm_french_voltigeur_pants,itm_french_voltigeur_shako_ranker,itm_bullets,itm_french_charleville,itm_french_briquet],
def_attrib_multiplayer|level(20),wpex(50,5,90,5,150,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["walker_french_hussar","Hussar","Hussars",tf_mounted|tf_guarantee_all,0,0,fac_commoners,
[itm_russian_hussar_ranker,itm_rus_hussar_pants_nco,itm_french_hussar_shako_ranker,itm_french_light_cav_sabre],
def_attrib|level(20),wpex(130,5,30,5,30,5),knows_common|knows_riding_4|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_old_2],
["walker_french_officer","Officer","officers",tf_guarantee_all,0,0,fac_commoners,
[itm_french_45e_body_officer,itm_french_voltigeur_officer_pants,itm_french_inf_bicorne_45_officer,itm_french_inf_off_sabre,itm_pistol_ammo,itm_french_officer_pistol,itm_french_pistol_1766,itm_officer_gloves],
def_attrib_multiplayer|level(20),wpex(80,5,80,5,50,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["walker_messenger","Messenger","Messenger",tf_guarantee_all,0,0,fac_commoners,
[itm_french_gap_body_officer,itm_french_voltigeur_officer_pants],
def_attrib|level(20),wpex(50,5,130,5,120,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
["walker_peasant_male","Peasant","Peasants",tf_guarantee_all,0,0,fac_commoners,
[itm_rus_partizan1,itm_rus_partizan2,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_partisan_hat1,itm_rus_partisan_hat2,itm_rus_partisan_hat3,itm_rus_partisan_hat4,itm_rus_partisan_hat5],
def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2],
["walker_peasant_female","Peasant", "Peasants",tf_female|tf_guarantee_all,0,0, fac_commoners,
[],
def_attrib|level(4),wp(60),knows_common, 0x00000000ef00000237dc71b90c31631200000000001e371b0000000000000000, 0x000000050b003004072d51c293a9a70b00000000001dd6a90000000000000000],
["walkers_end","walkers_end","walkers_end",tf_hero, 0,0, fac_commoners,[],def_attrib|level(2),wp(20),knows_inventory_management_10,0],
# Merchants
["camp_armorer","Tailor","{!}Armorer", tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,
[itm_french_dragoon_pants,itm_french_artillery_train_shako,itm_french_briquet],
def_attrib|level(2),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["camp_weaponsmith", "Weapon Merchant","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,
[itm_french_dragoon_pants,itm_french_artillery_train_shako,itm_french_briquet],
def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["camp_horse_merchant","Horse Merchant","{!}Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,
[itm_french_dragoon_pants,itm_french_artillery_train_shako,itm_french_briquet],
def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2],
["merchants_end","merchants_end","merchants_end",tf_hero, 0,0, fac_commoners,[],def_attrib|level(2),wp(20),knows_inventory_management_10,0],
]
#Troop upgrade declarations
| 121.610857 | 757 | 0.865647 | 29,736 | 185,943 | 4.863768 | 0.029997 | 0.050806 | 0.040379 | 0.042433 | 0.869279 | 0.858196 | 0.846034 | 0.834169 | 0.815065 | 0.797551 | 0 | 0.07917 | 0.039539 | 185,943 | 1,528 | 758 | 121.690445 | 0.730664 | 0.02881 | 0 | 0.392559 | 0 | 0 | 0.118956 | 0.030778 | 0 | 0 | 0.038511 | 0 | 0 | 1 | 0.003037 | false | 0 | 0.006074 | 0 | 0.012149 | 0 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
93c0dcfc0c928361d3d9a9ebc0c5b2fc403ce00e | 116 | py | Python | rand_param_envs/gym/envs/board_game/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 24 | 2021-03-24T07:14:52.000Z | 2022-03-17T08:15:44.000Z | rand_param_envs/gym/envs/board_game/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 12 | 2021-02-02T22:53:59.000Z | 2022-03-12T00:41:30.000Z | rand_param_envs/gym/envs/board_game/__init__.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 6 | 2021-04-12T18:49:47.000Z | 2021-09-07T05:33:22.000Z | from rand_param_envs.gym.envs.board_game.go import GoEnv
from rand_param_envs.gym.envs.board_game.hex import HexEnv
| 38.666667 | 58 | 0.862069 | 22 | 116 | 4.272727 | 0.545455 | 0.170213 | 0.276596 | 0.361702 | 0.702128 | 0.702128 | 0.702128 | 0.702128 | 0 | 0 | 0 | 0 | 0.068966 | 116 | 2 | 59 | 58 | 0.87037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 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 | 10 |
9e0251e4c621ea51ba1bd6707ccaa4b7c62d0774 | 2,416 | py | Python | mapper.py | cubeme/ECproject | c16f649ee6d188e890e0e5332bdf1e8d9ea87ebf | [
"MIT"
] | null | null | null | mapper.py | cubeme/ECproject | c16f649ee6d188e890e0e5332bdf1e8d9ea87ebf | [
"MIT"
] | null | null | null | mapper.py | cubeme/ECproject | c16f649ee6d188e890e0e5332bdf1e8d9ea87ebf | [
"MIT"
] | null | null | null | from coordinates import Coordinate
def map_individual(individual):
# first step always straight (1)
coord_back_2 = Coordinate(0, 0)
coord_back_1 = Coordinate(1, 0)
coordinates = [coord_back_2, coord_back_1]
for i in range(2, len(individual) + 2):
step = individual[i - 2]
# find out current orientation
# east
if coord_back_2.x < coord_back_1.x and coord_back_2.y == coord_back_1.y:
# and go straight
if step == 1:
new_coord = Coordinate(coord_back_1.x + 1, coord_back_1.y)
# and go left
if step == 0:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y + 1)
# and go right
if step == 2:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y - 1)
# north
if coord_back_2.x == coord_back_1.x and coord_back_2.y < coord_back_1.y:
# and go straight
if step == 1:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y + 1)
# and go left
if step == 0:
new_coord = Coordinate(coord_back_1.x - 1, coord_back_1.y)
# and go right
if step == 2:
new_coord = Coordinate(coord_back_1.x + 1, coord_back_1.y)
# west
if coord_back_2.x > coord_back_1.x and coord_back_2.y == coord_back_1.y:
# and go straight
if step == 1:
new_coord = Coordinate(coord_back_1.x - 1, coord_back_1.y)
# and go left
if step == 0:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y - 1)
# and go right
if step == 2:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y + 1)
# south
if coord_back_2.x == coord_back_1.x and coord_back_2.y > coord_back_1.y:
# and go straight
if step == 1:
new_coord = Coordinate(coord_back_1.x, coord_back_1.y - 1)
# and go left
if step == 0:
new_coord = Coordinate(coord_back_1.x + 1, coord_back_1.y)
# and go right
if step == 2:
new_coord = Coordinate(coord_back_1.x - 1, coord_back_1.y)
coordinates.append(new_coord)
coord_back_2 = coord_back_1
coord_back_1 = new_coord
return coordinates
| 32.213333 | 80 | 0.550497 | 357 | 2,416 | 3.420168 | 0.109244 | 0.346437 | 0.29484 | 0.144144 | 0.769861 | 0.769861 | 0.737101 | 0.737101 | 0.737101 | 0.737101 | 0 | 0.051533 | 0.36548 | 2,416 | 74 | 81 | 32.648649 | 0.744945 | 0.101407 | 0 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.025641 | false | 0 | 0.025641 | 0 | 0.076923 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.