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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
968fc4c3cfafbb28db4f12dc4b2d93b0851ffb76 | 65,824 | py | Python | tccli/services/cls/cls_client.py | ws0416/tencentcloud-cli | 0a90fa77c8be1efa30b196a3eeb31b8be1f6a325 | [
"Apache-2.0"
] | null | null | null | tccli/services/cls/cls_client.py | ws0416/tencentcloud-cli | 0a90fa77c8be1efa30b196a3eeb31b8be1f6a325 | [
"Apache-2.0"
] | null | null | null | tccli/services/cls/cls_client.py | ws0416/tencentcloud-cli | 0a90fa77c8be1efa30b196a3eeb31b8be1f6a325 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.cls.v20201016 import cls_client as cls_client_v20201016
from tencentcloud.cls.v20201016 import models as models_v20201016
def doCreateMachineGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateMachineGroupRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateMachineGroup(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeMachineGroups(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeMachineGroupsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeMachineGroups(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doGetAlarmLog(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.GetAlarmLogRequest()
model.from_json_string(json.dumps(args))
rsp = client.GetAlarmLog(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyTopic(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyTopicRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyTopic(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeShipperTasks(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeShipperTasksRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeShipperTasks(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyIndex(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyIndexRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyIndex(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeLogsets(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeLogsetsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeLogsets(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyMachineGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyMachineGroupRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyMachineGroup(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeExports(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeExportsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeExports(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeIndex(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeIndexRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeIndex(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doApplyConfigToMachineGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ApplyConfigToMachineGroupRequest()
model.from_json_string(json.dumps(args))
rsp = client.ApplyConfigToMachineGroup(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateIndex(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateIndexRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateIndex(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteConfig(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteConfigRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteConfig(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateShipper(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateShipperRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateShipper(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyShipper(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyShipperRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyShipper(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateAlarmNotice(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateAlarmNoticeRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateAlarmNotice(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeConfigs(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeConfigsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeConfigs(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyAlarm(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyAlarmRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyAlarm(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteMachineGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteMachineGroupRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteMachineGroup(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteLogset(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteLogsetRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteLogset(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeShippers(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeShippersRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeShippers(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteConfigFromMachineGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteConfigFromMachineGroupRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteConfigFromMachineGroup(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateLogset(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateLogsetRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateLogset(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeAlarms(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeAlarmsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeAlarms(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeAlarmNotices(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeAlarmNoticesRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeAlarmNotices(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateTopic(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateTopicRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateTopic(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribePartitions(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribePartitionsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribePartitions(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteAlarmNotice(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteAlarmNoticeRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteAlarmNotice(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateAlarm(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateAlarmRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateAlarm(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteAlarm(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteAlarmRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteAlarm(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyConfig(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyConfigRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyConfig(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doUploadLog(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.UploadLogRequest()
model.from_json_string(json.dumps(args))
rsp = client.UploadLog(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyLogset(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyLogsetRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyLogset(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateConfig(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateConfigRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateConfig(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeMachineGroupConfigs(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeMachineGroupConfigsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeMachineGroupConfigs(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeTopics(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeTopicsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeTopics(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteIndex(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteIndexRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteIndex(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doSearchLog(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.SearchLogRequest()
model.from_json_string(json.dumps(args))
rsp = client.SearchLog(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeLogContext(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeLogContextRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeLogContext(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doMergePartition(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.MergePartitionRequest()
model.from_json_string(json.dumps(args))
rsp = client.MergePartition(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeMachines(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeMachinesRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeMachines(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doRetryShipperTask(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.RetryShipperTaskRequest()
model.from_json_string(json.dumps(args))
rsp = client.RetryShipperTask(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeConfigMachineGroups(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DescribeConfigMachineGroupsRequest()
model.from_json_string(json.dumps(args))
rsp = client.DescribeConfigMachineGroups(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteShipper(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteShipperRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteShipper(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteExport(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteExportRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteExport(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doModifyAlarmNotice(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.ModifyAlarmNoticeRequest()
model.from_json_string(json.dumps(args))
rsp = client.ModifyAlarmNotice(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDeleteTopic(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DeleteTopicRequest()
model.from_json_string(json.dumps(args))
rsp = client.DeleteTopic(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doCreateExport(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.CreateExportRequest()
model.from_json_string(json.dumps(args))
rsp = client.CreateExport(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doSplitPartition(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.HttpsProxy]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ClsClient(cred, g_param[OptionsDefine.Region], profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.SplitPartitionRequest()
model.from_json_string(json.dumps(args))
rsp = client.SplitPartition(model)
result = rsp.to_json_string()
try:
json_obj = json.loads(result)
except TypeError as e:
json_obj = json.loads(result.decode('utf-8')) # python3.3
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
CLIENT_MAP = {
"v20201016": cls_client_v20201016,
}
MODELS_MAP = {
"v20201016": models_v20201016,
}
ACTION_MAP = {
"CreateMachineGroup": doCreateMachineGroup,
"DescribeMachineGroups": doDescribeMachineGroups,
"GetAlarmLog": doGetAlarmLog,
"ModifyTopic": doModifyTopic,
"DescribeShipperTasks": doDescribeShipperTasks,
"ModifyIndex": doModifyIndex,
"DescribeLogsets": doDescribeLogsets,
"ModifyMachineGroup": doModifyMachineGroup,
"DescribeExports": doDescribeExports,
"DescribeIndex": doDescribeIndex,
"ApplyConfigToMachineGroup": doApplyConfigToMachineGroup,
"CreateIndex": doCreateIndex,
"DeleteConfig": doDeleteConfig,
"CreateShipper": doCreateShipper,
"ModifyShipper": doModifyShipper,
"CreateAlarmNotice": doCreateAlarmNotice,
"DescribeConfigs": doDescribeConfigs,
"ModifyAlarm": doModifyAlarm,
"DeleteMachineGroup": doDeleteMachineGroup,
"DeleteLogset": doDeleteLogset,
"DescribeShippers": doDescribeShippers,
"DeleteConfigFromMachineGroup": doDeleteConfigFromMachineGroup,
"CreateLogset": doCreateLogset,
"DescribeAlarms": doDescribeAlarms,
"DescribeAlarmNotices": doDescribeAlarmNotices,
"CreateTopic": doCreateTopic,
"DescribePartitions": doDescribePartitions,
"DeleteAlarmNotice": doDeleteAlarmNotice,
"CreateAlarm": doCreateAlarm,
"DeleteAlarm": doDeleteAlarm,
"ModifyConfig": doModifyConfig,
"UploadLog": doUploadLog,
"ModifyLogset": doModifyLogset,
"CreateConfig": doCreateConfig,
"DescribeMachineGroupConfigs": doDescribeMachineGroupConfigs,
"DescribeTopics": doDescribeTopics,
"DeleteIndex": doDeleteIndex,
"SearchLog": doSearchLog,
"DescribeLogContext": doDescribeLogContext,
"MergePartition": doMergePartition,
"DescribeMachines": doDescribeMachines,
"RetryShipperTask": doRetryShipperTask,
"DescribeConfigMachineGroups": doDescribeConfigMachineGroups,
"DeleteShipper": doDeleteShipper,
"DeleteExport": doDeleteExport,
"ModifyAlarmNotice": doModifyAlarmNotice,
"DeleteTopic": doDeleteTopic,
"CreateExport": doCreateExport,
"SplitPartition": doSplitPartition,
}
AVAILABLE_VERSION_LIST = [
"v20201016",
]
def action_caller():
return ACTION_MAP
def parse_global_arg(parsed_globals):
g_param = parsed_globals
is_exist_profile = True
if not parsed_globals["profile"]:
is_exist_profile = False
g_param["profile"] = "default"
configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
conf = {}
cred = {}
if is_conf_exist:
conf = Utils.load_json_msg(conf_path)
if is_cred_exist:
cred = Utils.load_json_msg(cred_path)
if not (isinstance(conf, dict) and isinstance(cred, dict)):
raise ConfigurationError(
"file: %s or %s is not json format"
% (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
if OptionsDefine.Token not in cred:
cred[OptionsDefine.Token] = None
if not is_exist_profile:
if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
if os.environ.get(OptionsDefine.ENV_REGION):
conf[OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
for param in g_param.keys():
if g_param[param] is None:
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
if param in cred:
g_param[param] = cred[param]
else:
raise ConfigurationError("%s is invalid" % param)
elif param in [OptionsDefine.Region, OptionsDefine.Output]:
if param in conf:
g_param[param] = conf[param]
else:
raise ConfigurationError("%s is invalid" % param)
try:
if g_param[OptionsDefine.ServiceVersion]:
g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
else:
version = conf["cls"][OptionsDefine.Version]
g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
if g_param[OptionsDefine.Endpoint] is None:
g_param[OptionsDefine.Endpoint] = conf["cls"][OptionsDefine.Endpoint]
except Exception as err:
raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
return g_param
| 43.078534 | 105 | 0.724037 | 7,534 | 65,824 | 6.086541 | 0.036103 | 0.085703 | 0.246533 | 0.057266 | 0.870333 | 0.866473 | 0.864903 | 0.863333 | 0.861283 | 0.813111 | 0 | 0.00848 | 0.16693 | 65,824 | 1,527 | 106 | 43.106745 | 0.827759 | 0.007763 | 0 | 0.72929 | 0 | 0 | 0.037465 | 0.001961 | 0 | 0 | 0 | 0 | 0 | 1 | 0.037722 | false | 0 | 0.008876 | 0.00074 | 0.048077 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
96a317610c930f96d8538da41a71d09aed2f6efd | 41,400 | py | Python | tests/test_execution.py | jsphon/flumine | bd5cacf9793d53a99595fe4694aeb9b8d2962abb | [
"MIT"
] | null | null | null | tests/test_execution.py | jsphon/flumine | bd5cacf9793d53a99595fe4694aeb9b8d2962abb | [
"MIT"
] | null | null | null | tests/test_execution.py | jsphon/flumine | bd5cacf9793d53a99595fe4694aeb9b8d2962abb | [
"MIT"
] | null | null | null | import unittest
from unittest import mock
from unittest.mock import call
from flumine.clients.clients import ExchangeType
from flumine.exceptions import OrderExecutionError
from flumine.execution.baseexecution import BaseExecution, OrderPackageType
from flumine.execution.betfairexecution import BetfairExecution
from flumine.execution.simulatedexecution import SimulatedExecution
class BaseExecutionTest(unittest.TestCase):
def setUp(self) -> None:
self.mock_flumine = mock.Mock()
self.execution = BaseExecution(self.mock_flumine)
def test_init(self):
self.assertEqual(self.execution.flumine, self.mock_flumine)
self.assertIsNotNone(self.execution._thread_pool)
self.assertIsNone(self.execution.EXCHANGE)
self.assertEqual(self.execution._bet_id, 100000000000)
@mock.patch("flumine.execution.baseexecution.requests")
@mock.patch("flumine.execution.baseexecution.BaseExecution.execute_place")
def test_handler_place(self, mock_execute_place, mock_requests):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.PLACE
mock_thread_pool = mock.Mock()
self.execution._thread_pool = mock_thread_pool
self.execution.handler(mock_order_package)
mock_thread_pool.submit.assert_called_with(
mock_execute_place, mock_order_package, mock_requests.Session()
)
@mock.patch("flumine.execution.baseexecution.requests")
@mock.patch("flumine.execution.baseexecution.BaseExecution.execute_cancel")
def test_handler_cancel(self, mock_execute_cancel, mock_requests):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.PLACE.CANCEL
mock_thread_pool = mock.Mock()
self.execution._thread_pool = mock_thread_pool
self.execution.handler(mock_order_package)
mock_thread_pool.submit.assert_called_with(
mock_execute_cancel, mock_order_package, mock_requests.Session()
)
@mock.patch("flumine.execution.baseexecution.requests")
@mock.patch("flumine.execution.baseexecution.BaseExecution.execute_replace")
def test_handler_replace(self, mock_execute_replace, mock_requests):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.REPLACE
mock_thread_pool = mock.Mock()
self.execution._thread_pool = mock_thread_pool
self.execution.handler(mock_order_package)
mock_thread_pool.submit.assert_called_with(
mock_execute_replace, mock_order_package, mock_requests.Session()
)
@mock.patch("flumine.execution.baseexecution.requests")
@mock.patch("flumine.execution.baseexecution.BaseExecution.execute_update")
def test_handler_update(self, mock_execute_update, mock_requests):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.UPDATE
mock_thread_pool = mock.Mock()
self.execution._thread_pool = mock_thread_pool
self.execution.handler(mock_order_package)
mock_thread_pool.submit.assert_called_with(
mock_execute_update, mock_order_package, mock_requests.Session()
)
def test_handler_unknown(self):
mock_order_package = mock.Mock()
mock_order_package.package_type = "DELETE"
with self.assertRaises(NotImplementedError):
self.execution.handler(mock_order_package)
def test_execute_place(self):
with self.assertRaises(NotImplementedError):
self.execution.execute_place(None, None)
def test_execute_cancel(self):
with self.assertRaises(NotImplementedError):
self.execution.execute_place(None, None)
def test_execute_update(self):
with self.assertRaises(NotImplementedError):
self.execution.execute_place(None, None)
def test_execute_replace(self):
with self.assertRaises(NotImplementedError):
self.execution.execute_place(None, None)
@mock.patch("flumine.execution.baseexecution.OrderEvent")
def test__order_logger_place(self, mock_order_event):
mock_order = mock.Mock()
mock_instruction_report = mock.Mock()
self.execution._order_logger(
mock_order, mock_instruction_report, OrderPackageType.PLACE
)
self.assertEqual(mock_order.bet_id, mock_instruction_report.bet_id)
mock_order.responses.placed.assert_called_with(mock_instruction_report)
self.mock_flumine.log_control.assert_called_with(mock_order_event(mock_order))
def test__order_logger_cancel(self):
mock_order = mock.Mock()
mock_instruction_report = mock.Mock()
self.execution._order_logger(
mock_order, mock_instruction_report, OrderPackageType.CANCEL
)
mock_order.responses.cancelled.assert_called_with(mock_instruction_report)
def test__order_logger_update(self):
mock_order = mock.Mock()
mock_instruction_report = mock.Mock()
self.execution._order_logger(
mock_order, mock_instruction_report, OrderPackageType.UPDATE
)
mock_order.responses.updated.assert_called_with(mock_instruction_report)
@mock.patch("flumine.execution.baseexecution.OrderEvent")
def test__order_logger_replace(self, mock_order_event):
mock_order = mock.Mock()
mock_instruction_report = mock.Mock()
self.execution._order_logger(
mock_order, mock_instruction_report, OrderPackageType.REPLACE
)
self.assertEqual(mock_order.bet_id, mock_instruction_report.bet_id)
mock_order.responses.placed.assert_called_with(mock_instruction_report)
self.mock_flumine.log_control.assert_called_with(mock_order_event(mock_order))
def test_handler_queue(self):
self.assertEqual(self.execution.handler_queue, self.mock_flumine.handler_queue)
def test_shutdown(self):
self.execution.shutdown()
self.assertTrue(self.execution._thread_pool._shutdown)
class BetfairExecutionTest(unittest.TestCase):
def setUp(self) -> None:
self.mock_flumine = mock.Mock()
self.execution = BetfairExecution(self.mock_flumine)
def test_init(self):
self.assertEqual(self.execution.EXCHANGE, ExchangeType.BETFAIR)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.place")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_place_success(
self, mock__execution_helper, mock_place, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "SUCCESS"
mock_report.place_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_place(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_place, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.PLACE
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.place")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_place_failure(
self, mock__execution_helper, mock_place, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "FAILURE"
mock_report.place_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_place(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_place, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.PLACE
)
mock_order.lapsed.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.place")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_place_timeout(
self, mock__execution_helper, mock_place, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "TIMEOUT"
mock_report.place_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_place(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_place, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.PLACE
)
# mock_order.lapsed.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.place")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_place_error(self, mock__execution_helper, mock_place):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
mock__execution_helper.return_value = None
self.execution.execute_place(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_place, mock_order_package, mock_session
)
def test_place(self):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
self.assertEqual(
self.execution.place(mock_order_package, mock_session),
mock_order_package.client.betting_client.betting.place_orders(),
)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_success(
self, mock__execution_helper, mock_cancel, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order.size_remaining = 2
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "SUCCESS"
mock_instruction_report.instruction.bet_id = 123
mock_instruction_report.size_cancelled = 2
mock_report.cancel_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_cancel, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.CANCEL
)
mock_order.execution_complete.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_success_partial(
self, mock__execution_helper, mock_cancel, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order.size_remaining = 2
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "SUCCESS"
mock_instruction_report.instruction.bet_id = 123
mock_instruction_report.size_cancelled = 1
mock_report.cancel_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_cancel, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.CANCEL
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_failure(
self, mock__execution_helper, mock_cancel, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "FAILURE"
mock_instruction_report.instruction.bet_id = 123
mock_report.cancel_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_cancel, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.CANCEL
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_timeout(
self, mock__execution_helper, mock_cancel, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "TIMEOUT"
mock_instruction_report.instruction.bet_id = 123
mock_report.cancel_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_cancel, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.CANCEL
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_not_returned(
self, mock__execution_helper, mock_cancel, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_report.cancel_instruction_reports = []
mock__execution_helper.return_value = mock_report
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_cancel, mock_order_package, mock_session
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.cancel")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_cancel_error(self, mock__execution_helper, mock_place):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
mock__execution_helper.return_value = None
self.execution.execute_cancel(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_place, mock_order_package, mock_session
)
def test_cancel(self):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.cancel_instructions = [1, 2]
self.assertEqual(
self.execution.cancel(mock_order_package, mock_session),
mock_order_package.client.betting_client.betting.cancel_orders(),
)
def test_cancel_empty(self):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
mock_order_package.cancel_instructions = []
with self.assertRaises(OrderExecutionError):
self.execution.cancel(mock_order_package, mock_session)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.update")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_update_success(
self, mock__execution_helper, mock_update, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "SUCCESS"
mock_report.update_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_update(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_update, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.UPDATE
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.update")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_update_failure(
self, mock__execution_helper, mock_update, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "FAILURE"
mock_report.update_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_update(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_update, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.UPDATE
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.update")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_update_timeout(
self, mock__execution_helper, mock_update, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.status = "TIMEOUT"
mock_report.update_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_update(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_update, mock_order_package, mock_session
)
mock__order_logger.assert_called_with(
mock_order, mock_instruction_report, OrderPackageType.UPDATE
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.update")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_update_error(self, mock__execution_helper, mock_update):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
mock__execution_helper.return_value = None
self.execution.execute_update(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_update, mock_order_package, mock_session
)
def test_update(self):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
self.assertEqual(
self.execution.update(mock_order_package, mock_session),
mock_order_package.client.betting_client.betting.update_orders(),
)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._order_logger")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.replace")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_replace_success(
self, mock__execution_helper, mock_replace, mock__order_logger
):
mock_session = mock.Mock()
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.market_id = "1.234"
mock_order.bet_id = 123
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.info = {}
mock_report = mock.Mock()
mock_instruction_report = mock.Mock()
mock_instruction_report.cancel_instruction_reports.status = "SUCCESS"
mock_instruction_report.place_instruction_reports.status = "SUCCESS"
mock_report.replace_instruction_reports = [mock_instruction_report]
mock__execution_helper.return_value = mock_report
self.execution.execute_replace(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_replace, mock_order_package, mock_session
)
# mock__order_logger.assert_called_with(
# mock_order, mock_instruction_report, OrderPackageType.CANCEL
# )
mock_order.execution_complete.assert_called_with()
replacement_order = mock_order.trade.create_order_replacement()
replacement_order.executable.assert_called_with()
mock_order_package.market.place_order.assert_called_with(
replacement_order, execute=False
)
mock__order_logger.assert_called_with(
replacement_order,
mock_instruction_report.place_instruction_reports,
OrderPackageType.REPLACE,
)
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.betfairexecution.BetfairExecution.replace")
@mock.patch("flumine.execution.betfairexecution.BetfairExecution._execution_helper")
def test_execute_replace_error(self, mock__execution_helper, mock_replace):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
mock__execution_helper.return_value = None
self.execution.execute_replace(mock_order_package, mock_session)
mock__execution_helper.assert_called_with(
mock_replace, mock_order_package, mock_session
)
def test_replace(self):
mock_session = mock.Mock()
mock_order_package = mock.Mock()
self.assertEqual(
self.execution.replace(mock_order_package, mock_session),
mock_order_package.client.betting_client.betting.replace_orders(),
)
def test__execution_helper(self):
mock_trading_function = mock.Mock()
mock_trading_function.__name__ = "test"
mock_session = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.info = {}
self.execution._execution_helper(
mock_trading_function, mock_order_package, mock_session
)
mock_trading_function.assert_called_with(mock_order_package, mock_session)
class SimulatedExecutionTest(unittest.TestCase):
def setUp(self) -> None:
self.mock_flumine = mock.Mock()
self.execution = SimulatedExecution(self.mock_flumine)
def test_init(self):
self.assertEqual(self.execution.EXCHANGE, ExchangeType.SIMULATED)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution.execute_place")
def test_handler_place(self, mock_execute_place):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.PLACE
self.execution.handler(mock_order_package)
mock_execute_place.assert_called_with(mock_order_package, http_session=None)
@mock.patch(
"flumine.execution.simulatedexecution.SimulatedExecution.execute_cancel"
)
def test_handler_cancel(self, mock_execute_cancel):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.PLACE.CANCEL
self.execution.handler(mock_order_package)
mock_execute_cancel.assert_called_with(mock_order_package, http_session=None)
@mock.patch(
"flumine.execution.simulatedexecution.SimulatedExecution.execute_update"
)
def test_handler_update(self, mock_execute_update):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.UPDATE
self.execution.handler(mock_order_package)
mock_execute_update.assert_called_with(mock_order_package, http_session=None)
@mock.patch(
"flumine.execution.simulatedexecution.SimulatedExecution.execute_replace"
)
def test_handler_replace(self, mock_execute_replace):
mock_order_package = mock.Mock()
mock_order_package.package_type = OrderPackageType.REPLACE
self.execution.handler(mock_order_package)
mock_execute_replace.assert_called_with(mock_order_package, http_session=None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_place_success(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.place_instructions = [1]
mock_order_package.info = {}
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "SUCCESS"
mock_order.simulated.place.return_value = mock_sim_resp
self.execution.execute_place(mock_order_package, None)
mock_order.simulated.place.assert_called_with(
mock_order_package.client,
mock_order_package.market.market_book,
1,
self.execution._bet_id,
)
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_place_failure(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.place_instructions = [1]
mock_order_package.info = {}
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "FAILURE"
mock_order.simulated.place.return_value = mock_sim_resp
self.execution.execute_place(mock_order_package, None)
mock_order.simulated.place.assert_called_with(
mock_order_package.client,
mock_order_package.market.market_book,
1,
self.execution._bet_id,
)
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.lapsed.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_cancel(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "SUCCESS"
mock_order.simulated.cancel.return_value = mock_sim_resp
self.execution.execute_cancel(mock_order_package, None)
mock_order.simulated.cancel.assert_called_with()
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.execution_complete.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_cancel_failure(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "FAILURE"
mock_order.simulated.cancel.return_value = mock_sim_resp
self.execution.execute_cancel(mock_order_package, None)
mock_order.simulated.cancel.assert_called_with()
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_update(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.update_instructions = ["PERSIST"]
mock_order_package.info = {}
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "SUCCESS"
mock_order.simulated.update.return_value = mock_sim_resp
self.execution.execute_update(mock_order_package, None)
mock_order.simulated.update.assert_called_with("PERSIST")
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_update_failure(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.update_instructions = ["PERSIST"]
mock_order_package.info = {}
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "FAILURE"
mock_order.simulated.update.return_value = mock_sim_resp
self.execution.execute_update(mock_order_package, None)
mock_order.simulated.update.assert_called_with("PERSIST")
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, mock_order_package.package_type
)
mock_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_replace(self, mock__order_logger):
mock_market = mock.Mock()
self.mock_flumine.markets.markets = {"1.234": mock_market}
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order.market_id = "1.234"
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.replace_instructions = [{"newPrice": 2.03}]
mock_replacement_order = mock.Mock()
mock_replacement_order_package = mock.Mock()
mock_replacement_order_package.__iter__ = mock.Mock(
return_value=iter([mock_order])
)
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "SUCCESS"
mock_order.simulated.cancel.return_value = mock_sim_resp
mock_replacement_order.simulated.place.return_value = mock_sim_resp
mock_order.trade.create_order_replacement.return_value = mock_replacement_order
self.execution.execute_replace(mock_order_package, None)
mock_order.simulated.cancel.assert_called_with()
mock_replacement_order.simulated.place.assert_called_with(
mock_order_package.client,
mock_order_package.market.market_book,
{"newPrice": 2.03},
self.execution._bet_id,
)
mock__order_logger.assert_has_calls(
[
call(mock_order, mock_sim_resp, OrderPackageType.CANCEL),
call(
mock_replacement_order,
mock_sim_resp,
mock_order_package.package_type,
),
]
)
mock_order.execution_complete.assert_called_with()
mock_replacement_order.executable.assert_called_with()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
@mock.patch("flumine.execution.simulatedexecution.SimulatedExecution._order_logger")
def test_execute_replace_failure(self, mock__order_logger):
mock_order = mock.Mock()
mock_order.trade.__enter__ = mock.Mock()
mock_order.trade.__exit__ = mock.Mock()
mock_order_package = mock.Mock()
mock_order_package.__iter__ = mock.Mock(return_value=iter([mock_order]))
mock_order_package.replace_instructions = [{"newPrice": 2.54}]
mock_replacement_order = mock.Mock()
mock_replacement_order_package = mock.Mock()
mock_replacement_order_package.__iter__ = mock.Mock(
return_value=iter([mock_order])
)
mock_sim_resp = mock.Mock()
mock_sim_resp.status = "FAILURE"
mock_order.simulated.cancel.return_value = mock_sim_resp
mock_replacement_order.simulated.place.return_value = mock_sim_resp
mock_order.trade.create_order_replacement.return_value = mock_replacement_order
self.execution.execute_replace(mock_order_package, None)
mock_order.simulated.cancel.assert_called_with()
mock_replacement_order.simulated.place.assert_called_with(
mock_order_package.client,
mock_order_package.market.market_book,
{"newPrice": 2.54},
self.execution._bet_id,
)
mock__order_logger.assert_called_with(
mock_order, mock_sim_resp, OrderPackageType.CANCEL
)
mock_order.executable.assert_called_with()
mock_replacement_order.executable.assert_not_called()
mock_order.trade.__enter__.assert_called_with()
mock_order.trade.__exit__.assert_called_with(None, None, None)
| 47.477064 | 88 | 0.719734 | 4,773 | 41,400 | 5.74251 | 0.025141 | 0.142836 | 0.106242 | 0.073188 | 0.949433 | 0.941662 | 0.923346 | 0.912146 | 0.899777 | 0.894086 | 0 | 0.002553 | 0.195652 | 41,400 | 871 | 89 | 47.531573 | 0.820541 | 0.003478 | 0 | 0.753408 | 0 | 0 | 0.105476 | 0.100022 | 0 | 0 | 0 | 0 | 0.1772 | 1 | 0.068154 | false | 0 | 0.009913 | 0 | 0.081784 | 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 |
736c529b4b00d9ade6cffe170b7140270a9ece87 | 8,265 | py | Python | cottonformation/res/codestar.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 5 | 2021-07-22T03:45:59.000Z | 2021-12-17T21:07:14.000Z | cottonformation/res/codestar.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 1 | 2021-06-25T18:01:31.000Z | 2021-06-25T18:01:31.000Z | cottonformation/res/codestar.py | MacHu-GWU/cottonformation-project | 23e28c08cfb5a7cc0db6dbfdb1d7e1585c773f3b | [
"BSD-2-Clause"
] | 2 | 2021-06-27T03:08:21.000Z | 2021-06-28T22:15:51.000Z | # -*- coding: utf-8 -*-
"""
This module
"""
import attr
import typing
from ..core.model import (
Property, Resource, Tag, GetAtt, TypeHint, TypeCheck,
)
from ..core.constant import AttrMeta
#--- Property declaration ---
@attr.s
class PropGitHubRepositoryS3(Property):
"""
AWS Object Type = "AWS::CodeStar::GitHubRepository.S3"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html
Property Document:
- ``rp_Bucket``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-bucket
- ``rp_Key``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-key
- ``p_ObjectVersion``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-objectversion
"""
AWS_OBJECT_TYPE = "AWS::CodeStar::GitHubRepository.S3"
rp_Bucket: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Bucket"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-bucket"""
rp_Key: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "Key"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-key"""
p_ObjectVersion: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "ObjectVersion"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-s3.html#cfn-codestar-githubrepository-s3-objectversion"""
@attr.s
class PropGitHubRepositoryCode(Property):
"""
AWS Object Type = "AWS::CodeStar::GitHubRepository.Code"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-code.html
Property Document:
- ``rp_S3``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-code.html#cfn-codestar-githubrepository-code-s3
"""
AWS_OBJECT_TYPE = "AWS::CodeStar::GitHubRepository.Code"
rp_S3: typing.Union['PropGitHubRepositoryS3', dict] = attr.ib(
default=None,
converter=PropGitHubRepositoryS3.from_dict,
validator=attr.validators.instance_of(PropGitHubRepositoryS3),
metadata={AttrMeta.PROPERTY_NAME: "S3"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestar-githubrepository-code.html#cfn-codestar-githubrepository-code-s3"""
#--- Resource declaration ---
@attr.s
class GitHubRepository(Resource):
"""
AWS Object Type = "AWS::CodeStar::GitHubRepository"
Resource Document: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html
Property Document:
- ``rp_RepositoryName``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryname
- ``rp_RepositoryOwner``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryowner
- ``p_Code``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-code
- ``p_ConnectionArn``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-connectionarn
- ``p_EnableIssues``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-enableissues
- ``p_IsPrivate``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-isprivate
- ``p_RepositoryAccessToken``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryaccesstoken
- ``p_RepositoryDescription``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositorydescription
"""
AWS_OBJECT_TYPE = "AWS::CodeStar::GitHubRepository"
rp_RepositoryName: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "RepositoryName"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryname"""
rp_RepositoryOwner: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.instance_of(TypeCheck.intrinsic_str_type),
metadata={AttrMeta.PROPERTY_NAME: "RepositoryOwner"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryowner"""
p_Code: typing.Union['PropGitHubRepositoryCode', dict] = attr.ib(
default=None,
converter=PropGitHubRepositoryCode.from_dict,
validator=attr.validators.optional(attr.validators.instance_of(PropGitHubRepositoryCode)),
metadata={AttrMeta.PROPERTY_NAME: "Code"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-code"""
p_ConnectionArn: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "ConnectionArn"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-connectionarn"""
p_EnableIssues: bool = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(bool)),
metadata={AttrMeta.PROPERTY_NAME: "EnableIssues"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-enableissues"""
p_IsPrivate: bool = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(bool)),
metadata={AttrMeta.PROPERTY_NAME: "IsPrivate"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-isprivate"""
p_RepositoryAccessToken: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "RepositoryAccessToken"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositoryaccesstoken"""
p_RepositoryDescription: TypeHint.intrinsic_str = attr.ib(
default=None,
validator=attr.validators.optional(attr.validators.instance_of(TypeCheck.intrinsic_str_type)),
metadata={AttrMeta.PROPERTY_NAME: "RepositoryDescription"},
)
"""Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestar-githubrepository.html#cfn-codestar-githubrepository-repositorydescription"""
| 56.22449 | 192 | 0.76092 | 887 | 8,265 | 7 | 0.080045 | 0.220325 | 0.047834 | 0.073925 | 0.883395 | 0.875503 | 0.852955 | 0.822677 | 0.813819 | 0.813819 | 0 | 0.003388 | 0.107199 | 8,265 | 146 | 193 | 56.609589 | 0.838054 | 0.336116 | 0 | 0.324675 | 0 | 0 | 0.081991 | 0.055344 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.051948 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
737bfed4974e2b01f4f0bfa69d58774cedcc03a8 | 241 | py | Python | scripts/item/consume_2436743.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2436743.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2436743.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Created by MechAviv
# Chinese Text Damage Skin (30 Day) | (2436743)
if sm.addDamageSkin(2436743):
sm.chat("'Chinese Text Damage Skin (30 Day)' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() | 48.2 | 120 | 0.726141 | 36 | 241 | 4.861111 | 0.638889 | 0.228571 | 0.194286 | 0.24 | 0.297143 | 0.297143 | 0 | 0 | 0 | 0 | 0 | 0.09 | 0.170124 | 241 | 5 | 121 | 48.2 | 0.785 | 0.26971 | 0 | 0 | 0 | 0.333333 | 0.603448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
738663cccdfce392dd0b34fa4b13f29ee4ce3515 | 94,428 | py | Python | lib/services/vautoscaling/ncloud_vautoscaling/api/v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/vautoscaling/ncloud_vautoscaling/api/v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/vautoscaling/ncloud_vautoscaling/api/v2_api.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
vautoscaling
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 ncloud_vautoscaling.api_client import ApiClient
class V2Api(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_auto_scaling_group(self, create_auto_scaling_group_request, **kwargs): # noqa: E501
"""create_auto_scaling_group # noqa: E501
오토스케일링그룹생성 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_auto_scaling_group(create_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param CreateAutoScalingGroupRequest create_auto_scaling_group_request: createAutoScalingGroupRequest (required)
:return: CreateAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.create_auto_scaling_group_with_http_info(create_auto_scaling_group_request, **kwargs) # noqa: E501
else:
(data) = self.create_auto_scaling_group_with_http_info(create_auto_scaling_group_request, **kwargs) # noqa: E501
return data
def create_auto_scaling_group_with_http_info(self, create_auto_scaling_group_request, **kwargs): # noqa: E501
"""create_auto_scaling_group # noqa: E501
오토스케일링그룹생성 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_auto_scaling_group_with_http_info(create_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param CreateAutoScalingGroupRequest create_auto_scaling_group_request: createAutoScalingGroupRequest (required)
:return: CreateAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['create_auto_scaling_group_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_group" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'create_auto_scaling_group_request' is set
if ('create_auto_scaling_group_request' not in params or
params['create_auto_scaling_group_request'] is None):
raise ValueError("Missing the required parameter `create_auto_scaling_group_request` when calling `create_auto_scaling_group`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'create_auto_scaling_group_request' in params:
body_params = params['create_auto_scaling_group_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/createAutoScalingGroup', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CreateAutoScalingGroupResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 create_launch_configuration(self, create_launch_configuration_request, **kwargs): # noqa: E501
"""create_launch_configuration # noqa: E501
론치설정생성 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_launch_configuration(create_launch_configuration_request, async=True)
>>> result = thread.get()
:param async bool
:param CreateLaunchConfigurationRequest create_launch_configuration_request: createLaunchConfigurationRequest (required)
:return: CreateLaunchConfigurationResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.create_launch_configuration_with_http_info(create_launch_configuration_request, **kwargs) # noqa: E501
else:
(data) = self.create_launch_configuration_with_http_info(create_launch_configuration_request, **kwargs) # noqa: E501
return data
def create_launch_configuration_with_http_info(self, create_launch_configuration_request, **kwargs): # noqa: E501
"""create_launch_configuration # noqa: E501
론치설정생성 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_launch_configuration_with_http_info(create_launch_configuration_request, async=True)
>>> result = thread.get()
:param async bool
:param CreateLaunchConfigurationRequest create_launch_configuration_request: createLaunchConfigurationRequest (required)
:return: CreateLaunchConfigurationResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['create_launch_configuration_request'] # noqa: E501
all_params.append('async')
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_launch_configuration" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'create_launch_configuration_request' is set
if ('create_launch_configuration_request' not in params or
params['create_launch_configuration_request'] is None):
raise ValueError("Missing the required parameter `create_launch_configuration_request` when calling `create_launch_configuration`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'create_launch_configuration_request' in params:
body_params = params['create_launch_configuration_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/createLaunchConfiguration', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CreateLaunchConfigurationResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_group(self, delete_auto_scaling_group_request, **kwargs): # noqa: E501
"""delete_auto_scaling_group # noqa: E501
오토스케일링그룹삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_auto_scaling_group(delete_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteAutoScalingGroupRequest delete_auto_scaling_group_request: deleteAutoScalingGroupRequest (required)
:return: DeleteAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_auto_scaling_group_with_http_info(delete_auto_scaling_group_request, **kwargs) # noqa: E501
else:
(data) = self.delete_auto_scaling_group_with_http_info(delete_auto_scaling_group_request, **kwargs) # noqa: E501
return data
def delete_auto_scaling_group_with_http_info(self, delete_auto_scaling_group_request, **kwargs): # noqa: E501
"""delete_auto_scaling_group # noqa: E501
오토스케일링그룹삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_auto_scaling_group_with_http_info(delete_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteAutoScalingGroupRequest delete_auto_scaling_group_request: deleteAutoScalingGroupRequest (required)
:return: DeleteAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['delete_auto_scaling_group_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_group" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'delete_auto_scaling_group_request' is set
if ('delete_auto_scaling_group_request' not in params or
params['delete_auto_scaling_group_request'] is None):
raise ValueError("Missing the required parameter `delete_auto_scaling_group_request` when calling `delete_auto_scaling_group`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'delete_auto_scaling_group_request' in params:
body_params = params['delete_auto_scaling_group_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/deleteAutoScalingGroup', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeleteAutoScalingGroupResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_launch_configuration(self, delete_launch_configuration_request, **kwargs): # noqa: E501
"""delete_launch_configuration # noqa: E501
론치설정삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_launch_configuration(delete_launch_configuration_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteLaunchConfigurationRequest delete_launch_configuration_request: deleteLaunchConfigurationRequest (required)
:return: DeleteLaunchConfigurationResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_launch_configuration_with_http_info(delete_launch_configuration_request, **kwargs) # noqa: E501
else:
(data) = self.delete_launch_configuration_with_http_info(delete_launch_configuration_request, **kwargs) # noqa: E501
return data
def delete_launch_configuration_with_http_info(self, delete_launch_configuration_request, **kwargs): # noqa: E501
"""delete_launch_configuration # noqa: E501
론치설정삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_launch_configuration_with_http_info(delete_launch_configuration_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteLaunchConfigurationRequest delete_launch_configuration_request: deleteLaunchConfigurationRequest (required)
:return: DeleteLaunchConfigurationResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['delete_launch_configuration_request'] # noqa: E501
all_params.append('async')
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_launch_configuration" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'delete_launch_configuration_request' is set
if ('delete_launch_configuration_request' not in params or
params['delete_launch_configuration_request'] is None):
raise ValueError("Missing the required parameter `delete_launch_configuration_request` when calling `delete_launch_configuration`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'delete_launch_configuration_request' in params:
body_params = params['delete_launch_configuration_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/deleteLaunchConfiguration', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeleteLaunchConfigurationResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_scaling_policy(self, delete_scaling_policy_request, **kwargs): # noqa: E501
"""delete_scaling_policy # noqa: E501
스케일링정책삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_scaling_policy(delete_scaling_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteScalingPolicyRequest delete_scaling_policy_request: deleteScalingPolicyRequest (required)
:return: DeleteScalingPolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_scaling_policy_with_http_info(delete_scaling_policy_request, **kwargs) # noqa: E501
else:
(data) = self.delete_scaling_policy_with_http_info(delete_scaling_policy_request, **kwargs) # noqa: E501
return data
def delete_scaling_policy_with_http_info(self, delete_scaling_policy_request, **kwargs): # noqa: E501
"""delete_scaling_policy # noqa: E501
스케일링정책삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_scaling_policy_with_http_info(delete_scaling_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteScalingPolicyRequest delete_scaling_policy_request: deleteScalingPolicyRequest (required)
:return: DeleteScalingPolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['delete_scaling_policy_request'] # noqa: E501
all_params.append('async')
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_scaling_policy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'delete_scaling_policy_request' is set
if ('delete_scaling_policy_request' not in params or
params['delete_scaling_policy_request'] is None):
raise ValueError("Missing the required parameter `delete_scaling_policy_request` when calling `delete_scaling_policy`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'delete_scaling_policy_request' in params:
body_params = params['delete_scaling_policy_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/deleteScalingPolicy', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeleteScalingPolicyResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_scheduled_action(self, delete_scheduled_action_request, **kwargs): # noqa: E501
"""delete_scheduled_action # noqa: E501
스케쥴액션삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_scheduled_action(delete_scheduled_action_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteScheduledActionRequest delete_scheduled_action_request: deleteScheduledActionRequest (required)
:return: DeleteScheduledActionResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_scheduled_action_with_http_info(delete_scheduled_action_request, **kwargs) # noqa: E501
else:
(data) = self.delete_scheduled_action_with_http_info(delete_scheduled_action_request, **kwargs) # noqa: E501
return data
def delete_scheduled_action_with_http_info(self, delete_scheduled_action_request, **kwargs): # noqa: E501
"""delete_scheduled_action # noqa: E501
스케쥴액션삭제 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_scheduled_action_with_http_info(delete_scheduled_action_request, async=True)
>>> result = thread.get()
:param async bool
:param DeleteScheduledActionRequest delete_scheduled_action_request: deleteScheduledActionRequest (required)
:return: DeleteScheduledActionResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['delete_scheduled_action_request'] # noqa: E501
all_params.append('async')
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_scheduled_action" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'delete_scheduled_action_request' is set
if ('delete_scheduled_action_request' not in params or
params['delete_scheduled_action_request'] is None):
raise ValueError("Missing the required parameter `delete_scheduled_action_request` when calling `delete_scheduled_action`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'delete_scheduled_action_request' in params:
body_params = params['delete_scheduled_action_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/deleteScheduledAction', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeleteScheduledActionResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 execute_policy(self, execute_policy_request, **kwargs): # noqa: E501
"""execute_policy # noqa: E501
정책실행 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_policy(execute_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param ExecutePolicyRequest execute_policy_request: executePolicyRequest (required)
:return: ExecutePolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.execute_policy_with_http_info(execute_policy_request, **kwargs) # noqa: E501
else:
(data) = self.execute_policy_with_http_info(execute_policy_request, **kwargs) # noqa: E501
return data
def execute_policy_with_http_info(self, execute_policy_request, **kwargs): # noqa: E501
"""execute_policy # noqa: E501
정책실행 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_policy_with_http_info(execute_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param ExecutePolicyRequest execute_policy_request: executePolicyRequest (required)
:return: ExecutePolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['execute_policy_request'] # noqa: E501
all_params.append('async')
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 execute_policy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'execute_policy_request' is set
if ('execute_policy_request' not in params or
params['execute_policy_request'] is None):
raise ValueError("Missing the required parameter `execute_policy_request` when calling `execute_policy`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'execute_policy_request' in params:
body_params = params['execute_policy_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/executePolicy', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ExecutePolicyResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_adjustment_type_list(self, get_adjustment_type_list_request, **kwargs): # noqa: E501
"""get_adjustment_type_list # noqa: E501
조정유형리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_adjustment_type_list(get_adjustment_type_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAdjustmentTypeListRequest get_adjustment_type_list_request: getAdjustmentTypeListRequest (required)
:return: GetAdjustmentTypeListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_adjustment_type_list_with_http_info(get_adjustment_type_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_adjustment_type_list_with_http_info(get_adjustment_type_list_request, **kwargs) # noqa: E501
return data
def get_adjustment_type_list_with_http_info(self, get_adjustment_type_list_request, **kwargs): # noqa: E501
"""get_adjustment_type_list # noqa: E501
조정유형리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_adjustment_type_list_with_http_info(get_adjustment_type_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAdjustmentTypeListRequest get_adjustment_type_list_request: getAdjustmentTypeListRequest (required)
:return: GetAdjustmentTypeListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_adjustment_type_list_request'] # noqa: E501
all_params.append('async')
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_adjustment_type_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_adjustment_type_list_request' is set
if ('get_adjustment_type_list_request' not in params or
params['get_adjustment_type_list_request'] is None):
raise ValueError("Missing the required parameter `get_adjustment_type_list_request` when calling `get_adjustment_type_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_adjustment_type_list_request' in params:
body_params = params['get_adjustment_type_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getAdjustmentTypeList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetAdjustmentTypeListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_activity_log_list(self, get_auto_scaling_activity_log_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_activity_log_list # noqa: E501
액티비티로그리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_activity_log_list(get_auto_scaling_activity_log_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingActivityLogListRequest get_auto_scaling_activity_log_list_request: getAutoScalingActivityLogListRequest (required)
:return: GetAutoScalingActivityLogListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_auto_scaling_activity_log_list_with_http_info(get_auto_scaling_activity_log_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_auto_scaling_activity_log_list_with_http_info(get_auto_scaling_activity_log_list_request, **kwargs) # noqa: E501
return data
def get_auto_scaling_activity_log_list_with_http_info(self, get_auto_scaling_activity_log_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_activity_log_list # noqa: E501
액티비티로그리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_activity_log_list_with_http_info(get_auto_scaling_activity_log_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingActivityLogListRequest get_auto_scaling_activity_log_list_request: getAutoScalingActivityLogListRequest (required)
:return: GetAutoScalingActivityLogListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_auto_scaling_activity_log_list_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_activity_log_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_auto_scaling_activity_log_list_request' is set
if ('get_auto_scaling_activity_log_list_request' not in params or
params['get_auto_scaling_activity_log_list_request'] is None):
raise ValueError("Missing the required parameter `get_auto_scaling_activity_log_list_request` when calling `get_auto_scaling_activity_log_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_auto_scaling_activity_log_list_request' in params:
body_params = params['get_auto_scaling_activity_log_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getAutoScalingActivityLogList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetAutoScalingActivityLogListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_group_detail(self, get_auto_scaling_group_detail_request, **kwargs): # noqa: E501
"""get_auto_scaling_group_detail # noqa: E501
오토스케일링그룹상세조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_group_detail(get_auto_scaling_group_detail_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingGroupDetailRequest get_auto_scaling_group_detail_request: getAutoScalingGroupDetailRequest (required)
:return: GetAutoScalingGroupDetailResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_auto_scaling_group_detail_with_http_info(get_auto_scaling_group_detail_request, **kwargs) # noqa: E501
else:
(data) = self.get_auto_scaling_group_detail_with_http_info(get_auto_scaling_group_detail_request, **kwargs) # noqa: E501
return data
def get_auto_scaling_group_detail_with_http_info(self, get_auto_scaling_group_detail_request, **kwargs): # noqa: E501
"""get_auto_scaling_group_detail # noqa: E501
오토스케일링그룹상세조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_group_detail_with_http_info(get_auto_scaling_group_detail_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingGroupDetailRequest get_auto_scaling_group_detail_request: getAutoScalingGroupDetailRequest (required)
:return: GetAutoScalingGroupDetailResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_auto_scaling_group_detail_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_group_detail" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_auto_scaling_group_detail_request' is set
if ('get_auto_scaling_group_detail_request' not in params or
params['get_auto_scaling_group_detail_request'] is None):
raise ValueError("Missing the required parameter `get_auto_scaling_group_detail_request` when calling `get_auto_scaling_group_detail`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_auto_scaling_group_detail_request' in params:
body_params = params['get_auto_scaling_group_detail_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getAutoScalingGroupDetail', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetAutoScalingGroupDetailResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_group_list(self, get_auto_scaling_group_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_group_list # noqa: E501
오토스케일링그룹리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_group_list(get_auto_scaling_group_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingGroupListRequest get_auto_scaling_group_list_request: getAutoScalingGroupListRequest (required)
:return: GetAutoScalingGroupListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_auto_scaling_group_list_with_http_info(get_auto_scaling_group_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_auto_scaling_group_list_with_http_info(get_auto_scaling_group_list_request, **kwargs) # noqa: E501
return data
def get_auto_scaling_group_list_with_http_info(self, get_auto_scaling_group_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_group_list # noqa: E501
오토스케일링그룹리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_group_list_with_http_info(get_auto_scaling_group_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingGroupListRequest get_auto_scaling_group_list_request: getAutoScalingGroupListRequest (required)
:return: GetAutoScalingGroupListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_auto_scaling_group_list_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_group_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_auto_scaling_group_list_request' is set
if ('get_auto_scaling_group_list_request' not in params or
params['get_auto_scaling_group_list_request'] is None):
raise ValueError("Missing the required parameter `get_auto_scaling_group_list_request` when calling `get_auto_scaling_group_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_auto_scaling_group_list_request' in params:
body_params = params['get_auto_scaling_group_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getAutoScalingGroupList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetAutoScalingGroupListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_policy_list(self, get_auto_scaling_policy_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_policy_list # noqa: E501
오토스케일링정책리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_policy_list(get_auto_scaling_policy_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingPolicyListRequest get_auto_scaling_policy_list_request: getAutoScalingPolicyListRequest (required)
:return: GetAutoScalingPolicyListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_auto_scaling_policy_list_with_http_info(get_auto_scaling_policy_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_auto_scaling_policy_list_with_http_info(get_auto_scaling_policy_list_request, **kwargs) # noqa: E501
return data
def get_auto_scaling_policy_list_with_http_info(self, get_auto_scaling_policy_list_request, **kwargs): # noqa: E501
"""get_auto_scaling_policy_list # noqa: E501
오토스케일링정책리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_auto_scaling_policy_list_with_http_info(get_auto_scaling_policy_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetAutoScalingPolicyListRequest get_auto_scaling_policy_list_request: getAutoScalingPolicyListRequest (required)
:return: GetAutoScalingPolicyListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_auto_scaling_policy_list_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_policy_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_auto_scaling_policy_list_request' is set
if ('get_auto_scaling_policy_list_request' not in params or
params['get_auto_scaling_policy_list_request'] is None):
raise ValueError("Missing the required parameter `get_auto_scaling_policy_list_request` when calling `get_auto_scaling_policy_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_auto_scaling_policy_list_request' in params:
body_params = params['get_auto_scaling_policy_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getAutoScalingPolicyList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetAutoScalingPolicyListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_launch_configuration_detail(self, get_launch_configuration_detail_request, **kwargs): # noqa: E501
"""get_launch_configuration_detail # noqa: E501
론치설정상세조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_launch_configuration_detail(get_launch_configuration_detail_request, async=True)
>>> result = thread.get()
:param async bool
:param GetLaunchConfigurationDetailRequest get_launch_configuration_detail_request: getLaunchConfigurationDetailRequest (required)
:return: GetLaunchConfigurationDetailResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_launch_configuration_detail_with_http_info(get_launch_configuration_detail_request, **kwargs) # noqa: E501
else:
(data) = self.get_launch_configuration_detail_with_http_info(get_launch_configuration_detail_request, **kwargs) # noqa: E501
return data
def get_launch_configuration_detail_with_http_info(self, get_launch_configuration_detail_request, **kwargs): # noqa: E501
"""get_launch_configuration_detail # noqa: E501
론치설정상세조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_launch_configuration_detail_with_http_info(get_launch_configuration_detail_request, async=True)
>>> result = thread.get()
:param async bool
:param GetLaunchConfigurationDetailRequest get_launch_configuration_detail_request: getLaunchConfigurationDetailRequest (required)
:return: GetLaunchConfigurationDetailResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_launch_configuration_detail_request'] # noqa: E501
all_params.append('async')
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_launch_configuration_detail" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_launch_configuration_detail_request' is set
if ('get_launch_configuration_detail_request' not in params or
params['get_launch_configuration_detail_request'] is None):
raise ValueError("Missing the required parameter `get_launch_configuration_detail_request` when calling `get_launch_configuration_detail`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_launch_configuration_detail_request' in params:
body_params = params['get_launch_configuration_detail_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getLaunchConfigurationDetail', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetLaunchConfigurationDetailResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_launch_configuration_list(self, get_launch_configuration_list_request, **kwargs): # noqa: E501
"""get_launch_configuration_list # noqa: E501
론치설정리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_launch_configuration_list(get_launch_configuration_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetLaunchConfigurationListRequest get_launch_configuration_list_request: getLaunchConfigurationListRequest (required)
:return: GetLaunchConfigurationListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_launch_configuration_list_with_http_info(get_launch_configuration_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_launch_configuration_list_with_http_info(get_launch_configuration_list_request, **kwargs) # noqa: E501
return data
def get_launch_configuration_list_with_http_info(self, get_launch_configuration_list_request, **kwargs): # noqa: E501
"""get_launch_configuration_list # noqa: E501
론치설정리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_launch_configuration_list_with_http_info(get_launch_configuration_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetLaunchConfigurationListRequest get_launch_configuration_list_request: getLaunchConfigurationListRequest (required)
:return: GetLaunchConfigurationListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_launch_configuration_list_request'] # noqa: E501
all_params.append('async')
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_launch_configuration_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_launch_configuration_list_request' is set
if ('get_launch_configuration_list_request' not in params or
params['get_launch_configuration_list_request'] is None):
raise ValueError("Missing the required parameter `get_launch_configuration_list_request` when calling `get_launch_configuration_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_launch_configuration_list_request' in params:
body_params = params['get_launch_configuration_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getLaunchConfigurationList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetLaunchConfigurationListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_scaling_process_type_list(self, get_scaling_process_type_list_request, **kwargs): # noqa: E501
"""get_scaling_process_type_list # noqa: E501
스케일링프로세스유형리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_scaling_process_type_list(get_scaling_process_type_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetScalingProcessTypeListRequest get_scaling_process_type_list_request: getScalingProcessTypeListRequest (required)
:return: GetScalingProcessTypeListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_scaling_process_type_list_with_http_info(get_scaling_process_type_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_scaling_process_type_list_with_http_info(get_scaling_process_type_list_request, **kwargs) # noqa: E501
return data
def get_scaling_process_type_list_with_http_info(self, get_scaling_process_type_list_request, **kwargs): # noqa: E501
"""get_scaling_process_type_list # noqa: E501
스케일링프로세스유형리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_scaling_process_type_list_with_http_info(get_scaling_process_type_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetScalingProcessTypeListRequest get_scaling_process_type_list_request: getScalingProcessTypeListRequest (required)
:return: GetScalingProcessTypeListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_scaling_process_type_list_request'] # noqa: E501
all_params.append('async')
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_scaling_process_type_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_scaling_process_type_list_request' is set
if ('get_scaling_process_type_list_request' not in params or
params['get_scaling_process_type_list_request'] is None):
raise ValueError("Missing the required parameter `get_scaling_process_type_list_request` when calling `get_scaling_process_type_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_scaling_process_type_list_request' in params:
body_params = params['get_scaling_process_type_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getScalingProcessTypeList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetScalingProcessTypeListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_scheduled_action_list(self, get_scheduled_action_list_request, **kwargs): # noqa: E501
"""get_scheduled_action_list # noqa: E501
스케쥴액션리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_scheduled_action_list(get_scheduled_action_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetScheduledActionListRequest get_scheduled_action_list_request: getScheduledActionListRequest (required)
:return: GetScheduledActionListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_scheduled_action_list_with_http_info(get_scheduled_action_list_request, **kwargs) # noqa: E501
else:
(data) = self.get_scheduled_action_list_with_http_info(get_scheduled_action_list_request, **kwargs) # noqa: E501
return data
def get_scheduled_action_list_with_http_info(self, get_scheduled_action_list_request, **kwargs): # noqa: E501
"""get_scheduled_action_list # noqa: E501
스케쥴액션리스트조회 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_scheduled_action_list_with_http_info(get_scheduled_action_list_request, async=True)
>>> result = thread.get()
:param async bool
:param GetScheduledActionListRequest get_scheduled_action_list_request: getScheduledActionListRequest (required)
:return: GetScheduledActionListResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['get_scheduled_action_list_request'] # noqa: E501
all_params.append('async')
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_scheduled_action_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'get_scheduled_action_list_request' is set
if ('get_scheduled_action_list_request' not in params or
params['get_scheduled_action_list_request'] is None):
raise ValueError("Missing the required parameter `get_scheduled_action_list_request` when calling `get_scheduled_action_list`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'get_scheduled_action_list_request' in params:
body_params = params['get_scheduled_action_list_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/getScheduledActionList', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='GetScheduledActionListResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 put_scaling_policy(self, put_scaling_policy_request, **kwargs): # noqa: E501
"""put_scaling_policy # noqa: E501
스케일링정책생성/수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.put_scaling_policy(put_scaling_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param PutScalingPolicyRequest put_scaling_policy_request: putScalingPolicyRequest (required)
:return: PutScalingPolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.put_scaling_policy_with_http_info(put_scaling_policy_request, **kwargs) # noqa: E501
else:
(data) = self.put_scaling_policy_with_http_info(put_scaling_policy_request, **kwargs) # noqa: E501
return data
def put_scaling_policy_with_http_info(self, put_scaling_policy_request, **kwargs): # noqa: E501
"""put_scaling_policy # noqa: E501
스케일링정책생성/수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.put_scaling_policy_with_http_info(put_scaling_policy_request, async=True)
>>> result = thread.get()
:param async bool
:param PutScalingPolicyRequest put_scaling_policy_request: putScalingPolicyRequest (required)
:return: PutScalingPolicyResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['put_scaling_policy_request'] # noqa: E501
all_params.append('async')
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 put_scaling_policy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'put_scaling_policy_request' is set
if ('put_scaling_policy_request' not in params or
params['put_scaling_policy_request'] is None):
raise ValueError("Missing the required parameter `put_scaling_policy_request` when calling `put_scaling_policy`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'put_scaling_policy_request' in params:
body_params = params['put_scaling_policy_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/putScalingPolicy', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PutScalingPolicyResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 put_scheduled_update_group_action(self, put_scheduled_update_group_action_request, **kwargs): # noqa: E501
"""put_scheduled_update_group_action # noqa: E501
스케쥴액션생성/수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.put_scheduled_update_group_action(put_scheduled_update_group_action_request, async=True)
>>> result = thread.get()
:param async bool
:param PutScheduledUpdateGroupActionRequest put_scheduled_update_group_action_request: putScheduledUpdateGroupActionRequest (required)
:return: PutScheduledUpdateGroupActionResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.put_scheduled_update_group_action_with_http_info(put_scheduled_update_group_action_request, **kwargs) # noqa: E501
else:
(data) = self.put_scheduled_update_group_action_with_http_info(put_scheduled_update_group_action_request, **kwargs) # noqa: E501
return data
def put_scheduled_update_group_action_with_http_info(self, put_scheduled_update_group_action_request, **kwargs): # noqa: E501
"""put_scheduled_update_group_action # noqa: E501
스케쥴액션생성/수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.put_scheduled_update_group_action_with_http_info(put_scheduled_update_group_action_request, async=True)
>>> result = thread.get()
:param async bool
:param PutScheduledUpdateGroupActionRequest put_scheduled_update_group_action_request: putScheduledUpdateGroupActionRequest (required)
:return: PutScheduledUpdateGroupActionResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['put_scheduled_update_group_action_request'] # noqa: E501
all_params.append('async')
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 put_scheduled_update_group_action" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'put_scheduled_update_group_action_request' is set
if ('put_scheduled_update_group_action_request' not in params or
params['put_scheduled_update_group_action_request'] is None):
raise ValueError("Missing the required parameter `put_scheduled_update_group_action_request` when calling `put_scheduled_update_group_action`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'put_scheduled_update_group_action_request' in params:
body_params = params['put_scheduled_update_group_action_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/putScheduledUpdateGroupAction', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PutScheduledUpdateGroupActionResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_processes(self, resume_processes_request, **kwargs): # noqa: E501
"""resume_processes # noqa: E501
프로세스재시작 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.resume_processes(resume_processes_request, async=True)
>>> result = thread.get()
:param async bool
:param ResumeProcessesRequest resume_processes_request: resumeProcessesRequest (required)
:return: ResumeProcessesResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.resume_processes_with_http_info(resume_processes_request, **kwargs) # noqa: E501
else:
(data) = self.resume_processes_with_http_info(resume_processes_request, **kwargs) # noqa: E501
return data
def resume_processes_with_http_info(self, resume_processes_request, **kwargs): # noqa: E501
"""resume_processes # noqa: E501
프로세스재시작 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.resume_processes_with_http_info(resume_processes_request, async=True)
>>> result = thread.get()
:param async bool
:param ResumeProcessesRequest resume_processes_request: resumeProcessesRequest (required)
:return: ResumeProcessesResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['resume_processes_request'] # noqa: E501
all_params.append('async')
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_processes" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'resume_processes_request' is set
if ('resume_processes_request' not in params or
params['resume_processes_request'] is None):
raise ValueError("Missing the required parameter `resume_processes_request` when calling `resume_processes`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'resume_processes_request' in params:
body_params = params['resume_processes_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/resumeProcesses', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ResumeProcessesResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 set_desired_capacity(self, set_desired_capacity_request, **kwargs): # noqa: E501
"""set_desired_capacity # noqa: E501
기대용량설정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.set_desired_capacity(set_desired_capacity_request, async=True)
>>> result = thread.get()
:param async bool
:param SetDesiredCapacityRequest set_desired_capacity_request: setDesiredCapacityRequest (required)
:return: SetDesiredCapacityResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.set_desired_capacity_with_http_info(set_desired_capacity_request, **kwargs) # noqa: E501
else:
(data) = self.set_desired_capacity_with_http_info(set_desired_capacity_request, **kwargs) # noqa: E501
return data
def set_desired_capacity_with_http_info(self, set_desired_capacity_request, **kwargs): # noqa: E501
"""set_desired_capacity # noqa: E501
기대용량설정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.set_desired_capacity_with_http_info(set_desired_capacity_request, async=True)
>>> result = thread.get()
:param async bool
:param SetDesiredCapacityRequest set_desired_capacity_request: setDesiredCapacityRequest (required)
:return: SetDesiredCapacityResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['set_desired_capacity_request'] # noqa: E501
all_params.append('async')
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 set_desired_capacity" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'set_desired_capacity_request' is set
if ('set_desired_capacity_request' not in params or
params['set_desired_capacity_request'] is None):
raise ValueError("Missing the required parameter `set_desired_capacity_request` when calling `set_desired_capacity`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'set_desired_capacity_request' in params:
body_params = params['set_desired_capacity_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/setDesiredCapacity', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SetDesiredCapacityResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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 suspend_processes(self, suspend_processes_request, **kwargs): # noqa: E501
"""suspend_processes # noqa: E501
프로세스일시정지 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.suspend_processes(suspend_processes_request, async=True)
>>> result = thread.get()
:param async bool
:param SuspendProcessesRequest suspend_processes_request: suspendProcessesRequest (required)
:return: SuspendProcessesResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.suspend_processes_with_http_info(suspend_processes_request, **kwargs) # noqa: E501
else:
(data) = self.suspend_processes_with_http_info(suspend_processes_request, **kwargs) # noqa: E501
return data
def suspend_processes_with_http_info(self, suspend_processes_request, **kwargs): # noqa: E501
"""suspend_processes # noqa: E501
프로세스일시정지 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.suspend_processes_with_http_info(suspend_processes_request, async=True)
>>> result = thread.get()
:param async bool
:param SuspendProcessesRequest suspend_processes_request: suspendProcessesRequest (required)
:return: SuspendProcessesResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['suspend_processes_request'] # noqa: E501
all_params.append('async')
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 suspend_processes" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'suspend_processes_request' is set
if ('suspend_processes_request' not in params or
params['suspend_processes_request'] is None):
raise ValueError("Missing the required parameter `suspend_processes_request` when calling `suspend_processes`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'suspend_processes_request' in params:
body_params = params['suspend_processes_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/suspendProcesses', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SuspendProcessesResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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_auto_scaling_group(self, update_auto_scaling_group_request, **kwargs): # noqa: E501
"""update_auto_scaling_group # noqa: E501
오토스케일링그룹수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_auto_scaling_group(update_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param UpdateAutoScalingGroupRequest update_auto_scaling_group_request: updateAutoScalingGroupRequest (required)
:return: UpdateAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.update_auto_scaling_group_with_http_info(update_auto_scaling_group_request, **kwargs) # noqa: E501
else:
(data) = self.update_auto_scaling_group_with_http_info(update_auto_scaling_group_request, **kwargs) # noqa: E501
return data
def update_auto_scaling_group_with_http_info(self, update_auto_scaling_group_request, **kwargs): # noqa: E501
"""update_auto_scaling_group # noqa: E501
오토스케일링그룹수정 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_auto_scaling_group_with_http_info(update_auto_scaling_group_request, async=True)
>>> result = thread.get()
:param async bool
:param UpdateAutoScalingGroupRequest update_auto_scaling_group_request: updateAutoScalingGroupRequest (required)
:return: UpdateAutoScalingGroupResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['update_auto_scaling_group_request'] # noqa: E501
all_params.append('async')
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_auto_scaling_group" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'update_auto_scaling_group_request' is set
if ('update_auto_scaling_group_request' not in params or
params['update_auto_scaling_group_request'] is None):
raise ValueError("Missing the required parameter `update_auto_scaling_group_request` when calling `update_auto_scaling_group`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
query_params.append(('responseFormatType', 'json')) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'update_auto_scaling_group_request' in params:
body_params = params['update_auto_scaling_group_request']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/x-www-form-urlencoded']) # noqa: E501
# Authentication setting
auth_settings = ['x-ncp-iam'] # noqa: E501
return self.api_client.call_api(
'/updateAutoScalingGroup', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateAutoScalingGroupResponse', # noqa: E501
auth_settings=auth_settings,
_async=params.get('async'),
_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)
| 44.04291 | 171 | 0.655865 | 10,284 | 94,428 | 5.673376 | 0.02431 | 0.045248 | 0.034279 | 0.031674 | 0.967075 | 0.957888 | 0.944005 | 0.918913 | 0.897592 | 0.880058 | 0 | 0.014365 | 0.264996 | 94,428 | 2,143 | 172 | 44.063462 | 0.826281 | 0.323093 | 0 | 0.730213 | 1 | 0 | 0.23545 | 0.144814 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038298 | false | 0 | 0.003404 | 0 | 0.098723 | 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 |
73ac822f1bfb70eeee2c3e3bff157291549a14bc | 102 | py | Python | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | def print1():
print("code for first program")
def print2():
print("code for second program")
| 17 | 36 | 0.656863 | 14 | 102 | 4.785714 | 0.642857 | 0.268657 | 0.358209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024691 | 0.205882 | 102 | 5 | 37 | 20.4 | 0.802469 | 0 | 0 | 0 | 0 | 0 | 0.441176 | 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 |
73bbe4aeab902518facc50a2b20abe9e63ba33f3 | 28,996 | py | Python | lib/doekbase/data_api/sequence/assembly/service/ttypes.py | scanon/data_api2 | f453a8e544cb4052feb56f4cf77ba79122aeedf8 | [
"MIT"
] | null | null | null | lib/doekbase/data_api/sequence/assembly/service/ttypes.py | scanon/data_api2 | f453a8e544cb4052feb56f4cf77ba79122aeedf8 | [
"MIT"
] | null | null | null | lib/doekbase/data_api/sequence/assembly/service/ttypes.py | scanon/data_api2 | f453a8e544cb4052feb56f4cf77ba79122aeedf8 | [
"MIT"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:twisted
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class ServiceException(TException):
"""
Attributes:
- message
- stacktrace
- inputs
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
(3, TType.MAP, 'inputs', (TType.STRING,None,TType.STRING,None), None, ), # 3
)
def __init__(self, message=None, stacktrace=None, inputs=None,):
self.message = message
self.stacktrace = stacktrace
self.inputs = inputs
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.MAP:
self.inputs = {}
(_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
for _i4 in xrange(_size0):
_key5 = iprot.readString();
_val6 = iprot.readString();
self.inputs[_key5] = _val6
iprot.readMapEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ServiceException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
if self.inputs is not None:
oprot.writeFieldBegin('inputs', TType.MAP, 3)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.inputs))
for kiter7,viter8 in self.inputs.items():
oprot.writeString(kiter7)
oprot.writeString(viter8)
oprot.writeMapEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
value = (value * 31) ^ hash(self.inputs)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AuthorizationException(TException):
"""
Attributes:
- message
- stacktrace
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
)
def __init__(self, message=None, stacktrace=None,):
self.message = message
self.stacktrace = stacktrace
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AuthorizationException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AuthenticationException(TException):
"""
Attributes:
- message
- stacktrace
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
)
def __init__(self, message=None, stacktrace=None,):
self.message = message
self.stacktrace = stacktrace
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AuthenticationException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class ObjectReferenceException(TException):
"""
Attributes:
- message
- stacktrace
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
)
def __init__(self, message=None, stacktrace=None,):
self.message = message
self.stacktrace = stacktrace
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ObjectReferenceException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AttributeException(TException):
"""
Attributes:
- message
- stacktrace
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
)
def __init__(self, message=None, stacktrace=None,):
self.message = message
self.stacktrace = stacktrace
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AttributeException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class TypeException(TException):
"""
Attributes:
- message
- stacktrace
- valid_types
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'message', None, None, ), # 1
(2, TType.STRING, 'stacktrace', None, None, ), # 2
(3, TType.LIST, 'valid_types', (TType.STRING,None), None, ), # 3
)
def __init__(self, message=None, stacktrace=None, valid_types=None,):
self.message = message
self.stacktrace = stacktrace
self.valid_types = valid_types
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.message = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.stacktrace = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.LIST:
self.valid_types = []
(_etype12, _size9) = iprot.readListBegin()
for _i13 in xrange(_size9):
_elem14 = iprot.readString();
self.valid_types.append(_elem14)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('TypeException')
if self.message is not None:
oprot.writeFieldBegin('message', TType.STRING, 1)
oprot.writeString(self.message)
oprot.writeFieldEnd()
if self.stacktrace is not None:
oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
oprot.writeString(self.stacktrace)
oprot.writeFieldEnd()
if self.valid_types is not None:
oprot.writeFieldBegin('valid_types', TType.LIST, 3)
oprot.writeListBegin(TType.STRING, len(self.valid_types))
for iter15 in self.valid_types:
oprot.writeString(iter15)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.message is None:
raise TProtocol.TProtocolException(message='Required field message is unset!')
return
def __str__(self):
return repr(self)
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.message)
value = (value * 31) ^ hash(self.stacktrace)
value = (value * 31) ^ hash(self.valid_types)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AssemblyStats:
"""
Attributes:
- num_contigs
- dna_size
- gc_content
"""
thrift_spec = (
None, # 0
(1, TType.I64, 'num_contigs', None, None, ), # 1
(2, TType.I64, 'dna_size', None, None, ), # 2
(3, TType.DOUBLE, 'gc_content', None, None, ), # 3
)
def __init__(self, num_contigs=None, dna_size=None, gc_content=None,):
self.num_contigs = num_contigs
self.dna_size = dna_size
self.gc_content = gc_content
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I64:
self.num_contigs = iprot.readI64();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.I64:
self.dna_size = iprot.readI64();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.DOUBLE:
self.gc_content = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AssemblyStats')
if self.num_contigs is not None:
oprot.writeFieldBegin('num_contigs', TType.I64, 1)
oprot.writeI64(self.num_contigs)
oprot.writeFieldEnd()
if self.dna_size is not None:
oprot.writeFieldBegin('dna_size', TType.I64, 2)
oprot.writeI64(self.dna_size)
oprot.writeFieldEnd()
if self.gc_content is not None:
oprot.writeFieldBegin('gc_content', TType.DOUBLE, 3)
oprot.writeDouble(self.gc_content)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.num_contigs)
value = (value * 31) ^ hash(self.dna_size)
value = (value * 31) ^ hash(self.gc_content)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AssemblyExternalSourceInfo:
"""
Attributes:
- external_source
- external_source_id
- external_source_origination_date
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'external_source', None, None, ), # 1
(2, TType.STRING, 'external_source_id', None, None, ), # 2
(3, TType.STRING, 'external_source_origination_date', None, None, ), # 3
)
def __init__(self, external_source=None, external_source_id=None, external_source_origination_date=None,):
self.external_source = external_source
self.external_source_id = external_source_id
self.external_source_origination_date = external_source_origination_date
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.external_source = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.external_source_id = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.external_source_origination_date = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AssemblyExternalSourceInfo')
if self.external_source is not None:
oprot.writeFieldBegin('external_source', TType.STRING, 1)
oprot.writeString(self.external_source)
oprot.writeFieldEnd()
if self.external_source_id is not None:
oprot.writeFieldBegin('external_source_id', TType.STRING, 2)
oprot.writeString(self.external_source_id)
oprot.writeFieldEnd()
if self.external_source_origination_date is not None:
oprot.writeFieldBegin('external_source_origination_date', TType.STRING, 3)
oprot.writeString(self.external_source_origination_date)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.external_source)
value = (value * 31) ^ hash(self.external_source_id)
value = (value * 31) ^ hash(self.external_source_origination_date)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AssemblyContig:
"""
Attributes:
- contig_id
- sequence
- length
- gc_content
- md5
- name
- description
- is_complete
- is_circular
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'contig_id', None, None, ), # 1
(2, TType.STRING, 'sequence', None, None, ), # 2
(3, TType.I64, 'length', None, None, ), # 3
(4, TType.DOUBLE, 'gc_content', None, None, ), # 4
(5, TType.STRING, 'md5', None, None, ), # 5
(6, TType.STRING, 'name', None, None, ), # 6
(7, TType.STRING, 'description', None, None, ), # 7
(8, TType.BOOL, 'is_complete', None, None, ), # 8
(9, TType.BOOL, 'is_circular', None, None, ), # 9
)
def __init__(self, contig_id=None, sequence=None, length=None, gc_content=None, md5=None, name=None, description=None, is_complete=None, is_circular=None,):
self.contig_id = contig_id
self.sequence = sequence
self.length = length
self.gc_content = gc_content
self.md5 = md5
self.name = name
self.description = description
self.is_complete = is_complete
self.is_circular = is_circular
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.contig_id = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.sequence = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.I64:
self.length = iprot.readI64();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.DOUBLE:
self.gc_content = iprot.readDouble();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRING:
self.md5 = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.STRING:
self.name = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 7:
if ftype == TType.STRING:
self.description = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 8:
if ftype == TType.BOOL:
self.is_complete = iprot.readBool();
else:
iprot.skip(ftype)
elif fid == 9:
if ftype == TType.BOOL:
self.is_circular = iprot.readBool();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AssemblyContig')
if self.contig_id is not None:
oprot.writeFieldBegin('contig_id', TType.STRING, 1)
oprot.writeString(self.contig_id)
oprot.writeFieldEnd()
if self.sequence is not None:
oprot.writeFieldBegin('sequence', TType.STRING, 2)
oprot.writeString(self.sequence)
oprot.writeFieldEnd()
if self.length is not None:
oprot.writeFieldBegin('length', TType.I64, 3)
oprot.writeI64(self.length)
oprot.writeFieldEnd()
if self.gc_content is not None:
oprot.writeFieldBegin('gc_content', TType.DOUBLE, 4)
oprot.writeDouble(self.gc_content)
oprot.writeFieldEnd()
if self.md5 is not None:
oprot.writeFieldBegin('md5', TType.STRING, 5)
oprot.writeString(self.md5)
oprot.writeFieldEnd()
if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 6)
oprot.writeString(self.name)
oprot.writeFieldEnd()
if self.description is not None:
oprot.writeFieldBegin('description', TType.STRING, 7)
oprot.writeString(self.description)
oprot.writeFieldEnd()
if self.is_complete is not None:
oprot.writeFieldBegin('is_complete', TType.BOOL, 8)
oprot.writeBool(self.is_complete)
oprot.writeFieldEnd()
if self.is_circular is not None:
oprot.writeFieldBegin('is_circular', TType.BOOL, 9)
oprot.writeBool(self.is_circular)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.contig_id)
value = (value * 31) ^ hash(self.sequence)
value = (value * 31) ^ hash(self.length)
value = (value * 31) ^ hash(self.gc_content)
value = (value * 31) ^ hash(self.md5)
value = (value * 31) ^ hash(self.name)
value = (value * 31) ^ hash(self.description)
value = (value * 31) ^ hash(self.is_complete)
value = (value * 31) ^ hash(self.is_circular)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
| 31.79386 | 188 | 0.650021 | 3,417 | 28,996 | 5.286509 | 0.052385 | 0.04019 | 0.032385 | 0.037865 | 0.832485 | 0.78244 | 0.748118 | 0.723151 | 0.707595 | 0.707374 | 0 | 0.012163 | 0.231584 | 28,996 | 911 | 189 | 31.82876 | 0.798573 | 0.024831 | 0 | 0.764547 | 1 | 0 | 0.037401 | 0.005664 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105548 | false | 0 | 0.005413 | 0.036536 | 0.228687 | 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 |
73f4d2374eed85c7c20562942aa8ef7dfcbcb908 | 48,704 | py | Python | ghostwriter/reporting/tests/test_views.py | quantum-sec/Ghostwriter | 552a594abe212f96eeeda11ff7145b8de8a8e45a | [
"BSD-3-Clause"
] | 1 | 2021-12-02T14:50:35.000Z | 2021-12-02T14:50:35.000Z | ghostwriter/reporting/tests/test_views.py | quantum-sec/Ghostwriter | 552a594abe212f96eeeda11ff7145b8de8a8e45a | [
"BSD-3-Clause"
] | null | null | null | ghostwriter/reporting/tests/test_views.py | quantum-sec/Ghostwriter | 552a594abe212f96eeeda11ff7145b8de8a8e45a | [
"BSD-3-Clause"
] | null | null | null | # Standard Libraries
import logging
import random
from datetime import datetime
# Django Imports
from django.test import Client, TestCase
from django.urls import reverse
from django.utils.encoding import force_text
# Ghostwriter Libraries
from ghostwriter.factories import (
ClientContactFactory,
ClientFactory,
DomainServerConnectionFactory,
EvidenceFactory,
FindingFactory,
FindingTypeFactory,
GenerateMockProject,
HistoryFactory,
ObjectivePriorityFactory,
ObjectiveStatusFactory,
ProjectAssignmentFactory,
ProjectFactory,
ProjectObjectiveFactory,
ProjectScopeFactory,
ProjectSubtaskFactory,
ProjectTargetFactory,
ReportDocxTemplateFactory,
ReportFactory,
ReportFindingLinkFactory,
ReportPptxTemplateFactory,
ReportTemplateFactory,
ServerHistoryFactory,
SeverityFactory,
TransientServerFactory,
UserFactory,
)
from ghostwriter.reporting.templatetags import report_tags
logging.disable(logging.INFO)
PASSWORD = "SuperNaturalReporting!"
# Tests related to custom template tags and filters
class TemplateTagTests(TestCase):
"""Collection of tests for custom template tags."""
@classmethod
def setUpTestData(cls):
cls.ReportFindingLink = ReportFindingLinkFactory._meta.model
cls.report = ReportFactory()
for x in range(3):
ReportFindingLinkFactory(report=cls.report)
def setUp(self):
pass
def test_tags(self):
queryset = self.ReportFindingLink.objects.all()
severity_dict = report_tags.group_by_severity(queryset)
self.assertEqual(len(severity_dict), 3)
for group in severity_dict:
self.assertEqual(
report_tags.get_item(severity_dict, group), severity_dict.get(group)
)
lint_json = report_tags.load_json(self.report.docx_template.lint_result)
data = {"result": "success", "warnings": [], "errors": []}
self.assertEqual(lint_json, data)
# Tests related to report modification actions
class AssignBlankFindingTests(TestCase):
"""Collection of tests for :view:`reporting.AssignBlankFinding`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.user = UserFactory(password=PASSWORD)
# These must exist for the view to function
cls.high_severity = SeverityFactory(severity="High", weight=1)
cls.med_severity = SeverityFactory(severity="Medium", weight=2)
cls.low_severity = SeverityFactory(severity="Low", weight=3)
cls.info_severity = SeverityFactory(severity="Informational", weight=4)
cls.finding_type = FindingTypeFactory(finding_type="Network")
cls.uri = reverse("reporting:assign_blank_finding", kwargs={"pk": cls.report.pk})
cls.redirect_uri = reverse(
"reporting:report_detail", kwargs={"pk": cls.report.pk}
)
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertRedirects(response, self.redirect_uri)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
class ConvertFindingTests(TestCase):
"""Collection of tests for :view:`reporting.ConvertFinding`."""
@classmethod
def setUpTestData(cls):
cls.finding = ReportFindingLinkFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:convert_finding", kwargs={"pk": cls.finding.pk})
cls.redirect_uri = reverse(
"reporting:finding_detail", kwargs={"pk": cls.finding.pk}
)
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/finding_form.html")
class AssignFindingTests(TestCase):
"""Collection of tests for :view:`reporting.AssignFinding`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.finding = FindingFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:ajax_assign_finding", kwargs={"pk": cls.finding.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.post(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.post(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_response_with_session_vars(self):
self.session = self.client_auth.session
self.session["active_report"] = {}
self.session["active_report"]["id"] = self.report.id
self.session["active_report"]["title"] = self.report.title
self.session.save()
self.assertEqual(
self.session["active_report"],
{"id": self.report.id, "title": self.report.title},
)
response = self.client_auth.post(self.uri)
message = "{} successfully added to your active report".format(self.finding)
data = {"result": "success", "message": message}
self.assertJSONEqual(force_text(response.content), data)
def test_view_response_without_session_vars(self):
self.session = self.client_auth.session
self.session["active_report"] = None
self.session.save()
self.assertEqual(self.session["active_report"], None)
response = self.client_auth.post(self.uri)
message = "Please select a report to edit before trying to assign a finding"
data = {"result": "error", "message": message}
self.assertJSONEqual(force_text(response.content), data)
class CloneReportTests(TestCase):
"""Collection of tests for :view:`reporting.ReportClone`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.ReportFindingLink = ReportFindingLinkFactory._meta.model
cls.user = UserFactory(password=PASSWORD)
cls.num_of_findings = 10
cls.findings = []
for finding_id in range(cls.num_of_findings):
title = f"Finding {finding_id}"
cls.findings.append(ReportFindingLinkFactory(title=title, report=cls.report))
cls.uri = reverse("reporting:report_clone", kwargs={"pk": cls.report.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertIn("reporting/reports/", response.url)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_nonexistent_report(self):
uri = reverse("reporting:report_clone", kwargs={"pk": 100})
response = self.client_auth.get(uri)
self.assertEqual(response.status_code, 404)
def test_clone_with_zero_findings(self):
self.ReportFindingLink.objects.all().delete()
response = self.client_auth.get(self.uri)
self.assertIn("reporting/reports/", response.url)
# Tests related to :model:`reporting.Finding`
class FindingsListViewTests(TestCase):
"""Collection of tests for :view:`reporting.findings_list`."""
@classmethod
def setUpTestData(cls):
cls.Finding = FindingFactory._meta.model
cls.user = UserFactory(password=PASSWORD)
cls.num_of_findings = 10
cls.findings = []
for finding_id in range(cls.num_of_findings):
title = f"Finding {finding_id}"
cls.findings.append(FindingFactory(title=title))
cls.uri = reverse("reporting:findings")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/finding_list.html")
def test_lists_all_findings(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context["filter"].qs) == len(self.findings))
def test_search_findings(self):
response = self.client_auth.get(self.uri + "?finding_search=Finding+2")
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context["filter"].qs) == 1)
def test_filter_findings(self):
response = self.client_auth.get(self.uri + "?title=Finding+2&submit=Filter")
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context["filter"].qs) == 1)
class FindingDetailViewTests(TestCase):
"""Collection of tests for :view:`reporting.FindingDetailView`."""
@classmethod
def setUpTestData(cls):
cls.finding = FindingFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:finding_detail", kwargs={"pk": cls.finding.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/finding_detail.html")
class FindingCreateViewTests(TestCase):
"""Collection of tests for :view:`reporting.FindingCreate`."""
@classmethod
def setUpTestData(cls):
cls.finding = FindingFactory()
cls.Finding = FindingFactory._meta.model
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:finding_create")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/finding_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(response.context["cancel_link"], reverse("reporting:findings"))
class FindingUpdateViewTests(TestCase):
"""Collection of tests for :view:`reporting.FindingUpdate`."""
@classmethod
def setUpTestData(cls):
cls.finding = FindingFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:finding_update", kwargs={"pk": cls.finding.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/finding_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:finding_detail", kwargs={"pk": self.finding.pk}),
)
class FindingDeleteViewTests(TestCase):
"""Collection of tests for :view:`reporting.FindingDelete`."""
@classmethod
def setUpTestData(cls):
cls.finding = FindingFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:finding_delete", kwargs={"pk": cls.finding.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "confirm_delete.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertIn("object_type", response.context)
self.assertIn("object_to_be_deleted", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:findings"),
)
self.assertEqual(
response.context["object_type"],
"finding master record",
)
self.assertEqual(response.context["object_to_be_deleted"], self.finding.title)
# Tests related to :model:`reporting.Report`
class ReportsListViewTests(TestCase):
"""Collection of tests for :view:`reporting.reports_list`."""
@classmethod
def setUpTestData(cls):
cls.user = UserFactory(password=PASSWORD)
cls.num_of_reports = 10
cls.reports = []
for report_id in range(cls.num_of_reports):
title = f"Report {report_id}"
cls.reports.append(ReportFactory(title=title))
cls.uri = reverse("reporting:reports")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_list.html")
def test_lists_all_reports(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context["filter"].qs) == len(self.reports))
class ReportDetailViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportDetailView`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:report_detail", kwargs={"pk": cls.report.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_detail.html")
class ReportCreateViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportCreate`."""
@classmethod
def setUpTestData(cls):
cls.project = ProjectFactory()
cls.report = ReportFactory(project=cls.project)
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:report_create_no_project")
cls.project_uri = reverse(
"reporting:report_create", kwargs={"pk": cls.project.pk}
)
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(response.context["cancel_link"], reverse("reporting:reports"))
def test_view_uri_with_project_exists_at_desired_location(self):
response = self.client_auth.get(self.project_uri)
self.assertEqual(response.status_code, 200)
def test_custom_context_changes_for_project(self):
response = self.client_auth.get(self.project_uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("rolodex:project_detail", kwargs={"pk": self.project.pk}),
)
def test_form_with_no_active_projects(self):
self.project.complete = True
self.project.save()
response = self.client_auth.get(self.uri)
self.assertInHTML(
'<option value="" selected>-- No Active Projects --</option>',
response.content.decode(),
)
self.project.complete = False
self.project.save()
class ReportUpdateViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportUpdate`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:report_update", kwargs={"pk": cls.report.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:report_detail", kwargs={"pk": self.report.pk}),
)
class ReportDeleteViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportDelete`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:report_delete", kwargs={"pk": cls.report.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "confirm_delete.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertIn("object_type", response.context)
self.assertIn("object_to_be_deleted", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("rolodex:project_detail", kwargs={"pk": self.report.project.pk}),
)
self.assertEqual(
response.context["object_type"],
"entire report, evidence and all",
)
self.assertEqual(response.context["object_to_be_deleted"], self.report.title)
# Tests related to :model:`reporting.ReportFindingLink`
class ReportFindingLinkUpdateViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportFindingLinkUpdate`."""
@classmethod
def setUpTestData(cls):
cls.report = ReportFactory(
docx_template=ReportDocxTemplateFactory(),
pptx_template=ReportPptxTemplateFactory(),
)
cls.high_severity = SeverityFactory(severity="High", weight=1)
cls.critical_severity = SeverityFactory(severity="Critical", weight=0)
cls.user = UserFactory(password=PASSWORD)
cls.new_user = UserFactory(password=PASSWORD)
cls.num_of_findings = 10
cls.findings = []
for finding_id in range(cls.num_of_findings):
title = f"Finding {finding_id}"
cls.findings.append(ReportFindingLinkFactory(title=title, report=cls.report))
cls.uri = reverse("reporting:local_edit", kwargs={"pk": cls.findings[0].pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/local_edit.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:report_detail", kwargs={"pk": self.report.pk}),
)
# Tests related to :model:`reporting.Evidence`
class EvidenceDetailViewTests(TestCase):
"""
Collection of tests for :view:`reporting.EvidenceDetailView` and the related
:view:`reporting.upload_evidence_modal_success`.
"""
@classmethod
def setUpTestData(cls):
cls.evidence = EvidenceFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:evidence_detail", kwargs={"pk": cls.evidence.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/evidence_detail.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("filetype", response.context)
self.assertIn("evidence", response.context)
self.assertIn("file_content", response.context)
self.assertEqual(
response.context["filetype"],
"image",
)
self.assertEqual(
response.context["evidence"],
self.evidence,
)
class EvidenceCreateViewTests(TestCase):
"""Collection of tests for :view:`reporting.EvidenceCreate`."""
@classmethod
def setUpTestData(cls):
cls.finding = ReportFindingLinkFactory()
cls.evidence = EvidenceFactory(finding=cls.finding)
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:upload_evidence", kwargs={"pk": cls.finding.pk})
cls.modal_uri = reverse(
"reporting:upload_evidence_modal",
kwargs={"pk": cls.finding.pk, "modal": "modal"},
)
cls.success_uri = reverse(
"reporting:report_detail", args=(cls.finding.report.pk,)
)
cls.modal_success_uri = reverse("reporting:upload_evidence_modal_success")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
# Testing regular form view
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/evidence_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:report_detail", kwargs={"pk": self.finding.report.pk}),
)
# Testing modal form view
def test_view_modal_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.modal_uri)
self.assertEqual(response.status_code, 200)
def test_view_modal_requires_login(self):
response = self.client.get(self.modal_uri)
self.assertEqual(response.status_code, 302)
def test_view_modal_uses_correct_template(self):
response = self.client_auth.get(self.modal_uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/evidence_form_modal.html")
def test_custom_modal_context_exists(self):
response = self.client_auth.get(self.modal_uri)
self.assertIn("cancel_link", response.context)
self.assertIn("used_friendly_names", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:report_detail", kwargs={"pk": self.finding.report.pk}),
)
# Testing modal success view
def test_view_modal_success_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.modal_success_uri)
self.assertEqual(response.status_code, 200)
def test_view_modal_success_requires_login(self):
response = self.client.get(self.modal_success_uri)
self.assertEqual(response.status_code, 302)
def test_view_modal_success_uses_correct_template(self):
response = self.client_auth.get(self.modal_success_uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/evidence_modal_success.html")
class EvidenceUpdateViewTests(TestCase):
"""Collection of tests for :view:`reporting.EvidenceUpdate`."""
@classmethod
def setUpTestData(cls):
cls.evidence = EvidenceFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:evidence_update", kwargs={"pk": cls.evidence.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/evidence_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:evidence_detail", kwargs={"pk": self.evidence.pk}),
)
class EvidenceDeleteViewTests(TestCase):
"""Collection of tests for :view:`reporting.EvidenceDelete`."""
@classmethod
def setUpTestData(cls):
cls.evidence = EvidenceFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:evidence_delete", kwargs={"pk": cls.evidence.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "confirm_delete.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertIn("object_type", response.context)
self.assertIn("object_to_be_deleted", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:evidence_detail", kwargs={"pk": self.evidence.pk}),
)
self.assertEqual(
response.context["object_type"],
"evidence file (and associated file on disk)",
)
self.assertEqual(
response.context["object_to_be_deleted"], self.evidence.friendly_name
)
# Tests related to :model:`reporting.ReportTemplate`
class ReportTemplateListViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateListView`."""
@classmethod
def setUpTestData(cls):
cls.user = UserFactory(password=PASSWORD)
cls.num_of_templates = 10
cls.templates = []
for template_id in range(cls.num_of_templates):
cls.templates.append(ReportTemplateFactory())
cls.uri = reverse("reporting:templates")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_templates_list.html")
class ReportTemplateDownloadTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateDownload`."""
@classmethod
def setUpTestData(cls):
cls.template = ReportTemplateFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:template_download", kwargs={"pk": cls.template.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
class ReportTemplateDetailViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateDetailView`."""
@classmethod
def setUpTestData(cls):
cls.template = ReportTemplateFactory(protected=True)
cls.user = UserFactory(password=PASSWORD)
cls.admin_user = UserFactory(password=PASSWORD, is_staff=True)
cls.uri = reverse("reporting:template_detail", kwargs={"pk": cls.template.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_admin = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
self.assertTrue(
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_template_detail.html")
def test_view_for_protected_template(self):
response = self.client_auth.get(self.uri)
self.assertInHTML(
'<div class="alert alert-danger icon lock-icon" role="alert">This template is protected – only admins may edit it</div>',
response.content.decode(),
)
response = self.client_admin.get(self.uri)
self.assertInHTML(
'<div class="alert alert-secondary icon unlock-icon" role="alert">You may edit this template as an admin</div>',
response.content.decode(),
)
class ReportTemplateCreateViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateCreate`."""
@classmethod
def setUpTestData(cls):
cls.template = ReportTemplateFactory()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:template_create")
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_template_form.html")
def test_custom_context_exists(self):
response = self.client_auth.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(response.context["cancel_link"], reverse("reporting:templates"))
def test_initial_form_values(self):
response = self.client_auth.get(self.uri)
date = datetime.now().strftime("%d %B %Y")
initial_upload = f'<p><span class="bold">{date}</span></p><p>Initial upload</p>'
self.assertEqual(response.context["form"].initial["changelog"], initial_upload)
class ReportTemplateUpdateViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateUpdate`."""
@classmethod
def setUpTestData(cls):
cls.template = ReportTemplateFactory(protected=True)
cls.user = UserFactory(password=PASSWORD)
cls.admin_user = UserFactory(password=PASSWORD, is_staff=True)
cls.uri = reverse("reporting:template_update", kwargs={"pk": cls.template.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_admin = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
self.assertTrue(
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_admin.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_admin.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "reporting/report_template_form.html")
def test_custom_context_exists(self):
response = self.client_admin.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertEqual(response.context["cancel_link"], reverse("reporting:templates"))
def test_view_permissions(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 302)
class ReportTemplateDeleteViewTests(TestCase):
"""Collection of tests for :view:`reporting.ReportTemplateDelete`."""
@classmethod
def setUpTestData(cls):
cls.template = ReportTemplateFactory(protected=True)
cls.user = UserFactory(password=PASSWORD)
cls.admin_user = UserFactory(password=PASSWORD, is_staff=True)
cls.uri = reverse("reporting:template_delete", kwargs={"pk": cls.template.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_admin = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
self.assertTrue(
self.client_admin.login(username=self.admin_user.username, password=PASSWORD)
)
def test_view_uri_exists_at_desired_location(self):
response = self.client_admin.get(self.uri)
self.assertEqual(response.status_code, 200)
def test_view_requires_login(self):
response = self.client.get(self.uri)
self.assertEqual(response.status_code, 302)
def test_view_uses_correct_template(self):
response = self.client_admin.get(self.uri)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "confirm_delete.html")
def test_custom_context_exists(self):
response = self.client_admin.get(self.uri)
self.assertIn("cancel_link", response.context)
self.assertIn("object_type", response.context)
self.assertIn("object_to_be_deleted", response.context)
self.assertEqual(
response.context["cancel_link"],
reverse("reporting:template_detail", kwargs={"pk": self.template.pk}),
)
self.assertEqual(
response.context["object_type"],
"report template file (and associated file on disk)",
)
self.assertEqual(response.context["object_to_be_deleted"], self.template.filename)
def test_view_permissions(self):
response = self.client_auth.get(self.uri)
self.assertEqual(response.status_code, 302)
# Tests related to generating report types
class GenerateReportTests(TestCase):
"""Collection of tests for all :view:`reporting.GenerateReport*`."""
@classmethod
def setUpTestData(cls):
cls.org, cls.project, cls.report = GenerateMockProject()
cls.user = UserFactory(password=PASSWORD)
cls.uri = reverse("reporting:report_delete", kwargs={"pk": cls.report.pk})
cls.redirect_uri = reverse(
"reporting:report_detail", kwargs={"pk": cls.report.pk}
)
cls.docx_uri = reverse("reporting:generate_docx", kwargs={"pk": cls.report.pk})
cls.xlsx_uri = reverse("reporting:generate_xlsx", kwargs={"pk": cls.report.pk})
cls.pptx_uri = reverse("reporting:generate_pptx", kwargs={"pk": cls.report.pk})
cls.json_uri = reverse("reporting:generate_json", kwargs={"pk": cls.report.pk})
cls.all_uri = reverse("reporting:generate_all", kwargs={"pk": cls.report.pk})
def setUp(self):
self.client = Client()
self.client_auth = Client()
self.client_auth.login(username=self.user.username, password=PASSWORD)
self.assertTrue(
self.client_auth.login(username=self.user.username, password=PASSWORD)
)
def test_view_json_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.json_uri)
self.assertEqual(response.status_code, 200)
def test_view_docx_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.docx_uri)
self.assertEquals(
response.get("Content-Type"),
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
)
def test_view_xlsx_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.xlsx_uri)
self.assertEquals(
response.get("Content-Type"),
"application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
)
def test_view_pptx_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.pptx_uri)
self.assertEquals(
response.get("Content-Type"),
"application/application/vnd.openxmlformats-officedocument.presentationml.presentation",
)
def test_view_all_uri_exists_at_desired_location(self):
response = self.client_auth.get(self.all_uri)
self.assertEquals(
response.get("Content-Type"),
"application/x-zip-compressed",
)
def test_view_json_requires_login(self):
response = self.client.get(self.json_uri)
self.assertEqual(response.status_code, 302)
def test_view_docx_requires_login(self):
response = self.client.get(self.docx_uri)
self.assertEqual(response.status_code, 302)
def test_view_xlsx_requires_login(self):
response = self.client.get(self.xlsx_uri)
self.assertEqual(response.status_code, 302)
def test_view_pptxx_requires_login(self):
response = self.client.get(self.pptx_uri)
self.assertEqual(response.status_code, 302)
def test_view_all_requires_login(self):
response = self.client.get(self.all_uri)
self.assertEqual(response.status_code, 302)
| 37.093679 | 133 | 0.683599 | 5,580 | 48,704 | 5.780645 | 0.062007 | 0.072235 | 0.06901 | 0.076389 | 0.831349 | 0.814825 | 0.791171 | 0.750279 | 0.72557 | 0.695871 | 0 | 0.007579 | 0.206266 | 48,704 | 1,312 | 134 | 37.121951 | 0.826789 | 0.045602 | 0 | 0.689899 | 0 | 0.00303 | 0.086444 | 0.044431 | 0 | 0 | 0 | 0 | 0.217172 | 1 | 0.173737 | false | 0.090909 | 0.008081 | 0 | 0.209091 | 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 |
fb81586542c5b3a475fc5e864a775240c74a02a8 | 13,395 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/implicit_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | # 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 msrest.pipeline import ClientRawResponse
from .. import models
class ImplicitOperations(object):
"""ImplicitOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
def get_required_path(
self, path_parameter, custom_headers=None, raw=False, **operation_config):
"""Test implicitly required path parameter.
:param path_parameter:
:type path_parameter: 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:`Error
<Fixtures.AcceptanceTestsRequiredOptional.models.Error>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/implicit/required/path/{pathParameter}'
path_format_arguments = {
'pathParameter': self._serialize.url("path_parameter", path_parameter, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code < 200 or response.status_code >= 300:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def put_optional_query(
self, query_parameter=None, custom_headers=None, raw=False, **operation_config):
"""Test implicitly optional query parameter.
:param query_parameter:
:type query_parameter: 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
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/implicit/optional/query'
# Construct parameters
query_parameters = {}
if query_parameter is not None:
query_parameters['queryParameter'] = self._serialize.query("query_parameter", query_parameter, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def put_optional_header(
self, query_parameter=None, custom_headers=None, raw=False, **operation_config):
"""Test implicitly optional header parameter.
:param query_parameter:
:type query_parameter: 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
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/implicit/optional/header'
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
if query_parameter is not None:
header_parameters['queryParameter'] = self._serialize.header("query_parameter", query_parameter, 'str')
# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def put_optional_body(
self, body_parameter=None, custom_headers=None, raw=False, **operation_config):
"""Test implicitly optional body parameter.
:param body_parameter:
:type body_parameter: 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
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/implicit/optional/body'
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
if body_parameter is not None:
body_content = self._serialize.body(body_parameter, 'str')
else:
body_content = None
# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def get_required_global_path(
self, custom_headers=None, raw=False, **operation_config):
"""Test implicitly required path parameter.
: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:`Error
<Fixtures.AcceptanceTestsRequiredOptional.models.Error>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/global/required/path/{required-global-path}'
path_format_arguments = {
'required-global-path': self._serialize.url("self.config.required_global_path", self.config.required_global_path, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code < 200 or response.status_code >= 300:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def get_required_global_query(
self, custom_headers=None, raw=False, **operation_config):
"""Test implicitly required query parameter.
: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:`Error
<Fixtures.AcceptanceTestsRequiredOptional.models.Error>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/global/required/query'
# Construct parameters
query_parameters = {}
query_parameters['required-global-query'] = self._serialize.query("self.config.required_global_query", self.config.required_global_query, 'str')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code < 200 or response.status_code >= 300:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def get_optional_global_query(
self, custom_headers=None, raw=False, **operation_config):
"""Test implicitly optional query parameter.
: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:`Error
<Fixtures.AcceptanceTestsRequiredOptional.models.Error>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`ErrorException<Fixtures.AcceptanceTestsRequiredOptional.models.ErrorException>`
"""
# Construct URL
url = '/reqopt/global/optional/query'
# Construct parameters
query_parameters = {}
if self.config.optional_global_query is not None:
query_parameters['optional-global-query'] = self._serialize.query("self.config.optional_global_query", self.config.optional_global_query, 'int')
# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
if response.status_code < 200 or response.status_code >= 300:
raise models.ErrorException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
| 40.225225 | 156 | 0.665174 | 1,342 | 13,395 | 6.462742 | 0.097616 | 0.053499 | 0.037127 | 0.016142 | 0.864176 | 0.845382 | 0.821976 | 0.802606 | 0.802606 | 0.802606 | 0 | 0.004036 | 0.241583 | 13,395 | 332 | 157 | 40.346386 | 0.84969 | 0.382083 | 0 | 0.706767 | 0 | 0 | 0.109279 | 0.052025 | 0 | 0 | 0 | 0 | 0 | 1 | 0.06015 | false | 0 | 0.015038 | 0 | 0.135338 | 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 |
8381fda2caf1d26ecfcd6884aaa238c000321560 | 14,835 | py | Python | tests/blueprint/snapshots/snap_test_schema_based_on_auth.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | null | null | null | tests/blueprint/snapshots/snap_test_schema_based_on_auth.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 24 | 2020-04-02T19:29:07.000Z | 2022-03-08T03:05:43.000Z | tests/blueprint/snapshots/snap_test_schema_based_on_auth.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 1 | 2020-04-08T15:48:28.000Z | 2020-04-08T15:48:28.000Z | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_schema_selection[False-False] 1'] = {
'data': {
'__schema': {
'mutationType': {
'fields': [
{
'name': 'authenticateWithGitHub'
},
{
'name': 'createLog'
}
]
},
'queryType': {
'fields': [
{
'name': 'webConfig'
},
{
'name': 'isSignedIn'
},
{
'name': 'gitHubOAuthAppInfo'
}
]
},
'subscriptionType': None
}
}
}
snapshots['test_schema_selection[False-True] 1'] = {
'data': {
'__schema': {
'mutationType': {
'fields': [
{
'name': 'authenticateWithGitHub'
},
{
'name': 'createLog'
},
{
'name': 'createProduct'
},
{
'name': 'deleteProduct'
},
{
'name': 'updateProduct'
},
{
'name': 'createProductFilePath'
},
{
'name': 'deleteProductFilePath'
},
{
'name': 'updateProductFilePath'
},
{
'name': 'createProductRelation'
},
{
'name': 'deleteProductRelation'
},
{
'name': 'createProductRelationTypes'
},
{
'name': 'deleteProductRelationTypes'
},
{
'name': 'updateProductRelationType'
},
{
'name': 'createProductType'
},
{
'name': 'deleteProductType'
},
{
'name': 'updateProductType'
},
{
'name': 'createField'
},
{
'name': 'deleteField'
},
{
'name': 'updateField'
}
]
},
'queryType': {
'fields': [
{
'name': 'webConfig'
},
{
'name': 'isSignedIn'
},
{
'name': 'gitHubOAuthAppInfo'
},
{
'name': 'version'
},
{
'name': 'alembicVersion'
},
{
'name': 'isAdmin'
},
{
'name': 'gitHubViewer'
},
{
'name': 'allProducts'
},
{
'name': 'allProductTypes'
},
{
'name': 'allProductRelations'
},
{
'name': 'allProductRelationTypes'
},
{
'name': 'allProductFilePaths'
},
{
'name': 'allFields'
},
{
'name': 'product'
},
{
'name': 'productType'
},
{
'name': 'productRelation'
},
{
'name': 'productRelationType'
},
{
'name': 'field'
},
{
'name': 'node'
}
]
},
'subscriptionType': None
}
}
}
snapshots['test_schema_selection[True-False] 1'] = {
'data': {
'__schema': {
'mutationType': {
'fields': [
{
'name': 'authenticateWithGitHub'
},
{
'name': 'createLog'
},
{
'name': 'createProduct'
},
{
'name': 'deleteProduct'
},
{
'name': 'updateProduct'
},
{
'name': 'createProductFilePath'
},
{
'name': 'deleteProductFilePath'
},
{
'name': 'updateProductFilePath'
},
{
'name': 'createProductRelation'
},
{
'name': 'deleteProductRelation'
},
{
'name': 'createProductRelationTypes'
},
{
'name': 'deleteProductRelationTypes'
},
{
'name': 'updateProductRelationType'
},
{
'name': 'createProductType'
},
{
'name': 'deleteProductType'
},
{
'name': 'updateProductType'
},
{
'name': 'createField'
},
{
'name': 'deleteField'
},
{
'name': 'updateField'
},
{
'name': 'addGitHubOrg'
},
{
'name': 'deleteGitHubOrg'
},
{
'name': 'addGitHubAdminAppToken'
},
{
'name': 'deleteGitHubAdminAppToken'
},
{
'name': 'updateGitHubOrgMemberLists'
},
{
'name': 'deleteLog'
}
]
},
'queryType': {
'fields': [
{
'name': 'webConfig'
},
{
'name': 'isSignedIn'
},
{
'name': 'gitHubOAuthAppInfo'
},
{
'name': 'version'
},
{
'name': 'alembicVersion'
},
{
'name': 'isAdmin'
},
{
'name': 'gitHubViewer'
},
{
'name': 'allProducts'
},
{
'name': 'allProductTypes'
},
{
'name': 'allProductRelations'
},
{
'name': 'allProductRelationTypes'
},
{
'name': 'allProductFilePaths'
},
{
'name': 'allFields'
},
{
'name': 'product'
},
{
'name': 'productType'
},
{
'name': 'productRelation'
},
{
'name': 'productRelationType'
},
{
'name': 'field'
},
{
'name': 'node'
},
{
'name': 'allGitHubOrgs'
},
{
'name': 'allGitHubUsers'
},
{
'name': 'allGitHubTokens'
},
{
'name': 'allLogs'
},
{
'name': 'log'
}
]
},
'subscriptionType': None
}
}
}
snapshots['test_schema_selection[True-True] 1'] = {
'data': {
'__schema': {
'mutationType': {
'fields': [
{
'name': 'authenticateWithGitHub'
},
{
'name': 'createLog'
},
{
'name': 'createProduct'
},
{
'name': 'deleteProduct'
},
{
'name': 'updateProduct'
},
{
'name': 'createProductFilePath'
},
{
'name': 'deleteProductFilePath'
},
{
'name': 'updateProductFilePath'
},
{
'name': 'createProductRelation'
},
{
'name': 'deleteProductRelation'
},
{
'name': 'createProductRelationTypes'
},
{
'name': 'deleteProductRelationTypes'
},
{
'name': 'updateProductRelationType'
},
{
'name': 'createProductType'
},
{
'name': 'deleteProductType'
},
{
'name': 'updateProductType'
},
{
'name': 'createField'
},
{
'name': 'deleteField'
},
{
'name': 'updateField'
},
{
'name': 'addGitHubOrg'
},
{
'name': 'deleteGitHubOrg'
},
{
'name': 'addGitHubAdminAppToken'
},
{
'name': 'deleteGitHubAdminAppToken'
},
{
'name': 'updateGitHubOrgMemberLists'
},
{
'name': 'deleteLog'
}
]
},
'queryType': {
'fields': [
{
'name': 'webConfig'
},
{
'name': 'isSignedIn'
},
{
'name': 'gitHubOAuthAppInfo'
},
{
'name': 'version'
},
{
'name': 'alembicVersion'
},
{
'name': 'isAdmin'
},
{
'name': 'gitHubViewer'
},
{
'name': 'allProducts'
},
{
'name': 'allProductTypes'
},
{
'name': 'allProductRelations'
},
{
'name': 'allProductRelationTypes'
},
{
'name': 'allProductFilePaths'
},
{
'name': 'allFields'
},
{
'name': 'product'
},
{
'name': 'productType'
},
{
'name': 'productRelation'
},
{
'name': 'productRelationType'
},
{
'name': 'field'
},
{
'name': 'node'
},
{
'name': 'allGitHubOrgs'
},
{
'name': 'allGitHubUsers'
},
{
'name': 'allGitHubTokens'
},
{
'name': 'allLogs'
},
{
'name': 'log'
}
]
},
'subscriptionType': None
}
}
}
| 29.909274 | 60 | 0.216178 | 362 | 14,835 | 8.801105 | 0.21547 | 0.02511 | 0.023854 | 0.035154 | 0.962963 | 0.951036 | 0.93597 | 0.909605 | 0.889517 | 0.889517 | 0 | 0.001546 | 0.694843 | 14,835 | 495 | 61 | 29.969697 | 0.702231 | 0.004179 | 0 | 0.347737 | 0 | 0 | 0.206364 | 0.066418 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.004115 | 0 | 0.004115 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 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 |
83beeddfdaafed2e07249f752de2d871031c11d1 | 13,170 | py | Python | src/KeePassLibrary/keywords/keepassgroup.py | loomanw/robotframework-keepasslibrary | 5e494e91a5898e11d2cecc55a8e50f494325091d | [
"MIT"
] | 1 | 2021-06-16T15:25:45.000Z | 2021-06-16T15:25:45.000Z | src/KeePassLibrary/keywords/keepassgroup.py | loomanw/robotframework-keepasslibrary | 5e494e91a5898e11d2cecc55a8e50f494325091d | [
"MIT"
] | 5 | 2019-06-11T14:24:26.000Z | 2022-03-11T11:40:30.000Z | src/KeePassLibrary/keywords/keepassgroup.py | loomanw/robotframework-keepasslibrary | 5e494e91a5898e11d2cecc55a8e50f494325091d | [
"MIT"
] | 2 | 2020-05-21T17:04:12.000Z | 2021-01-27T06:45:15.000Z | """Library components."""
from KeePassLibrary.base import keyword, LibraryComponent, Group
from KeePassLibrary.errors import GroupInvalid
class KeePassGroup(LibraryComponent):
#---------- Base Element ----------
# TODO: Implented
#@keyword
# def _get_group_accessed_time(self, group:Group):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _set_group_accessed_time(self, group:Group, value):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _get_group_created_time(self, group:Group):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _set_group_created_time(self, group:Group, value):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _group_delete(self, group:Group):
# """Not Implemented
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
#@keyword
# def _get_group_expiry_time(self, group:Group):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _set_group_expiry_time(self, group:Group, value):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_icon(self, group:Group):
"""Return the icon of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Icon` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.icon
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def set_group_icon(self, group:Group, value):
"""Set the ``icon`` of the supplied KeePass ``group`` to the given ``value``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| `Set Group Expires` | ${group} | 20 | #Gear icon |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
group.icon = value
else:
raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _get_group_modified_time(self, group:Group):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _set_group_modified_time(self, group:Group, value):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_parent(self, group:Group):
"""Return the parentgroup of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Parent` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.parentgroup
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_uuid(self, group:Group):
"""Return the uuid of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Uuid` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return str(group.uuid)
else:
raise GroupInvalid('Invalid KeePass Group.')
# TODO: Implented
#@keyword
# def _set_group_uuid(self, group:Group, value):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_expires(self, group:Group):
"""Return expires of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Expires` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.expires
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def set_group_expires(self, group:Group, value:bool):
"""Sets expires value of the supplied KeePass ``group`` to the given ``value``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| `Set Group Parent` | ${group} | True |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
group.expires = value
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_expired(self, group:Group):
"""Return expired value of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Expired` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.expired
else:
raise GroupInvalid('Invalid KeePass Group.')
# @keyword
# def group_should_be_expired(self, group:Group):
# """Verifies that the supplied ``group`` is expired
#
# New in KeePassLibrary 0.3
# """
# if isinstance(group, Group):
# return group.expired
# else:
# raise GroupInvalid('Invalid KeePass Group.')
#
# @keyword
# def group_should_not_be_expired(self, group:Group):
# """Verifies that the supplied ``group`` is not expired
# """
# if isinstance(group, Group):
# return not group.expired
# else:
# raise GroupInvalid('Invalid KeePass Group.')
#---------- Group ----------
# TODO: Implented
#@keyword
# def _group_append_entry(self, group:Group):
# """*DEPRECATED*
# """
# if isinstance(group, Group):
# raise NotImplementedYet('This keyword is not implemented.')
# else:
# raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_entries(self, group:Group):
"""Returns a list of entries from the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Entries` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.entries
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_name(self, group:Group):
"""Return the name value of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Name` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.name
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def set_group_name(self, group:Group, value):
"""Set the name value of the supplied KeePass ``group`` to the given ``value``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| `Set Group Parent` | ${group} | new_group_name |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
group.name = value
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_notes(self, group:Group):
"""Return the notes value of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Notes` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.notes
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def set_group_notes(self, group:Group, value):
"""Set the notes value of the supplied KeePass ``group`` to the given ``value``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Notes` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
group.notes = value
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_subgroups(self, group:Group):
"""Returns a list of subgroups from the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Subgroups` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.subgroups
else:
raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_is_root_group(self, group:Group):
"""Return is root group value of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Is Root Group` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.is_root_group
else:
raise GroupInvalid('Invalid KeePass Group.')
# @keyword
# def group_should_be_root_group(self, group:Group):
# """Verifies that the supplied ``group`` is root group.
#
# New in KeePassLibrary 0.3
# """
# if isinstance(group, Group):
# return group.is_root_group
# else:
# raise GroupInvalid('Invalid KeePass Group.')
#
# @keyword
# def group_should_not_be_root_group(self, group:Group):
# """Verifies that the supplied ``group`` is not root group.
#
# New in KeePassLibrary 0.3
# """
# if isinstance(group, Group):
# return not group.is_root_group
# else:
# raise GroupInvalid('Invalid KeePass Group.')
@keyword
def get_group_path(self, group:Group):
"""Return the path value of the supplied KeePass ``group``
Example:
| ${group} = | `Get Groups By Name` | foobar_group | first=True |
| ${value} = | `Get Group Path` | ${group} |
New in KeePassLibrary 0.3
"""
if isinstance(group, Group):
return group.path
else:
raise GroupInvalid('Invalid KeePass Group.')
| 34.296875 | 89 | 0.518527 | 1,261 | 13,170 | 5.327518 | 0.064235 | 0.098244 | 0.062519 | 0.098244 | 0.920214 | 0.884341 | 0.849658 | 0.833433 | 0.821227 | 0.821227 | 0 | 0.004579 | 0.369856 | 13,170 | 384 | 90 | 34.296875 | 0.804916 | 0.631967 | 0 | 0.645161 | 0 | 0 | 0.090709 | 0 | 0 | 0 | 0 | 0.010417 | 0 | 1 | 0.16129 | false | 0.193548 | 0.021505 | 0 | 0.311828 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 8 |
83cee48f0e23082cc35d0ba887470069f6daca8b | 46 | py | Python | nm_iconfinder/__init__.py | newsbeam/iconfinder | 820ab59909bc6d97d50219307bc500add3de9073 | [
"0BSD"
] | 4 | 2020-06-12T06:41:48.000Z | 2020-09-22T11:32:04.000Z | nm_iconfinder/__init__.py | newsbeam/iconfinder | 820ab59909bc6d97d50219307bc500add3de9073 | [
"0BSD"
] | 1 | 2022-01-13T02:51:52.000Z | 2022-01-13T02:51:52.000Z | nm_iconfinder/__init__.py | newsmailerio/iconfinder | 820ab59909bc6d97d50219307bc500add3de9073 | [
"0BSD"
] | null | null | null | from nm_iconfinder.nm_iconfinder import icons
| 23 | 45 | 0.891304 | 7 | 46 | 5.571429 | 0.714286 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 46 | 1 | 46 | 46 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 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 |
f7bd6a10d09181f86a610e5d101451affb2d103f | 6,373 | py | Python | my_exp_ptch.py | pulkitag/egomotion | fad2ab94b0c2f5533c79a01d1b0546b8d0c64f19 | [
"BSD-3-Clause"
] | 9 | 2017-11-25T14:24:23.000Z | 2022-03-25T07:08:28.000Z | my_exp_ptch.py | pulkitag/egomotion | fad2ab94b0c2f5533c79a01d1b0546b8d0c64f19 | [
"BSD-3-Clause"
] | null | null | null | my_exp_ptch.py | pulkitag/egomotion | fad2ab94b0c2f5533c79a01d1b0546b8d0c64f19 | [
"BSD-3-Clause"
] | 3 | 2017-10-13T02:30:28.000Z | 2021-06-30T05:55:42.000Z | ##Records all the experiments I run
import street_params as sp
import street_exp as se
def smallnetv2_pool4_ptch_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=False, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, lrAbove=None):
prms = sp.get_prms_ptch(geoFence='dc-v2', crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain)
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v2',
concatLayer='pool4', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc, lrAbove=lrAbove)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000, clip_gradients=10.0)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
def smallnetv2_fc5_ptch_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=True, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, numFc5=512, runNum=0):
prms = sp.get_prms_ptch(geoFence='dc-v2', crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain)
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v2',
concatLayer='fc5', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc, numFc5=numFc5)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000,
clip_gradients=10.0, debug_info=True)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter, runNum=runNum)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
def smallnetv5_fc5_ptch_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=True, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, numFc5=512, runNum=0,
lrAbove=None, geoFence='dc-v2', numTest=1e+4):
prms = sp.get_prms_ptch(geoFence=geoFence, crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain, numTest=numTest)
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v5',
concatLayer='fc5', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc, numFc5=numFc5, lrAbove=lrAbove)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000,
clip_gradients=10.0, debug_info=True)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter, runNum=runNum)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
def smallnetv5_fc5_ptch_euler_mx5_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=True, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, numFc5=512, runNum=0,
lrAbove=None, geoFence='dc-v2', numTest=1e+4):
prms = sp.get_prms_ptch(geoFence=geoFence, crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain, numTest=numTest,
mxPtchRot=5)
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v5',
concatLayer='fc5', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc, numFc5=numFc5, lrAbove=lrAbove)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000,
clip_gradients=10.0, debug_info=True)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter, runNum=runNum)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
def ptch_from_ptch_pose_euler_mx90_smallnetv5_fc5_exp1(isRun=False, deviceId=[1],
numTrain=1e+7, batchsize=256, extraFc=None, isPythonLayer=True,
numFc5=None, numCommonFc=None):
prms = sp.get_prms(geoFence='dc-v2', labels=['pose', 'ptch'],
labelType=['euler', 'wngtv'],
lossType=['l2', 'classify'], labelFrac=[0.5,0.5],
rawImSz=256, crpSz=192, splitDist=100,
numTrain=numTrain, maxEulerRot=90,
nBins=[None, None], binTypes=[None, None])
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v5',
concatLayer='fc5', lossWeight=[0.0, 10.0],
multiLossProto=None, extraFc=extraFc,
isPythonLayer=isPythonLayer, numFc5=numFc5,
numCommonFc=numCommonFc)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=20000, clip_gradients=10.0,
debug_info=True)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
else:
return prms, cPrms
def smallnetv6_pool4_ptch_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=True, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, numConv4=64, runNum=0):
prms = sp.get_prms_ptch(geoFence='dc-v2', crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain)
nPrms = se.get_nw_prms(imSz=101, netName='smallnet-v6',
concatLayer='pool4', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc, numConv4=numConv4)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000,
clip_gradients=10.0, debug_info=True)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter, runNum=runNum)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
def matchnet_ptch_crp192_imSz64_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=True, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None):
prms = sp.get_prms_ptch(geoFence='dc-v2', crpSz=192,
rawImSz=256, splitDist=100,
numTrain=numTrain)
nPrms = se.get_nw_prms(imSz=64, netName='matchnet',
concatLayer='pool5', lossWeight=10.0,
randCrop=False, concatDrop=False,
isGray=isGray, isPythonLayer=isPythonLayer,
extraFc=extraFc)
lPrms = se.get_lr_prms(batchsize=batchsize, stepsize=10000, clip_gradients=10.0)
cPrms = se.get_caffe_prms(nPrms, lPrms, deviceId=deviceId,
resumeIter=resumeIter)
if isRun:
exp = se.make_experiment(prms, cPrms)
exp.run()
return prms, cPrms
| 40.852564 | 93 | 0.696846 | 825 | 6,373 | 5.249697 | 0.133333 | 0.024244 | 0.017779 | 0.021011 | 0.85269 | 0.848765 | 0.848765 | 0.848765 | 0.829139 | 0.829139 | 0 | 0.062548 | 0.182175 | 6,373 | 155 | 94 | 41.116129 | 0.768419 | 0.005178 | 0 | 0.71223 | 0 | 0 | 0.02588 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.05036 | false | 0 | 0.014388 | 0 | 0.115108 | 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 |
f7d68b25a76ba434726ba913214fed04171bf9a1 | 47 | py | Python | helium/feed/models/__init__.py | HeliumEdu/platform | 54b82a40c21fd14d1b7f37d5f2afb51eea2f8cf5 | [
"MIT"
] | 15 | 2018-01-02T00:44:58.000Z | 2022-03-19T21:38:29.000Z | helium/feed/models/__init__.py | HeliumEdu/platform | 54b82a40c21fd14d1b7f37d5f2afb51eea2f8cf5 | [
"MIT"
] | 327 | 2017-11-24T22:36:07.000Z | 2022-02-10T08:09:08.000Z | helium/feed/models/__init__.py | HeliumEdu/platform | 54b82a40c21fd14d1b7f37d5f2afb51eea2f8cf5 | [
"MIT"
] | 3 | 2018-05-04T17:57:58.000Z | 2021-11-18T13:58:46.000Z | from .externalcalendar import ExternalCalendar
| 23.5 | 46 | 0.893617 | 4 | 47 | 10.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085106 | 47 | 1 | 47 | 47 | 0.976744 | 0 | 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 |
f7e9920308e54d3fa65aefc47bd94ff87d5662b4 | 1,596 | py | Python | banner/banner3.py | attackgithub/arissploit | 27208adddaa523e10c4efc6e1ba62f7b4ccc041f | [
"BSD-3-Clause"
] | 1 | 2021-08-13T22:14:29.000Z | 2021-08-13T22:14:29.000Z | banner/banner3.py | attackgithub/arissploit | 27208adddaa523e10c4efc6e1ba62f7b4ccc041f | [
"BSD-3-Clause"
] | null | null | null | banner/banner3.py | attackgithub/arissploit | 27208adddaa523e10c4efc6e1ba62f7b4ccc041f | [
"BSD-3-Clause"
] | null | null | null | # Set color
R = '\033[31m' # Red
N = '\033[1;37m' # White
print ""+N+" #########"
print " ################# #"
print " ###################### #"
print " ######################### #"
print " ############################"
print " ##############################"
print " ###############################"
print " ###############################"
print " ##############################"
print " # ######## #"
print " "+R+" ## ### "+N+" #### ##"
print " ### ###"
print " #### ###"
print " #### ########## ####"
print " ####################### ####"
print " #################### ####"
print " ################## ####"
print " ############ ##"
print " ######## ###"
print " ######### #####"
print " ############ ######"
print " ######## #########"
print " ##### ########"
print " ### #########"
print " ###### ############"
print " #######################"
print " # # ### # # ##"
print " ########################"
print " ## ## ## ##"
| 48.363636 | 64 | 0.112155 | 43 | 1,596 | 4.162791 | 0.255814 | 1.452514 | 2.011173 | 2.458101 | 0.793296 | 0.793296 | 0.793296 | 0.793296 | 0.793296 | 0.793296 | 0 | 0.013836 | 0.50188 | 1,596 | 32 | 65 | 49.875 | 0.211321 | 0.011905 | 0 | 0.451613 | 0 | 0 | 0.813732 | 0.169739 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.935484 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 13 |
f7eeef1378f12cee6cb86a63ac422b7168e6e2b1 | 73 | py | Python | domains/pomdp_hallway2_v0/__init__.py | hai-h-nguyen/belief-grounded-network | 3c4e6df3d72b17f7c045ec6821015c08d2636f15 | [
"MIT"
] | 10 | 2020-11-16T18:11:06.000Z | 2022-03-05T04:37:57.000Z | domains/pomdp_hallway2_v0/__init__.py | hai-h-nguyen/belief-grounded-network | 3c4e6df3d72b17f7c045ec6821015c08d2636f15 | [
"MIT"
] | null | null | null | domains/pomdp_hallway2_v0/__init__.py | hai-h-nguyen/belief-grounded-network | 3c4e6df3d72b17f7c045ec6821015c08d2636f15 | [
"MIT"
] | 1 | 2020-11-13T22:30:57.000Z | 2020-11-13T22:30:57.000Z | from gym.envs.pomdp_hallway2_v0.pomdp_hallway2_v0 import PomdpHallway2V0
| 36.5 | 72 | 0.90411 | 11 | 73 | 5.636364 | 0.727273 | 0.419355 | 0.483871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.054795 | 73 | 1 | 73 | 73 | 0.811594 | 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 |
790fcad30f24a02df67c053c24d7cb4c3fa91244 | 372 | py | Python | terrascript/data/onelogin.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/onelogin.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/onelogin.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/onelogin.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:23:37 UTC)
#
# For imports without namespace, e.g.
#
# >>> import terrascript.data.onelogin
#
# instead of
#
# >>> import terrascript.data.onelogin.onelogin
#
# This is only available for 'official' and 'partner' providers.
from terrascript.data.onelogin.onelogin import *
| 24.8 | 73 | 0.739247 | 49 | 372 | 5.612245 | 0.693878 | 0.218182 | 0.334545 | 0.210909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037383 | 0.137097 | 372 | 14 | 74 | 26.571429 | 0.819315 | 0.798387 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
791efd8e52a90b2111821c5ca689da08fb3548d4 | 147 | py | Python | test/integration/__init__.py | fajfer/aiohttp-client-cache | bf4bc563c5b5ac5869db576ac478852d4d55ab59 | [
"BSD-2-Clause",
"MIT"
] | 38 | 2020-11-14T04:23:32.000Z | 2022-03-25T09:10:40.000Z | test/integration/__init__.py | fajfer/aiohttp-client-cache | bf4bc563c5b5ac5869db576ac478852d4d55ab59 | [
"BSD-2-Clause",
"MIT"
] | 83 | 2020-11-20T21:42:37.000Z | 2022-03-29T11:19:06.000Z | test/integration/__init__.py | fajfer/aiohttp-client-cache | bf4bc563c5b5ac5869db576ac478852d4d55ab59 | [
"BSD-2-Clause",
"MIT"
] | 9 | 2020-11-20T21:44:06.000Z | 2022-03-18T11:21:15.000Z | # flake8: noqa: F401
from test.integration.base_backend_test import BaseBackendTest
from test.integration.base_storage_test import BaseStorageTest
| 36.75 | 62 | 0.870748 | 19 | 147 | 6.526316 | 0.631579 | 0.129032 | 0.306452 | 0.370968 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02963 | 0.081633 | 147 | 3 | 63 | 49 | 0.888889 | 0.122449 | 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 |
f712a8705ad2ed75e3a830467d81bc75ea91dc2b | 28,860 | py | Python | sdk/python/pulumi_azure/dashboard/dashboard.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 109 | 2018-06-18T00:19:44.000Z | 2022-02-20T05:32:57.000Z | sdk/python/pulumi_azure/dashboard/dashboard.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 663 | 2018-06-18T21:08:46.000Z | 2022-03-31T20:10:11.000Z | sdk/python/pulumi_azure/dashboard/dashboard.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-07-19T22:37:38.000Z | 2022-03-14T10:56:26.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
__all__ = ['DashboardArgs', 'Dashboard']
@pulumi.input_type
class DashboardArgs:
def __init__(__self__, *,
resource_group_name: pulumi.Input[str],
dashboard_properties: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
"""
The set of arguments for constructing a Dashboard resource.
:param pulumi.Input[str] resource_group_name: The name of the resource group in which to
create the dashboard.
:param pulumi.Input[str] dashboard_properties: JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
:param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
"""
pulumi.set(__self__, "resource_group_name", resource_group_name)
if dashboard_properties is not None:
pulumi.set(__self__, "dashboard_properties", dashboard_properties)
if location is not None:
pulumi.set(__self__, "location", location)
if name is not None:
pulumi.set(__self__, "name", name)
if tags is not None:
pulumi.set(__self__, "tags", tags)
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> pulumi.Input[str]:
"""
The name of the resource group in which to
create the dashboard.
"""
return pulumi.get(self, "resource_group_name")
@resource_group_name.setter
def resource_group_name(self, value: pulumi.Input[str]):
pulumi.set(self, "resource_group_name", value)
@property
@pulumi.getter(name="dashboardProperties")
def dashboard_properties(self) -> Optional[pulumi.Input[str]]:
"""
JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
"""
return pulumi.get(self, "dashboard_properties")
@dashboard_properties.setter
def dashboard_properties(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "dashboard_properties", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
A mapping of tags to assign to the resource.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@pulumi.input_type
class _DashboardState:
def __init__(__self__, *,
dashboard_properties: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
"""
Input properties used for looking up and filtering Dashboard resources.
:param pulumi.Input[str] dashboard_properties: JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
:param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
:param pulumi.Input[str] resource_group_name: The name of the resource group in which to
create the dashboard.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
"""
if dashboard_properties is not None:
pulumi.set(__self__, "dashboard_properties", dashboard_properties)
if location is not None:
pulumi.set(__self__, "location", location)
if name is not None:
pulumi.set(__self__, "name", name)
if resource_group_name is not None:
pulumi.set(__self__, "resource_group_name", resource_group_name)
if tags is not None:
pulumi.set(__self__, "tags", tags)
@property
@pulumi.getter(name="dashboardProperties")
def dashboard_properties(self) -> Optional[pulumi.Input[str]]:
"""
JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
"""
return pulumi.get(self, "dashboard_properties")
@dashboard_properties.setter
def dashboard_properties(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "dashboard_properties", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the resource group in which to
create the dashboard.
"""
return pulumi.get(self, "resource_group_name")
@resource_group_name.setter
def resource_group_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_group_name", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
A mapping of tags to assign to the resource.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
class Dashboard(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
dashboard_properties: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
__props__=None):
"""
Manages a shared dashboard in the Azure Portal.
## Example Usage
```python
import pulumi
import pulumi_azure as azure
config = pulumi.Config()
md_content = config.get("mdContent")
if md_content is None:
md_content = "# Hello all :)"
video_link = config.get("videoLink")
if video_link is None:
video_link = "https://www.youtube.com/watch?v=......"
current = azure.core.get_subscription()
my_group = azure.core.ResourceGroup("my-group", location="West Europe")
my_board = azure.dashboard.Dashboard("my-board",
resource_group_name=my_group.name,
location=my_group.location,
tags={
"source": "managed",
},
dashboard_properties=f\"\"\"{{
"lenses": {{
"0": {{
"order": 0,
"parts": {{
"0": {{
"position": {{
"x": 0,
"y": 0,
"rowSpan": 2,
"colSpan": 3
}},
"metadata": {{
"inputs": [],
"type": "Extension/HubsExtension/PartType/MarkdownPart",
"settings": {{
"content": {{
"settings": {{
"content": "{md_content}",
"subtitle": "",
"title": ""
}}
}}
}}
}}
}},
"1": {{
"position": {{
"x": 5,
"y": 0,
"rowSpan": 4,
"colSpan": 6
}},
"metadata": {{
"inputs": [],
"type": "Extension/HubsExtension/PartType/VideoPart",
"settings": {{
"content": {{
"settings": {{
"title": "Important Information",
"subtitle": "",
"src": "{video_link}",
"autoplay": true
}}
}}
}}
}}
}},
"2": {{
"position": {{
"x": 0,
"y": 4,
"rowSpan": 4,
"colSpan": 6
}},
"metadata": {{
"inputs": [
{{
"name": "ComponentId",
"value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp"
}}
],
"type": "Extension/AppInsightsExtension/PartType/AppMapGalPt",
"settings": {{}},
"asset": {{
"idInputName": "ComponentId",
"type": "ApplicationInsights"
}}
}}
}}
}}
}}
}},
"metadata": {{
"model": {{
"timeRange": {{
"value": {{
"relative": {{
"duration": 24,
"timeUnit": 1
}}
}},
"type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"
}},
"filterLocale": {{
"value": "en-us"
}},
"filters": {{
"value": {{
"MsPortalFx_TimeRange": {{
"model": {{
"format": "utc",
"granularity": "auto",
"relative": "24h"
}},
"displayCache": {{
"name": "UTC Time",
"value": "Past 24 hours"
}},
"filteredPartIds": [
"StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7"
]
}}
}}
}}
}}
}}
}}
\"\"\")
```
It is recommended to follow the steps outlined
[here](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example.
## Import
Dashboards can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:dashboard/dashboard:Dashboard my-board /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Portal/dashboards/00000000-0000-0000-0000-000000000000
```
Note the URI in the above sample can be found using the Resource Explorer tool in the Azure Portal.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] dashboard_properties: JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
:param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
:param pulumi.Input[str] resource_group_name: The name of the resource group in which to
create the dashboard.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: DashboardArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Manages a shared dashboard in the Azure Portal.
## Example Usage
```python
import pulumi
import pulumi_azure as azure
config = pulumi.Config()
md_content = config.get("mdContent")
if md_content is None:
md_content = "# Hello all :)"
video_link = config.get("videoLink")
if video_link is None:
video_link = "https://www.youtube.com/watch?v=......"
current = azure.core.get_subscription()
my_group = azure.core.ResourceGroup("my-group", location="West Europe")
my_board = azure.dashboard.Dashboard("my-board",
resource_group_name=my_group.name,
location=my_group.location,
tags={
"source": "managed",
},
dashboard_properties=f\"\"\"{{
"lenses": {{
"0": {{
"order": 0,
"parts": {{
"0": {{
"position": {{
"x": 0,
"y": 0,
"rowSpan": 2,
"colSpan": 3
}},
"metadata": {{
"inputs": [],
"type": "Extension/HubsExtension/PartType/MarkdownPart",
"settings": {{
"content": {{
"settings": {{
"content": "{md_content}",
"subtitle": "",
"title": ""
}}
}}
}}
}}
}},
"1": {{
"position": {{
"x": 5,
"y": 0,
"rowSpan": 4,
"colSpan": 6
}},
"metadata": {{
"inputs": [],
"type": "Extension/HubsExtension/PartType/VideoPart",
"settings": {{
"content": {{
"settings": {{
"title": "Important Information",
"subtitle": "",
"src": "{video_link}",
"autoplay": true
}}
}}
}}
}}
}},
"2": {{
"position": {{
"x": 0,
"y": 4,
"rowSpan": 4,
"colSpan": 6
}},
"metadata": {{
"inputs": [
{{
"name": "ComponentId",
"value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp"
}}
],
"type": "Extension/AppInsightsExtension/PartType/AppMapGalPt",
"settings": {{}},
"asset": {{
"idInputName": "ComponentId",
"type": "ApplicationInsights"
}}
}}
}}
}}
}}
}},
"metadata": {{
"model": {{
"timeRange": {{
"value": {{
"relative": {{
"duration": 24,
"timeUnit": 1
}}
}},
"type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"
}},
"filterLocale": {{
"value": "en-us"
}},
"filters": {{
"value": {{
"MsPortalFx_TimeRange": {{
"model": {{
"format": "utc",
"granularity": "auto",
"relative": "24h"
}},
"displayCache": {{
"name": "UTC Time",
"value": "Past 24 hours"
}},
"filteredPartIds": [
"StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7"
]
}}
}}
}}
}}
}}
}}
\"\"\")
```
It is recommended to follow the steps outlined
[here](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example.
## Import
Dashboards can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:dashboard/dashboard:Dashboard my-board /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Portal/dashboards/00000000-0000-0000-0000-000000000000
```
Note the URI in the above sample can be found using the Resource Explorer tool in the Azure Portal.
:param str resource_name: The name of the resource.
:param DashboardArgs 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(DashboardArgs, 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,
dashboard_properties: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, 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__ = DashboardArgs.__new__(DashboardArgs)
__props__.__dict__["dashboard_properties"] = dashboard_properties
__props__.__dict__["location"] = location
__props__.__dict__["name"] = name
if resource_group_name is None and not opts.urn:
raise TypeError("Missing required property 'resource_group_name'")
__props__.__dict__["resource_group_name"] = resource_group_name
__props__.__dict__["tags"] = tags
super(Dashboard, __self__).__init__(
'azure:dashboard/dashboard:Dashboard',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
dashboard_properties: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None) -> 'Dashboard':
"""
Get an existing Dashboard 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] dashboard_properties: JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
:param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
:param pulumi.Input[str] resource_group_name: The name of the resource group in which to
create the dashboard.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _DashboardState.__new__(_DashboardState)
__props__.__dict__["dashboard_properties"] = dashboard_properties
__props__.__dict__["location"] = location
__props__.__dict__["name"] = name
__props__.__dict__["resource_group_name"] = resource_group_name
__props__.__dict__["tags"] = tags
return Dashboard(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="dashboardProperties")
def dashboard_properties(self) -> pulumi.Output[str]:
"""
JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
"""
return pulumi.get(self, "dashboard_properties")
@property
@pulumi.getter
def location(self) -> pulumi.Output[str]:
"""
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> pulumi.Output[str]:
"""
The name of the resource group in which to
create the dashboard.
"""
return pulumi.get(self, "resource_group_name")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
A mapping of tags to assign to the resource.
"""
return pulumi.get(self, "tags")
| 45.520505 | 389 | 0.500624 | 2,644 | 28,860 | 5.313918 | 0.114599 | 0.064199 | 0.066762 | 0.051673 | 0.883488 | 0.870676 | 0.861495 | 0.852527 | 0.848897 | 0.843986 | 0 | 0.013266 | 0.401871 | 28,860 | 633 | 390 | 45.592417 | 0.80066 | 0.562613 | 0 | 0.738916 | 1 | 0 | 0.090307 | 0.005793 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157635 | false | 0.004926 | 0.024631 | 0 | 0.275862 | 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 |
f716f342dfdde7c09452213431f486564cd316b0 | 20,293 | py | Python | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 2,583 | 2016-07-27T08:25:47.000Z | 2022-03-31T10:42:17.000Z | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 2,122 | 2016-07-31T14:20:04.000Z | 2022-03-31T20:44:14.000Z | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 451 | 2016-08-12T05:52:58.000Z | 2022-03-31T01:33:07.000Z | import bpy, math, os, gpu, bgl
import numpy as np
from . import utility
from fractions import Fraction
from gpu_extras.batch import batch_for_shader
def encodeLogLuvGPU(image, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
offscreen = gpu.types.GPUOffScreen(input_image.size[0], input_image.size[1])
image = input_image
vertex_shader = '''
uniform mat4 ModelViewProjectionMatrix;
in vec2 texCoord;
in vec2 pos;
out vec2 texCoord_interp;
void main()
{
//gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
//gl_Position.z = 1.0;
gl_Position = vec4(pos.xy, 100, 100);
texCoord_interp = texCoord;
}
'''
fragment_shader = '''
in vec2 texCoord_interp;
out vec4 fragColor;
uniform sampler2D image;
const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
vec4 LinearToLogLuv( in vec4 value ) {
vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;
Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );
vec4 vResult;
vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
vResult.w = fract( Le );
vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;
return vResult;
//return vec4(Xp_Y_XYZp,1);
}
const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
vec4 LogLuvToLinear( in vec4 value ) {
float Le = value.z * 255.0 + value.w;
vec3 Xp_Y_XYZp;
Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );
Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;
//return vec4( max( vRGB, 0.0 ), 1.0 );
return vec4( max( Xp_Y_XYZp, 0.0 ), 1.0 );
}
void main()
{
//fragColor = LinearToLogLuv(pow(texture(image, texCoord_interp), vec4(0.454)));
fragColor = LinearToLogLuv(texture(image, texCoord_interp));
//fragColor = LogLuvToLinear(LinearToLogLuv(texture(image, texCoord_interp)));
}
'''
x_screen = 0
off_x = -100
off_y = -100
y_screen_flip = 0
sx = 200
sy = 200
vertices = (
(x_screen + off_x, y_screen_flip - off_y),
(x_screen + off_x, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - off_x))
if input_image.colorspace_settings.name != 'Linear':
input_image.colorspace_settings.name = 'Linear'
# Removing .exr or .hdr prefix
if image_name[-4:] == '.exr' or image_name[-4:] == '.hdr':
image_name = image_name[:-4]
target_image = bpy.data.images.get(image_name + '_encoded')
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(image_name + '_encoded')
if not target_image:
target_image = bpy.data.images.new(
name = image_name + '_encoded',
width = input_image.size[0],
height = input_image.size[1],
alpha = True,
float_buffer = False
)
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"pos": vertices,
"texCoord": ((0, 1), (0, 0), (1, 0), (1, 1)),
},
)
if image.gl_load():
raise Exception()
with offscreen.bind():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
shader.bind()
shader.uniform_int("image", 0)
batch.draw(shader)
buffer = bgl.Buffer(bgl.GL_BYTE, input_image.size[0] * input_image.size[1] * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, input_image.size[0], input_image.size[1], bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
offscreen.free()
target_image.pixels = [v / 255 for v in buffer]
input_image = target_image
#Save LogLuv
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(input_image.name)
input_image.filepath_raw = outDir + "/" + input_image.name + ".png"
#input_image.filepath_raw = outDir + "_encoded.png"
input_image.file_format = "PNG"
bpy.context.scene.render.image_settings.quality = quality
#input_image.save_render(filepath = input_image.filepath_raw, scene = bpy.context.scene)
input_image.save()
#Todo - Find a way to save
#bpy.ops.image.save_all_modified()
def encodeImageRGBDGPU(image, maxRange, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
offscreen = gpu.types.GPUOffScreen(input_image.size[0], input_image.size[1])
image = input_image
vertex_shader = '''
uniform mat4 ModelViewProjectionMatrix;
in vec2 texCoord;
in vec2 pos;
out vec2 texCoord_interp;
void main()
{
//gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
//gl_Position.z = 1.0;
gl_Position = vec4(pos.xy, 100, 100);
texCoord_interp = texCoord;
}
'''
fragment_shader = '''
in vec2 texCoord_interp;
out vec4 fragColor;
uniform sampler2D image;
//Code from here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/helperFunctions.fx
const float PI = 3.1415926535897932384626433832795;
const float HALF_MIN = 5.96046448e-08; // Smallest positive half.
const float LinearEncodePowerApprox = 2.2;
const float GammaEncodePowerApprox = 1.0 / LinearEncodePowerApprox;
const vec3 LuminanceEncodeApprox = vec3(0.2126, 0.7152, 0.0722);
const float Epsilon = 0.0000001;
#define saturate(x) clamp(x, 0.0, 1.0)
float maxEps(float x) {
return max(x, Epsilon);
}
float toLinearSpace(float color)
{
return pow(color, LinearEncodePowerApprox);
}
vec3 toLinearSpace(vec3 color)
{
return pow(color, vec3(LinearEncodePowerApprox));
}
vec4 toLinearSpace(vec4 color)
{
return vec4(pow(color.rgb, vec3(LinearEncodePowerApprox)), color.a);
}
vec3 toGammaSpace(vec3 color)
{
return pow(color, vec3(GammaEncodePowerApprox));
}
vec4 toGammaSpace(vec4 color)
{
return vec4(pow(color.rgb, vec3(GammaEncodePowerApprox)), color.a);
}
float toGammaSpace(float color)
{
return pow(color, GammaEncodePowerApprox);
}
float square(float value)
{
return value * value;
}
// Check if configurable value is needed.
const float rgbdMaxRange = 255.0;
vec4 toRGBD(vec3 color) {
float maxRGB = maxEps(max(color.r, max(color.g, color.b)));
float D = max(rgbdMaxRange / maxRGB, 1.);
D = clamp(floor(D) / 255.0, 0., 1.);
vec3 rgb = color.rgb * D;
// Helps with png quantization.
rgb = toGammaSpace(rgb);
return vec4(rgb, D);
}
vec3 fromRGBD(vec4 rgbd) {
// Helps with png quantization.
rgbd.rgb = toLinearSpace(rgbd.rgb);
// return rgbd.rgb * ((rgbdMaxRange / 255.0) / rgbd.a);
return rgbd.rgb / rgbd.a;
}
void main()
{
fragColor = toRGBD(texture(image, texCoord_interp).rgb);
}
'''
x_screen = 0
off_x = -100
off_y = -100
y_screen_flip = 0
sx = 200
sy = 200
vertices = (
(x_screen + off_x, y_screen_flip - off_y),
(x_screen + off_x, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - off_x))
if input_image.colorspace_settings.name != 'Linear':
input_image.colorspace_settings.name = 'Linear'
# Removing .exr or .hdr prefix
if image_name[-4:] == '.exr' or image_name[-4:] == '.hdr':
image_name = image_name[:-4]
target_image = bpy.data.images.get(image_name + '_encoded')
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(image_name + '_encoded')
if not target_image:
target_image = bpy.data.images.new(
name = image_name + '_encoded',
width = input_image.size[0],
height = input_image.size[1],
alpha = True,
float_buffer = False
)
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"pos": vertices,
"texCoord": ((0, 1), (0, 0), (1, 0), (1, 1)),
},
)
if image.gl_load():
raise Exception()
with offscreen.bind():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
shader.bind()
shader.uniform_int("image", 0)
batch.draw(shader)
buffer = bgl.Buffer(bgl.GL_BYTE, input_image.size[0] * input_image.size[1] * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, input_image.size[0], input_image.size[1], bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
offscreen.free()
target_image.pixels = [v / 255 for v in buffer]
input_image = target_image
#Save LogLuv
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(input_image.name)
input_image.filepath_raw = outDir + "/" + input_image.name + ".png"
#input_image.filepath_raw = outDir + "_encoded.png"
input_image.file_format = "PNG"
bpy.context.scene.render.image_settings.quality = quality
#input_image.save_render(filepath = input_image.filepath_raw, scene = bpy.context.scene)
input_image.save()
#Todo - Find a way to save
#bpy.ops.image.save_all_modified()
#TODO - FINISH THIS
def encodeImageRGBMGPU(image, maxRange, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
offscreen = gpu.types.GPUOffScreen(input_image.size[0], input_image.size[1])
image = input_image
vertex_shader = '''
uniform mat4 ModelViewProjectionMatrix;
in vec2 texCoord;
in vec2 pos;
out vec2 texCoord_interp;
void main()
{
//gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
//gl_Position.z = 1.0;
gl_Position = vec4(pos.xy, 100, 100);
texCoord_interp = texCoord;
}
'''
fragment_shader = '''
in vec2 texCoord_interp;
out vec4 fragColor;
uniform sampler2D image;
//Code from here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/helperFunctions.fx
const float PI = 3.1415926535897932384626433832795;
const float HALF_MIN = 5.96046448e-08; // Smallest positive half.
const float LinearEncodePowerApprox = 2.2;
const float GammaEncodePowerApprox = 1.0 / LinearEncodePowerApprox;
const vec3 LuminanceEncodeApprox = vec3(0.2126, 0.7152, 0.0722);
const float Epsilon = 0.0000001;
#define saturate(x) clamp(x, 0.0, 1.0)
float maxEps(float x) {
return max(x, Epsilon);
}
float toLinearSpace(float color)
{
return pow(color, LinearEncodePowerApprox);
}
vec3 toLinearSpace(vec3 color)
{
return pow(color, vec3(LinearEncodePowerApprox));
}
vec4 toLinearSpace(vec4 color)
{
return vec4(pow(color.rgb, vec3(LinearEncodePowerApprox)), color.a);
}
vec3 toGammaSpace(vec3 color)
{
return pow(color, vec3(GammaEncodePowerApprox));
}
vec4 toGammaSpace(vec4 color)
{
return vec4(pow(color.rgb, vec3(GammaEncodePowerApprox)), color.a);
}
float toGammaSpace(float color)
{
return pow(color, GammaEncodePowerApprox);
}
float square(float value)
{
return value * value;
}
// Check if configurable value is needed.
const float rgbdMaxRange = 255.0;
vec4 toRGBM(vec3 color) {
vec4 rgbm;
color *= 1.0/6.0;
rgbm.a = saturate( max( max( color.r, color.g ), max( color.b, 1e-6 ) ) );
rgbm.a = clamp(floor(D) / 255.0, 0., 1.);
rgbm.rgb = color / rgbm.a;
return
float maxRGB = maxEps(max(color.r, max(color.g, color.b)));
float D = max(rgbdMaxRange / maxRGB, 1.);
D = clamp(floor(D) / 255.0, 0., 1.);
vec3 rgb = color.rgb * D;
// Helps with png quantization.
rgb = toGammaSpace(rgb);
return vec4(rgb, D);
}
vec3 fromRGBD(vec4 rgbd) {
// Helps with png quantization.
rgbd.rgb = toLinearSpace(rgbd.rgb);
// return rgbd.rgb * ((rgbdMaxRange / 255.0) / rgbd.a);
return rgbd.rgb / rgbd.a;
}
void main()
{
fragColor = toRGBM(texture(image, texCoord_interp).rgb);
}
'''
x_screen = 0
off_x = -100
off_y = -100
y_screen_flip = 0
sx = 200
sy = 200
vertices = (
(x_screen + off_x, y_screen_flip - off_y),
(x_screen + off_x, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - sy - off_y),
(x_screen + off_x + sx, y_screen_flip - off_x))
if input_image.colorspace_settings.name != 'Linear':
input_image.colorspace_settings.name = 'Linear'
# Removing .exr or .hdr prefix
if image_name[-4:] == '.exr' or image_name[-4:] == '.hdr':
image_name = image_name[:-4]
target_image = bpy.data.images.get(image_name + '_encoded')
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(image_name + '_encoded')
if not target_image:
target_image = bpy.data.images.new(
name = image_name + '_encoded',
width = input_image.size[0],
height = input_image.size[1],
alpha = True,
float_buffer = False
)
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"pos": vertices,
"texCoord": ((0, 1), (0, 0), (1, 0), (1, 1)),
},
)
if image.gl_load():
raise Exception()
with offscreen.bind():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
shader.bind()
shader.uniform_int("image", 0)
batch.draw(shader)
buffer = bgl.Buffer(bgl.GL_BYTE, input_image.size[0] * input_image.size[1] * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, input_image.size[0], input_image.size[1], bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
offscreen.free()
target_image.pixels = [v / 255 for v in buffer]
input_image = target_image
#Save LogLuv
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(input_image.name)
input_image.filepath_raw = outDir + "/" + input_image.name + ".png"
#input_image.filepath_raw = outDir + "_encoded.png"
input_image.file_format = "PNG"
bpy.context.scene.render.image_settings.quality = quality
#input_image.save_render(filepath = input_image.filepath_raw, scene = bpy.context.scene)
input_image.save()
#Todo - Find a way to save
#bpy.ops.image.save_all_modified()
def encodeImageRGBMCPU(image, maxRange, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
if input_image.colorspace_settings.name != 'Linear':
input_image.colorspace_settings.name = 'Linear'
# Removing .exr or .hdr prefix
if image_name[-4:] == '.exr' or image_name[-4:] == '.hdr':
image_name = image_name[:-4]
target_image = bpy.data.images.get(image_name + '_encoded')
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(image_name + '_encoded')
if not target_image:
target_image = bpy.data.images.new(
name = image_name + '_encoded',
width = input_image.size[0],
height = input_image.size[1],
alpha = True,
float_buffer = False
)
num_pixels = len(input_image.pixels)
result_pixel = list(input_image.pixels)
for i in range(0,num_pixels,4):
for j in range(3):
result_pixel[i+j] *= 1.0 / maxRange;
result_pixel[i+3] = saturate(max(result_pixel[i], result_pixel[i+1], result_pixel[i+2], 1e-6))
result_pixel[i+3] = math.ceil(result_pixel[i+3] * 255.0) / 255.0
for j in range(3):
result_pixel[i+j] /= result_pixel[i+3]
target_image.pixels = result_pixel
input_image = target_image
#Save RGBM
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(input_image.name)
input_image.filepath_raw = outDir + "/" + input_image.name + ".png"
input_image.file_format = "PNG"
bpy.context.scene.render.image_settings.quality = quality
input_image.save()
#input_image.save_render(filepath = input_image.filepath_raw, scene = bpy.context.scene)
# input_image.filepath_raw = outDir + "_encoded.png"
# input_image.file_format = "PNG"
# bpy.context.scene.render.image_settings.quality = quality
# input_image.save_render(filepath = input_image.filepath_raw, scene = bpy.context.scene)
#input_image.
#input_image.save()
def saturate(num, floats=True):
if num <= 0:
num = 0
elif num > (1 if floats else 255):
num = (1 if floats else 255)
return num
def maxEps(x):
return max(x, 1e-6)
def encodeImageRGBDCPU(image, maxRange, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
if input_image.colorspace_settings.name != 'Linear':
input_image.colorspace_settings.name = 'Linear'
# Removing .exr or .hdr prefix
if image_name[-4:] == '.exr' or image_name[-4:] == '.hdr':
image_name = image_name[:-4]
target_image = bpy.data.images.get(image_name + '_encoded')
if not target_image:
target_image = bpy.data.images.new(
name = image_name + '_encoded',
width = input_image.size[0],
height = input_image.size[1],
alpha = True,
float_buffer = False
)
num_pixels = len(input_image.pixels)
result_pixel = list(input_image.pixels)
rgbdMaxRange = 255.0
for i in range(0,num_pixels,4):
maxRGB = maxEps(max(result_pixel[i], result_pixel[i+1], result_pixel[i+2]))
D = max(rgbdMaxRange/maxRGB, 1.0)
D = np.clip((math.floor(D) / 255.0), 0.0, 1.0)
result_pixel[i] = math.pow(result_pixel[i] * D, 1/2.2)
result_pixel[i+1] = math.pow(result_pixel[i+1] * D, 1/2.2)
result_pixel[i+2] = math.pow(result_pixel[i+2] * D, 1/2.2)
result_pixel[i+3] = D
target_image.pixels = result_pixel
input_image = target_image
#Save RGBD
if bpy.context.scene.TLM_SceneProperties.tlm_verbose:
print(input_image.name)
input_image.filepath_raw = outDir + "/" + input_image.name + ".png"
input_image.file_format = "PNG"
bpy.context.scene.render.image_settings.quality = quality
input_image.save() | 31.51087 | 123 | 0.588824 | 2,525 | 20,293 | 4.548119 | 0.101386 | 0.088819 | 0.034134 | 0.023511 | 0.888802 | 0.873824 | 0.870516 | 0.864855 | 0.861024 | 0.85667 | 0 | 0.045897 | 0.295668 | 20,293 | 644 | 124 | 31.51087 | 0.757574 | 0.056374 | 0 | 0.731343 | 0 | 0.01919 | 0.42565 | 0.051415 | 0 | 0 | 0 | 0.001553 | 0 | 1 | 0.014925 | false | 0 | 0.010661 | 0.002132 | 0.078891 | 0.01919 | 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 |
f7541991f36ff68d8bba5c6f7185e51e3901f4b4 | 65,080 | py | Python | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_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 TemplatePermissionSetApi(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 template_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.template_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.template_permission_sets_change_stream_get_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_change_stream_get_with_http_info(**kwargs)
return data
def template_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.template_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 template_permission_sets_change_stream_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets/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 template_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.template_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.template_permission_sets_change_stream_post_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_change_stream_post_with_http_info(**kwargs)
return data
def template_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.template_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 template_permission_sets_change_stream_post" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets/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 template_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.template_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.template_permission_sets_count_get_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_count_get_with_http_info(**kwargs)
return data
def template_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.template_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 template_permission_sets_count_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets/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 template_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.template_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: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_find_one_get_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_find_one_get_with_http_info(**kwargs)
return data
def template_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.template_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: TemplatePermissionSet
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 template_permission_sets_find_one_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets/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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_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[TemplatePermissionSet]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_get_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_get_with_http_info(**kwargs)
return data
def template_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.template_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[TemplatePermissionSet]
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 template_permission_sets_get" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets'.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[TemplatePermissionSet]',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_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.template_permission_sets_id_delete_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_delete_with_http_info(id, **kwargs)
return data
def template_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.template_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 template_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 `template_permission_sets_id_delete`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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 template_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.template_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.template_permission_sets_id_exists_get_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_exists_get_with_http_info(id, **kwargs)
return data
def template_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.template_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 template_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 `template_permission_sets_id_exists_get`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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 template_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.template_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: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_id_get_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_get_with_http_info(id, **kwargs)
return data
def template_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.template_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: TemplatePermissionSet
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 template_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 `template_permission_sets_id_get`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_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.template_permission_sets_id_head_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_head_with_http_info(id, **kwargs)
return data
def template_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.template_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 template_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 `template_permission_sets_id_head`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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 template_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.template_permission_sets_id_patch(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TemplatePermissionSet id (required)
:param TemplatePermissionSet data: An object of model property name/value pairs
:return: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_id_patch_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_patch_with_http_info(id, **kwargs)
return data
def template_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.template_permission_sets_id_patch_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TemplatePermissionSet id (required)
:param TemplatePermissionSet data: An object of model property name/value pairs
:return: TemplatePermissionSet
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 template_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 `template_permission_sets_id_patch`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_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 TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_id_put_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_put_with_http_info(id, **kwargs)
return data
def template_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.template_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 TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
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 template_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 `template_permission_sets_id_put`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_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 TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_id_replace_post_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_replace_post_with_http_info(id, **kwargs)
return data
def template_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.template_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 TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
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 template_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 `template_permission_sets_id_replace_post`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_permission_sets_id_template_get(self, id, **kwargs):
"""
Fetches belongsTo relation template.
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.template_permission_sets_id_template_get(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TemplatePermissionSet id (required)
:param bool refresh:
:return: Template
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_id_template_get_with_http_info(id, **kwargs)
else:
(data) = self.template_permission_sets_id_template_get_with_http_info(id, **kwargs)
return data
def template_permission_sets_id_template_get_with_http_info(self, id, **kwargs):
"""
Fetches belongsTo relation template.
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.template_permission_sets_id_template_get_with_http_info(id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str id: TemplatePermissionSet id (required)
:param bool refresh:
:return: Template
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 template_permission_sets_id_template_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 `template_permission_sets_id_template_get`")
collection_formats = {}
resource_path = '/TemplatePermissionSets/{id}/template'.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='Template',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
def template_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.template_permission_sets_post(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.template_permission_sets_post_with_http_info(**kwargs)
else:
(data) = self.template_permission_sets_post_with_http_info(**kwargs)
return data
def template_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.template_permission_sets_post_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param TemplatePermissionSet data: Model instance data
:return: TemplatePermissionSet
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 template_permission_sets_post" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
resource_path = '/TemplatePermissionSets'.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='TemplatePermissionSet',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
collection_formats=collection_formats)
| 41.531589 | 165 | 0.573141 | 6,572 | 65,080 | 5.443092 | 0.039257 | 0.062619 | 0.065191 | 0.042939 | 0.964497 | 0.961814 | 0.959521 | 0.949374 | 0.945488 | 0.943475 | 0 | 0.001102 | 0.344576 | 65,080 | 1,566 | 166 | 41.55811 | 0.837534 | 0.32437 | 0 | 0.821429 | 0 | 0 | 0.179308 | 0.07665 | 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 |
e3982f405ee1355cb5f739d943b79038b7afab5c | 12,073 | py | Python | omd/versions/1.2.8p15.cre/lib/python/netsnmp_python-1.0a1-py2.7-linux-x86_64.egg/netsnmp/tests/test.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | 58 | 2015-03-21T20:48:05.000Z | 2022-02-16T08:04:22.000Z | omd/versions/1.2.8p15.cre/lib/python/netsnmp_python-1.0a1-py2.7-linux-x86_64.egg/netsnmp/tests/test.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | 15 | 2015-11-13T19:12:12.000Z | 2017-03-13T11:12:40.000Z | omd/versions/1.2.8p15.cre/lib/python/netsnmp_python-1.0a1-py2.7-linux-x86_64.egg/netsnmp/tests/test.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | 79 | 2015-01-08T01:54:44.000Z | 2021-12-12T23:37:06.000Z | """ Runs all unit tests for the netsnmp package. """
# Copyright (c) 2006 Andy Gross. See LICENSE.txt for details.
import sys
import unittest
import netsnmp
import time
class BasicTests(unittest.TestCase):
def testFuncs(self):
print ""
var = netsnmp.Varbind('sysDescr.0')
var = netsnmp.Varbind('sysDescr','0')
var = netsnmp.Varbind(
'.iso.org.dod.internet.mgmt.mib-2.system.sysDescr','0')
var = netsnmp.Varbind(
'.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0')
var = netsnmp.Varbind('.1.3.6.1.2.1.1.1.0')
var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0')
print "---v1 GET tests -------------------------------------\n"
res = netsnmp.snmpget(var,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpget result: ", res, "\n"
print "v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 GETNEXT tests-------------------------------------\n"
res = netsnmp.snmpgetnext(var,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpgetnext result: ", res, "\n"
print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 SET tests-------------------------------------\n"
var = netsnmp.Varbind('sysLocation','0', 'my new location')
res = netsnmp.snmpset(var,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpset result: ", res, "\n"
print "v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 walk tests-------------------------------------\n"
vars = netsnmp.VarList(netsnmp.Varbind('system'))
print "v1 varlist walk in: "
for var in vars:
print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
res = netsnmp.snmpwalk(vars,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpwalk result: ", res, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 walk 2-------------------------------------\n"
print "v1 varbind walk in: "
var = netsnmp.Varbind('system')
res = netsnmp.snmpwalk(var,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpwalk result (should be = orig): ", res, "\n"
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 multi-varbind test-------------------------------------\n"
sess = netsnmp.Session(Version=1,
DestHost='localhost',
Community='public')
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
netsnmp.Varbind('sysContact', 0),
netsnmp.Varbind('sysLocation', 0))
vals = sess.get(vars)
print "v1 sess.get result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
vals = sess.getnext(vars)
print "v1 sess.getnext result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
netsnmp.Varbind('sysORLastChange'),
netsnmp.Varbind('sysORID'),
netsnmp.Varbind('sysORDescr'),
netsnmp.Varbind('sysORUpTime'))
vals = sess.getbulk(2, 8, vars)
print "v1 sess.getbulk result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v1 set2-------------------------------------\n"
vars = netsnmp.VarList(
netsnmp.Varbind('sysLocation', '0', 'my newer location'))
res = sess.set(vars)
print "v1 sess.set result: ", res, "\n"
print "---v1 walk3-------------------------------------\n"
vars = netsnmp.VarList(netsnmp.Varbind('system'))
vals = sess.walk(vars)
print "v1 sess.walk result: ", vals, "\n"
for var in vars:
print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v2c get-------------------------------------\n"
sess = netsnmp.Session(Version=2,
DestHost='localhost',
Community='public')
sess.UseEnums = 1
sess.UseLongNames = 1
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
netsnmp.Varbind('sysContact', 0),
netsnmp.Varbind('sysLocation', 0))
vals = sess.get(vars)
print "v2 sess.get result: ", vals, "\n"
print "---v2c getnext-------------------------------------\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
vals = sess.getnext(vars)
print "v2 sess.getnext result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
print "---v2c getbulk-------------------------------------\n"
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
netsnmp.Varbind('sysORLastChange'),
netsnmp.Varbind('sysORID'),
netsnmp.Varbind('sysORDescr'),
netsnmp.Varbind('sysORUpTime'))
vals = sess.getbulk(2, 8, vars)
print "v2 sess.getbulk result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
print "---v2c set-------------------------------------\n"
vars = netsnmp.VarList(
netsnmp.Varbind('sysLocation','0','my even newer location'))
res = sess.set(vars)
print "v2 sess.set result: ", res, "\n"
print "---v2c walk-------------------------------------\n"
vars = netsnmp.VarList(netsnmp.Varbind('system'))
vals = sess.walk(vars)
print "v2 sess.walk result: ", vals, "\n"
for var in vars:
print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
print "---v3 setup-------------------------------------\n"
sess = netsnmp.Session(Version=3,
DestHost='localhost',
SecLevel='authPriv',
SecName='initial',
PrivPass='priv_pass',
AuthPass='auth_pass')
sess.UseSprintValue = 1
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0),
netsnmp.Varbind('sysContact', 0),
netsnmp.Varbind('sysLocation', 0))
print "---v3 get-------------------------------------\n"
vals = sess.get(vars)
print "v3 sess.get result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
print "---v3 getnext-------------------------------------\n"
vals = sess.getnext(vars)
print "v3 sess.getnext result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'),
netsnmp.Varbind('sysORLastChange'),
netsnmp.Varbind('sysORID'),
netsnmp.Varbind('sysORDescr'),
netsnmp.Varbind('sysORUpTime'))
vals = sess.getbulk(2, 8, vars)
print "v3 sess.getbulk result: ", vals, "\n"
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
print "---v3 set-------------------------------------\n"
vars = netsnmp.VarList(
netsnmp.Varbind('sysLocation','0', 'my final destination'))
res = sess.set(vars)
print "v3 sess.set result: ", res, "\n"
print "---v3 walk-------------------------------------\n"
vars = netsnmp.VarList(netsnmp.Varbind('system'))
vals = sess.walk(vars)
print "v3 sess.walk result: ", vals, "\n"
for var in vars:
print " ",var.tag, var.iid, "=", var.val, '(',var.type,')'
class SetTests(unittest.TestCase):
def testFuncs(self):
print "\n-------------- SET Test Start ----------------------------\n"
var = netsnmp.Varbind('sysUpTime','0')
res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
Community='public')
print "uptime = ", res[0]
var = netsnmp.Varbind('versionRestartAgent','0', 1)
res = netsnmp.snmpset(var, Version = 1, DestHost='localhost',
Community='public')
var = netsnmp.Varbind('sysUpTime','0')
res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
Community='public')
print "uptime = ", res[0]
var = netsnmp.Varbind('nsCacheEntry')
res = netsnmp.snmpgetnext(var, Version = 1, DestHost='localhost',
Community='public')
print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')'
var.val = 65
res = netsnmp.snmpset(var, Version = 1, DestHost='localhost',
Community='public')
res = netsnmp.snmpget(var, Version = 1, DestHost='localhost',
Community='public')
print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')'
sess = netsnmp.Session(Version = 1, DestHost='localhost',
Community='public')
vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.2.116.101.115.116','','.1.3.6.1.6.1.1'),
netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.3.116.101.115.116','','1234'),
netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4))
res = sess.set(vars)
print "res = ", res
vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'),
netsnmp.Varbind('snmpTargetAddrTAddress'),
netsnmp.Varbind('snmpTargetAddrRowStatus'))
res = sess.getnext(vars)
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 6))
res = sess.set(vars)
print "res = ", res
vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'),
netsnmp.Varbind('snmpTargetAddrTAddress'),
netsnmp.Varbind('snmpTargetAddrRowStatus'))
res = sess.getnext(vars)
for var in vars:
print var.tag, var.iid, "=", var.val, '(',var.type,')'
print "\n"
print "\n-------------- SET Test End ----------------------------\n"
if __name__=='__main__':
unittest.main()
| 37.493789 | 110 | 0.441978 | 1,190 | 12,073 | 4.47563 | 0.108403 | 0.139317 | 0.037176 | 0.049568 | 0.851483 | 0.810176 | 0.77469 | 0.755351 | 0.747278 | 0.735824 | 0 | 0.02928 | 0.355007 | 12,073 | 321 | 111 | 37.610592 | 0.654681 | 0.00497 | 0 | 0.613043 | 0 | 0.017391 | 0.24471 | 0.102283 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.008696 | 0.017391 | null | null | 0.33913 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
e3ebd304549aeaf724b208d5e11b3f5bb393376b | 6,090 | py | Python | tests/test_diamond_add_taxonomy.py | pvanheus/diamond_add_taxonomy | 5a552670261394c98e9f72c08ee42c78b72ccdac | [
"MIT"
] | 2 | 2019-01-15T17:06:29.000Z | 2019-01-16T18:55:59.000Z | tests/test_diamond_add_taxonomy.py | pvanheus/diamond_add_taxonomy | 5a552670261394c98e9f72c08ee42c78b72ccdac | [
"MIT"
] | null | null | null | tests/test_diamond_add_taxonomy.py | pvanheus/diamond_add_taxonomy | 5a552670261394c98e9f72c08ee42c78b72ccdac | [
"MIT"
] | null | null | null | import os
from tempfile import NamedTemporaryFile
from pathlib import Path
from click.testing import CliRunner
import pytest
from diamond_add_taxonomy import __version__
import diamond_add_taxonomy.cli
test_data = """BOT1cds1 PKP60081.1 29.0 138 96 2 7 143 8 144 2.5e-07 65.5 209 217 63.1 PKP60081.1 hypothetical protein CVT88_04030 [Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1] 2013673
BOT1cds1 PJI86295.1 36.6 71 39 3 22 90 175 241 8.7e+00 40.4 295 217 31.8 PJI86295.1 4-diphosphocytidyl-2-C-methyl-D-erythritol kinase [Yoonia maricola] 420999
BOT1cds1 WP_100368596.1 36.6 71 39 3 22 90 165 231 8.7e+00 40.4 285 217 31.8 WP_100368596.1 4-(cytidine 5'-diphospho)-2-C-methyl-D-erythritol kinase [Yoonia maricola] 420999
BOT1cds2 WP_106860599.1 30.7 274 188 1 1 274 1 272 6.2e-35 157.5 273 275 99.6 WP_106860599.1 hypothetical protein [Candidatus Sulfopaludibacter sp. SbA4] 2043165
BOT1cds2 SPE37964.1 36.3 190 120 1 86 275 1 189 4.4e-25 124.8 192 275 69.1 SPE37964.1 hypothetical protein SBA6_80035 [Candidatus Sulfopaludibacter sp. SbA6] 2043166
BOT1cds2 WP_105313039.1 36.2 177 112 1 99 275 1 176 2.7e-22 115.5 179 275 64.4 WP_105313039.1 hypothetical protein [Candidatus Sulfopaludibacter sp. SbA6] 2043166
BOT1cds2 WP_048155622.1 28.2 280 187 7 3 275 6 278 4.6e-22 114.8 279 275 99.3 WP_048155622.1 MULTISPECIES: hypothetical protein [Methanosarcina] 2207;1434108;1860098
BOT1cds2 PKP60082.1 28.0 264 172 8 24 275 4 261 3.1e-18 102.1 266 275 91.6 PKP60082.1 hypothetical protein CVT88_04035 [Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1] 2013673
BOT1cds2 POZ52851.1 25.6 270 178 8 1 258 10 268 4.9e-08 68.2 295 275 93.8 POZ52851.1 hypothetical protein AADEFJLK_01460 [Methylovulum psychrotolerans] 1704499
BOT1cds2 WP_103973803.1 25.6 270 178 8 1 258 1 259 4.9e-08 68.2 286 275 93.8 WP_103973803.1 hypothetical protein [Methylovulum psychrotolerans] 1704499
"""
test_expected_result = """BOT1cds1 PKP60081.1 29.0 138 96 2 7 143 8 144 2.5e-07 65.5 209 217 63.1 PKP60081.1 hypothetical protein CVT88_04030 [Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1] 2013673 Archaea Euryarchaeota UNKNOWN Candidatus Altiarchaeales UNKNOWN UNKNOWN Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1
BOT1cds1 PJI86295.1 36.6 71 39 3 22 90 175 241 8.7e+00 40.4 295 217 31.8 PJI86295.1 4-diphosphocytidyl-2-C-methyl-D-erythritol kinase [Yoonia maricola] 420999 Bacteria Proteobacteria Alphaproteobacteria Rhodobacterales Rhodobacteraceae Yoonia Yoonia maricola
BOT1cds1 WP_100368596.1 36.6 71 39 3 22 90 165 231 8.7e+00 40.4 285 217 31.8 WP_100368596.1 4-(cytidine 5'-diphospho)-2-C-methyl-D-erythritol kinase [Yoonia maricola] 420999 Bacteria Proteobacteria Alphaproteobacteria Rhodobacterales Rhodobacteraceae Yoonia Yoonia maricola
BOT1cds2 WP_106860599.1 30.7 274 188 1 1 274 1 272 6.2e-35 157.5 273 275 99.6 WP_106860599.1 hypothetical protein [Candidatus Sulfopaludibacter sp. SbA4] 2043165 Bacteria Acidobacteria Solibacteres Solibacterales Solibacteraceae Candidatus Sulfopaludibacter Candidatus Sulfopaludibacter sp. SbA4
BOT1cds2 SPE37964.1 36.3 190 120 1 86 275 1 189 4.4e-25 124.8 192 275 69.1 SPE37964.1 hypothetical protein SBA6_80035 [Candidatus Sulfopaludibacter sp. SbA6] 2043166 Bacteria Acidobacteria Solibacteres Solibacterales Solibacteraceae Candidatus Sulfopaludibacter Candidatus Sulfopaludibacter sp. SbA6
BOT1cds2 WP_105313039.1 36.2 177 112 1 99 275 1 176 2.7e-22 115.5 179 275 64.4 WP_105313039.1 hypothetical protein [Candidatus Sulfopaludibacter sp. SbA6] 2043166 Bacteria Acidobacteria Solibacteres Solibacterales Solibacteraceae Candidatus Sulfopaludibacter Candidatus Sulfopaludibacter sp. SbA6
BOT1cds2 WP_048155622.1 28.2 280 187 7 3 275 6 278 4.6e-22 114.8 279 275 99.3 WP_048155622.1 MULTISPECIES: hypothetical protein [Methanosarcina] 2207;1434108;1860098 UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE UNKNOWN/MULTIPLE
BOT1cds2 PKP60082.1 28.0 264 172 8 24 275 4 261 3.1e-18 102.1 266 275 91.6 PKP60082.1 hypothetical protein CVT88_04035 [Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1] 2013673 Archaea Euryarchaeota UNKNOWN Candidatus Altiarchaeales UNKNOWN UNKNOWN Candidatus Altiarchaeales archaeon HGW-Altiarchaeales-1
BOT1cds2 POZ52851.1 25.6 270 178 8 1 258 10 268 4.9e-08 68.2 295 275 93.8 POZ52851.1 hypothetical protein AADEFJLK_01460 [Methylovulum psychrotolerans] 1704499 Bacteria Proteobacteria Gammaproteobacteria Methylococcales Methylococcaceae Methylovulum Methylovulum psychrotolerans
BOT1cds2 WP_103973803.1 25.6 270 178 8 1 258 1 259 4.9e-08 68.2 286 275 93.8 WP_103973803.1 hypothetical protein [Methylovulum psychrotolerans] 1704499 Bacteria Proteobacteria Gammaproteobacteria Methylococcales Methylococcaceae Methylovulum Methylovulum psychrotolerans
"""
def test_version():
assert __version__ == "0.1.0"
def test_annotate_diamond():
taxdb_path = Path(os.environ.get('NCBI_TAX_DB', ''))
if not(taxdb_path.exists() and taxdb_path.is_file()):
pytest.skip("set NCBI_TAX_DB to the filename of a file containing the sqlite3 version of the NCBI taxonomy database")
else:
input_file = NamedTemporaryFile(mode='w+', delete=False)
input_file.write(test_data)
input_file.close()
input_filename = input_file.name
output_file = NamedTemporaryFile(mode='w+', delete=False)
output_temp_filename = output_file.name
diamond_output_format = "6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore slen qlen qcovhsp stitle staxids"
runner = CliRunner()
runner.invoke(diamond_add_taxonomy.cli.annotate_diamond,
['--diamond_output_format', diamond_output_format,
'--output_file', output_temp_filename,
'--taxdb_filename', taxdb_path.as_posix(),
input_filename])
os.unlink(input_filename)
result = open(output_temp_filename).read()
os.unlink(output_temp_filename)
assert result == test_expected_result
| 96.666667 | 335 | 0.79179 | 950 | 6,090 | 4.984211 | 0.247368 | 0.064203 | 0.059134 | 0.044351 | 0.804013 | 0.804013 | 0.787962 | 0.787962 | 0.787962 | 0.787962 | 0 | 0.248846 | 0.146141 | 6,090 | 62 | 336 | 98.225806 | 0.661731 | 0 | 0 | 0.037736 | 0 | 0.377358 | 0.795731 | 0.043514 | 0 | 0 | 0 | 0 | 0.037736 | 1 | 0.037736 | false | 0 | 0.132075 | 0 | 0.169811 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 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 | 9 |
5417615349d74a787dba1712864c78f2025f5483 | 23,350 | py | Python | sdk/python/pulumi_sakuracloud/gslb.py | sacloud/pulumi-sakuracloud | 3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2019-12-07T07:46:05.000Z | 2020-12-19T02:41:42.000Z | sdk/python/pulumi_sakuracloud/gslb.py | sacloud/pulumi-sakuracloud | 3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-09-11T04:41:06.000Z | 2021-10-19T07:50:34.000Z | sdk/python/pulumi_sakuracloud/gslb.py | sacloud/pulumi-sakuracloud | 3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-09-08T05:38:16.000Z | 2021-06-24T01:32:47.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__ = ['GSLBArgs', 'GSLB']
@pulumi.input_type
class GSLBArgs:
def __init__(__self__, *,
health_check: pulumi.Input['GSLBHealthCheckArgs'],
description: Optional[pulumi.Input[str]] = None,
icon_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
servers: Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]] = None,
sorry_server: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
weighted: Optional[pulumi.Input[bool]] = None):
"""
The set of arguments for constructing a GSLB resource.
:param pulumi.Input['GSLBHealthCheckArgs'] health_check: A `health_check` block as defined below.
:param pulumi.Input[str] description: The description of the GSLB. The length of this value must be in the range [`1`-`512`].
:param pulumi.Input[str] icon_id: The icon id to attach to the GSLB.
:param pulumi.Input[str] name: The name of the GSLB. The length of this value must be in the range [`1`-`64`].
:param pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]] servers: One or more `server` blocks as defined below.
:param pulumi.Input[str] sorry_server: The IP address of the SorryServer. This will be used when all servers are down.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Any tags to assign to the GSLB.
:param pulumi.Input[bool] weighted: The flag to enable weighted load-balancing.
"""
pulumi.set(__self__, "health_check", health_check)
if description is not None:
pulumi.set(__self__, "description", description)
if icon_id is not None:
pulumi.set(__self__, "icon_id", icon_id)
if name is not None:
pulumi.set(__self__, "name", name)
if servers is not None:
pulumi.set(__self__, "servers", servers)
if sorry_server is not None:
pulumi.set(__self__, "sorry_server", sorry_server)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if weighted is not None:
pulumi.set(__self__, "weighted", weighted)
@property
@pulumi.getter(name="healthCheck")
def health_check(self) -> pulumi.Input['GSLBHealthCheckArgs']:
"""
A `health_check` block as defined below.
"""
return pulumi.get(self, "health_check")
@health_check.setter
def health_check(self, value: pulumi.Input['GSLBHealthCheckArgs']):
pulumi.set(self, "health_check", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The description of the GSLB. The length of this value must be in the range [`1`-`512`].
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter(name="iconId")
def icon_id(self) -> Optional[pulumi.Input[str]]:
"""
The icon id to attach to the GSLB.
"""
return pulumi.get(self, "icon_id")
@icon_id.setter
def icon_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "icon_id", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the GSLB. The length of this value must be in the range [`1`-`64`].
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]]:
"""
One or more `server` blocks as defined below.
"""
return pulumi.get(self, "servers")
@servers.setter
def servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]]):
pulumi.set(self, "servers", value)
@property
@pulumi.getter(name="sorryServer")
def sorry_server(self) -> Optional[pulumi.Input[str]]:
"""
The IP address of the SorryServer. This will be used when all servers are down.
"""
return pulumi.get(self, "sorry_server")
@sorry_server.setter
def sorry_server(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sorry_server", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Any tags to assign to the GSLB.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter
def weighted(self) -> Optional[pulumi.Input[bool]]:
"""
The flag to enable weighted load-balancing.
"""
return pulumi.get(self, "weighted")
@weighted.setter
def weighted(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "weighted", value)
@pulumi.input_type
class _GSLBState:
def __init__(__self__, *,
description: Optional[pulumi.Input[str]] = None,
fqdn: Optional[pulumi.Input[str]] = None,
health_check: Optional[pulumi.Input['GSLBHealthCheckArgs']] = None,
icon_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
servers: Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]] = None,
sorry_server: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
weighted: Optional[pulumi.Input[bool]] = None):
"""
Input properties used for looking up and filtering GSLB resources.
:param pulumi.Input[str] description: The description of the GSLB. The length of this value must be in the range [`1`-`512`].
:param pulumi.Input[str] fqdn: The FQDN for accessing to the GSLB. This is typically used as value of CNAME record.
:param pulumi.Input['GSLBHealthCheckArgs'] health_check: A `health_check` block as defined below.
:param pulumi.Input[str] icon_id: The icon id to attach to the GSLB.
:param pulumi.Input[str] name: The name of the GSLB. The length of this value must be in the range [`1`-`64`].
:param pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]] servers: One or more `server` blocks as defined below.
:param pulumi.Input[str] sorry_server: The IP address of the SorryServer. This will be used when all servers are down.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Any tags to assign to the GSLB.
:param pulumi.Input[bool] weighted: The flag to enable weighted load-balancing.
"""
if description is not None:
pulumi.set(__self__, "description", description)
if fqdn is not None:
pulumi.set(__self__, "fqdn", fqdn)
if health_check is not None:
pulumi.set(__self__, "health_check", health_check)
if icon_id is not None:
pulumi.set(__self__, "icon_id", icon_id)
if name is not None:
pulumi.set(__self__, "name", name)
if servers is not None:
pulumi.set(__self__, "servers", servers)
if sorry_server is not None:
pulumi.set(__self__, "sorry_server", sorry_server)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if weighted is not None:
pulumi.set(__self__, "weighted", weighted)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The description of the GSLB. The length of this value must be in the range [`1`-`512`].
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter
def fqdn(self) -> Optional[pulumi.Input[str]]:
"""
The FQDN for accessing to the GSLB. This is typically used as value of CNAME record.
"""
return pulumi.get(self, "fqdn")
@fqdn.setter
def fqdn(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "fqdn", value)
@property
@pulumi.getter(name="healthCheck")
def health_check(self) -> Optional[pulumi.Input['GSLBHealthCheckArgs']]:
"""
A `health_check` block as defined below.
"""
return pulumi.get(self, "health_check")
@health_check.setter
def health_check(self, value: Optional[pulumi.Input['GSLBHealthCheckArgs']]):
pulumi.set(self, "health_check", value)
@property
@pulumi.getter(name="iconId")
def icon_id(self) -> Optional[pulumi.Input[str]]:
"""
The icon id to attach to the GSLB.
"""
return pulumi.get(self, "icon_id")
@icon_id.setter
def icon_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "icon_id", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the GSLB. The length of this value must be in the range [`1`-`64`].
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]]:
"""
One or more `server` blocks as defined below.
"""
return pulumi.get(self, "servers")
@servers.setter
def servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GSLBServerArgs']]]]):
pulumi.set(self, "servers", value)
@property
@pulumi.getter(name="sorryServer")
def sorry_server(self) -> Optional[pulumi.Input[str]]:
"""
The IP address of the SorryServer. This will be used when all servers are down.
"""
return pulumi.get(self, "sorry_server")
@sorry_server.setter
def sorry_server(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sorry_server", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Any tags to assign to the GSLB.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter
def weighted(self) -> Optional[pulumi.Input[bool]]:
"""
The flag to enable weighted load-balancing.
"""
return pulumi.get(self, "weighted")
@weighted.setter
def weighted(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "weighted", value)
class GSLB(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
description: Optional[pulumi.Input[str]] = None,
health_check: Optional[pulumi.Input[pulumi.InputType['GSLBHealthCheckArgs']]] = None,
icon_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
servers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GSLBServerArgs']]]]] = None,
sorry_server: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
weighted: Optional[pulumi.Input[bool]] = None,
__props__=None):
"""
Manages a SakuraCloud GSLB.
## Example Usage
```python
import pulumi
import pulumi_sakuracloud as sakuracloud
foobar = sakuracloud.GSLB("foobar",
description="description",
health_check=sakuracloud.GSLBHealthCheckArgs(
delay_loop=10,
host_header="example.com",
path="/",
protocol="http",
status="200",
),
servers=[
sakuracloud.GSLBServerArgs(
enabled=True,
ip_address="192.2.0.11",
weight=1,
),
sakuracloud.GSLBServerArgs(
enabled=True,
ip_address="192.2.0.12",
weight=1,
),
],
sorry_server="192.2.0.1",
tags=[
"tag1",
"tag2",
])
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] description: The description of the GSLB. The length of this value must be in the range [`1`-`512`].
:param pulumi.Input[pulumi.InputType['GSLBHealthCheckArgs']] health_check: A `health_check` block as defined below.
:param pulumi.Input[str] icon_id: The icon id to attach to the GSLB.
:param pulumi.Input[str] name: The name of the GSLB. The length of this value must be in the range [`1`-`64`].
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GSLBServerArgs']]]] servers: One or more `server` blocks as defined below.
:param pulumi.Input[str] sorry_server: The IP address of the SorryServer. This will be used when all servers are down.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Any tags to assign to the GSLB.
:param pulumi.Input[bool] weighted: The flag to enable weighted load-balancing.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: GSLBArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Manages a SakuraCloud GSLB.
## Example Usage
```python
import pulumi
import pulumi_sakuracloud as sakuracloud
foobar = sakuracloud.GSLB("foobar",
description="description",
health_check=sakuracloud.GSLBHealthCheckArgs(
delay_loop=10,
host_header="example.com",
path="/",
protocol="http",
status="200",
),
servers=[
sakuracloud.GSLBServerArgs(
enabled=True,
ip_address="192.2.0.11",
weight=1,
),
sakuracloud.GSLBServerArgs(
enabled=True,
ip_address="192.2.0.12",
weight=1,
),
],
sorry_server="192.2.0.1",
tags=[
"tag1",
"tag2",
])
```
:param str resource_name: The name of the resource.
:param GSLBArgs 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(GSLBArgs, 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,
description: Optional[pulumi.Input[str]] = None,
health_check: Optional[pulumi.Input[pulumi.InputType['GSLBHealthCheckArgs']]] = None,
icon_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
servers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GSLBServerArgs']]]]] = None,
sorry_server: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
weighted: Optional[pulumi.Input[bool]] = 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__ = GSLBArgs.__new__(GSLBArgs)
__props__.__dict__["description"] = description
if health_check is None and not opts.urn:
raise TypeError("Missing required property 'health_check'")
__props__.__dict__["health_check"] = health_check
__props__.__dict__["icon_id"] = icon_id
__props__.__dict__["name"] = name
__props__.__dict__["servers"] = servers
__props__.__dict__["sorry_server"] = sorry_server
__props__.__dict__["tags"] = tags
__props__.__dict__["weighted"] = weighted
__props__.__dict__["fqdn"] = None
super(GSLB, __self__).__init__(
'sakuracloud:index/gSLB:GSLB',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
description: Optional[pulumi.Input[str]] = None,
fqdn: Optional[pulumi.Input[str]] = None,
health_check: Optional[pulumi.Input[pulumi.InputType['GSLBHealthCheckArgs']]] = None,
icon_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
servers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GSLBServerArgs']]]]] = None,
sorry_server: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
weighted: Optional[pulumi.Input[bool]] = None) -> 'GSLB':
"""
Get an existing GSLB 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] description: The description of the GSLB. The length of this value must be in the range [`1`-`512`].
:param pulumi.Input[str] fqdn: The FQDN for accessing to the GSLB. This is typically used as value of CNAME record.
:param pulumi.Input[pulumi.InputType['GSLBHealthCheckArgs']] health_check: A `health_check` block as defined below.
:param pulumi.Input[str] icon_id: The icon id to attach to the GSLB.
:param pulumi.Input[str] name: The name of the GSLB. The length of this value must be in the range [`1`-`64`].
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GSLBServerArgs']]]] servers: One or more `server` blocks as defined below.
:param pulumi.Input[str] sorry_server: The IP address of the SorryServer. This will be used when all servers are down.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Any tags to assign to the GSLB.
:param pulumi.Input[bool] weighted: The flag to enable weighted load-balancing.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _GSLBState.__new__(_GSLBState)
__props__.__dict__["description"] = description
__props__.__dict__["fqdn"] = fqdn
__props__.__dict__["health_check"] = health_check
__props__.__dict__["icon_id"] = icon_id
__props__.__dict__["name"] = name
__props__.__dict__["servers"] = servers
__props__.__dict__["sorry_server"] = sorry_server
__props__.__dict__["tags"] = tags
__props__.__dict__["weighted"] = weighted
return GSLB(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
"""
The description of the GSLB. The length of this value must be in the range [`1`-`512`].
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def fqdn(self) -> pulumi.Output[str]:
"""
The FQDN for accessing to the GSLB. This is typically used as value of CNAME record.
"""
return pulumi.get(self, "fqdn")
@property
@pulumi.getter(name="healthCheck")
def health_check(self) -> pulumi.Output['outputs.GSLBHealthCheck']:
"""
A `health_check` block as defined below.
"""
return pulumi.get(self, "health_check")
@property
@pulumi.getter(name="iconId")
def icon_id(self) -> pulumi.Output[Optional[str]]:
"""
The icon id to attach to the GSLB.
"""
return pulumi.get(self, "icon_id")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
The name of the GSLB. The length of this value must be in the range [`1`-`64`].
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def servers(self) -> pulumi.Output[Optional[Sequence['outputs.GSLBServer']]]:
"""
One or more `server` blocks as defined below.
"""
return pulumi.get(self, "servers")
@property
@pulumi.getter(name="sorryServer")
def sorry_server(self) -> pulumi.Output[Optional[str]]:
"""
The IP address of the SorryServer. This will be used when all servers are down.
"""
return pulumi.get(self, "sorry_server")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
Any tags to assign to the GSLB.
"""
return pulumi.get(self, "tags")
@property
@pulumi.getter
def weighted(self) -> pulumi.Output[Optional[bool]]:
"""
The flag to enable weighted load-balancing.
"""
return pulumi.get(self, "weighted")
| 40.538194 | 142 | 0.608308 | 2,731 | 23,350 | 5.027829 | 0.072867 | 0.112155 | 0.101012 | 0.064089 | 0.868691 | 0.851795 | 0.826014 | 0.820261 | 0.811449 | 0.797393 | 0 | 0.006391 | 0.276317 | 23,350 | 575 | 143 | 40.608696 | 0.80619 | 0.318758 | 0 | 0.779935 | 1 | 0 | 0.088571 | 0.003484 | 0 | 0 | 0 | 0 | 0 | 1 | 0.161812 | false | 0.003236 | 0.022654 | 0 | 0.281553 | 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 |
58203938998b60b584f25c2b60ba2cdb3159219b | 16,269 | py | Python | MHD/FEniCS/MHD/Stabilised/Precond/MHDstabPrecond.py | wathen/PhD | 35524f40028541a4d611d8c78574e4cf9ddc3278 | [
"MIT"
] | 3 | 2020-10-25T13:30:20.000Z | 2021-08-10T21:27:30.000Z | MHD/FEniCS/MHD/Stabilised/Precond/MHDstabPrecond.py | wathen/PhD | 35524f40028541a4d611d8c78574e4cf9ddc3278 | [
"MIT"
] | null | null | null | MHD/FEniCS/MHD/Stabilised/Precond/MHDstabPrecond.py | wathen/PhD | 35524f40028541a4d611d8c78574e4cf9ddc3278 | [
"MIT"
] | 3 | 2019-10-28T16:12:13.000Z | 2020-01-13T13:59:44.000Z | import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import numpy as np
from dolfin import tic, toc
import HiptmairSetup
import scipy.sparse as sp
class BaseMyPC(object):
def setup(self, pc):
pass
def reset(self, pc):
pass
def apply(self, pc, x, y):
raise NotImplementedError
def applyT(self, pc, x, y):
self.apply(pc, x, y)
def applyS(self, pc, x, y):
self.apply(pc, x, y)
def applySL(self, pc, x, y):
self.applyS(pc, x, y)
def applySR(self, pc, x, y):
self.applyS(pc, x, y)
def applyRich(self, pc, x, y, w, tols):
self.apply(pc, x, y)
class InnerOuter(BaseMyPC):
def __init__(self, W, kspF, kspA, kspQ,Fp,kspScalar, kspCGScalar, kspVector, G, P, A, Hiptmairtol,Bt):
self.W = W
self.kspF = kspF
self.kspA = kspA
self.kspQ = kspQ
self.Fp = Fp
self.kspScalar = kspScalar
self.kspCGScalar = kspCGScalar
self.kspVector = kspVector
self.Bt = Bt
self.HiptmairIts = 0
self.CGits = 0
self.P = P
self.G = G
self.A = A
self.tol = Hiptmairtol
self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim()))
self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim()+self.W[2].dim(),self.W[0].dim()+self.W[1].dim()+self.W[2].dim()+self.W[3].dim()))
def create(self, pc):
print "Create"
# def setUp(self, pc):
# A, P, flag = pc.getOperators()
# print A.size
# self.Bt = A.getSubMatrix(self.u_is,self.p_is)
# print "setup"
def apply(self, pc, x, y):
x1 = x.getSubVector(self.u_is)
y1 = x1.duplicate()
y11 = x1.duplicate()
x2 = x.getSubVector(self.p_is)
y2 = x2.duplicate()
y3 = x2.duplicate()
y4 = x2.duplicate()
self.kspA.solve(x2,y2)
self.Fp.mult(y2,y3)
self.kspQ.solve(y3,y4)
self.Bt.mult(y4,y11)
self.kspF.solve(x1-y11,y1)
x1 = x.getSubVector(self.b_is)
yy1 = x1.duplicate()
x2 = x.getSubVector(self.r_is)
yy2 = x2.duplicate()
# tic()
yy1, its, self.HiptmairTime = HiptmairSetup.HiptmairApply(self.A, x1, self.kspScalar, self.kspVector, self.G, self.P, self.tol)
# print "Hiptmair time: ", toc()
self.HiptmairIts += its
tic()
self.kspCGScalar.solve(x2, yy2)
self.CGtime = toc()
y.array = (np.concatenate([y1.array, y4.array,yy1.array,yy2.array]))
def ITS(self):
return self.CGits, self.HiptmairIts , self.CGtime, self.HiptmairTime
class Test(BaseMyPC):
def __init__(self, W, kspF, kspA, kspQ,Fp,kspScalar, kspCGScalar, kspVector, G, P, A, Hiptmairtol,Bt,C):
self.W = W
self.kspF = kspF
self.kspA = kspA
self.kspQ = kspQ
self.Fp = Fp
self.kspScalar = kspScalar
self.kspCGScalar = kspCGScalar
self.kspVector = kspVector
self.Bt = Bt
self.HiptmairIts = 0
self.CGits = 0
self.P = P
self.G = G
self.A = A
self.tol = Hiptmairtol
self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim()))
self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim()+self.W[2].dim(),self.W[0].dim()+self.W[1].dim()+self.W[2].dim()+self.W[3].dim()))
def create(self, pc):
print "Create"
# def setUp(self, pc):
# A, P, flag = pc.getOperators()
# print A.size
# self.Bt = A.getSubMatrix(self.u_is,self.p_is)
# print "setup"
def apply(self, pc, x, y):
x1 = x.getSubVector(self.b_is)
yy1 = x1.duplicate()
x2 = x.getSubVector(self.r_is)
yy2 = x2.duplicate()
# tic()
yy1, its, self.HiptmairTime = HiptmairSetup.HiptmairApply(self.A, x1, self.kspScalar, self.kspVector, self.G, self.P, self.tol)
# print "Hiptmair time: ", toc()
self.HiptmairIts += its
tic()
self.kspCGScalar.solve(x2, yy2)
self.CGtime = toc()
x1 = x.getSubVector(self.u_is)
y1 = x1.duplicate()
y11 = x1.duplicate()
y111 = x2.duplicate()
x2 = x.getSubVector(self.p_is)
y2 = x2.duplicate()
y3 = x2.duplicate()
y4 = x2.duplicate()
self.kspA.solve(x2,y2)
self.Fp.mult(y2,y3)
self.kspQ.solve(y3,y4)
self.Bt.mult(y4,y11)
self.C.mult(yy1,y111)
self.kspF.solve(x1-y11-y111,y1)
y.array = (np.concatenate([y1.array, y4.array,yy1.array,yy2.array]))
def ITS(self):
return self.CGits, self.HiptmairIts , self.CGtime, self.HiptmairTime
class InnerOuterWITHOUT(BaseMyPC):
def __init__(self, W, kspF, kspA, kspQ,Fp,kspScalar, kspCGScalar, kspVector, G, P, A, Hiptmairtol,PP):
self.W = W
self.kspF = kspF
self.kspA = kspA
self.kspQ = kspQ
self.Fp = Fp
self.kspScalar = kspScalar
self.kspCGScalar = kspCGScalar
self.kspVector = kspVector
# self.Bt = Bt
self.HiptmairIts = 0
self.CGits = 0
self.PP = PP
# print range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim())
# ss
self.P = P
self.G = G
self.AA = A
self.tol = Hiptmairtol
#self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
#self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim()))
#self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),
# self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
#self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim()+self.W[2].dim(),
# self.W[0].dim()+self.W[1].dim()+self.W[2].dim()+self.W[3].dim()))
self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim(),
self.W[0].dim()+self.W[1].dim()))
self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),
self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()
+self.W[1].dim()+self.W[2].dim(),self.W[0].dim()+self.W[1].dim()
+self.W[2].dim()+self.W[3].dim()))
def create(self, pc):
print "Create"
def setUp(self, pc):
P,A, flag = pc.getOperators()
print A.size
print A
A = self.PP
self.Ct = A.getSubMatrix(self.u_is,self.b_is)
self.C = A.getSubMatrix(self.b_is,self.u_is)
self.D = A.getSubMatrix(self.r_is,self.b_is)
self.Bt = A.getSubMatrix(self.u_is,self.p_is)
self.B = A.getSubMatrix(self.p_is,self.u_is)
self.Dt = A.getSubMatrix(self.b_is,self.r_is)
# print self.Ct.view()
kspF = PETSc.KSP()
kspF.create(comm=PETSc.COMM_WORLD)
pcF = kspF.getPC()
kspF.setType('preonly')
pcF.setType('lu')
OptDB = PETSc.Options()
OptDB["pc_factor_mat_ordering_type"] = "rcm"
OptDB["pc_factor_mat_solver_package"] = "mumps"
# asas
# print B.shape
# ss
kspF.setFromOptions()
kspF.setOperators(A.getSubMatrix(self.u_is,self.u_is),A.getSubMatrix(self.u_is,self.u_is))
FC = sp.csr_matrix((self.W[0].dim(),self.W[1].dim()))
row = np.array([])
column = np.array([])
data = np.array([])
for i in range(0,self.W[1].dim()):
x = A.getSubMatrix(self.u_is,self.u_is).getVecRight()
rhs = self.Ct.getColumnVector(i)
kspF.solve(rhs,x)
xx = self.AA.getVecRight()
self.C.mult(x,xx)
xx = xx.array
if xx.nonzero()[0].shape != 0:
row = np.concatenate((row,xx.nonzero()[0]))
data = np.concatenate((data,xx[xx.nonzero()[0]]))
column = np.concatenate((column,i*np.ones(xx.nonzero()[0].shape)))
CFC = sp.csr_matrix( (data,(row,column)), shape=(self.W[2].dim(),self.W[2].dim()) )
print CFC.shape
CFC = PETSc.Mat().createAIJ(size=CFC.shape,csr=(CFC.indptr, CFC.indices, CFC.data))
print CFC.size, self.AA.size
MX = self.AA - CFC
# B = IO.matToSparse(MX).tocsr()
# MO.StoreMatrix(B,"A")
# print FC.todense()
self.kspF.setType('preonly')
self.kspF.getPC().setType('lu')
self.kspF.setFromOptions()
self.kspF.setPCSide(0)
self.kspA.setType('preonly')
self.kspA.getPC().setType('lu')
self.kspA.setFromOptions()
self.kspA.setPCSide(0)
self.kspQ.setType('preonly')
self.kspQ.getPC().setType('lu')
self.kspQ.setFromOptions()
self.kspQ.setPCSide(0)
self.kspScalar.setType('preonly')
self.kspScalar.getPC().setType('lu')
self.kspScalar.setFromOptions()
self.kspScalar.setPCSide(0)
kspMX = PETSc.KSP()
kspMX.create(comm=PETSc.COMM_WORLD)
pcMX = kspMX.getPC()
kspMX.setType('preonly')
pcMX.setType('lu')
OptDB = PETSc.Options()
kspMX.setOperators(MX,MX)
self.kspMX = kspMX
# self.kspCGScalar.setType('preonly')
# self.kspCGScalar.getPC().setType('lu')
# self.kspCGScalar.setFromOptions()
# self.kspCGScalar.setPCSide(0)
self.kspVector.setType('preonly')
self.kspVector.getPC().setType('lu')
self.kspVector.setFromOptions()
self.kspVector.setPCSide(0)
print "setup"
def apply(self, pc, x, y):
br = x.getSubVector(self.r_is)
xr = br.duplicate()
self.kspScalar.solve(br, xr)
# print self.D.size
x2 = x.getSubVector(self.p_is)
y2 = x2.duplicate()
y3 = x2.duplicate()
xp = x2.duplicate()
self.kspA.solve(x2,y2)
self.Fp.mult(y2,y3)
self.kspQ.solve(y3,xp)
# self.kspF.solve(bu1-bu4-bu2,xu)
bu1 = x.getSubVector(self.u_is)
bu1 = bu1 - self.Bt*xp
xx = bu1.duplicate()
self.kspF.solve(bu1,xx)
bb = x.getSubVector(self.b_is)
bb = bb - self.Dt*xr
xb = bb.duplicate()
#self.kspMX.solve(bb,xb)
self.kspMX.solve(bb-self.C*xx,xb)
bu1 = x.getSubVector(self.u_is)
bu1 = bu1-self.Bt*xp
bu2 = self.Bt*xp
bu4 = self.Ct*xb
XX = bu1.duplicate()
xu = XX.duplicate()
# self.kspF.solve(bu1-bu4-bu2,xu)
self.kspF.solve(self.Ct*xb,XX)
#self.kspF.solve(bu1-self.Ct*xb,xu)
self.kspF.solve(bu1-XX,xu)
y.array = (np.concatenate([xu.array, xb.array,xp.array,xr.array]))
def ITS(self):
return self.CGits, self.HiptmairIts , self.CGtime, self.HiptmairTime
class SaddleFromTest(BaseMyPC):
def __init__(self, W, kspF, kspA, kspQ,Fp,kspScalar, kspCGScalar, kspVector, G, P, A, Hiptmairtol,PP):
self.W = W
self.kspF = kspF
self.kspA = kspA
self.kspQ = kspQ
self.Fp = Fp
self.kspScalar = kspScalar
self.kspCGScalar = kspCGScalar
self.kspVector = kspVector
# self.Bt = Bt
self.HiptmairIts = 0
self.CGits = 0
self.PP = PP
# print range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim())
# ss
self.P = P
self.G = G
self.AA = A
self.tol = Hiptmairtol
#self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
#self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim(),self.W[0].dim()+self.W[1].dim()))
#self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),
# self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
#self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim()+self.W[2].dim(),
# self.W[0].dim()+self.W[1].dim()+self.W[2].dim()+self.W[3].dim()))
self.u_is = PETSc.IS().createGeneral(range(self.W[0].dim()))
self.p_is = PETSc.IS().createGeneral(range(self.W[0].dim(),
self.W[0].dim()+self.W[1].dim()))
self.b_is = PETSc.IS().createGeneral(range(self.W[0].dim()+self.W[1].dim(),
self.W[0].dim()+self.W[1].dim()+self.W[2].dim()))
self.r_is = PETSc.IS().createGeneral(range(self.W[0].dim()
+self.W[1].dim()+self.W[2].dim(),self.W[0].dim()+self.W[1].dim()
+self.W[2].dim()+self.W[3].dim()))
def create(self, pc):
print "Create"
def setUp(self, pc):
A, P, flag = pc.getOperators()
print A.size
print A
self.Ct = A.getSubMatrix(self.u_is,self.b_is)
self.C = A.getSubMatrix(self.b_is,self.u_is)
self.D = A.getSubMatrix(self.r_is,self.b_is)
self.Bt = A.getSubMatrix(self.u_is,self.p_is)
self.B = A.getSubMatrix(self.p_is,self.u_is)
self.Dt = A.getSubMatrix(self.b_is,self.r_is)
# print self.Ct.view()
MX = self.PP
# B = IO.matToSparse(MX).tocsr()
# MO.StoreMatrix(B,"A")
# print FC.todense()
self.kspF.setType('preonly')
self.kspF.getPC().setType('lu')
self.kspF.setFromOptions()
self.kspF.setPCSide(0)
self.kspA.setType('preonly')
self.kspA.getPC().setType('lu')
self.kspA.setFromOptions()
self.kspA.setPCSide(0)
self.kspQ.setType('preonly')
self.kspQ.getPC().setType('lu')
self.kspQ.setFromOptions()
self.kspQ.setPCSide(0)
self.kspScalar.setType('preonly')
self.kspScalar.getPC().setType('lu')
self.kspScalar.setFromOptions()
self.kspScalar.setPCSide(0)
kspMX = PETSc.KSP()
kspMX.create(comm=PETSc.COMM_WORLD)
pcMX = kspMX.getPC()
kspMX.setType('preonly')
pcMX.setType('lu')
OptDB = PETSc.Options()
kspMX.setOperators(MX,MX)
self.kspMX = kspMX
# self.kspCGScalar.setType('preonly')
# self.kspCGScalar.getPC().setType('lu')
# self.kspCGScalar.setFromOptions()
# self.kspCGScalar.setPCSide(0)
self.kspVector.setType('preonly')
self.kspVector.getPC().setType('lu')
self.kspVector.setFromOptions()
self.kspVector.setPCSide(0)
print "setup"
def apply(self, pc, x, y):
br = x.getSubVector(self.r_is)
xr = br.duplicate()
self.kspScalar.solve(br, xr)
# print self.D.size
x2 = x.getSubVector(self.p_is)
y2 = x2.duplicate()
y3 = x2.duplicate()
xp = x2.duplicate()
self.kspA.solve(x2,y2)
self.Fp.mult(y2,y3)
self.kspQ.solve(y3,xp)
# self.kspF.solve(bu1-bu4-bu2,xu)
bu1 = x.getSubVector(self.u_is)
bu1 = bu1
#- self.Bt*xp
xx = bu1.duplicate()
self.kspF.solve(bu1,xx)
bb = x.getSubVector(self.b_is)
bb = bb
#- self.Dt*xr
xb = bb.duplicate()
#self.kspMX.solve(bb,xb)
self.kspMX.solve(bb,xb)
#-self.C*xx,xb)
bu1 = x.getSubVector(self.u_is)
bu1 = bu1
#-self.Bt*xp
bu2 = self.Bt*xp
bu4 = self.Ct*xb
XX = bu1.duplicate()
xu = XX.duplicate()
# self.kspF.solve(bu1-bu4-bu2,xu)
#self.kspF.solve(self.Ct*xb,XX)
#self.kspF.solve(bu1-self.Ct*xb,xu)
self.kspF.solve(bu1-bu4,xu)
#-XX,xu)
y.array = (np.concatenate([xu.array, xb.array,xp.array,xr.array]))
def ITS(self):
return self.CGits, self.HiptmairIts , self.CGtime, self.HiptmairTime
| 31.226488 | 164 | 0.554613 | 2,311 | 16,269 | 3.858936 | 0.07183 | 0.064476 | 0.069971 | 0.047432 | 0.892689 | 0.881251 | 0.877663 | 0.877663 | 0.862077 | 0.862077 | 0 | 0.024419 | 0.275063 | 16,269 | 520 | 165 | 31.286538 | 0.731728 | 0.13787 | 0 | 0.806358 | 0 | 0 | 0.015333 | 0.003941 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.00578 | 0.020231 | null | null | 0.034682 | 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 |
546fc8d4686ec0efa6b035988506cf911917e75d | 88,929 | py | Python | tradefed_cluster/cluster_device_api_test.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | tradefed_cluster/cluster_device_api_test.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | tradefed_cluster/cluster_device_api_test.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 cluster_device_api."""
import datetime
import unittest
import mock
from protorpc import protojson
import pytz
from tradefed_cluster.util import ndb_shim as ndb
from tradefed_cluster import api_messages
from tradefed_cluster import api_test
from tradefed_cluster import common
from tradefed_cluster import datastore_entities
from tradefed_cluster import datastore_test_util
from tradefed_cluster import device_manager
from tradefed_cluster import note_manager
class ClusterDeviceApiTest(api_test.ApiTest):
TIMESTAMP = datetime.datetime(2015, 10, 9)
TIMESTAMP_0 = datetime.datetime(2015, 10, 5)
TIMESTAMP_1 = datetime.datetime(2015, 10, 6)
def _assertDeviceCount(self, request, count):
"""Helper function for checking device list count given a request."""
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(count, len(device_collection.device_infos))
def _setDeviceState(self, serial, state):
"""Helper function to set a device's state."""
device = datastore_entities.DeviceInfo.query().filter(
datastore_entities.DeviceInfo.device_serial == serial).get()
device.state = state
device.put()
def setUp(self):
api_test.ApiTest.setUp(self)
self.ndb_host_0 = datastore_test_util.CreateHost('free', 'host_0')
self.ndb_device_0 = datastore_test_util.CreateDevice(
'free', 'host_0', 'device_0', 'lab-name-1', timestamp=self.TIMESTAMP)
self.ndb_device_1 = datastore_test_util.CreateDevice(
'free', 'host_0', 'device_1', timestamp=self.TIMESTAMP)
self.ndb_host_1 = datastore_test_util.CreateHost(
'paid', 'host_1', lab_name='alab')
self.ndb_device_2 = datastore_test_util.CreateDevice(
'paid', 'host_1', 'device_2', hidden=True, lab_name='alab')
self.ndb_device_3 = datastore_test_util.CreateDevice(
'paid',
'host_1',
'device_3',
lab_name='alab',
device_type=api_messages.DeviceTypeMessage.NULL)
self.ndb_host_2 = datastore_test_util.CreateHost(
'free', 'host_2', hidden=True)
self.ndb_device_4 = datastore_test_util.CreateDevice(
'free',
'host_2',
'device_4',
device_type=api_messages.DeviceTypeMessage.NULL)
self.note = datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_0',
user='user0',
timestamp=self.TIMESTAMP,
message='Hello, World')
self.note.put()
self.device_history_0 = datastore_entities.DeviceStateHistory(
device_serial='device_0',
parent=self.ndb_device_0.key,
timestamp=self.TIMESTAMP_0,
state='Available')
device_history_0_key = self.device_history_0.put()
self.device_history_1 = datastore_entities.DeviceStateHistory(
device_serial='device_0',
parent=self.ndb_device_0.key,
timestamp=self.TIMESTAMP_1,
state='Allocated')
device_history_1_key = self.device_history_1.put()
self.history = [device_history_0_key, device_history_1_key]
def testListDevices(self):
"""Tests ListDevices returns all devices."""
api_request = {}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# ListDevices counts non-hidden devices under hidden host.
self.assertEqual(4, len(device_collection.device_infos))
def testListDevices_filterCluster(self):
"""Tests ListDevices returns devices filtered by cluster."""
api_request = {'cluster_id': 'free'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# ListDevices counts non-hidden devices under hidden host.
self.assertEqual(3, len(device_collection.device_infos))
for device in device_collection.device_infos:
self.assertEqual('free', device.cluster)
def testListDevices_filterLabName(self):
"""Tests ListDevices returns devices filtered by lab_name."""
api_request = {'lab_name': 'alab'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# It will not get the hidden device.
self.assertEqual(1, len(device_collection.device_infos))
for device in device_collection.device_infos:
self.assertEqual('alab', device.lab_name)
def testListDevices_filterDeviceSerial(self):
"""Tests ListDevices returns device filtered by device serial."""
api_request = {'device_serial': self.ndb_device_3.device_serial}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(1, len(device_collection.device_infos))
self.assertEqual(self.ndb_device_3.device_serial,
device_collection.device_infos[0].device_serial)
def testListDevices_filterTestHarness(self):
"""Tests ListDevices returns devices filtered by test harness."""
self.ndb_device_0 = datastore_test_util.CreateDevice(
'mh_cluster',
'mh_host',
'mh_device',
timestamp=self.TIMESTAMP,
test_harness='mh')
api_request = {'test_harness': 'mh'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# It will not get the hidden device.
self.assertEqual(1, len(device_collection.device_infos))
self.assertEqual('mh', device_collection.device_infos[0].test_harness)
def testListDevices_filterMultiTestHarness(self):
"""Tests ListDevices returns devices filtered by multiple test harness."""
datastore_test_util.CreateDevice(
'mh_cluster',
'mh_host',
'mh_device',
test_harness='mh')
datastore_test_util.CreateDevice(
'goats_cluster',
'goats_host',
'goats_device',
test_harness='goats')
api_request = {'test_harness': ['mh', 'goats']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# It will not get the hidden device.
self.assertEqual(2, len(device_collection.device_infos))
self.assertEqual('goats', device_collection.device_infos[0].test_harness)
self.assertEqual('mh', device_collection.device_infos[1].test_harness)
def testListDevices_filterHostname(self):
"""Tests ListDevices returns devices filtered by hostname."""
api_request = {'hostname': 'host_1'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# It will not get the hidden device.
self.assertEqual(1, len(device_collection.device_infos))
for device in device_collection.device_infos:
self.assertEqual('host_1', device.hostname)
def testListDevices_filterHostnames(self):
"""Tests ListDevices returns devices filtered by hostnames."""
api_request = {'hostnames': ['host_0', 'host_1']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(3, len(device_collection.device_infos))
self.assertEqual(self.ndb_device_0.device_serial,
device_collection.device_infos[0].device_serial)
self.assertEqual(self.ndb_device_1.device_serial,
device_collection.device_infos[1].device_serial)
self.assertEqual(self.ndb_device_3.device_serial,
device_collection.device_infos[2].device_serial)
def testListDevices_filterPools(self):
"""Tests ListDevices returns devices filtered by pools."""
datastore_test_util.CreateDevice('cluster_01', 'host_01', 'device_01',
pools='pools_A')
datastore_test_util.CreateDevice('cluster_01', 'host_01', 'device_02',
pools='pools_B')
api_request = {'pools': ['pools_A', 'pools_B']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_collection.device_infos))
self.assertEqual(['pools_A'], device_collection.device_infos[0].pools)
self.assertEqual(['pools_B'], device_collection.device_infos[1].pools)
def testListDevices_includeHidden(self):
"""Tests ListDevices returns both hidden and non-hidden devices."""
api_request = {'include_hidden': True}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(5, len(device_collection.device_infos))
def testListDevices_deviceTypePhysicalAndNull(self):
"""Tests ListDevices returns physical and null devices."""
api_request = {'device_types': ['PHYSICAL', 'NULL']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# ListDevices counts non-hidden devices under hidden host.
self.assertEqual(4, len(device_collection.device_infos))
def testListDevices_deviceTypeNull(self):
"""Tests ListDevices returns null devices."""
api_request = {'device_types': ['NULL']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
# ListDevices counts non-hidden devices under hidden host.
self.assertEqual(2, len(device_collection.device_infos))
for d in device_collection.device_infos:
self.assertEqual(api_messages.DeviceTypeMessage.NULL, d.device_type)
def testListDevices_filterHostGroups(self):
"""Tests ListDevices returns devices filtered by host groups."""
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_01',
host_group='hg_01')
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_02',
host_group='hg_02')
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_03',
host_group='hg_02')
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_04',
host_group='hg_03')
api_request = {'host_groups': ['hg_01', 'hg_02']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(3, len(device_collection.device_infos))
self.assertEqual('hg_01', device_collection.device_infos[0].host_group)
self.assertEqual('hg_02', device_collection.device_infos[1].host_group)
self.assertEqual('hg_02', device_collection.device_infos[2].host_group)
def testListDevices_withOffset(self):
"""Tests ListDevices returns devices applying a count and offset."""
api_request = {'include_hidden': True, 'count': '2'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_collection.device_infos))
self.assertTrue(device_collection.more)
self.assertIsNotNone(device_collection.next_cursor)
def testListDevices_withCursorAndOffsetAndLastPage(self):
"""Tests ListDevices returns devices applying a count and offset.
This test retrieves the last page which should have less devices than the
specified count.
"""
# 5 devices. Offset of 3 means it should return only 2 when count >= 2
api_request = {'include_hidden': True, 'count': '3'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
device_infos = device_collection.device_infos
self.assertEqual('200 OK', api_response.status)
self.assertEqual(3, len(device_infos))
self.assertEqual('device_0', device_infos[0].device_serial)
self.assertEqual('device_1', device_infos[1].device_serial)
self.assertEqual('device_2', device_infos[2].device_serial)
api_request = {
'include_hidden': True,
'count': '3',
'cursor': device_collection.next_cursor
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
device_infos = device_collection.device_infos
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_collection.device_infos))
self.assertEqual('device_3', device_infos[0].device_serial)
self.assertEqual('device_4', device_infos[1].device_serial)
self.assertFalse(device_collection.more)
def testListDevices_filterRunTargets(self):
"""Tests ListDevices returns devices filtered by run targets."""
datastore_test_util.CreateDevice('cluster_01', 'host_01', 'device_01',
run_target='run_target_01')
datastore_test_util.CreateDevice('cluster_01', 'host_01', 'device_02',
run_target='run_target_02')
datastore_test_util.CreateDevice('cluster_01', 'host_01', 'device_03',
run_target='run_target_03')
api_request = {'run_targets': ['run_target_01', 'run_target_02']}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_collection.device_infos))
self.assertEqual('run_target_01',
device_collection.device_infos[0].run_target)
self.assertEqual('run_target_02',
device_collection.device_infos[1].run_target)
def testListDevices_filterState(self):
"""Tests ListDevices returns devices filtered by states."""
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_01',
state=common.DeviceState.ALLOCATED)
datastore_test_util.CreateDevice(
'cluster_01', 'host_01', 'device_02', state=common.DeviceState.UNKNOWN)
api_request = {
'device_states': [
common.DeviceState.ALLOCATED, common.DeviceState.UNKNOWN
]
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_collection.device_infos))
self.assertEqual(common.DeviceState.ALLOCATED,
device_collection.device_infos[0].state)
self.assertEqual(common.DeviceState.UNKNOWN,
device_collection.device_infos[1].state)
def testListDevices_filterExtraInfo(self):
"""Tests ListDevices returns devices filtered by extra info."""
extra_info_0 = {}
extra_info_0['sim_state'] = 'ready'
extra_info_0['key2'] = 'value2'
datastore_test_util.CreateDevice(
'cluster_01',
'host_01',
'device_01',
state=common.DeviceState.ALLOCATED,
extra_info=extra_info_0)
datastore_test_util.CreateDevice(
'cluster_01', 'host_01', 'device_02', state=common.DeviceState.UNKNOWN)
api_request = {
'flated_extra_info': 'sim_state:ready'
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListDevices', api_request)
device_collection = protojson.decode_message(
api_messages.DeviceInfoCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(1, len(device_collection.device_infos))
self.assertEqual('device_01',
device_collection.device_infos[0].device_serial)
def testBatchGetLatestNotesByDevice(self):
"""Tests ListDevices returns all devices."""
note_entities = [
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
user='user1',
device_serial=self.ndb_device_2.device_serial,
timestamp=datetime.datetime(1987, 10, 19),
message='message_0'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
user='user1',
device_serial=self.ndb_device_2.device_serial,
timestamp=datetime.datetime(2020, 3, 12),
message='message_3'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
user='user1',
device_serial=self.ndb_device_4.device_serial,
timestamp=datetime.datetime(2001, 9, 17),
message='message_1'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
user='user1',
device_serial=self.ndb_device_4.device_serial,
timestamp=datetime.datetime(2008, 10, 15),
message='message_2'),
]
ndb.put_multi(note_entities)
api_request = {
'device_serials': [
self.ndb_device_2.device_serial,
self.ndb_device_4.device_serial,
]
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchGetLatestNotesByDevice', api_request)
device_note_collection = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_note_collection.notes))
self.assertEqual('message_3',
device_note_collection.notes[0].message)
self.assertEqual('message_2',
device_note_collection.notes[1].message)
def testBatchGetLatestNotesByDevice_noNotesFound(self):
"""Tests ListDevices returns all devices."""
api_request = {
'device_serials': [
self.ndb_device_2.device_serial,
self.ndb_device_4.device_serial,
]
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchGetLatestNotesByDevice', api_request)
device_note_collection = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(0, len(device_note_collection.notes))
def testGetDevice(self):
"""Tests GetDevice without including notes."""
api_request = {'device_serial': self.ndb_device_0.device_serial}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_0.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_0.hostname, device.hostname)
self.assertEqual(self.ndb_device_0.physical_cluster, device.cluster)
self.assertEqual(self.ndb_device_0.battery_level, device.battery_level)
self.assertEqual(self.ndb_device_0.hidden, device.hidden)
self.assertEqual(0, len(device.notes))
def testGetDevice_withHostname(self):
"""Tests GetDevice without including notes."""
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'hostname': self.ndb_device_0.hostname
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_0.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_0.hostname, device.hostname)
def testGetDevice_notFound(self):
"""Tests GetDevice where it does not exist."""
api_request = {'device_serial': 'fake_device_serial'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.GetDevice', api_request, expect_errors=True)
self.assertEqual('404 Not Found', api_response.status)
def testGetDevice_includeNotes(self):
"""Tests GetDevice including notes when they are available."""
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_notes': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_0.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_0.hostname, device.hostname)
self.assertEqual(self.ndb_device_0.physical_cluster, device.cluster)
self.assertEqual(self.ndb_device_0.battery_level, device.battery_level)
self.assertEqual(self.ndb_device_0.hidden, device.hidden)
self.assertEqual(1, len(device.notes))
self.assertEqual(self.note.user, device.notes[0].user)
self.assertEqual(self.note.timestamp, device.notes[0].timestamp)
self.assertEqual(self.note.message, device.notes[0].message)
def testGetDevice_includeNotesNoneAvailable(self):
"""Tests GetDevice including notes when they are available."""
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'include_notes': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_1.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_1.hostname, device.hostname)
self.assertEqual(self.ndb_device_1.battery_level, device.battery_level)
self.assertEqual(self.ndb_device_1.hidden, device.hidden)
self.assertEqual(0, len(device.notes))
@mock.patch.object(common, 'Now')
def testGetDevice_includeUtilization(self, mock_now):
"""Tests GetDevice including utilization."""
mock_now.return_value = datetime.datetime(2015, 11, 20)
device_snapshot = datastore_entities.DeviceStateHistory(
timestamp=datetime.datetime(2015, 11, 13),
device_serial=self.ndb_device_0.device_serial,
state='Allocated')
device_snapshot.put()
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_utilization': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(1, device.utilization)
def testGetDevice_includeUtilization_noUtilization(self):
"""Tests GetDevice including utilization."""
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_utilization': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(0, device.utilization)
def testNewNote_withNoneExisting(self):
"""Tests adding a note to a device when none exist already."""
user = 'some_user'
timestamp = datetime.datetime(2015, 10, 18, 20, 46)
message = 'The Message'
offline_reason = 'Battery ran out'
recovery_action = 'Press a button'
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'user': user,
'timestamp': timestamp.isoformat(),
'message': message,
'offline_reason': offline_reason,
'recovery_action': recovery_action,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.NewNote',
api_request)
self.assertEqual('200 OK', api_response.status)
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'include_notes': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual(1, len(device.notes))
self.assertEqual(user, device.notes[0].user)
self.assertEqual(timestamp, device.notes[0].timestamp)
self.assertEqual(message, device.notes[0].message)
self.assertEqual(offline_reason, device.notes[0].offline_reason)
self.assertEqual(recovery_action, device.notes[0].recovery_action)
def testNewNote_withTimezoneOffset(self):
"""Tests adding a note to a device with a timestamp with offset."""
user = 'some_user'
timestamp = pytz.utc.localize(datetime.datetime(2015, 10, 18, 20))
message = 'The Message'
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'user': user,
'timestamp': timestamp.isoformat(),
'message': message
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.NewNote',
api_request)
self.assertEqual('200 OK', api_response.status)
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'include_notes': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual(1, len(device.notes))
self.assertEqual(user, device.notes[0].user)
expected_timestamp = datetime.datetime(2015, 10, 18, 20)
self.assertEqual(expected_timestamp, device.notes[0].timestamp)
self.assertEqual(message, device.notes[0].message)
def testNewNote_withExisting(self):
"""Tests adding a note to a device when one already exists."""
user = 'some_user'
timestamp = datetime.datetime(2015, 10, 18, 20, 46)
message = 'The Message'
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'user': user,
'timestamp': timestamp.isoformat(),
'message': message
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.NewNote',
api_request)
self.assertEqual('200 OK', api_response.status)
# Query the same device again. Notes should be sorted.
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_notes': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual(2, len(device.notes))
self.assertEqual(user, device.notes[0].user)
self.assertEqual(timestamp, device.notes[0].timestamp)
self.assertEqual(message, device.notes[0].message)
self.assertEqual(self.note.user, device.notes[1].user)
self.assertEqual(self.note.timestamp, device.notes[1].timestamp)
self.assertEqual(self.note.message, device.notes[1].message)
@mock.patch.object(device_manager, 'GetDevice')
@mock.patch.object(note_manager, 'PublishMessage')
def testAddOrUpdateDeviceNote_addWithTextOfflineReasonAndRecoveryAction(
self, mock_publish_device_note_message, mock_get_device):
"""Tests adding a non-existing device note."""
mock_get_device.return_value = self.ndb_device_0
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'offline_reason': 'offline-reason-1',
'recovery_action': 'recovery-action-1',
'lab_name': self.ndb_device_0.lab_name,
'event_time': self.TIMESTAMP.isoformat(),
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request)
self.assertEqual('200 OK', api_response.status)
device_note = protojson.decode_message(api_messages.Note,
api_response.body)
device_note_event_msg = api_messages.NoteEvent(
note=device_note,
hostname=self.ndb_device_0.hostname,
lab_name=self.ndb_device_0.lab_name,
run_target=self.ndb_device_0.run_target)
# Assert datastore id is generated.
self.assertIsNotNone(device_note.id)
# Assert fields equal.
self.assertEqual(api_request['device_serial'], device_note.device_serial)
self.assertEqual(api_request['user'], device_note.user)
self.assertEqual(api_request['message'], device_note.message)
self.assertEqual(api_request['offline_reason'], device_note.offline_reason)
self.assertEqual(api_request['recovery_action'],
device_note.recovery_action)
self.assertEqual(api_request['event_time'],
device_note.event_time.isoformat())
# Assert PredefinedMessage entities are written into datastore.
self.assertIsNotNone(datastore_entities.PredefinedMessage.query().filter(
datastore_entities.PredefinedMessage.content ==
api_request['offline_reason']).get())
self.assertIsNotNone(datastore_entities.PredefinedMessage.query().filter(
datastore_entities.PredefinedMessage.content ==
api_request['recovery_action']).get())
# Side Effect: Assert DeviceInfoHistory is written into datastore.
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_0.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note.id), histories[0].extra_info['device_note_id'])
mock_publish_device_note_message.assert_called_once_with(
device_note_event_msg, common.PublishEventType.DEVICE_NOTE_EVENT)
@mock.patch.object(device_manager, 'GetDevice')
@mock.patch.object(note_manager, 'PublishMessage')
def testAddOrUpdateDeviceNote_UpdateWithTextOfflineReasonAndRecoveryAction(
self, mock_publish_device_note_message, mock_get_device):
"""Tests updating an existing device note."""
mock_get_device.return_value = self.ndb_device_0
api_request_1 = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'offline_reason': 'offline-reason-1',
'recovery_action': 'recovery-action-1',
'lab_name': self.ndb_device_0.lab_name,
'event_time': self.TIMESTAMP_0.isoformat(),
}
api_response_1 = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request_1)
self.assertEqual('200 OK', api_response_1.status)
device_note_1 = protojson.decode_message(api_messages.Note,
api_response_1.body)
new_lab_name = 'lab-name-2'
mock_get_device.return_value.lab_name = new_lab_name
api_request_2 = {
'id': int(device_note_1.id),
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-2',
'message': 'message-2',
'offline_reason': 'offline-reason-2',
'recovery_action': 'recovery-action-2',
'lab_name': new_lab_name,
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response_2 = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request_2)
self.assertEqual('200 OK', api_response_1.status)
device_note_2 = protojson.decode_message(api_messages.Note,
api_response_2.body)
device_note_event_msg = api_messages.NoteEvent(
note=device_note_2,
hostname=self.ndb_device_0.hostname,
lab_name=new_lab_name,
run_target=self.ndb_device_0.run_target)
# Assert two requests modified the same datastore entity.
self.assertEqual(device_note_1.id, device_note_2.id)
# Assert the fields finally equal to the ones in the 2nd request.
self.assertEqual(api_request_2['device_serial'],
device_note_2.device_serial)
self.assertEqual(api_request_2['user'], device_note_2.user)
self.assertEqual(api_request_2['message'], device_note_2.message)
self.assertEqual(api_request_2['offline_reason'],
device_note_2.offline_reason)
self.assertEqual(api_request_2['recovery_action'],
device_note_2.recovery_action)
self.assertEqual(api_request_2['event_time'],
device_note_2.event_time.isoformat())
# Side Effect: Assert DeviceInfoHistory is written into datastore.
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_0.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(int(device_note_1.id),
histories[0].extra_info['device_note_id'])
mock_publish_device_note_message.assert_called_with(
device_note_event_msg, common.PublishEventType.DEVICE_NOTE_EVENT)
@mock.patch.object(device_manager, 'GetDevice')
@mock.patch.object(note_manager, 'PublishMessage')
def testAddOrUpdateDeviceNote_UpdateWithDedupTextPredefinedMessage(
self, mock_publish_device_note_message, mock_get_device):
"""Tests updating an existing device note."""
mock_get_device.return_value = self.ndb_device_0
api_request_1 = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'offline_reason': 'offline-reason-1',
'recovery_action': 'recovery-action-1',
'lab_name': 'lab-name-1',
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response_1 = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request_1)
self.assertEqual('200 OK', api_response_1.status)
device_note_1 = protojson.decode_message(api_messages.Note,
api_response_1.body)
api_request_2 = {
'id': int(device_note_1.id),
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-2',
'message': 'message-2',
'offline_reason': 'offline-reason-1',
'recovery_action': 'recovery-action-1',
'lab_name': 'lab-name-1',
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response_2 = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request_2)
self.assertEqual('200 OK', api_response_1.status)
device_note_2 = protojson.decode_message(api_messages.Note,
api_response_2.body)
# Assert two requests modified the same datastore entity.
self.assertEqual(device_note_1.id, device_note_2.id)
# Assert the fields finally equal to the ones in the 2nd request.
self.assertEqual(api_request_2['device_serial'],
device_note_2.device_serial)
self.assertEqual(api_request_2['user'], device_note_2.user)
self.assertEqual(api_request_2['message'], device_note_2.message)
self.assertEqual(api_request_2['offline_reason'],
device_note_2.offline_reason)
self.assertEqual(api_request_2['recovery_action'],
device_note_2.recovery_action)
self.assertEqual(api_request_2['event_time'],
device_note_2.event_time.isoformat())
# Side Effect: Assert PredefinedMessage is created only in first call.
predefine_messages = list(datastore_entities.PredefinedMessage.query(
datastore_entities.PredefinedMessage.lab_name == 'lab-name-1').fetch())
self.assertEqual(2, len(predefine_messages))
@mock.patch.object(device_manager, 'GetDevice')
@mock.patch.object(note_manager, 'PublishMessage')
def testAddOrUpdateDeviceNote_addWithIdOfflineReasonAndRecoveryAction(
self, mock_publish_device_note_message, mock_get_device):
"""Tests adding a device note with existing predefined messages."""
offline_reason = 'offline-reason'
recovery_action = 'recovery-action'
mock_get_device.return_value = self.ndb_device_0
predefined_message_entities = [
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 111),
lab_name=self.ndb_device_0.lab_name,
type=api_messages.PredefinedMessageType.DEVICE_OFFLINE_REASON,
content=offline_reason,
used_count=2),
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 222),
lab_name=self.ndb_device_0.lab_name,
type=api_messages.PredefinedMessageType.DEVICE_RECOVERY_ACTION,
content=recovery_action,
used_count=5),
]
offline_reason_key, recovery_action_key = ndb.put_multi(
predefined_message_entities)
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'offline_reason_id': 111,
'recovery_action_id': 222,
'lab_name': self.ndb_device_0.lab_name,
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote', api_request)
self.assertEqual('200 OK', api_response.status)
device_note = protojson.decode_message(api_messages.Note,
api_response.body)
device_note_event_msg = api_messages.NoteEvent(
note=device_note,
hostname=self.ndb_device_0.hostname,
lab_name=self.ndb_device_0.lab_name,
run_target=self.ndb_device_0.run_target)
# Assert datastore id is generated.
self.assertIsNotNone(device_note.id)
# Assert fields equal.
self.assertEqual(api_request['device_serial'], device_note.device_serial)
self.assertEqual(api_request['user'], device_note.user)
self.assertEqual(api_request['message'], device_note.message)
self.assertEqual(offline_reason, device_note.offline_reason)
self.assertEqual(recovery_action, device_note.recovery_action)
self.assertEqual(api_request['event_time'],
device_note.event_time.isoformat())
# Assert PredefinedMessage used_count fields are updated.
self.assertEqual(3, offline_reason_key.get().used_count)
self.assertEqual(6, recovery_action_key.get().used_count)
# Side Effect: Assert DeviceInfoHistory is written into datastore.
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_0.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note.id), histories[0].extra_info['device_note_id'])
mock_publish_device_note_message.assert_called_once_with(
device_note_event_msg, common.PublishEventType.DEVICE_NOTE_EVENT)
@mock.patch.object(device_manager, 'GetDevice')
@mock.patch.object(note_manager, 'PublishMessage')
def testAddOrUpdateDeviceNote_InvalidIdOfflineReasonAndRecoveryAction(
self, mock_publish_device_note_message, mock_get_device):
"""Tests adding a device note with existing predefined messages."""
mock_get_device.return_value = self.ndb_device_0
offline_reason = 'offline-reason'
recovery_action = 'recovery-action'
lab_name = 'lab-name'
predefined_message_entities = [
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 111),
lab_name=lab_name,
type=api_messages.PredefinedMessageType.DEVICE_OFFLINE_REASON,
content=offline_reason,
used_count=2),
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 222),
lab_name=lab_name,
type=api_messages.PredefinedMessageType.DEVICE_RECOVERY_ACTION,
content=recovery_action,
used_count=5),
]
ndb.put_multi(predefined_message_entities)
# Invalid recovery action.
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'recovery_action_id': 111,
'lab_name': lab_name,
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote',
api_request,
expect_errors=True)
self.assertEqual('400 Bad Request', api_response.status)
# Non-existing offline reason.
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'user': 'user-1',
'message': 'message-1',
'offline_reason_id': 333,
'lab_name': lab_name,
'event_time': self.TIMESTAMP_1.isoformat(),
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.AddOrUpdateNote',
api_request,
expect_errors=True)
self.assertEqual('400 Bad Request', api_response.status)
@mock.patch.object(note_manager, 'PublishMessage')
def testBatchUpdateNotesWithPredefinedMessage(
self, mock_publish_device_note_message):
"""Tests updating notes with the same content and PredefinedMessage."""
api_request = {
'user':
'user-1',
'message':
'message-1',
'offline_reason':
'offline_reason-1',
'recovery_action':
'recovery_action-1',
'lab_name':
'lab-1',
'event_time':
self.TIMESTAMP.isoformat(),
'notes': [
{
'device_serial': self.ndb_device_0.device_serial,
'hostname': self.ndb_device_0.hostname,
},
{
'device_serial': self.ndb_device_1.device_serial,
'hostname': self.ndb_device_1.hostname,
},
{
'device_serial': self.ndb_device_2.device_serial,
'hostname': self.ndb_device_2.hostname,
},
],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchUpdateNotesWithPredefinedMessage',
api_request)
self.assertEqual('200 OK', api_response.status)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
note_msgs = device_note_collection_msg.notes
self.assertEqual(3, len(note_msgs))
self.assertEqual(self.ndb_device_0.device_serial,
note_msgs[0].device_serial)
self.assertEqual(self.ndb_device_1.device_serial,
note_msgs[1].device_serial)
self.assertEqual(self.ndb_device_2.device_serial,
note_msgs[2].device_serial)
self.assertEqual(self.ndb_device_0.hostname, note_msgs[0].hostname)
self.assertEqual(self.ndb_device_1.hostname, note_msgs[1].hostname)
self.assertEqual(self.ndb_device_2.hostname, note_msgs[2].hostname)
self.assertEqual('message-1', note_msgs[0].message)
self.assertEqual('message-1', note_msgs[1].message)
self.assertEqual('message-1', note_msgs[2].message)
self.assertEqual('user-1', note_msgs[0].user)
self.assertEqual('user-1', note_msgs[1].user)
self.assertEqual('user-1', note_msgs[2].user)
self.assertEqual('offline_reason-1', note_msgs[0].offline_reason)
self.assertEqual('offline_reason-1', note_msgs[1].offline_reason)
self.assertEqual('offline_reason-1', note_msgs[2].offline_reason)
self.assertEqual('recovery_action-1', note_msgs[0].recovery_action)
self.assertEqual('recovery_action-1', note_msgs[1].recovery_action)
self.assertEqual('recovery_action-1', note_msgs[2].recovery_action)
self.assertEqual(self.TIMESTAMP, note_msgs[0].event_time)
self.assertEqual(self.TIMESTAMP, note_msgs[1].event_time)
self.assertEqual(self.TIMESTAMP, note_msgs[2].event_time)
# Side Effect: Assert each PredefinedMessage is created only once.
offline_reasons = list(
datastore_entities.PredefinedMessage.query()
.filter(datastore_entities.PredefinedMessage.lab_name == 'lab-1')
.filter(datastore_entities.PredefinedMessage.type ==
common.PredefinedMessageType.DEVICE_OFFLINE_REASON)
.fetch())
self.assertEqual(1, len(offline_reasons))
self.assertEqual(3, offline_reasons[0].used_count)
self.assertEqual('offline_reason-1', offline_reasons[0].content)
recovery_actions = list(
datastore_entities.PredefinedMessage.query()
.filter(datastore_entities.PredefinedMessage.lab_name == 'lab-1')
.filter(datastore_entities.PredefinedMessage.type ==
common.PredefinedMessageType.DEVICE_RECOVERY_ACTION)
.fetch())
self.assertEqual(1, len(recovery_actions))
self.assertEqual(3, recovery_actions[0].used_count)
self.assertEqual('recovery_action-1', recovery_actions[0].content)
# Side Effect: Assert DeviceInfoHistory is written into datastore.
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_0.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note_collection_msg.notes[0].id),
histories[0].extra_info['device_note_id'])
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_1.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note_collection_msg.notes[1].id),
histories[0].extra_info['device_note_id'])
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_2.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note_collection_msg.notes[2].id),
histories[0].extra_info['device_note_id'])
# Side Effect: Assert device note event is published.
mock_publish_device_note_message.assert_has_calls([
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[0],
hostname=self.ndb_device_0.hostname,
lab_name=self.ndb_device_0.lab_name,
run_target=self.ndb_device_0.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[1],
hostname=self.ndb_device_1.hostname,
lab_name=self.ndb_device_1.lab_name,
run_target=self.ndb_device_1.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[2],
hostname=self.ndb_device_2.hostname,
lab_name=self.ndb_device_2.lab_name,
run_target=self.ndb_device_2.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
])
@mock.patch.object(note_manager, 'PublishMessage')
def testBatchUpdateNotes_ExistingNoteAndPredefinedMessage(
self, mock_publish_device_note_message):
"""Tests updating notes with the same content and PredefinedMessage."""
existing_entities = [
datastore_entities.Note(
hostname=self.ndb_device_0.hostname,
device_serial=self.ndb_device_0.device_serial,
type=common.NoteType.DEVICE_NOTE),
datastore_entities.PredefinedMessage(
type=common.PredefinedMessageType.DEVICE_OFFLINE_REASON,
content='offline_reason-1',
lab_name='lab-1',
used_count=2),
datastore_entities.PredefinedMessage(
type=common.PredefinedMessageType.DEVICE_RECOVERY_ACTION,
content='recovery_action-1',
lab_name='lab-1',
used_count=3),
]
keys = ndb.put_multi(existing_entities)
api_request = {
'user':
'user-1',
'message':
'message-1',
'offline_reason_id':
str(keys[1].id()),
'recovery_action_id':
str(keys[2].id()),
'event_time':
self.TIMESTAMP.isoformat(),
'notes': [
{
'id': str(keys[0].id()),
},
{
'device_serial': self.ndb_device_1.device_serial,
'hostname': self.ndb_device_1.hostname,
},
{
'device_serial': self.ndb_device_2.device_serial,
'hostname': self.ndb_device_2.hostname,
},
],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchUpdateNotesWithPredefinedMessage',
api_request)
self.assertEqual('200 OK', api_response.status)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
note_msgs = device_note_collection_msg.notes
self.assertEqual(3, len(note_msgs))
self.assertEqual(self.ndb_device_0.device_serial,
note_msgs[0].device_serial)
self.assertEqual(self.ndb_device_1.device_serial,
note_msgs[1].device_serial)
self.assertEqual(self.ndb_device_2.device_serial,
note_msgs[2].device_serial)
self.assertEqual(self.ndb_device_0.hostname, note_msgs[0].hostname)
self.assertEqual(self.ndb_device_1.hostname, note_msgs[1].hostname)
self.assertEqual(self.ndb_device_2.hostname, note_msgs[2].hostname)
self.assertEqual('message-1', note_msgs[0].message)
self.assertEqual('message-1', note_msgs[1].message)
self.assertEqual('message-1', note_msgs[2].message)
self.assertEqual('user-1', note_msgs[0].user)
self.assertEqual('user-1', note_msgs[1].user)
self.assertEqual('user-1', note_msgs[2].user)
self.assertEqual('offline_reason-1', note_msgs[0].offline_reason)
self.assertEqual('offline_reason-1', note_msgs[1].offline_reason)
self.assertEqual('offline_reason-1', note_msgs[2].offline_reason)
self.assertEqual('recovery_action-1', note_msgs[0].recovery_action)
self.assertEqual('recovery_action-1', note_msgs[1].recovery_action)
self.assertEqual('recovery_action-1', note_msgs[2].recovery_action)
self.assertEqual(self.TIMESTAMP, note_msgs[0].event_time)
self.assertEqual(self.TIMESTAMP, note_msgs[1].event_time)
self.assertEqual(self.TIMESTAMP, note_msgs[2].event_time)
# Side Effect: Assert each PredefinedMessage is created only once.
offline_reasons = list(
datastore_entities.PredefinedMessage.query()
.filter(datastore_entities.PredefinedMessage.lab_name == 'lab-1')
.filter(datastore_entities.PredefinedMessage.type ==
common.PredefinedMessageType.DEVICE_OFFLINE_REASON)
.fetch())
self.assertEqual(1, len(offline_reasons))
self.assertEqual(5, offline_reasons[0].used_count)
self.assertEqual('offline_reason-1', offline_reasons[0].content)
recovery_actions = list(
datastore_entities.PredefinedMessage.query()
.filter(datastore_entities.PredefinedMessage.lab_name == 'lab-1')
.filter(datastore_entities.PredefinedMessage.type ==
common.PredefinedMessageType.DEVICE_RECOVERY_ACTION)
.fetch())
self.assertEqual(1, len(recovery_actions))
self.assertEqual(6, recovery_actions[0].used_count)
self.assertEqual('recovery_action-1', recovery_actions[0].content)
# Side Effect: Assert DeviceInfoHistory is written into datastore.
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_0.device_serial).fetch())
self.assertEqual(0, len(histories))
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_1.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note_collection_msg.notes[1].id),
histories[0].extra_info['device_note_id'])
histories = list(
datastore_entities.DeviceInfoHistory.query(
datastore_entities.DeviceInfoHistory.device_serial ==
self.ndb_device_2.device_serial).fetch())
self.assertEqual(1, len(histories))
self.assertEqual(
int(device_note_collection_msg.notes[2].id),
histories[0].extra_info['device_note_id'])
# Side Effect: Assert device note event is published.
mock_publish_device_note_message.assert_has_calls([
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[0],
hostname=self.ndb_device_0.hostname,
lab_name=self.ndb_device_0.lab_name,
run_target=self.ndb_device_0.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[1],
hostname=self.ndb_device_1.hostname,
lab_name=self.ndb_device_1.lab_name,
run_target=self.ndb_device_1.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
mock.call(
api_messages.NoteEvent(
note=device_note_collection_msg.notes[2],
hostname=self.ndb_device_2.hostname,
lab_name=self.ndb_device_2.lab_name,
run_target=self.ndb_device_2.run_target),
common.PublishEventType.DEVICE_NOTE_EVENT),
])
def testBatchUpdateNotes_InvalidPredefinedMessages(self):
"""Tests updating notes with the same content and PredefinedMessage."""
offline_reason = 'offline-reason'
recovery_action = 'recovery-action'
lab_name = 'lab-name'
existing_entities = [
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 111),
lab_name=lab_name,
type=api_messages.PredefinedMessageType.DEVICE_OFFLINE_REASON,
content=offline_reason,
used_count=2),
datastore_entities.PredefinedMessage(
key=ndb.Key(datastore_entities.PredefinedMessage, 222),
lab_name=lab_name,
type=api_messages.PredefinedMessageType.DEVICE_RECOVERY_ACTION,
content=recovery_action,
used_count=5),
]
ndb.put_multi(existing_entities)
# invalid recovery action
api_request = {
'user': 'user-1',
'message': 'message-1',
'offline_reason_id': '111',
'recovery_action_id': '444',
'notes': [
{
'device_serial': self.ndb_device_0.device_serial,
'hostname': self.ndb_device_0.hostname,
},
{
'device_serial': self.ndb_device_1.device_serial,
'hostname': self.ndb_device_1.hostname,
},
{
'device_serial': self.ndb_device_2.device_serial,
'hostname': self.ndb_device_2.hostname,
},
],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchUpdateNotesWithPredefinedMessage',
api_request,
expect_errors=True)
self.assertEqual('400 Bad Request', api_response.status)
# invalid offline reason
api_request = {
'user': 'user-1',
'message': 'message-1',
'offline_reason_id': '333',
'recovery_action_id': '222',
'notes': [
{
'device_serial': self.ndb_device_0.device_serial,
'hostname': self.ndb_device_0.hostname,
},
{
'device_serial': self.ndb_device_1.device_serial,
'hostname': self.ndb_device_1.hostname,
},
{
'device_serial': self.ndb_device_2.device_serial,
'hostname': self.ndb_device_2.hostname,
},
],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchUpdateNotesWithPredefinedMessage',
api_request,
expect_errors=True)
self.assertEqual('400 Bad Request', api_response.status)
def testGetDevice_includeHistory(self):
"""Tests GetDevice including history when they are available."""
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_history': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_0.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_0.hostname, device.hostname)
self.assertEqual(self.ndb_device_0.battery_level, device.battery_level)
self.assertEqual(self.ndb_device_0.hidden, device.hidden)
self.assertEqual(2, len(device.history))
# history will be sorted with newest first
self.assertEqual(self.device_history_1.timestamp,
device.history[0].timestamp)
self.assertEqual(self.device_history_1.state, device.history[0].state)
self.assertEqual(self.device_history_0.timestamp,
device.history[1].timestamp)
self.assertEqual(self.device_history_0.state, device.history[1].state)
def testGetDevice_includeHistoryNoneAvailable(self):
"""Tests GetDevice including history when none available."""
api_request = {
'device_serial': self.ndb_device_1.device_serial,
'include_history': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(self.ndb_device_1.device_serial, device.device_serial)
self.assertEqual(self.ndb_device_1.hostname, device.hostname)
self.assertEqual(self.ndb_device_1.battery_level, device.battery_level)
self.assertEqual(self.ndb_device_1.hidden, device.hidden)
self.assertEqual(0, len(device.history))
def testGetDevice_includeNotesAndHistory(self):
"""Tests GetDevice including notes and history."""
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'include_notes': True,
'include_history': True
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(1, len(device.notes))
self.assertEqual(2, len(device.history))
def testRemove(self):
"""Tests Remove."""
# Check that the existing device is not set to hidden
api_request = {'device_serial': self.ndb_device_0.device_serial}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertFalse(device.hidden)
# Call Remove
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.Remove',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
# Verify API response
self.assertEqual('200 OK', api_response.status)
self.assertTrue(device.hidden)
# Verify by retrieving the device
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertTrue(device.hidden)
def testRemove_withHostname(self):
"""Tests Remove."""
# Check that the existing device is not set to hidden
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'hostname': self.ndb_device_0.hostname
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertFalse(device.hidden)
# Call Remove
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.Remove',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
# Verify API response
self.assertEqual('200 OK', api_response.status)
self.assertTrue(device.hidden)
# Verify by retrieving the device
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertTrue(device.hidden)
def testRemove_missingDevice(self):
"""Test Remove with an invalid device."""
api_request = {'device_serial': 'some-fake-serial'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.Remove', api_request, expect_errors=True)
self.assertEqual('404 Not Found', api_response.status)
def testRestore(self):
"""Tests Restore."""
# Check that the existing device is set to hidden
api_request = {'device_serial': self.ndb_device_2.device_serial}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertTrue(device.hidden)
# Call Restore
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.Restore',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
# Verify API response
self.assertEqual('200 OK', api_response.status)
self.assertFalse(device.hidden)
# Verify by retrieving the device
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertFalse(device.hidden)
def testRestore_withHostname(self):
"""Tests Restore."""
# Check that the existing device is set to hidden
api_request = {
'device_serial': self.ndb_device_2.device_serial,
'hostname': self.ndb_device_2.hostname,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertTrue(device.hidden)
# Call Restore
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.Restore',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
# Verify API response
self.assertEqual('200 OK', api_response.status)
self.assertFalse(device.hidden)
# Verify by retrieving the device
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.GetDevice',
api_request)
device = protojson.decode_message(api_messages.DeviceInfo,
api_response.body)
self.assertFalse(device.hidden)
def testRestore_missingDevice(self):
"""Test Remove with an invalid device."""
api_request = {'device_serial': 'some-fake-serial'}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.Restore', api_request, expect_errors=True)
self.assertEqual('404 Not Found', api_response.status)
def testListDevices_ignoreOfflineDevices(self):
"""Test list ignoring offline devices."""
# Should list all 4 devices when excluding unavailable devices
api_request = {'include_offline_devices': False}
self._assertDeviceCount(api_request, 4)
# Set Device 4 state to Gone
self._setDeviceState(self.ndb_device_4.device_serial,
common.DeviceState.GONE)
# Should only list 3 devices when excluding unavailable devices
api_request = {'include_offline_devices': False}
self._assertDeviceCount(api_request, 3)
# Set Device 3 state to Fastboot
self._setDeviceState(self.ndb_device_3.device_serial,
common.DeviceState.FASTBOOT)
# Should list 2 devices when excluding unavailable devices
api_request = {'include_offline_devices': False}
self._assertDeviceCount(api_request, 2)
# Should list 4 devices when including unavailable devices
api_request = {'include_offline_devices': True}
self._assertDeviceCount(api_request, 4)
def testListDeviceNotes(self):
note_entities = [
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user1',
timestamp=datetime.datetime(1928, 1, 1),
message='message_1',
offline_reason='offline_reason_1',
recovery_action='recovery_action_1'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user2',
timestamp=datetime.datetime(1918, 1, 1),
message='message_2',
offline_reason='offline_reason_2',
recovery_action='recovery_action_2'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user3',
timestamp=datetime.datetime(1988, 1, 1),
message='message_3',
offline_reason='offline_reason_3',
recovery_action='recovery_action_3'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_2',
user='user4',
timestamp=datetime.datetime(2008, 1, 1),
message='message_4',
offline_reason='offline_reason_4',
recovery_action='recovery_action_4'),
]
ndb.put_multi(note_entities)
# The result will be sorted by timestamp in descending order. `
api_request = {
'device_serial': 'device_1',
'count': 2,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.ListNotes',
api_request)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
self.assertTrue(device_note_collection_msg.more)
self.assertIsNotNone(device_note_collection_msg.next_cursor)
note_msgs = device_note_collection_msg.notes
self.assertEqual(2, len(note_msgs))
self.assertEqual(note_msgs[0].device_serial, note_entities[2].device_serial)
self.assertEqual(note_msgs[0].user, note_entities[2].user)
self.assertEqual(note_msgs[0].timestamp,
note_entities[2].timestamp)
self.assertEqual(note_msgs[0].message, note_entities[2].message)
self.assertEqual(note_msgs[0].offline_reason,
note_entities[2].offline_reason)
self.assertEqual(note_msgs[0].recovery_action,
note_entities[2].recovery_action)
self.assertEqual(note_msgs[1].device_serial, note_entities[0].device_serial)
self.assertEqual(note_msgs[1].user, note_entities[0].user)
self.assertEqual(note_msgs[1].timestamp,
note_entities[0].timestamp)
self.assertEqual(note_msgs[1].message, note_entities[0].message)
self.assertEqual(note_msgs[1].offline_reason,
note_entities[0].offline_reason)
self.assertEqual(note_msgs[1].recovery_action,
note_entities[0].recovery_action)
def testListDeviceNotes_withCursorAndOffsetAndBackwards(self):
note_entities = [
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user1',
timestamp=datetime.datetime(1928, 1, 1),
message='message_1',
offline_reason='offline_reason_1',
recovery_action='recovery_action_1'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user2',
timestamp=datetime.datetime(1918, 1, 1),
message='message_2',
offline_reason='offline_reason_2',
recovery_action='recovery_action_2'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user3',
timestamp=datetime.datetime(1988, 1, 1),
message='message_3',
offline_reason='offline_reason_3',
recovery_action='recovery_action_3'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_2',
user='user4',
timestamp=datetime.datetime(2008, 1, 1),
message='message_4',
offline_reason='offline_reason_4',
recovery_action='recovery_action_4'),
]
ndb.put_multi(note_entities)
# The result will be sorted by timestamp in descending order. `
api_request = {
'device_serial': 'device_1',
'count': 2,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.ListNotes',
api_request)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
self.assertIsNotNone(device_note_collection_msg.next_cursor)
note_msgs = device_note_collection_msg.notes
self.assertEqual(2, len(note_msgs))
self.assertEqual(note_msgs[0].device_serial, note_entities[2].device_serial)
self.assertEqual(note_msgs[0].user, note_entities[2].user)
self.assertEqual(note_msgs[0].timestamp, note_entities[2].timestamp)
self.assertEqual(note_msgs[0].message, note_entities[2].message)
self.assertEqual(note_msgs[0].offline_reason,
note_entities[2].offline_reason)
self.assertEqual(note_msgs[0].recovery_action,
note_entities[2].recovery_action)
self.assertEqual(note_msgs[1].device_serial, note_entities[0].device_serial)
self.assertEqual(note_msgs[1].user, note_entities[0].user)
self.assertEqual(note_msgs[1].timestamp,
note_entities[0].timestamp)
self.assertEqual(note_msgs[1].message, note_entities[0].message)
self.assertEqual(note_msgs[1].offline_reason,
note_entities[0].offline_reason)
self.assertEqual(note_msgs[1].recovery_action,
note_entities[0].recovery_action)
# fetch next page
api_request = {
'device_serial': 'device_1',
'count': 2,
'cursor': device_note_collection_msg.next_cursor,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.ListNotes',
api_request)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
self.assertIsNotNone(device_note_collection_msg.prev_cursor)
note_msgs = device_note_collection_msg.notes
self.assertEqual(1, len(note_msgs))
self.assertEqual(note_msgs[0].device_serial, note_entities[1].device_serial)
self.assertEqual(note_msgs[0].user, note_entities[1].user)
self.assertEqual(note_msgs[0].timestamp,
note_entities[1].timestamp)
self.assertEqual(note_msgs[0].message, note_entities[1].message)
self.assertEqual(note_msgs[0].offline_reason,
note_entities[1].offline_reason)
self.assertEqual(note_msgs[0].recovery_action,
note_entities[1].recovery_action)
# fetch previous page (same as first page)
api_request = {
'device_serial': 'device_1',
'count': 2,
'cursor': device_note_collection_msg.prev_cursor,
'backwards': True,
}
api_response = self.testapp.post_json('/_ah/api/ClusterDeviceApi.ListNotes',
api_request)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
note_msgs = device_note_collection_msg.notes
self.assertEqual(2, len(note_msgs))
self.assertEqual(note_msgs[0].device_serial, note_entities[2].device_serial)
self.assertEqual(note_msgs[0].user, note_entities[2].user)
self.assertEqual(note_msgs[0].timestamp,
note_entities[2].timestamp)
self.assertEqual(note_msgs[0].message, note_entities[2].message)
self.assertEqual(note_msgs[0].offline_reason,
note_entities[2].offline_reason)
self.assertEqual(note_msgs[0].recovery_action,
note_entities[2].recovery_action)
self.assertEqual(note_msgs[1].device_serial, note_entities[0].device_serial)
self.assertEqual(note_msgs[1].user, note_entities[0].user)
self.assertEqual(note_msgs[1].timestamp,
note_entities[0].timestamp)
self.assertEqual(note_msgs[1].message, note_entities[0].message)
self.assertEqual(note_msgs[1].offline_reason,
note_entities[0].offline_reason)
self.assertEqual(note_msgs[1].recovery_action,
note_entities[0].recovery_action)
def testBatchGetDeviceNotes(self):
note_entities = [
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user1',
timestamp=datetime.datetime(1928, 1, 1),
message='message_1',
offline_reason='offline_reason_1',
recovery_action='recovery_action_1'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user2',
timestamp=datetime.datetime(1918, 1, 1),
message='message_2',
offline_reason='offline_reason_2',
recovery_action='recovery_action_2'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user3',
timestamp=datetime.datetime(1988, 1, 1),
message='message_3',
offline_reason='offline_reason_3',
recovery_action='recovery_action_3'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_2',
user='user4',
timestamp=datetime.datetime(2008, 1, 1),
message='message_4',
offline_reason='offline_reason_4',
recovery_action='recovery_action_4'),
]
keys = ndb.put_multi(note_entities)
# note4 will not be included in response because device_serial is unmatched.
api_request = {
'device_serial': 'device_1',
'ids': [keys[0].id(), keys[1].id(), keys[3].id()],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchGetNotes', api_request)
device_note_collection_msg = protojson.decode_message(
api_messages.NoteCollection, api_response.body)
note_msgs = device_note_collection_msg.notes
self.assertEqual(2, len(note_msgs))
self.assertEqual(note_msgs[0].device_serial, note_entities[0].device_serial)
self.assertEqual(note_msgs[0].user, note_entities[0].user)
self.assertEqual(note_msgs[0].timestamp,
note_entities[0].timestamp)
self.assertEqual(note_msgs[0].message, note_entities[0].message)
self.assertEqual(note_msgs[0].offline_reason,
note_entities[0].offline_reason)
self.assertEqual(note_msgs[0].recovery_action,
note_entities[0].recovery_action)
self.assertEqual(note_msgs[1].device_serial, note_entities[1].device_serial)
self.assertEqual(note_msgs[1].user, note_entities[1].user)
self.assertEqual(note_msgs[1].timestamp,
note_entities[1].timestamp)
self.assertEqual(note_msgs[1].message, note_entities[1].message)
self.assertEqual(note_msgs[1].offline_reason,
note_entities[1].offline_reason)
self.assertEqual(note_msgs[1].recovery_action,
note_entities[1].recovery_action)
def testDeleteDeviceNotes(self):
note_entities = [
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user1',
timestamp=datetime.datetime(1928, 1, 1),
message='message_1',
offline_reason='offline_reason_1',
recovery_action='recovery_action_1'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user2',
timestamp=datetime.datetime(1918, 1, 1),
message='message_2',
offline_reason='offline_reason_2',
recovery_action='recovery_action_2'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_1',
user='user3',
timestamp=datetime.datetime(1988, 1, 1),
message='message_3',
offline_reason='offline_reason_3',
recovery_action='recovery_action_3'),
datastore_entities.Note(
type=common.NoteType.DEVICE_NOTE,
device_serial='device_2',
user='user4',
timestamp=datetime.datetime(2008, 1, 1),
message='message_4',
offline_reason='offline_reason_4',
recovery_action='recovery_action_4'),
]
keys = ndb.put_multi(note_entities)
# When the ID does not match device serial, none of notes will be deleted.
api_request = {
'device_serial': 'device_2',
'ids': [keys[0].id(), keys[1].id(), keys[3].id(), 100],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchDeleteNotes', api_request,
expect_errors=True)
self.assertEqual('400 Bad Request', api_response.status)
self.assertLen(list(filter(None, ndb.get_multi(keys))), len(keys))
# When all IDs matches exactly, all requested notes get deleted.
api_request = {
'device_serial': 'device_1',
'ids': [keys[0].id(), keys[2].id()],
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchDeleteNotes', api_request)
self.assertEqual('200 OK', api_response.status)
self.assertCountEqual([note_entities[1].key.id(),
note_entities[3].key.id()],
[entity.key.id() for entity in ndb.get_multi(keys)
if entity])
def testListDeviceHistories(self):
"""Tests ListHistories returns all device histories."""
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
self.ndb_device_0.state = common.DeviceState.ALLOCATED
self.ndb_device_0.timestamp += datetime.timedelta(hours=1)
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
self.ndb_device_0.state = common.DeviceState.GONE
self.ndb_device_0.timestamp += datetime.timedelta(hours=1)
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
api_request = {'device_serial': self.ndb_device_0.device_serial}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListHistories', api_request)
device_history_collection = protojson.decode_message(
api_messages.DeviceInfoHistoryCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(3, len(device_history_collection.histories))
self.assertEqual(common.DeviceState.GONE,
device_history_collection.histories[0].state)
self.assertEqual(common.DeviceState.ALLOCATED,
device_history_collection.histories[1].state)
self.assertEqual(common.DeviceState.AVAILABLE,
device_history_collection.histories[2].state)
def testListDeviceHistories_withCursorAndOffsetAndBackwards(self):
"""Tests ListHistories returns histories applying a count and offset."""
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
self.ndb_device_0.state = common.DeviceState.ALLOCATED
self.ndb_device_0.timestamp += datetime.timedelta(hours=1)
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
self.ndb_device_0.state = common.DeviceState.GONE
self.ndb_device_0.timestamp += datetime.timedelta(hours=1)
device_manager._CreateDeviceInfoHistory(self.ndb_device_0).put()
# fetch first page
api_request = {'device_serial': self.ndb_device_0.device_serial, 'count': 2}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListHistories', api_request)
device_history_collection = protojson.decode_message(
api_messages.DeviceInfoHistoryCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_history_collection.histories))
self.assertEqual(common.DeviceState.GONE,
device_history_collection.histories[0].state)
self.assertEqual(common.DeviceState.ALLOCATED,
device_history_collection.histories[1].state)
self.assertIsNotNone(device_history_collection.next_cursor) # has next
# fetch next page
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'count': 2,
'cursor': device_history_collection.next_cursor
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListHistories', api_request)
device_history_collection = protojson.decode_message(
api_messages.DeviceInfoHistoryCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(1, len(device_history_collection.histories))
self.assertIsNone(device_history_collection.next_cursor) # no more results
self.assertIsNotNone(device_history_collection.prev_cursor) # has previous
# fetch previous page (same as first page)
api_request = {
'device_serial': self.ndb_device_0.device_serial,
'count': 2,
'cursor': device_history_collection.prev_cursor,
'backwards': True
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.ListHistories', api_request)
device_history_collection = protojson.decode_message(
api_messages.DeviceInfoHistoryCollection, api_response.body)
self.assertEqual('200 OK', api_response.status)
self.assertEqual(2, len(device_history_collection.histories))
self.assertEqual(common.DeviceState.GONE,
device_history_collection.histories[0].state)
self.assertEqual(common.DeviceState.ALLOCATED,
device_history_collection.histories[1].state)
self.assertIsNone(device_history_collection.prev_cursor) # first page
self.assertIsNotNone(device_history_collection.next_cursor)
def testBatchSetRecoveryState(self):
"""Tests BatchSetRecoveryState."""
api_request = {
'device_recovery_state_requests': [
{
'hostname': self.ndb_device_0.hostname,
'device_serial': self.ndb_device_0.device_serial,
'recovery_state': 'FIXED',
},
{
'hostname': self.ndb_device_1.hostname,
'device_serial': self.ndb_device_1.device_serial,
'recovery_state': 'FIXED',
},
]
}
api_response = self.testapp.post_json(
'/_ah/api/ClusterDeviceApi.BatchSetRecoveryState',
api_request)
self.assertEqual('200 OK', api_response.status)
self.ndb_device_0 = self.ndb_device_0.key.get()
self.assertEqual('FIXED', self.ndb_device_0.recovery_state)
self.ndb_device_1 = self.ndb_device_1.key.get()
self.assertEqual('FIXED', self.ndb_device_1.recovery_state)
if __name__ == '__main__':
unittest.main()
| 45.348802 | 80 | 0.678148 | 10,158 | 88,929 | 5.646387 | 0.044497 | 0.08918 | 0.042384 | 0.026118 | 0.881669 | 0.862456 | 0.840209 | 0.815259 | 0.795645 | 0.781209 | 0 | 0.019781 | 0.219478 | 88,929 | 1,960 | 81 | 45.371939 | 0.806544 | 0.070494 | 0 | 0.747106 | 0 | 0 | 0.112148 | 0.036978 | 0 | 0 | 0 | 0 | 0.220486 | 1 | 0.033565 | false | 0 | 0.007523 | 0 | 0.043403 | 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 |
49b819e50c6fb39a48c5bf17debfc9b573ca52a5 | 4,533 | py | Python | DQM/EcalMonitorTasks/python/RecoSummaryTask_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/EcalMonitorTasks/python/RecoSummaryTask_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/EcalMonitorTasks/python/RecoSummaryTask_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
ecalRecoSummaryTask = cms.untracked.PSet(
params = cms.untracked.PSet(
rechitThresholdEB = cms.untracked.double(0.8),
rechitThresholdEE = cms.untracked.double(1.2),
fillRecoFlagReduced = cms.untracked.bool(True)
),
MEs = cms.untracked.PSet(
EnergyMax = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sRecoSummary/recHits_%(subdetshortsig)s_energyMax'),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(100.),
low = cms.untracked.double(-10.),
nbins = cms.untracked.int32(110)
),
description = cms.untracked.string('Maximum energy of the rechit.')
),
Chi2 = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/recHits_%(subdetshortsig)s_Chi2"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(100.),
low = cms.untracked.double(0.),
nbins = cms.untracked.int32(100)
),
description = cms.untracked.string('Chi2 of the pulse reconstruction.')
),
Time = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/recHits_%(subdetshortsig)s_time"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(50.),
low = cms.untracked.double(-50.),
nbins = cms.untracked.int32(100)
),
description = cms.untracked.string('Rechit time.')
),
SwissCross = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/recHits_%(subdetshort)s_E1oE4"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('EB'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(1.5),
low = cms.untracked.double(0.),
nbins = cms.untracked.int32(100)
),
description = cms.untracked.string('Swiss cross.')
),
RecoFlagAll = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/recHits_%(subdetshort)s_recoFlag"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal2P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(15.5),
low = cms.untracked.double(-0.5),
nbins = cms.untracked.int32(16)
),
description = cms.untracked.string('Reconstruction flags from all rechits.')
),
RecoFlagReduced = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/redRecHits_%(subdetshort)s_recoFlag"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal2P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(15.5),
low = cms.untracked.double(-0.5),
nbins = cms.untracked.int32(16)
),
description = cms.untracked.string('Reconstruction flags from reduced rechits.')
),
RecoFlagBasicCluster = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sRecoSummary/basicClusters_recHits_%(subdetshort)s_recoFlag"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal2P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(15.5),
low = cms.untracked.double(-0.5),
nbins = cms.untracked.int32(16)
),
description = cms.untracked.string('Reconstruction flags from rechits in basic clusters.')
)
)
)
| 47.21875 | 123 | 0.566512 | 452 | 4,533 | 5.64823 | 0.172566 | 0.357227 | 0.246769 | 0.054837 | 0.786917 | 0.786917 | 0.786526 | 0.786526 | 0.786526 | 0.746181 | 0 | 0.026704 | 0.297816 | 4,533 | 95 | 124 | 47.715789 | 0.775369 | 0 | 0 | 0.606383 | 0 | 0 | 0.172733 | 0.103905 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.010638 | 0 | 0.010638 | 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 |
49fe7f09b9c7c98f87d9673b3c6d7674ddda5ce1 | 54,804 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py | a-santamaria/azure-sdk-for-python | 9dec418ad621ac75f217e56e901f15b6624800b0 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py | a-santamaria/azure-sdk-for-python | 9dec418ad621ac75f217e56e901f15b6624800b0 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py | a-santamaria/azure-sdk-for-python | 9dec418ad621ac75f217e56e901f15b6624800b0 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import pytest
import platform
import functools
import itertools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.pipeline.transport import AioHttpTransport
from azure.core.credentials import AzureKeyCredential
from multidict import CIMultiDict, CIMultiDictProxy
from testcase import GlobalTextAnalyticsAccountPreparer
from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPreparer
from asynctestcase import AsyncTextAnalyticsTest
from azure.ai.textanalytics.aio import TextAnalyticsClient
from azure.ai.textanalytics import (
TextDocumentInput,
VERSION,
TextAnalyticsApiVersion,
EntitiesRecognitionTask,
PiiEntitiesRecognitionTask,
KeyPhraseExtractionTask
)
# pre-apply the client_cls positional argument so it needn't be explicitly passed below
TextAnalyticsClientPreparer = functools.partial(_TextAnalyticsClientPreparer, TextAnalyticsClient)
class AiohttpTestTransport(AioHttpTransport):
"""Workaround to vcrpy bug: https://github.com/kevin1024/vcrpy/pull/461
"""
async def send(self, request, **config):
response = await super(AiohttpTestTransport, self).send(request, **config)
if not isinstance(response.headers, CIMultiDictProxy):
response.headers = CIMultiDictProxy(CIMultiDict(response.internal_response.headers))
response.content_type = response.headers.get("content-type")
return response
class TestAnalyzeAsync(AsyncTextAnalyticsTest):
def _interval(self):
return 5 if self.is_live else 0
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_no_single_input(self, client):
with self.assertRaises(TypeError):
response = await client.begin_analyze("hello world", polling_interval=self._interval())
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_dict_key_phrase_task(self, client):
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen"},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
async with client:
response = await (await client.begin_analyze(
docs,
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
show_stats=True,
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].key_phrase_extraction_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 2)
for phrases in results:
self.assertIn("Paul Allen", phrases.key_phrases)
self.assertIn("Bill Gates", phrases.key_phrases)
self.assertIn("Microsoft", phrases.key_phrases)
self.assertIsNotNone(phrases.id)
# self.assertIsNotNone(phrases.statistics)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_dict_entities_task(self, client):
docs = [
{"id": "1", "language": "en",
"text": "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975."},
{"id": "2", "language": "es",
"text": "Microsoft fue fundado por Bill Gates y Paul Allen el 4 de abril de 1975."},
{"id": "3", "language": "de",
"text": "Microsoft wurde am 4. April 1975 von Bill Gates und Paul Allen gegründet."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
show_stats=True,
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
for doc in results:
self.assertEqual(len(doc.entities), 4)
self.assertIsNotNone(doc.id)
# self.assertIsNotNone(doc.statistics)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_dict_pii_entities_task(self, client):
docs = [{"id": "1", "text": "My SSN is 859-98-0987."},
{"id": "2",
"text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."},
{"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
async with client:
response = await (await client.begin_analyze(
docs,
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
show_stats=True,
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].pii_entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
self.assertEqual(results[0].entities[0].text, "859-98-0987")
self.assertEqual(results[0].entities[0].category, "U.S. Social Security Number (SSN)")
self.assertEqual(results[1].entities[0].text, "111000025")
# self.assertEqual(results[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
self.assertEqual(results[2].entities[0].text, "998.214.865-68")
self.assertEqual(results[2].entities[0].category, "Brazil CPF Number")
for doc in results:
self.assertIsNotNone(doc.id)
# self.assertIsNotNone(doc.statistics)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_text_document_input_key_phrase_task(self, client):
docs = [
TextDocumentInput(id="1", text="Microsoft was founded by Bill Gates and Paul Allen", language="en"),
TextDocumentInput(id="2", text="Microsoft fue fundado por Bill Gates y Paul Allen", language="es")
]
async with client:
response = await (await client.begin_analyze(
docs,
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
key_phrase_task_results = results_pages[0].key_phrase_extraction_results
self.assertEqual(len(key_phrase_task_results), 1)
results = key_phrase_task_results[0].results
self.assertEqual(len(results), 2)
for phrases in results:
self.assertIn("Paul Allen", phrases.key_phrases)
self.assertIn("Bill Gates", phrases.key_phrases)
self.assertIn("Microsoft", phrases.key_phrases)
self.assertIsNotNone(phrases.id)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_text_document_input_entities_task(self, client):
docs = [
TextDocumentInput(id="1", text="Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975.",
language="en"),
TextDocumentInput(id="2", text="Microsoft fue fundado por Bill Gates y Paul Allen el 4 de abril de 1975.",
language="es"),
TextDocumentInput(id="3", text="Microsoft wurde am 4. April 1975 von Bill Gates und Paul Allen gegründet.",
language="de")
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
for doc in results:
self.assertEqual(len(doc.entities), 4)
self.assertIsNotNone(doc.id)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_all_successful_passing_text_document_input_pii_entities_task(self, client):
docs = [
TextDocumentInput(id="1", text="My SSN is 859-98-0987."),
TextDocumentInput(id="2",
text="Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."),
TextDocumentInput(id="3", text="Is 998.214.865-68 your Brazilian CPF number?")
]
async with client:
response = await (await client.begin_analyze(
docs,
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].pii_entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
self.assertEqual(results[0].entities[0].text, "859-98-0987")
self.assertEqual(results[0].entities[0].category, "U.S. Social Security Number (SSN)")
self.assertEqual(results[1].entities[0].text, "111000025")
# self.assertEqual(results[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
self.assertEqual(results[2].entities[0].text, "998.214.865-68")
self.assertEqual(results[2].entities[0].category, "Brazil CPF Number")
for doc in results:
self.assertIsNotNone(doc.id)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_passing_only_string_key_phrase_task(self, client):
docs = [
u"Microsoft was founded by Bill Gates and Paul Allen",
u"Microsoft fue fundado por Bill Gates y Paul Allen"
]
async with client:
response = await (await client.begin_analyze(
docs,
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
key_phrase_task_results = results_pages[0].key_phrase_extraction_results
self.assertEqual(len(key_phrase_task_results), 1)
results = key_phrase_task_results[0].results
self.assertEqual(len(results), 2)
self.assertIn("Paul Allen", results[0].key_phrases)
self.assertIn("Bill Gates", results[0].key_phrases)
self.assertIn("Microsoft", results[0].key_phrases)
self.assertIsNotNone(results[0].id)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_bad_request_on_empty_document(self, client):
docs = [u""]
with self.assertRaises(HttpResponseError):
async with client:
response = await (await client.begin_analyze(
docs,
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
polling_interval=self._interval()
)).result()
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_passing_only_string_entities_task(self, client):
docs = [
u"Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975.",
u"Microsoft fue fundado por Bill Gates y Paul Allen el 4 de abril de 1975.",
u"Microsoft wurde am 4. April 1975 von Bill Gates und Paul Allen gegründet."
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
self.assertEqual(len(results[0].entities), 4)
self.assertIsNotNone(results[0].id)
for entity in results[0].entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_passing_only_string_pii_entities_task(self, client):
docs = [
u"My SSN is 859-98-0987.",
u"Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check.",
u"Is 998.214.865-68 your Brazilian CPF number?"
]
async with client:
response = await (await client.begin_analyze(
docs,
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_results = results_pages[0].pii_entities_recognition_results
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 3)
self.assertEqual(results[0].entities[0].text, "859-98-0987")
self.assertEqual(results[0].entities[0].category, "U.S. Social Security Number (SSN)")
self.assertEqual(results[1].entities[0].text, "111000025")
# self.assertEqual(results[1].entities[0].category, "ABA Routing Number") # Service is currently returning PhoneNumber here
self.assertEqual(results[2].entities[0].text, "998.214.865-68")
self.assertEqual(results[2].entities[0].category, "Brazil CPF Number")
for i in range(3):
self.assertIsNotNone(results[i].id)
for entity in results[i].entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.category)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.confidence_score)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_output_same_order_as_input_multiple_tasks(self, client):
docs = [
TextDocumentInput(id="1", text="one"),
TextDocumentInput(id="2", text="two"),
TextDocumentInput(id="3", text="three"),
TextDocumentInput(id="4", text="four"),
TextDocumentInput(id="5", text="five")
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), 5)
for idx, doc in enumerate(results):
self.assertEqual(str(idx + 1), doc.id)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={
"text_analytics_account_key": "",
})
async def test_empty_credential_class(self, client):
with self.assertRaises(ClientAuthenticationError):
async with client:
response = await client.begin_analyze(
["This is written in English."],
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={
"text_analytics_account_key": "xxxxxxxxxxxx"
})
async def test_bad_credentials(self, client):
with self.assertRaises(ClientAuthenticationError):
async with client:
response = await client.begin_analyze(
["This is written in English."],
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_bad_document_input(self, client):
docs = "This is the wrong type"
with self.assertRaises(TypeError):
async with client:
response = await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_mixing_inputs(self, client):
docs = [
{"id": "1", "text": "Microsoft was founded by Bill Gates and Paul Allen."},
TextDocumentInput(id="2", text="I did not like the hotel we stayed at. It was too expensive."),
u"You cannot mix string input with the above inputs"
]
with self.assertRaises(TypeError):
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_out_of_order_ids_multiple_tasks(self, client):
docs = [{"id": "56", "text": ":)"},
{"id": "0", "text": ":("},
{"id": "19", "text": ":P"},
{"id": "1", "text": ":D"}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="bad")],
# at this moment this should cause all documents to be errors, which isn't correct behavior but I'm using it here to test document ordering with errors. :)
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
in_order = ["56", "0", "19", "1"]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), len(docs))
for idx, resp in enumerate(results):
self.assertEqual(resp.id, in_order[idx])
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_show_stats_and_model_version_multiple_tasks(self, client):
docs = [{"id": "56", "text": ":)"},
{"id": "0", "text": ":("},
{"id": "19", "text": ":P"},
{"id": "1", "text": ":D"}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="latest")],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask(model_version="latest")],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask(model_version="latest")],
show_stats=True,
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), len(docs))
# self.assertEqual(results.statistics.document_count, 5)
# self.assertEqual(results.statistics.transaction_count, 4)
# self.assertEqual(results.statistics.valid_document_count, 4)
# self.assertEqual(results.statistics.erroneous_document_count, 1)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_language_hint(self, client):
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed at. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="en",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_dont_use_language_hint(self, client):
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed at. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_per_item_dont_use_language_hint(self, client):
docs = [{"id": "1", "language": "", "text": "I will go to the park."},
{"id": "2", "language": "", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_language_hint_and_obj_input(self, client):
async def callback(resp):
language_str = "\"language\": \"de\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [
TextDocumentInput(id="1", text="I should take my cat to the veterinarian."),
TextDocumentInput(id="4", text="Este es un document escrito en Español."),
TextDocumentInput(id="3", text="猫は幸せ"),
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="en",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_language_hint_and_dict_input(self, client):
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="en",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_language_hint_and_obj_per_item_hints(self, client):
docs = [
TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="en"),
TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="en"),
TextDocumentInput(id="3", text="猫は幸せ"),
]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="en",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_whole_batch_language_hint_and_dict_per_item_hints(self, client):
docs = [{"id": "1", "language": "en", "text": "I will go to the park."},
{"id": "2", "language": "en", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
language="en",
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
task_results = getattr(results_pages[0], task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
for r in results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={
"default_language": "en"
})
async def test_client_passed_default_language_hint(self, client):
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
tasks = getattr(results_pages[0], task_type)
self.assertEqual(len(tasks), 1)
self.assertEqual(len(tasks[0].results), 3)
for r in tasks[0].results:
self.assertFalse(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_invalid_language_hint_method(self, client):
async with client:
response = await (await client.begin_analyze(
["This should fail because we're passing in an invalid language hint"],
language="notalanguage",
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
tasks = getattr(results_pages[0], task_type)
self.assertEqual(len(tasks), 1)
for r in tasks[0].results:
self.assertTrue(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_invalid_language_hint_docs(self, client):
async with client:
response = await (await client.begin_analyze(
[{"id": "1", "language": "notalanguage",
"text": "This should fail because we're passing in an invalid language hint"}],
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
tasks = getattr(results_pages[0], task_type)
self.assertEqual(len(tasks), 1)
for r in tasks[0].results:
self.assertTrue(r.is_error)
@GlobalTextAnalyticsAccountPreparer()
async def test_rotate_subscription_key(self, resource_group, location, text_analytics_account,
text_analytics_account_key):
credential = AzureKeyCredential(text_analytics_account_key)
client = TextAnalyticsClient(text_analytics_account, credential)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
self.assertIsNotNone(response)
credential.update("xxx") # Make authentication fail
with self.assertRaises(ClientAuthenticationError):
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
credential.update(text_analytics_account_key) # Authenticate successfully again
response = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
self.assertIsNotNone(response)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_user_agent(self, client):
async def callback(resp):
self.assertIn("azsdk-python-ai-textanalytics/{} Python/{} ({})".format(
VERSION, platform.python_version(), platform.platform()),
resp.http_request.headers["User-Agent"]
)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed at."},
{"id": "3", "text": "The restaurant had really good food."}]
async with client:
poller = await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
self.assertIn("azsdk-python-ai-textanalytics/{} Python/{} ({})".format(
VERSION, platform.python_version(), platform.platform()),
poller._polling_method._initial_response.http_request.headers["User-Agent"]
)
await poller.result() # need to call this before tearDown runs even though we don't need the response for the test.
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_bad_model_version_error_single_task(self, client): # TODO: verify behavior of service
docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}]
with self.assertRaises(HttpResponseError):
async with client:
result = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="bad")],
polling_interval=self._interval()
)).result()
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_bad_model_version_error_multiple_tasks(self, client): # TODO: verify behavior of service
docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}]
async with client:
response = await(await
client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="latest")],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask(model_version="bad")],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask(model_version="bad")],
polling_interval=self._interval()
)).result()
results_pages = []
async for p in response:
results_pages.append(p)
self.assertEqual(len(results_pages), 1)
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
for task_type in task_types:
tasks = getattr(results_pages[0], task_type) # only expecting a single page of results here
self.assertEqual(len(tasks), 1)
for r in tasks[0].results:
self.assertTrue(
r.is_error) # This is not the optimal way to represent this failure. We are discussing this with the service team.
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_bad_model_version_error_all_tasks(self, client): # TODO: verify behavior of service
docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}]
with self.assertRaises(HttpResponseError):
async with client:
result = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="bad")],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask(model_version="bad")],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask(model_version="bad")],
polling_interval=self._interval()
)).result()
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_not_passing_list_for_docs(self, client):
docs = {"id": "1", "text": "hello world"}
with pytest.raises(TypeError) as excinfo:
async with client:
await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
assert "Input documents cannot be a dict" in str(excinfo.value)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_missing_input_records_error(self, client):
docs = []
with pytest.raises(ValueError) as excinfo:
async with client:
await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
assert "Input documents can not be empty or None" in str(excinfo.value)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_passing_none_docs(self, client):
with pytest.raises(ValueError) as excinfo:
async with client:
await client.begin_analyze(None, polling_interval=self._interval())
assert "Input documents can not be empty or None" in str(excinfo.value)
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_duplicate_ids_error(self, client): # TODO: verify behavior of service
# Duplicate Ids
docs = [{"id": "1", "text": "hello world"},
{"id": "1", "text": "I did not like the hotel we stayed at."}]
with self.assertRaises(HttpResponseError):
async with client:
result = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_pass_cls(self, client):
def callback(pipeline_response, deserialized, _):
return "cls result"
async with client:
res = await (await client.begin_analyze(
documents=["Test passing cls to endpoint"],
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
cls=callback,
polling_interval=self._interval()
)).result()
assert res == "cls result"
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_multiple_pages_of_results_returned_successfully(self, client):
single_doc = "hello world"
docs = [{"id": str(idx), "text": val} for (idx, val) in
enumerate(list(itertools.repeat(single_doc, 25)))] # max number of documents is 25
async with client:
result = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
show_stats=True,
polling_interval=self._interval()
)).result()
pages = []
async for p in result:
pages.append(p)
self.assertEqual(len(pages), 2) # default page size is 20
# self.assertIsNotNone(result.statistics) # statistics not working at the moment, but a bug has been filed on the service to correct this.
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
expected_results_per_page = [20, 5]
for idx, page in enumerate(pages):
for task_type in task_types:
task_results = getattr(page, task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), expected_results_per_page[idx])
for doc in results:
self.assertFalse(doc.is_error)
# self.assertIsNotNone(doc.statistics)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_multiple_pages_of_results_with_errors_returned_successfully(self, client):
single_doc = "hello world"
docs = [{"id": str(idx), "text": val} for (idx, val) in
enumerate(list(itertools.repeat(single_doc, 25)))] # max number of documents is 25
async with client:
result = await (await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="bad")],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)).result()
pages = []
async for p in result:
pages.append(p)
self.assertEqual(len(pages), 2) # default page size is 20
task_types = [
"entities_recognition_results",
"key_phrase_extraction_results",
"pii_entities_recognition_results"
]
expected_results_per_page = [20, 5]
for idx, page in enumerate(pages):
for task_type in task_types:
task_results = getattr(page, task_type)
self.assertEqual(len(task_results), 1)
results = task_results[0].results
self.assertEqual(len(results), expected_results_per_page[idx])
for doc in results:
if task_type == "entities_recognition_results":
self.assertTrue(doc.is_error)
else:
self.assertFalse(doc.is_error)
@pytest.mark.playback_test_only
@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer()
async def test_too_many_documents(self, client):
docs = list(itertools.repeat("input document", 26)) # Maximum number of documents per request is 25
with pytest.raises(HttpResponseError) as excinfo:
async with client:
await client.begin_analyze(
docs,
entities_recognition_tasks=[EntitiesRecognitionTask()],
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_tasks=[PiiEntitiesRecognitionTask()],
polling_interval=self._interval()
)
assert excinfo.value.status_code == 400
| 42.782201 | 172 | 0.601325 | 5,258 | 54,804 | 6.048498 | 0.076645 | 0.063327 | 0.038487 | 0.031098 | 0.878408 | 0.858284 | 0.842279 | 0.833223 | 0.829513 | 0.811024 | 0 | 0.012946 | 0.306529 | 54,804 | 1,280 | 173 | 42.815625 | 0.823865 | 0.035782 | 0 | 0.789374 | 0 | 0.002846 | 0.110303 | 0.029697 | 0 | 0 | 0 | 0.000781 | 0.152751 | 1 | 0.001898 | false | 0.01518 | 0.013283 | 0.001898 | 0.019924 | 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 |
b70ef55496c3ca28f58683ef4812ccb064812813 | 48,144 | py | Python | sdk/python/pulumi_vault/pkisecret/secret_backend_root_cert.py | pulumi/pulumi-vault | 1682875f4a5d7d508f36e166529ad2b8aec34090 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2019-10-07T17:44:18.000Z | 2022-03-30T20:46:33.000Z | sdk/python/pulumi_vault/pkisecret/secret_backend_root_cert.py | pulumi/pulumi-vault | 1682875f4a5d7d508f36e166529ad2b8aec34090 | [
"ECL-2.0",
"Apache-2.0"
] | 79 | 2019-10-11T18:13:07.000Z | 2022-03-31T21:09:41.000Z | sdk/python/pulumi_vault/pkisecret/secret_backend_root_cert.py | pulumi/pulumi-vault | 1682875f4a5d7d508f36e166529ad2b8aec34090 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-28T10:08:40.000Z | 2020-03-17T14:20:55.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
__all__ = ['SecretBackendRootCertArgs', 'SecretBackendRootCert']
@pulumi.input_type
class SecretBackendRootCertArgs:
def __init__(__self__, *,
backend: pulumi.Input[str],
common_name: pulumi.Input[str],
type: pulumi.Input[str],
alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
country: Optional[pulumi.Input[str]] = None,
exclude_cn_from_sans: Optional[pulumi.Input[bool]] = None,
format: Optional[pulumi.Input[str]] = None,
ip_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
key_bits: Optional[pulumi.Input[int]] = None,
key_type: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
max_path_length: Optional[pulumi.Input[int]] = None,
organization: Optional[pulumi.Input[str]] = None,
other_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ou: Optional[pulumi.Input[str]] = None,
permitted_dns_domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
private_key_format: Optional[pulumi.Input[str]] = None,
province: Optional[pulumi.Input[str]] = None,
street_address: Optional[pulumi.Input[str]] = None,
ttl: Optional[pulumi.Input[str]] = None,
uri_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
The set of arguments for constructing a SecretBackendRootCert resource.
:param pulumi.Input[str] backend: The PKI secret backend the resource belongs to.
:param pulumi.Input[str] common_name: CN of intermediate to create
:param pulumi.Input[str] type: Type of intermediate to create. Must be either \"exported\" or \"internal\"
:param pulumi.Input[Sequence[pulumi.Input[str]]] alt_names: List of alternative names
:param pulumi.Input[str] country: The country
:param pulumi.Input[bool] exclude_cn_from_sans: Flag to exclude CN from SANs
:param pulumi.Input[str] format: The format of data
:param pulumi.Input[Sequence[pulumi.Input[str]]] ip_sans: List of alternative IPs
:param pulumi.Input[int] key_bits: The number of bits to use
:param pulumi.Input[str] key_type: The desired key type
:param pulumi.Input[str] locality: The locality
:param pulumi.Input[int] max_path_length: The maximum path length to encode in the generated certificate
:param pulumi.Input[str] organization: The organization
:param pulumi.Input[Sequence[pulumi.Input[str]]] other_sans: List of other SANs
:param pulumi.Input[str] ou: The organization unit
:param pulumi.Input[Sequence[pulumi.Input[str]]] permitted_dns_domains: List of domains for which certificates are allowed to be issued
:param pulumi.Input[str] postal_code: The postal code
:param pulumi.Input[str] private_key_format: The private key format
:param pulumi.Input[str] province: The province
:param pulumi.Input[str] street_address: The street address
:param pulumi.Input[str] ttl: Time to live
:param pulumi.Input[Sequence[pulumi.Input[str]]] uri_sans: List of alternative URIs
"""
pulumi.set(__self__, "backend", backend)
pulumi.set(__self__, "common_name", common_name)
pulumi.set(__self__, "type", type)
if alt_names is not None:
pulumi.set(__self__, "alt_names", alt_names)
if country is not None:
pulumi.set(__self__, "country", country)
if exclude_cn_from_sans is not None:
pulumi.set(__self__, "exclude_cn_from_sans", exclude_cn_from_sans)
if format is not None:
pulumi.set(__self__, "format", format)
if ip_sans is not None:
pulumi.set(__self__, "ip_sans", ip_sans)
if key_bits is not None:
pulumi.set(__self__, "key_bits", key_bits)
if key_type is not None:
pulumi.set(__self__, "key_type", key_type)
if locality is not None:
pulumi.set(__self__, "locality", locality)
if max_path_length is not None:
pulumi.set(__self__, "max_path_length", max_path_length)
if organization is not None:
pulumi.set(__self__, "organization", organization)
if other_sans is not None:
pulumi.set(__self__, "other_sans", other_sans)
if ou is not None:
pulumi.set(__self__, "ou", ou)
if permitted_dns_domains is not None:
pulumi.set(__self__, "permitted_dns_domains", permitted_dns_domains)
if postal_code is not None:
pulumi.set(__self__, "postal_code", postal_code)
if private_key_format is not None:
pulumi.set(__self__, "private_key_format", private_key_format)
if province is not None:
pulumi.set(__self__, "province", province)
if street_address is not None:
pulumi.set(__self__, "street_address", street_address)
if ttl is not None:
pulumi.set(__self__, "ttl", ttl)
if uri_sans is not None:
pulumi.set(__self__, "uri_sans", uri_sans)
@property
@pulumi.getter
def backend(self) -> pulumi.Input[str]:
"""
The PKI secret backend the resource belongs to.
"""
return pulumi.get(self, "backend")
@backend.setter
def backend(self, value: pulumi.Input[str]):
pulumi.set(self, "backend", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Input[str]:
"""
CN of intermediate to create
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: pulumi.Input[str]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter
def type(self) -> pulumi.Input[str]:
"""
Type of intermediate to create. Must be either \"exported\" or \"internal\"
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: pulumi.Input[str]):
pulumi.set(self, "type", value)
@property
@pulumi.getter(name="altNames")
def alt_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative names
"""
return pulumi.get(self, "alt_names")
@alt_names.setter
def alt_names(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "alt_names", value)
@property
@pulumi.getter
def country(self) -> Optional[pulumi.Input[str]]:
"""
The country
"""
return pulumi.get(self, "country")
@country.setter
def country(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "country", value)
@property
@pulumi.getter(name="excludeCnFromSans")
def exclude_cn_from_sans(self) -> Optional[pulumi.Input[bool]]:
"""
Flag to exclude CN from SANs
"""
return pulumi.get(self, "exclude_cn_from_sans")
@exclude_cn_from_sans.setter
def exclude_cn_from_sans(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "exclude_cn_from_sans", value)
@property
@pulumi.getter
def format(self) -> Optional[pulumi.Input[str]]:
"""
The format of data
"""
return pulumi.get(self, "format")
@format.setter
def format(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "format", value)
@property
@pulumi.getter(name="ipSans")
def ip_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative IPs
"""
return pulumi.get(self, "ip_sans")
@ip_sans.setter
def ip_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ip_sans", value)
@property
@pulumi.getter(name="keyBits")
def key_bits(self) -> Optional[pulumi.Input[int]]:
"""
The number of bits to use
"""
return pulumi.get(self, "key_bits")
@key_bits.setter
def key_bits(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "key_bits", value)
@property
@pulumi.getter(name="keyType")
def key_type(self) -> Optional[pulumi.Input[str]]:
"""
The desired key type
"""
return pulumi.get(self, "key_type")
@key_type.setter
def key_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "key_type", value)
@property
@pulumi.getter
def locality(self) -> Optional[pulumi.Input[str]]:
"""
The locality
"""
return pulumi.get(self, "locality")
@locality.setter
def locality(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "locality", value)
@property
@pulumi.getter(name="maxPathLength")
def max_path_length(self) -> Optional[pulumi.Input[int]]:
"""
The maximum path length to encode in the generated certificate
"""
return pulumi.get(self, "max_path_length")
@max_path_length.setter
def max_path_length(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "max_path_length", value)
@property
@pulumi.getter
def organization(self) -> Optional[pulumi.Input[str]]:
"""
The organization
"""
return pulumi.get(self, "organization")
@organization.setter
def organization(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "organization", value)
@property
@pulumi.getter(name="otherSans")
def other_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of other SANs
"""
return pulumi.get(self, "other_sans")
@other_sans.setter
def other_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "other_sans", value)
@property
@pulumi.getter
def ou(self) -> Optional[pulumi.Input[str]]:
"""
The organization unit
"""
return pulumi.get(self, "ou")
@ou.setter
def ou(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "ou", value)
@property
@pulumi.getter(name="permittedDnsDomains")
def permitted_dns_domains(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of domains for which certificates are allowed to be issued
"""
return pulumi.get(self, "permitted_dns_domains")
@permitted_dns_domains.setter
def permitted_dns_domains(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "permitted_dns_domains", value)
@property
@pulumi.getter(name="postalCode")
def postal_code(self) -> Optional[pulumi.Input[str]]:
"""
The postal code
"""
return pulumi.get(self, "postal_code")
@postal_code.setter
def postal_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "postal_code", value)
@property
@pulumi.getter(name="privateKeyFormat")
def private_key_format(self) -> Optional[pulumi.Input[str]]:
"""
The private key format
"""
return pulumi.get(self, "private_key_format")
@private_key_format.setter
def private_key_format(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "private_key_format", value)
@property
@pulumi.getter
def province(self) -> Optional[pulumi.Input[str]]:
"""
The province
"""
return pulumi.get(self, "province")
@province.setter
def province(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "province", value)
@property
@pulumi.getter(name="streetAddress")
def street_address(self) -> Optional[pulumi.Input[str]]:
"""
The street address
"""
return pulumi.get(self, "street_address")
@street_address.setter
def street_address(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "street_address", value)
@property
@pulumi.getter
def ttl(self) -> Optional[pulumi.Input[str]]:
"""
Time to live
"""
return pulumi.get(self, "ttl")
@ttl.setter
def ttl(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "ttl", value)
@property
@pulumi.getter(name="uriSans")
def uri_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative URIs
"""
return pulumi.get(self, "uri_sans")
@uri_sans.setter
def uri_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "uri_sans", value)
@pulumi.input_type
class _SecretBackendRootCertState:
def __init__(__self__, *,
alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
backend: Optional[pulumi.Input[str]] = None,
certificate: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
country: Optional[pulumi.Input[str]] = None,
exclude_cn_from_sans: Optional[pulumi.Input[bool]] = None,
format: Optional[pulumi.Input[str]] = None,
ip_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_ca: Optional[pulumi.Input[str]] = None,
key_bits: Optional[pulumi.Input[int]] = None,
key_type: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
max_path_length: Optional[pulumi.Input[int]] = None,
organization: Optional[pulumi.Input[str]] = None,
other_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ou: Optional[pulumi.Input[str]] = None,
permitted_dns_domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
private_key_format: Optional[pulumi.Input[str]] = None,
province: Optional[pulumi.Input[str]] = None,
serial: Optional[pulumi.Input[str]] = None,
street_address: Optional[pulumi.Input[str]] = None,
ttl: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
uri_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
Input properties used for looking up and filtering SecretBackendRootCert resources.
:param pulumi.Input[Sequence[pulumi.Input[str]]] alt_names: List of alternative names
:param pulumi.Input[str] backend: The PKI secret backend the resource belongs to.
:param pulumi.Input[str] certificate: The certificate
:param pulumi.Input[str] common_name: CN of intermediate to create
:param pulumi.Input[str] country: The country
:param pulumi.Input[bool] exclude_cn_from_sans: Flag to exclude CN from SANs
:param pulumi.Input[str] format: The format of data
:param pulumi.Input[Sequence[pulumi.Input[str]]] ip_sans: List of alternative IPs
:param pulumi.Input[str] issuing_ca: The issuing CA
:param pulumi.Input[int] key_bits: The number of bits to use
:param pulumi.Input[str] key_type: The desired key type
:param pulumi.Input[str] locality: The locality
:param pulumi.Input[int] max_path_length: The maximum path length to encode in the generated certificate
:param pulumi.Input[str] organization: The organization
:param pulumi.Input[Sequence[pulumi.Input[str]]] other_sans: List of other SANs
:param pulumi.Input[str] ou: The organization unit
:param pulumi.Input[Sequence[pulumi.Input[str]]] permitted_dns_domains: List of domains for which certificates are allowed to be issued
:param pulumi.Input[str] postal_code: The postal code
:param pulumi.Input[str] private_key_format: The private key format
:param pulumi.Input[str] province: The province
:param pulumi.Input[str] serial: The serial
:param pulumi.Input[str] street_address: The street address
:param pulumi.Input[str] ttl: Time to live
:param pulumi.Input[str] type: Type of intermediate to create. Must be either \"exported\" or \"internal\"
:param pulumi.Input[Sequence[pulumi.Input[str]]] uri_sans: List of alternative URIs
"""
if alt_names is not None:
pulumi.set(__self__, "alt_names", alt_names)
if backend is not None:
pulumi.set(__self__, "backend", backend)
if certificate is not None:
pulumi.set(__self__, "certificate", certificate)
if common_name is not None:
pulumi.set(__self__, "common_name", common_name)
if country is not None:
pulumi.set(__self__, "country", country)
if exclude_cn_from_sans is not None:
pulumi.set(__self__, "exclude_cn_from_sans", exclude_cn_from_sans)
if format is not None:
pulumi.set(__self__, "format", format)
if ip_sans is not None:
pulumi.set(__self__, "ip_sans", ip_sans)
if issuing_ca is not None:
pulumi.set(__self__, "issuing_ca", issuing_ca)
if key_bits is not None:
pulumi.set(__self__, "key_bits", key_bits)
if key_type is not None:
pulumi.set(__self__, "key_type", key_type)
if locality is not None:
pulumi.set(__self__, "locality", locality)
if max_path_length is not None:
pulumi.set(__self__, "max_path_length", max_path_length)
if organization is not None:
pulumi.set(__self__, "organization", organization)
if other_sans is not None:
pulumi.set(__self__, "other_sans", other_sans)
if ou is not None:
pulumi.set(__self__, "ou", ou)
if permitted_dns_domains is not None:
pulumi.set(__self__, "permitted_dns_domains", permitted_dns_domains)
if postal_code is not None:
pulumi.set(__self__, "postal_code", postal_code)
if private_key_format is not None:
pulumi.set(__self__, "private_key_format", private_key_format)
if province is not None:
pulumi.set(__self__, "province", province)
if serial is not None:
pulumi.set(__self__, "serial", serial)
if street_address is not None:
pulumi.set(__self__, "street_address", street_address)
if ttl is not None:
pulumi.set(__self__, "ttl", ttl)
if type is not None:
pulumi.set(__self__, "type", type)
if uri_sans is not None:
pulumi.set(__self__, "uri_sans", uri_sans)
@property
@pulumi.getter(name="altNames")
def alt_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative names
"""
return pulumi.get(self, "alt_names")
@alt_names.setter
def alt_names(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "alt_names", value)
@property
@pulumi.getter
def backend(self) -> Optional[pulumi.Input[str]]:
"""
The PKI secret backend the resource belongs to.
"""
return pulumi.get(self, "backend")
@backend.setter
def backend(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "backend", value)
@property
@pulumi.getter
def certificate(self) -> Optional[pulumi.Input[str]]:
"""
The certificate
"""
return pulumi.get(self, "certificate")
@certificate.setter
def certificate(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "certificate", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> Optional[pulumi.Input[str]]:
"""
CN of intermediate to create
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter
def country(self) -> Optional[pulumi.Input[str]]:
"""
The country
"""
return pulumi.get(self, "country")
@country.setter
def country(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "country", value)
@property
@pulumi.getter(name="excludeCnFromSans")
def exclude_cn_from_sans(self) -> Optional[pulumi.Input[bool]]:
"""
Flag to exclude CN from SANs
"""
return pulumi.get(self, "exclude_cn_from_sans")
@exclude_cn_from_sans.setter
def exclude_cn_from_sans(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "exclude_cn_from_sans", value)
@property
@pulumi.getter
def format(self) -> Optional[pulumi.Input[str]]:
"""
The format of data
"""
return pulumi.get(self, "format")
@format.setter
def format(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "format", value)
@property
@pulumi.getter(name="ipSans")
def ip_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative IPs
"""
return pulumi.get(self, "ip_sans")
@ip_sans.setter
def ip_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ip_sans", value)
@property
@pulumi.getter(name="issuingCa")
def issuing_ca(self) -> Optional[pulumi.Input[str]]:
"""
The issuing CA
"""
return pulumi.get(self, "issuing_ca")
@issuing_ca.setter
def issuing_ca(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "issuing_ca", value)
@property
@pulumi.getter(name="keyBits")
def key_bits(self) -> Optional[pulumi.Input[int]]:
"""
The number of bits to use
"""
return pulumi.get(self, "key_bits")
@key_bits.setter
def key_bits(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "key_bits", value)
@property
@pulumi.getter(name="keyType")
def key_type(self) -> Optional[pulumi.Input[str]]:
"""
The desired key type
"""
return pulumi.get(self, "key_type")
@key_type.setter
def key_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "key_type", value)
@property
@pulumi.getter
def locality(self) -> Optional[pulumi.Input[str]]:
"""
The locality
"""
return pulumi.get(self, "locality")
@locality.setter
def locality(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "locality", value)
@property
@pulumi.getter(name="maxPathLength")
def max_path_length(self) -> Optional[pulumi.Input[int]]:
"""
The maximum path length to encode in the generated certificate
"""
return pulumi.get(self, "max_path_length")
@max_path_length.setter
def max_path_length(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "max_path_length", value)
@property
@pulumi.getter
def organization(self) -> Optional[pulumi.Input[str]]:
"""
The organization
"""
return pulumi.get(self, "organization")
@organization.setter
def organization(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "organization", value)
@property
@pulumi.getter(name="otherSans")
def other_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of other SANs
"""
return pulumi.get(self, "other_sans")
@other_sans.setter
def other_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "other_sans", value)
@property
@pulumi.getter
def ou(self) -> Optional[pulumi.Input[str]]:
"""
The organization unit
"""
return pulumi.get(self, "ou")
@ou.setter
def ou(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "ou", value)
@property
@pulumi.getter(name="permittedDnsDomains")
def permitted_dns_domains(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of domains for which certificates are allowed to be issued
"""
return pulumi.get(self, "permitted_dns_domains")
@permitted_dns_domains.setter
def permitted_dns_domains(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "permitted_dns_domains", value)
@property
@pulumi.getter(name="postalCode")
def postal_code(self) -> Optional[pulumi.Input[str]]:
"""
The postal code
"""
return pulumi.get(self, "postal_code")
@postal_code.setter
def postal_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "postal_code", value)
@property
@pulumi.getter(name="privateKeyFormat")
def private_key_format(self) -> Optional[pulumi.Input[str]]:
"""
The private key format
"""
return pulumi.get(self, "private_key_format")
@private_key_format.setter
def private_key_format(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "private_key_format", value)
@property
@pulumi.getter
def province(self) -> Optional[pulumi.Input[str]]:
"""
The province
"""
return pulumi.get(self, "province")
@province.setter
def province(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "province", value)
@property
@pulumi.getter
def serial(self) -> Optional[pulumi.Input[str]]:
"""
The serial
"""
return pulumi.get(self, "serial")
@serial.setter
def serial(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "serial", value)
@property
@pulumi.getter(name="streetAddress")
def street_address(self) -> Optional[pulumi.Input[str]]:
"""
The street address
"""
return pulumi.get(self, "street_address")
@street_address.setter
def street_address(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "street_address", value)
@property
@pulumi.getter
def ttl(self) -> Optional[pulumi.Input[str]]:
"""
Time to live
"""
return pulumi.get(self, "ttl")
@ttl.setter
def ttl(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "ttl", value)
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input[str]]:
"""
Type of intermediate to create. Must be either \"exported\" or \"internal\"
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "type", value)
@property
@pulumi.getter(name="uriSans")
def uri_sans(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of alternative URIs
"""
return pulumi.get(self, "uri_sans")
@uri_sans.setter
def uri_sans(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "uri_sans", value)
class SecretBackendRootCert(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
backend: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
country: Optional[pulumi.Input[str]] = None,
exclude_cn_from_sans: Optional[pulumi.Input[bool]] = None,
format: Optional[pulumi.Input[str]] = None,
ip_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
key_bits: Optional[pulumi.Input[int]] = None,
key_type: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
max_path_length: Optional[pulumi.Input[int]] = None,
organization: Optional[pulumi.Input[str]] = None,
other_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ou: Optional[pulumi.Input[str]] = None,
permitted_dns_domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
private_key_format: Optional[pulumi.Input[str]] = None,
province: Optional[pulumi.Input[str]] = None,
street_address: Optional[pulumi.Input[str]] = None,
ttl: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
uri_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
__props__=None):
"""
Create a SecretBackendRootCert resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[Sequence[pulumi.Input[str]]] alt_names: List of alternative names
:param pulumi.Input[str] backend: The PKI secret backend the resource belongs to.
:param pulumi.Input[str] common_name: CN of intermediate to create
:param pulumi.Input[str] country: The country
:param pulumi.Input[bool] exclude_cn_from_sans: Flag to exclude CN from SANs
:param pulumi.Input[str] format: The format of data
:param pulumi.Input[Sequence[pulumi.Input[str]]] ip_sans: List of alternative IPs
:param pulumi.Input[int] key_bits: The number of bits to use
:param pulumi.Input[str] key_type: The desired key type
:param pulumi.Input[str] locality: The locality
:param pulumi.Input[int] max_path_length: The maximum path length to encode in the generated certificate
:param pulumi.Input[str] organization: The organization
:param pulumi.Input[Sequence[pulumi.Input[str]]] other_sans: List of other SANs
:param pulumi.Input[str] ou: The organization unit
:param pulumi.Input[Sequence[pulumi.Input[str]]] permitted_dns_domains: List of domains for which certificates are allowed to be issued
:param pulumi.Input[str] postal_code: The postal code
:param pulumi.Input[str] private_key_format: The private key format
:param pulumi.Input[str] province: The province
:param pulumi.Input[str] street_address: The street address
:param pulumi.Input[str] ttl: Time to live
:param pulumi.Input[str] type: Type of intermediate to create. Must be either \"exported\" or \"internal\"
:param pulumi.Input[Sequence[pulumi.Input[str]]] uri_sans: List of alternative URIs
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: SecretBackendRootCertArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Create a SecretBackendRootCert resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param SecretBackendRootCertArgs 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(SecretBackendRootCertArgs, 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,
alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
backend: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
country: Optional[pulumi.Input[str]] = None,
exclude_cn_from_sans: Optional[pulumi.Input[bool]] = None,
format: Optional[pulumi.Input[str]] = None,
ip_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
key_bits: Optional[pulumi.Input[int]] = None,
key_type: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
max_path_length: Optional[pulumi.Input[int]] = None,
organization: Optional[pulumi.Input[str]] = None,
other_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ou: Optional[pulumi.Input[str]] = None,
permitted_dns_domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
private_key_format: Optional[pulumi.Input[str]] = None,
province: Optional[pulumi.Input[str]] = None,
street_address: Optional[pulumi.Input[str]] = None,
ttl: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
uri_sans: Optional[pulumi.Input[Sequence[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__ = SecretBackendRootCertArgs.__new__(SecretBackendRootCertArgs)
__props__.__dict__["alt_names"] = alt_names
if backend is None and not opts.urn:
raise TypeError("Missing required property 'backend'")
__props__.__dict__["backend"] = backend
if common_name is None and not opts.urn:
raise TypeError("Missing required property 'common_name'")
__props__.__dict__["common_name"] = common_name
__props__.__dict__["country"] = country
__props__.__dict__["exclude_cn_from_sans"] = exclude_cn_from_sans
__props__.__dict__["format"] = format
__props__.__dict__["ip_sans"] = ip_sans
__props__.__dict__["key_bits"] = key_bits
__props__.__dict__["key_type"] = key_type
__props__.__dict__["locality"] = locality
__props__.__dict__["max_path_length"] = max_path_length
__props__.__dict__["organization"] = organization
__props__.__dict__["other_sans"] = other_sans
__props__.__dict__["ou"] = ou
__props__.__dict__["permitted_dns_domains"] = permitted_dns_domains
__props__.__dict__["postal_code"] = postal_code
__props__.__dict__["private_key_format"] = private_key_format
__props__.__dict__["province"] = province
__props__.__dict__["street_address"] = street_address
__props__.__dict__["ttl"] = ttl
if type is None and not opts.urn:
raise TypeError("Missing required property 'type'")
__props__.__dict__["type"] = type
__props__.__dict__["uri_sans"] = uri_sans
__props__.__dict__["certificate"] = None
__props__.__dict__["issuing_ca"] = None
__props__.__dict__["serial"] = None
super(SecretBackendRootCert, __self__).__init__(
'vault:pkiSecret/secretBackendRootCert:SecretBackendRootCert',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
backend: Optional[pulumi.Input[str]] = None,
certificate: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
country: Optional[pulumi.Input[str]] = None,
exclude_cn_from_sans: Optional[pulumi.Input[bool]] = None,
format: Optional[pulumi.Input[str]] = None,
ip_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_ca: Optional[pulumi.Input[str]] = None,
key_bits: Optional[pulumi.Input[int]] = None,
key_type: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
max_path_length: Optional[pulumi.Input[int]] = None,
organization: Optional[pulumi.Input[str]] = None,
other_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ou: Optional[pulumi.Input[str]] = None,
permitted_dns_domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
private_key_format: Optional[pulumi.Input[str]] = None,
province: Optional[pulumi.Input[str]] = None,
serial: Optional[pulumi.Input[str]] = None,
street_address: Optional[pulumi.Input[str]] = None,
ttl: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
uri_sans: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'SecretBackendRootCert':
"""
Get an existing SecretBackendRootCert 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[Sequence[pulumi.Input[str]]] alt_names: List of alternative names
:param pulumi.Input[str] backend: The PKI secret backend the resource belongs to.
:param pulumi.Input[str] certificate: The certificate
:param pulumi.Input[str] common_name: CN of intermediate to create
:param pulumi.Input[str] country: The country
:param pulumi.Input[bool] exclude_cn_from_sans: Flag to exclude CN from SANs
:param pulumi.Input[str] format: The format of data
:param pulumi.Input[Sequence[pulumi.Input[str]]] ip_sans: List of alternative IPs
:param pulumi.Input[str] issuing_ca: The issuing CA
:param pulumi.Input[int] key_bits: The number of bits to use
:param pulumi.Input[str] key_type: The desired key type
:param pulumi.Input[str] locality: The locality
:param pulumi.Input[int] max_path_length: The maximum path length to encode in the generated certificate
:param pulumi.Input[str] organization: The organization
:param pulumi.Input[Sequence[pulumi.Input[str]]] other_sans: List of other SANs
:param pulumi.Input[str] ou: The organization unit
:param pulumi.Input[Sequence[pulumi.Input[str]]] permitted_dns_domains: List of domains for which certificates are allowed to be issued
:param pulumi.Input[str] postal_code: The postal code
:param pulumi.Input[str] private_key_format: The private key format
:param pulumi.Input[str] province: The province
:param pulumi.Input[str] serial: The serial
:param pulumi.Input[str] street_address: The street address
:param pulumi.Input[str] ttl: Time to live
:param pulumi.Input[str] type: Type of intermediate to create. Must be either \"exported\" or \"internal\"
:param pulumi.Input[Sequence[pulumi.Input[str]]] uri_sans: List of alternative URIs
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _SecretBackendRootCertState.__new__(_SecretBackendRootCertState)
__props__.__dict__["alt_names"] = alt_names
__props__.__dict__["backend"] = backend
__props__.__dict__["certificate"] = certificate
__props__.__dict__["common_name"] = common_name
__props__.__dict__["country"] = country
__props__.__dict__["exclude_cn_from_sans"] = exclude_cn_from_sans
__props__.__dict__["format"] = format
__props__.__dict__["ip_sans"] = ip_sans
__props__.__dict__["issuing_ca"] = issuing_ca
__props__.__dict__["key_bits"] = key_bits
__props__.__dict__["key_type"] = key_type
__props__.__dict__["locality"] = locality
__props__.__dict__["max_path_length"] = max_path_length
__props__.__dict__["organization"] = organization
__props__.__dict__["other_sans"] = other_sans
__props__.__dict__["ou"] = ou
__props__.__dict__["permitted_dns_domains"] = permitted_dns_domains
__props__.__dict__["postal_code"] = postal_code
__props__.__dict__["private_key_format"] = private_key_format
__props__.__dict__["province"] = province
__props__.__dict__["serial"] = serial
__props__.__dict__["street_address"] = street_address
__props__.__dict__["ttl"] = ttl
__props__.__dict__["type"] = type
__props__.__dict__["uri_sans"] = uri_sans
return SecretBackendRootCert(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="altNames")
def alt_names(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
List of alternative names
"""
return pulumi.get(self, "alt_names")
@property
@pulumi.getter
def backend(self) -> pulumi.Output[str]:
"""
The PKI secret backend the resource belongs to.
"""
return pulumi.get(self, "backend")
@property
@pulumi.getter
def certificate(self) -> pulumi.Output[str]:
"""
The certificate
"""
return pulumi.get(self, "certificate")
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Output[str]:
"""
CN of intermediate to create
"""
return pulumi.get(self, "common_name")
@property
@pulumi.getter
def country(self) -> pulumi.Output[Optional[str]]:
"""
The country
"""
return pulumi.get(self, "country")
@property
@pulumi.getter(name="excludeCnFromSans")
def exclude_cn_from_sans(self) -> pulumi.Output[Optional[bool]]:
"""
Flag to exclude CN from SANs
"""
return pulumi.get(self, "exclude_cn_from_sans")
@property
@pulumi.getter
def format(self) -> pulumi.Output[Optional[str]]:
"""
The format of data
"""
return pulumi.get(self, "format")
@property
@pulumi.getter(name="ipSans")
def ip_sans(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
List of alternative IPs
"""
return pulumi.get(self, "ip_sans")
@property
@pulumi.getter(name="issuingCa")
def issuing_ca(self) -> pulumi.Output[str]:
"""
The issuing CA
"""
return pulumi.get(self, "issuing_ca")
@property
@pulumi.getter(name="keyBits")
def key_bits(self) -> pulumi.Output[Optional[int]]:
"""
The number of bits to use
"""
return pulumi.get(self, "key_bits")
@property
@pulumi.getter(name="keyType")
def key_type(self) -> pulumi.Output[Optional[str]]:
"""
The desired key type
"""
return pulumi.get(self, "key_type")
@property
@pulumi.getter
def locality(self) -> pulumi.Output[Optional[str]]:
"""
The locality
"""
return pulumi.get(self, "locality")
@property
@pulumi.getter(name="maxPathLength")
def max_path_length(self) -> pulumi.Output[Optional[int]]:
"""
The maximum path length to encode in the generated certificate
"""
return pulumi.get(self, "max_path_length")
@property
@pulumi.getter
def organization(self) -> pulumi.Output[Optional[str]]:
"""
The organization
"""
return pulumi.get(self, "organization")
@property
@pulumi.getter(name="otherSans")
def other_sans(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
List of other SANs
"""
return pulumi.get(self, "other_sans")
@property
@pulumi.getter
def ou(self) -> pulumi.Output[Optional[str]]:
"""
The organization unit
"""
return pulumi.get(self, "ou")
@property
@pulumi.getter(name="permittedDnsDomains")
def permitted_dns_domains(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
List of domains for which certificates are allowed to be issued
"""
return pulumi.get(self, "permitted_dns_domains")
@property
@pulumi.getter(name="postalCode")
def postal_code(self) -> pulumi.Output[Optional[str]]:
"""
The postal code
"""
return pulumi.get(self, "postal_code")
@property
@pulumi.getter(name="privateKeyFormat")
def private_key_format(self) -> pulumi.Output[Optional[str]]:
"""
The private key format
"""
return pulumi.get(self, "private_key_format")
@property
@pulumi.getter
def province(self) -> pulumi.Output[Optional[str]]:
"""
The province
"""
return pulumi.get(self, "province")
@property
@pulumi.getter
def serial(self) -> pulumi.Output[str]:
"""
The serial
"""
return pulumi.get(self, "serial")
@property
@pulumi.getter(name="streetAddress")
def street_address(self) -> pulumi.Output[Optional[str]]:
"""
The street address
"""
return pulumi.get(self, "street_address")
@property
@pulumi.getter
def ttl(self) -> pulumi.Output[Optional[str]]:
"""
Time to live
"""
return pulumi.get(self, "ttl")
@property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
"""
Type of intermediate to create. Must be either \"exported\" or \"internal\"
"""
return pulumi.get(self, "type")
@property
@pulumi.getter(name="uriSans")
def uri_sans(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
List of alternative URIs
"""
return pulumi.get(self, "uri_sans")
| 39.462295 | 143 | 0.625125 | 5,669 | 48,144 | 5.077968 | 0.03528 | 0.14253 | 0.12985 | 0.098586 | 0.924723 | 0.912287 | 0.887241 | 0.872894 | 0.858408 | 0.833328 | 0 | 0.000028 | 0.257083 | 48,144 | 1,219 | 144 | 39.494668 | 0.80482 | 0.199194 | 0 | 0.849132 | 1 | 0 | 0.082055 | 0.008768 | 0 | 0 | 0 | 0 | 0 | 1 | 0.168224 | false | 0.001335 | 0.006676 | 0 | 0.276368 | 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 |
b729241f710dfea28db1896149eb79efca194fd4 | 824 | py | Python | api/src/config/ShiftQueueConfig.py | SamuelJansen/telegram-manager-api | d25ed296c67f85b4cf706156d9819b59486e3f00 | [
"MIT"
] | 1 | 2022-02-25T06:45:31.000Z | 2022-02-25T06:45:31.000Z | api/src/config/ShiftQueueConfig.py | SamuelJansen/telegram-manager-api | d25ed296c67f85b4cf706156d9819b59486e3f00 | [
"MIT"
] | null | null | null | api/src/config/ShiftQueueConfig.py | SamuelJansen/telegram-manager-api | d25ed296c67f85b4cf706156d9819b59486e3f00 | [
"MIT"
] | null | null | null | from globals import getGlobalsInstance
globalsInstance = getGlobalsInstance()
HIT_SHIFT_QUEUE_KEY = globalsInstance.getSetting('queue-manager-api.hit-shift.queue-key')
HIT_SHIFT_EMITTER_URL = globalsInstance.getSetting('queue-manager-api.base-url')
HIT_SHIFT_EMITTER_API_KEY = globalsInstance.getSetting('queue-manager-api.api-key')
HIT_SHIFT_EMITTER_TIMEOUT = globalsInstance.getSetting('queue-manager-api.hit-shift.emitter.timeout')
HIT_SHIFT_NOW_QUEUE_KEY = globalsInstance.getSetting('queue-manager-api.hit-shift-now.queue-key')
HIT_SHIFT_NOW_EMITTER_URL = globalsInstance.getSetting('queue-manager-api.base-url')
HIT_SHIFT_NOW_EMITTER_API_KEY = globalsInstance.getSetting('queue-manager-api.api-key')
HIT_SHIFT_NOW_EMITTER_TIMEOUT = globalsInstance.getSetting('queue-manager-api.hit-shift-now.emitter.timeout')
| 43.368421 | 109 | 0.839806 | 110 | 824 | 6.018182 | 0.154545 | 0.145015 | 0.362538 | 0.44713 | 0.835347 | 0.76435 | 0.76435 | 0.76435 | 0.755287 | 0.398792 | 0 | 0 | 0.04733 | 824 | 18 | 110 | 45.777778 | 0.843312 | 0 | 0 | 0 | 0 | 0 | 0.32767 | 0.32767 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
3fa0c5b7f6c946bdab31d6579d4fe2d3c0d90c26 | 65,803 | py | Python | tests/system/action/poll/test_vote.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | tests/system/action/poll/test_vote.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | tests/system/action/poll/test_vote.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | import pytest
from openslides_backend.models.models import Poll
from tests.system.action.base import BaseActionTestCase
class PollVoteTest(BaseActionTestCase):
def test_vote_correct_pollmethod_Y(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1, 2]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"user/2": {
"username": "test2",
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
"vote_weight_$113": "2.000000",
},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"poll/1": {
"title": "my test poll",
"option_ids": [11],
"pollmethod": "Y",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
"min_votes_amount": 1,
"max_votes_amount": 10,
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request(
"poll.vote", {"id": 1, "user_id": 1, "value": {"11": 1}}
)
self.assert_status_code(response, 200)
vote = self.get_model("vote/1")
assert vote.get("value") == "Y"
assert vote.get("option_id") == 11
assert vote.get("weight") == "1.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
assert option.get("yes") == "1.000000"
assert option.get("no") == "0.000000"
assert option.get("abstain") == "0.000000"
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1]
response = self.request(
"poll.vote", {"id": 1, "user_id": 2, "value": {"11": 1}}
)
self.assert_status_code(response, 200)
vote = self.get_model("vote/2")
assert vote.get("value") == "Y"
assert vote.get("option_id") == 11
assert vote.get("weight") == "2.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 2
option = self.get_model("option/11")
assert option.get("vote_ids") == [1, 2]
assert option.get("yes") == "3.000000"
assert option.get("no") == "0.000000"
assert option.get("abstain") == "0.000000"
user = self.get_model("user/2")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [2]
def test_value_check(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"option/12": {"meeting_id": 113, "poll_id": 1},
"option/13": {"meeting_id": 113, "poll_id": 1},
"poll/1": {
"title": "my test poll",
"option_ids": [11, 12, 13],
"pollmethod": "YN",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request(
"poll.vote",
{
"id": 1,
"user_id": 1,
"value": {"11": "Y", "12": "N", "13": "A"},
},
)
self.assert_status_code(response, 400)
assert (
"Option 13 has not a right value. (int, str)." in response.json["message"]
)
def test_vote_correct_pollmethod_YN(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"option/12": {"meeting_id": 113, "poll_id": 1},
"option/13": {"meeting_id": 113, "poll_id": 1},
"poll/1": {
"title": "my test poll",
"option_ids": [11, 12, 13],
"pollmethod": "YN",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
"min_votes_amount": 1,
"max_votes_amount": 10,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request(
"poll.vote",
{
"id": 1,
"user_id": 1,
"value": {"11": "Y", "12": "N"},
},
)
self.assert_status_code(response, 200)
vote = self.get_model("vote/1")
assert vote.get("value") == "Y"
assert vote.get("option_id") == 11
assert vote.get("weight") == "1.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
vote = self.get_model("vote/2")
assert vote.get("value") == "N"
assert vote.get("option_id") == 12
assert vote.get("weight") == "1.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
assert option.get("yes") == "1.000000"
assert option.get("no") == "0.000000"
assert option.get("abstain") == "0.000000"
option = self.get_model("option/12")
assert option.get("vote_ids") == [2]
assert option.get("yes") == "0.000000"
assert option.get("no") == "1.000000"
assert option.get("abstain") == "0.000000"
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1, 2]
def test_vote_wrong_votes_total(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"option/12": {"meeting_id": 113, "poll_id": 1},
"option/13": {"meeting_id": 113, "poll_id": 1},
"poll/1": {
"title": "my test poll",
"option_ids": [11, 12, 13],
"pollmethod": "YN",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
"min_votes_amount": 1,
"max_votes_amount": 1,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request(
"poll.vote",
{
"id": 1,
"user_id": 1,
"value": {"11": "Y", "12": "N"},
},
)
self.assert_status_code(response, 400)
assert (
"Total amount of votes is not in min-max-interval."
in response.data.decode()
)
self.assert_model_not_exists("vote/1")
def test_vote_wrong_votes_total_min_case(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"option/12": {"meeting_id": 113, "poll_id": 1},
"option/13": {"meeting_id": 113, "poll_id": 1},
"poll/1": {
"title": "my test poll",
"option_ids": [11, 12, 13],
"pollmethod": "YN",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
"min_votes_amount": 2,
"max_votes_amount": 2,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request(
"poll.vote",
{
"id": 1,
"user_id": 1,
"value": {"11": "Y"},
},
)
self.assert_status_code(response, 400)
assert (
"Total amount of votes is not in min-max-interval."
in response.data.decode()
)
self.assert_model_not_exists("vote/1")
def test_vote_global(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1, 2]},
"option/11": {"meeting_id": 113, "used_as_global_option_in_poll_id": 1},
"user/2": {
"username": "test2",
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"poll/1": {
"title": "my test poll",
"global_option_id": 11,
"global_no": True,
"global_yes": False,
"global_abstain": False,
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
"pollmethod": "YNA",
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "N"})
self.assert_status_code(response, 200)
vote = self.get_model("vote/1")
assert vote.get("value") == "N"
assert vote.get("option_id") == 11
assert vote.get("weight") == "1.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
assert option.get("yes") == "0.000000"
assert option.get("no") == "1.000000"
assert option.get("abstain") == "0.000000"
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1]
response = self.request("poll.vote", {"id": 1, "user_id": 2, "value": "Y"})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/2")
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1]
def test_vote_schema_problems(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"poll/1": {
"title": "my test poll",
"entitled_group_ids": [1],
"meeting_id": 113,
"pollmethod": "YNA",
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "X"})
self.assert_status_code(response, 400)
assert "Option value X is not in 'YNA'" in response.json["message"]
def test_vote_for_analog_type(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"poll/1": {
"title": "my test poll",
"type": "analog",
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$_ids": ["113"],
"group_$113_ids": [1],
},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "Y"})
self.assert_status_code(response, 400)
assert "poll.vote is not allowed for analog voting." in response.json["message"]
def test_vote_option_not_in_poll(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"poll/1": {
"title": "my test poll",
"type": "named",
"entitled_group_ids": [1],
"meeting_id": 113,
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
}
)
response = self.request(
"poll.vote",
{
"id": 1,
"user_id": 1,
"value": {"113": "Y"},
},
)
self.assert_status_code(response, 400)
assert "Option 113 not in options of the poll." in response.json["message"]
def test_double_vote(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1, 2]},
"option/11": {"meeting_id": 113, "used_as_global_option_in_poll_id": 1},
"user/2": {
"username": "test2",
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"poll/1": {
"title": "my test poll",
"global_option_id": 11,
"global_no": True,
"global_yes": False,
"global_abstain": False,
"meeting_id": 113,
"entitled_group_ids": [1],
"pollmethod": "YN",
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "N"})
self.assert_status_code(response, 200)
vote = self.get_model("vote/1")
assert vote.get("value") == "N"
assert vote.get("option_id") == 11
assert vote.get("weight") == "1.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1]
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "N"})
self.assert_status_code(response, 400)
assert "Only one vote per poll per user allowed." in response.json["message"]
def test_check_user_in_entitled_group(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"option/11": {"meeting_id": 113, "used_as_global_option_in_poll_id": 1},
"user/1": {"is_present_in_meeting_ids": [113]},
"poll/1": {
"title": "my test poll",
"global_option_id": 11,
"global_no": True,
"global_yes": False,
"global_abstain": False,
"meeting_id": 113,
"entitled_group_ids": [],
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "N"})
self.assert_status_code(response, 400)
assert "User is not allowed to vote." in response.json["message"]
def test_check_user_present_in_meeting(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"user/1": {"group_$_ids": ["113"], "group_$113_ids": [1]},
"option/11": {"meeting_id": 113, "used_as_global_option_in_poll_id": 1},
"poll/1": {
"title": "my test poll",
"global_option_id": 11,
"global_no": True,
"global_yes": False,
"global_abstain": False,
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "N"})
self.assert_status_code(response, 400)
assert "User is not present in the meeting." in response.json["message"]
def test_check_str_validation(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"poll/1": {
"title": "my test poll",
"type": "named",
"meeting_id": 113,
"entitled_group_ids": [1],
"pollmethod": "Y",
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$_ids": ["113"],
"group_$113_ids": [1],
},
}
)
response = self.request("poll.vote", {"id": 1, "user_id": 1, "value": "X"})
self.assert_status_code(response, 400)
assert "Option value X is not in 'YNA'." in response.json["message"]
def test_default_vote_weight(self) -> None:
self.set_models(
{
"organisation/1": {"enable_electronic_voting": True},
"group/1": {"user_ids": [1]},
"option/11": {"meeting_id": 113, "poll_id": 1},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
"default_vote_weight": "3.000000",
},
"poll/1": {
"title": "my test poll",
"option_ids": [11],
"pollmethod": "Y",
"meeting_id": 113,
"entitled_group_ids": [1],
"state": Poll.STATE_STARTED,
},
"meeting/113": {"name": "my meeting"},
}
)
response = self.request(
"poll.vote", {"id": 1, "user_id": 1, "value": {"11": 1}}
)
self.assert_status_code(response, 200)
vote = self.get_model("vote/1")
assert vote.get("value") == "Y"
assert vote.get("option_id") == 11
assert vote.get("weight") == "3.000000"
assert vote.get("meeting_id") == 113
assert vote.get("user_id") == 1
option = self.get_model("option/11")
assert option.get("vote_ids") == [1]
assert option.get("yes") == "3.000000"
assert option.get("no") == "0.000000"
assert option.get("abstain") == "0.000000"
user = self.get_model("user/1")
assert user.get("vote_$_ids") == ["113"]
assert user.get("vote_$113_ids") == [1]
class VotePollBaseTestClass(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.create_model(
"assignment/1",
{
"title": "test_assignment_tcLT59bmXrXif424Qw7K",
"open_posts": 1,
},
)
self.create_poll()
self.set_models(
{
"meeting/113": {"name": "my meeting"},
"group/1": {"user_ids": [1]},
"option/1": {
"meeting_id": 113,
"poll_id": 1,
"yes": "0.000000",
"no": "0.000000",
"abstain": "0.000000",
},
"option/2": {
"meeting_id": 113,
"poll_id": 1,
"yes": "0.000000",
"no": "0.000000",
"abstain": "0.000000",
},
"user/1": {
"is_present_in_meeting_ids": [113],
"group_$113_ids": [1],
"group_$_ids": ["113"],
},
"option/11": {"meeting_id": 113, "used_as_global_option_in_poll_id": 1},
"poll/1": {"global_option_id": 11},
}
)
def create_poll(self) -> None:
# has to be implemented by subclasses
raise NotImplementedError()
def start_poll(self) -> None:
self.update_model("poll/1", {"state": Poll.STATE_STARTED})
def add_option(self) -> None:
self.set_models(
{
"option/3": {"meeting_id": 113, "poll_id": 1},
"poll/1": {"option_ids": [1, 2, 3]},
}
)
class VotePollAnalogYNA(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_04k0y4TwPLpJKaSvIGm1",
"pollmethod": "YNA",
"type": Poll.TYPE_ANALOG,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{
"value": {
"1": {"Y": "1", "N": "2.35", "A": "-1"},
"2": {"Y": "30", "N": "-2", "A": "8.93"},
},
"user_id": 1,
"id": 1,
},
)
self.assert_status_code(response, 400)
assert "poll.vote is not allowed for analog voting." in response.json["message"]
class VotePollNamedYNA(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_OkHAIvOSIcpFnCxbaL6v",
"pollmethod": "YNA",
"type": Poll.TYPE_NAMED,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votescast": "0.000000",
"votesvalid": "0.000000",
"votesinvalid": "0.000000",
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.add_option()
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "2": "N", "3": "A"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_count("vote", 113, 3)
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
self.assertIn(1, poll.get("voted_ids", []))
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
option3 = self.get_model("option/3")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "1.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
self.assertEqual(option3.get("yes"), "0.000000")
self.assertEqual(option3.get("no"), "0.000000")
self.assertEqual(option3.get("abstain"), "1.000000")
def test_vote_with_voteweight(self) -> None:
self.update_model("user/1", {"vote_weight_$113": "4.200000"})
self.add_option()
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "2": "N", "3": "A"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_count("vote", 113, 3)
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "4.200000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
option3 = self.get_model("option/3")
self.assertEqual(option1.get("yes"), "4.200000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "4.200000")
self.assertEqual(option2.get("abstain"), "0.000000")
self.assertEqual(option3.get("yes"), "0.000000")
self.assertEqual(option3.get("no"), "0.000000")
self.assertEqual(option3.get("abstain"), "4.200000")
def test_change_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/2")
vote = self.get_model("vote/1")
self.assertEqual(vote.get("value"), "Y")
def test_too_many_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "3": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "3": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
@pytest.mark.skip()
def test_no_permissions(self) -> None:
self.start_poll()
# self.make_admin_delegate()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_anonymous(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 0},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request(
"poll.vote", {"value": {"1": "Y"}, "id": 1, "user_id": 1}
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_data(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_data_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": [1, 2, 5], "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"id": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_data(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": [None]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
class VotePollNamedY(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_Zrvh146QAdq7t6iSDwZk",
"pollmethod": "Y",
"type": Poll.TYPE_NAMED,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votesinvalid": "0.000000",
"global_yes": True,
"global_no": True,
"global_abstain": True,
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_exists("vote/1")
self.assert_model_not_exists("vote/2")
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
self.assertIn(1, poll.get("voted_ids", []))
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_change_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": 0, "2": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_global_yes(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "Y", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "1.000000")
self.assertEqual(option.get("no"), "0.000000")
self.assertEqual(option.get("abstain"), "0.000000")
def test_global_yes_forbidden(self) -> None:
self.update_model("poll/1", {"global_yes": False})
self.start_poll()
response = self.request("poll.vote", {"value": "Y", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_global_no(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "N", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "0.000000")
self.assertEqual(option.get("no"), "1.000000")
self.assertEqual(option.get("abstain"), "0.000000")
def test_global_no_forbidden(self) -> None:
self.update_model("poll/1", {"global_no": False})
self.start_poll()
response = self.request("poll.vote", {"value": "N", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_global_abstain(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "A", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "0.000000")
self.assertEqual(option.get("no"), "0.000000")
self.assertEqual(option.get("abstain"), "1.000000")
def test_global_abstain_forbidden(self) -> None:
self.update_model("poll/1", {"global_abstain": False})
self.start_poll()
response = self.request("poll.vote", {"value": "A", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_negative_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": -1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_too_many_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 1, "3": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"3": 1}},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
@pytest.mark.skip()
def test_no_permissions(self) -> None:
self.start_poll()
# self.make_admin_delegate()
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_anonymous(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 0},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_data(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_data_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": [1, 2, 5], "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"id": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_data(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": [None]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
class VotePollNamedN(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_4oi49ckKFk39SDIfj30s",
"pollmethod": "N",
"type": Poll.TYPE_NAMED,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votesinvalid": "0.000000",
"global_yes": True,
"global_no": True,
"global_abstain": True,
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_exists("vote/1")
self.assert_model_not_exists("vote/2")
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
self.assertTrue(1 in poll.get("voted_ids", []))
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "0.000000")
self.assertEqual(option1.get("no"), "1.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_change_vote(self) -> None:
self.add_option()
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": 0, "2": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "0.000000")
self.assertEqual(option1.get("no"), "1.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_global_yes(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "Y", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "1.000000")
self.assertEqual(option.get("no"), "0.000000")
self.assertEqual(option.get("abstain"), "0.000000")
def test_global_yes_forbidden(self) -> None:
self.update_model("poll/1", {"global_yes": False})
self.start_poll()
response = self.request("poll.vote", {"value": "Y", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_global_no(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "N", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "0.000000")
self.assertEqual(option.get("no"), "1.000000")
self.assertEqual(option.get("abstain"), "0.000000")
def test_global_no_forbidden(self) -> None:
self.update_model("poll/1", {"global_no": False})
self.start_poll()
response = self.request("poll.vote", {"value": "N", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_global_abstain(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": "A", "id": 1, "user_id": 1})
self.assert_status_code(response, 200)
option = self.get_model("option/11")
self.assertEqual(option.get("yes"), "0.000000")
self.assertEqual(option.get("no"), "0.000000")
self.assertEqual(option.get("abstain"), "1.000000")
def test_global_abstain_forbidden(self) -> None:
self.update_model("poll/1", {"global_abstain": False})
self.start_poll()
response = self.request("poll.vote", {"value": "A", "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_negative_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": -1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"3": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
@pytest.mark.skip()
def test_no_permissions(self) -> None:
self.start_poll()
# self.make_admin_delegate()
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_anonymous(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 2},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_data(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_data_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": [1, 2, 5], "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"id": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_data(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": [None]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
class VotePollPseudoanonymousYNA(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_OkHAIvOSIcpFnCxbaL6v",
"pollmethod": "YNA",
"type": Poll.TYPE_PSEUDOANONYMOUS,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votesinvalid": "0.000000",
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.add_option()
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "2": "N", "3": "A"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_count("vote", 113, 3)
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
option3 = self.get_model("option/3")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "1.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
self.assertEqual(option3.get("yes"), "0.000000")
self.assertEqual(option3.get("no"), "0.000000")
self.assertEqual(option3.get("abstain"), "1.000000")
def test_change_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
option1 = self.get_model("option/1")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
def test_too_many_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "3": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_partial_vote(self) -> None:
self.add_option()
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_exists("vote/1")
def test_wrong_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y", "3": "N"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
@pytest.mark.skip()
def test_no_permissions(self) -> None:
self.start_poll()
# self.make_admin_delegate()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_anonymous(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 2},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"value": {"1": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_value(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_value_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": [1, 2, 5], "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"id": "Y"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_value(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": [None]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
class VotePollPseudoanonymousY(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_Zrvh146QAdq7t6iSDwZk",
"pollmethod": "Y",
"type": Poll.TYPE_PSEUDOANONYMOUS,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votesinvalid": "0.000000",
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_exists("vote/1")
self.assert_model_not_exists("vote/2")
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
self.assertTrue(1 in poll.get("voted_ids", []))
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
vote = self.get_model("vote/1")
self.assertIsNone(vote.get("user_id"))
def test_change_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": 0, "2": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.get_model("poll/1")
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "1.000000")
self.assertEqual(option1.get("no"), "0.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_negative_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": -1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_options(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"3": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_data(self) -> None:
self.start_poll()
response = self.request("poll.vote", {"value": {}, "id": 1, "user_id": 1})
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_data_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"value": [1, 2, 5]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"id": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_data(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": [None]}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
class VotePollPseudoAnonymousN(VotePollBaseTestClass):
def create_poll(self) -> None:
self.create_model(
"poll/1",
{
"content_object_id": "assignment/1",
"title": "test_title_wWPOVJgL9afm83eamf3e",
"pollmethod": "N",
"type": Poll.TYPE_PSEUDOANONYMOUS,
"state": Poll.STATE_CREATED,
"meeting_id": 113,
"option_ids": [1, 2],
"entitled_group_ids": [1],
"votesinvalid": "0.000000",
"min_votes_amount": 1,
"max_votes_amount": 10,
},
)
def test_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"id": 1, "value": {"1": 1, "2": 0}, "user_id": 1},
)
self.assert_status_code(response, 200)
self.assert_model_exists("vote/1")
self.assert_model_not_exists("vote/2")
poll = self.get_model("poll/1")
self.assertEqual(poll.get("votesvalid"), "1.000000")
self.assertEqual(poll.get("votesinvalid"), "0.000000")
self.assertEqual(poll.get("votescast"), "1.000000")
self.assertEqual(poll.get("state"), Poll.STATE_STARTED)
self.assertTrue(1 in poll.get("voted_ids", []))
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "0.000000")
self.assertEqual(option1.get("no"), "1.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
vote = self.get_model("vote/1")
self.assertIsNone(vote.get("user_id"))
def test_change_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1},
)
response = self.request(
"poll.vote",
{"value": {"1": 0, "2": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.get_model("poll/1")
option1 = self.get_model("option/1")
option2 = self.get_model("option/2")
self.assertEqual(option1.get("yes"), "0.000000")
self.assertEqual(option1.get("no"), "1.000000")
self.assertEqual(option1.get("abstain"), "0.000000")
self.assertEqual(option2.get("yes"), "0.000000")
self.assertEqual(option2.get("no"), "0.000000")
self.assertEqual(option2.get("abstain"), "0.000000")
def test_negative_vote(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": -1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_vote_not_present(self) -> None:
self.start_poll()
self.update_model("user/1", {"is_present_in_meeting_ids": []})
response = self.request(
"poll.vote",
{"id": 1, "user_id": 1, "value": {"1": 1}},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_state(self) -> None:
response = self.request(
"poll.vote",
{"value": {"1": 1}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_missing_data(self) -> None:
self.start_poll()
response = self.request("poll.vote", {})
self.assert_status_code(response, 400)
assert (
"data must contain ['id', 'user_id', 'value'] properties"
in response.json["message"]
)
self.assert_model_not_exists("vote/1")
poll = self.get_model("poll/1")
self.assertNotIn(1, poll.get("voted_ids", []))
def test_wrong_data_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": [1, 2, 5], "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
assert "data.value must be object or string" in response.json["message"]
self.assert_model_not_exists("vote/1")
def test_wrong_option_format(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"value": {"1": "string"}, "id": 1, "user_id": 1},
)
self.assert_status_code(response, 400)
assert "Option 1 has not a right value. (int, str)." in response.json["message"]
self.assert_model_not_exists("vote/1")
def test_wrong_option_id_type(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"id": 1},
)
self.assert_status_code(response, 400)
self.assert_model_not_exists("vote/1")
def test_wrong_vote_data(self) -> None:
self.start_poll()
response = self.request(
"poll.vote",
{"id": 1, "value": {"1": [None]}, "user_id": 1},
)
self.assert_status_code(response, 400)
assert "Option 1 has not a right value. (int, str)." in response.json["message"]
self.assert_model_not_exists("vote/1")
| 37.861335 | 88 | 0.510053 | 7,467 | 65,803 | 4.278291 | 0.025311 | 0.022914 | 0.066612 | 0.080636 | 0.961717 | 0.953641 | 0.950855 | 0.944813 | 0.936017 | 0.935923 | 0 | 0.065598 | 0.326079 | 65,803 | 1,737 | 89 | 37.883132 | 0.654783 | 0.002173 | 0 | 0.804361 | 0 | 0 | 0.198845 | 0.020166 | 0 | 0 | 0 | 0 | 0.260436 | 1 | 0.071028 | false | 0 | 0.001869 | 0 | 0.078505 | 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 |
3ff1d9861a90b3ed792741f7590c60b5a13c8a90 | 6,636 | py | Python | tests/test_api_permission.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 15 | 2019-09-24T09:32:32.000Z | 2021-12-30T08:07:41.000Z | tests/test_api_permission.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 13 | 2019-09-06T03:20:02.000Z | 2021-09-27T03:37:25.000Z | tests/test_api_permission.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | 17 | 2019-09-02T06:31:05.000Z | 2021-10-08T04:23:23.000Z | # import unittest
# import os
# from django.conf import settings
# from unittest import mock
# from django.http import JsonResponse
#
#
# class MockRequests(object):
# @property
# def path(self):
# return '/api/xx/xxx/xxxx/'
#
# @property
# def method(self):
# return 'GET'
#
# @property
# def META(self):
# return {'REMOTE_USER': '3213321131312313'}
#
#
# class MockRequests2(object):
# @property
# def path(self):
# return '/api/xx/xxx/123/'
#
# @property
# def method(self):
# return 'GET'
#
# @property
# def META(self):
# return {'REMOTE_USER': '3213321131312313'}
#
#
# class MockRequests1(object):
# @property
# def path(self):
# return '/api/xx/xxx/500/'
#
# @property
# def method(self):
# return 'GET'
#
# @property
# def META(self):
# return {'REMOTE_USER': '3213321131312313'}
#
#
# def mocked_requests_get(*args, **kwargs):
# class MockResponse:
# def __init__(self, json_data, status_code):
# self.json_data = json_data
# self.status_code = status_code
#
# def json(self):
# return self.json_data
#
# def content(self):
# return b''
#
# if kwargs['url'] == 'http://127.0.0.1:8500/api/xx/xxx/xxxx/':
# return MockResponse({"has_perm": True}, 200)
# if kwargs['url'] == 'http://127.0.0.1:8500/api/xx/xxx/500/':
# return MockResponse({"has_perm": False}, 500)
# return MockResponse({"has_perm": False}, 400)
#
#
# class TestPermissionMiddleware(unittest.TestCase):
# """测试permission_middleware"""
# def setUp(self):
# os.environ["DJANGO_SETTINGS_MODULE"] = "tests.mock_settings"
# os.environ["SPARROW_TEST_HOST"] = "127.0.0.1:8500"
#
# @mock.patch('requests.request', side_effect=mocked_requests_get)
# @mock.patch('sparrow_cloud.utils.validation_data.VerificationConfiguration.valid_permission_svc', return_value='')
# @mock.patch('sparrow_cloud.restclient.rest_client.get_acl_token', return_value='123')
# def test_has_permission(self, acl_token, verify_middleware_location, mocked_requests_get):
# settings.PERMISSION_MIDDLEWARE = {
# # 权限验证服务的配置
# "PERMISSION_SERVICE": {
# "ENV_NAME": "SPARROW_TEST_HOST",
# # VALUE 为服务发现的注册名称
# "VALUE": "sparrow",
# },
# "API_PATH": "/api/xx/xxx/xxxx/",
# "FILTER_PATH": [''], # 使用权限验证中间件, 如有不需要验证的URL, 可添加到列表中
# "SKIP_PERMISSION": False,
# # 是否启用权限中间件, SKIP_PERMISSION:True, 则跳过中间件, 如果不配置SKIP_PERMISSION,或者SKIP_PERMISSION:False,则不跳过中间件
# }
# from sparrow_cloud.middleware.api_permission import PermissionMiddleware
# self.assertEqual(PermissionMiddleware().process_request(MockRequests()), None)
#
# @mock.patch('requests.request', side_effect=mocked_requests_get)
# @mock.patch('sparrow_cloud.utils.validation_data.VerificationConfiguration.valid_permission_svc', return_value='')
# @mock.patch('sparrow_cloud.restclient.rest_client.get_acl_token', return_value='123')
# def test_permission_exception_400(self, acl_token, verify_middleware_location, mocked_requests_get):
# settings.PERMISSION_MIDDLEWARE = {
# # 权限验证服务的配置
# "PERMISSION_SERVICE": {
# "ENV_NAME": "SPARROW_TEST_HOST",
# # VALUE 为服务发现的注册名称
# "VALUE": "sparrow",
# },
# "API_PATH": "/api/xx/xxx/ssss/",
# "FILTER_PATH": [''], # 使用权限验证中间件, 如有不需要验证的URL, 可添加到列表中
# "SKIP_PERMISSION": False,
# # 是否启用权限中间件, SKIP_PERMISSION:True, 则跳过中间件, 如果不配置SKIP_PERMISSION,或者SKIP_PERMISSION:False,则不跳过中间件
# }
# from sparrow_cloud.middleware.api_permission import PermissionMiddleware
# self.assertEqual(PermissionMiddleware().process_request(MockRequests2()).status_code,
# JsonResponse({'msg': '400'}, status=400).status_code)
#
# @mock.patch('requests.request', side_effect=mocked_requests_get)
# @mock.patch('sparrow_cloud.utils.validation_data.VerificationConfiguration.valid_permission_svc', return_value='')
# @mock.patch('sparrow_cloud.restclient.rest_client.get_acl_token', return_value='123')
# def test_permission_exception_500(self, acl_token, verify_middleware_location, mocked_requests_get):
# settings.PERMISSION_MIDDLEWARE = {
# # 权限验证服务的配置
# "PERMISSION_SERVICE": {
# "ENV_NAME": "SPARROW_TEST_HOST",
# # VALUE 为服务发现的注册名称
# "VALUE": "sparrow",
# },
# "API_PATH": "/api/xx/xxx/500/",
# "FILTER_PATH": [''], # 使用权限验证中间件, 如有不需要验证的URL, 可添加到列表中
# "SKIP_PERMISSION": False,
# # 是否启用权限中间件, SKIP_PERMISSION:True, 则跳过中间件, 如果不配置SKIP_PERMISSION,或者SKIP_PERMISSION:False,则不跳过中间件
# }
# from sparrow_cloud.middleware.api_permission import PermissionMiddleware
# PermissionMiddleware().process_request(MockRequests())
# self.assertEqual(PermissionMiddleware().process_request(MockRequests1()), None)
#
# @mock.patch('requests.request', side_effect=mocked_requests_get)
# @mock.patch('sparrow_cloud.utils.validation_data.VerificationConfiguration.valid_permission_svc', return_value='')
# @mock.patch('sparrow_cloud.restclient.rest_client.get_acl_token', return_value='123')
# def test_permission_skip_permission_and_filter_path(self, acl_token, verify_middleware_location,
# mocked_requests_get):
# settings.PERMISSION_MIDDLEWARE = {
# # 权限验证服务的配置
# "PERMISSION_SERVICE": {
# "ENV_NAME": "SPARROW_TEST_HOST",
# # VALUE 为服务发现的注册名称
# "VALUE": "sparrow",
# },
# "API_PATH": "/api/xx/xxx/xxxx/",
# "FILTER_PATH": ['/api/xx/xxx/xxxx/'], # 使用权限验证中间件, 如有不需要验证的URL, 可添加到列表中
# "SKIP_PERMISSION": 'False',
# # 是否启用权限中间件, SKIP_PERMISSION:True, 则跳过中间件, 如果不配置SKIP_PERMISSION,或者SKIP_PERMISSION:False,则不跳过中间件
# }
# from sparrow_cloud.middleware.api_permission import PermissionMiddleware
# PermissionMiddleware().process_request(MockRequests())
# self.assertEqual(PermissionMiddleware().process_request(MockRequests()), None)
#
# def tearDown(self):
# del os.environ["DJANGO_SETTINGS_MODULE"]
#
#
# if __name__ == '__main__':
# unittest.main()
| 41.217391 | 120 | 0.62613 | 656 | 6,636 | 6.057927 | 0.170732 | 0.027177 | 0.020131 | 0.042275 | 0.835934 | 0.815803 | 0.799195 | 0.792149 | 0.792149 | 0.762708 | 0 | 0.025208 | 0.240808 | 6,636 | 160 | 121 | 41.475 | 0.763597 | 0.949216 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
b77a2a38131d46520d4709370458f7eb07e74ffb | 9,775 | py | Python | AppServer/lib/django-1.2/tests/regressiontests/middleware/tests.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.2/tests/regressiontests/middleware/tests.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.2/tests/regressiontests/middleware/tests.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | # -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpRequest
from django.middleware.common import CommonMiddleware
from django.test import TestCase
class CommonMiddlewareTest(TestCase):
def setUp(self):
self.slash = settings.APPEND_SLASH
self.www = settings.PREPEND_WWW
def tearDown(self):
settings.APPEND_SLASH = self.slash
settings.PREPEND_WWW = self.www
def _get_request(self, path):
request = HttpRequest()
request.META = {
'SERVER_NAME': 'testserver',
'SERVER_PORT': 80,
}
request.path = request.path_info = "/middleware/%s" % path
return request
def test_append_slash_have_slash(self):
"""
Tests that URLs with slashes go unmolested.
"""
settings.APPEND_SLASH = True
request = self._get_request('slash/')
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_slashless_resource(self):
"""
Tests that matches to explicit slashless URLs go unmolested.
"""
settings.APPEND_SLASH = True
request = self._get_request('noslash')
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_slashless_unknown(self):
"""
Tests that APPEND_SLASH doesn't redirect to unknown resources.
"""
settings.APPEND_SLASH = True
request = self._get_request('unknown')
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_redirect(self):
"""
Tests that APPEND_SLASH redirects slashless URLs to a valid pattern.
"""
settings.APPEND_SLASH = True
request = self._get_request('slash')
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'], 'http://testserver/middleware/slash/')
def test_append_slash_no_redirect_on_POST_in_DEBUG(self):
"""
Tests that while in debug mode, an exception is raised with a warning
when a failed attempt is made to POST to an URL which would normally be
redirected to a slashed version.
"""
settings.APPEND_SLASH = True
settings.DEBUG = True
request = self._get_request('slash')
request.method = 'POST'
self.assertRaises(
RuntimeError,
CommonMiddleware().process_request,
request)
try:
CommonMiddleware().process_request(request)
except RuntimeError, e:
self.assertTrue('end in a slash' in str(e))
settings.DEBUG = False
def test_append_slash_disabled(self):
"""
Tests disabling append slash functionality.
"""
settings.APPEND_SLASH = False
request = self._get_request('slash')
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_quoted(self):
"""
Tests that URLs which require quoting are redirected to their slash
version ok.
"""
settings.APPEND_SLASH = True
request = self._get_request('needsquoting#')
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(
r['Location'],
'http://testserver/middleware/needsquoting%23/')
def test_prepend_www(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = False
request = self._get_request('path/')
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(
r['Location'],
'http://www.testserver/middleware/path/')
def test_prepend_www_append_slash_have_slash(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = True
request = self._get_request('slash/')
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'],
'http://www.testserver/middleware/slash/')
def test_prepend_www_append_slash_slashless(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = True
request = self._get_request('slash')
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'],
'http://www.testserver/middleware/slash/')
# The following tests examine expected behavior given a custom urlconf that
# overrides the default one through the request object.
def test_append_slash_have_slash_custom_urlconf(self):
"""
Tests that URLs with slashes go unmolested.
"""
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/slash/')
request.urlconf = 'regressiontests.middleware.extra_urls'
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_slashless_resource_custom_urlconf(self):
"""
Tests that matches to explicit slashless URLs go unmolested.
"""
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/noslash')
request.urlconf = 'regressiontests.middleware.extra_urls'
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_slashless_unknown_custom_urlconf(self):
"""
Tests that APPEND_SLASH doesn't redirect to unknown resources.
"""
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/unknown')
request.urlconf = 'regressiontests.middleware.extra_urls'
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_redirect_custom_urlconf(self):
"""
Tests that APPEND_SLASH redirects slashless URLs to a valid pattern.
"""
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/slash')
request.urlconf = 'regressiontests.middleware.extra_urls'
r = CommonMiddleware().process_request(request)
self.assertFalse(r is None,
"CommonMiddlware failed to return APPEND_SLASH redirect using request.urlconf")
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'], 'http://testserver/middleware/customurlconf/slash/')
def test_append_slash_no_redirect_on_POST_in_DEBUG_custom_urlconf(self):
"""
Tests that while in debug mode, an exception is raised with a warning
when a failed attempt is made to POST to an URL which would normally be
redirected to a slashed version.
"""
settings.APPEND_SLASH = True
settings.DEBUG = True
request = self._get_request('customurlconf/slash')
request.urlconf = 'regressiontests.middleware.extra_urls'
request.method = 'POST'
self.assertRaises(
RuntimeError,
CommonMiddleware().process_request,
request)
try:
CommonMiddleware().process_request(request)
except RuntimeError, e:
self.assertTrue('end in a slash' in str(e))
settings.DEBUG = False
def test_append_slash_disabled_custom_urlconf(self):
"""
Tests disabling append slash functionality.
"""
settings.APPEND_SLASH = False
request = self._get_request('customurlconf/slash')
request.urlconf = 'regressiontests.middleware.extra_urls'
self.assertEquals(CommonMiddleware().process_request(request), None)
def test_append_slash_quoted_custom_urlconf(self):
"""
Tests that URLs which require quoting are redirected to their slash
version ok.
"""
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/needsquoting#')
request.urlconf = 'regressiontests.middleware.extra_urls'
r = CommonMiddleware().process_request(request)
self.assertFalse(r is None,
"CommonMiddlware failed to return APPEND_SLASH redirect using request.urlconf")
self.assertEquals(r.status_code, 301)
self.assertEquals(
r['Location'],
'http://testserver/middleware/customurlconf/needsquoting%23/')
def test_prepend_www_custom_urlconf(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = False
request = self._get_request('customurlconf/path/')
request.urlconf = 'regressiontests.middleware.extra_urls'
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(
r['Location'],
'http://www.testserver/middleware/customurlconf/path/')
def test_prepend_www_append_slash_have_slash_custom_urlconf(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/slash/')
request.urlconf = 'regressiontests.middleware.extra_urls'
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'],
'http://www.testserver/middleware/customurlconf/slash/')
def test_prepend_www_append_slash_slashless_custom_urlconf(self):
settings.PREPEND_WWW = True
settings.APPEND_SLASH = True
request = self._get_request('customurlconf/slash')
request.urlconf = 'regressiontests.middleware.extra_urls'
r = CommonMiddleware().process_request(request)
self.assertEquals(r.status_code, 301)
self.assertEquals(r['Location'],
'http://www.testserver/middleware/customurlconf/slash/')
| 39.1 | 91 | 0.674476 | 1,066 | 9,775 | 5.971857 | 0.124765 | 0.082941 | 0.065661 | 0.127867 | 0.901351 | 0.897267 | 0.879359 | 0.870091 | 0.858467 | 0.83946 | 0 | 0.00493 | 0.232225 | 9,775 | 249 | 92 | 39.257028 | 0.843304 | 0.015243 | 0 | 0.690058 | 0 | 0 | 0.172145 | 0.053445 | 0 | 0 | 0 | 0 | 0.19883 | 0 | null | null | 0 | 0.023392 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
b786f8ff1038f1607c369a6bf6343d66f66e33f2 | 411,965 | py | Python | tools/ngui/precache.py | ycyun/ablestack-cloud | b7bd36a043e2697d05303246373988aa033c9229 | [
"Apache-2.0"
] | 1,131 | 2015-01-08T18:59:06.000Z | 2022-03-29T11:31:10.000Z | tools/ngui/precache.py | ycyun/ablestack-cloud | b7bd36a043e2697d05303246373988aa033c9229 | [
"Apache-2.0"
] | 5,908 | 2015-01-13T15:28:37.000Z | 2022-03-31T20:31:07.000Z | tools/ngui/precache.py | ycyun/ablestack-cloud | b7bd36a043e2697d05303246373988aa033c9229 | [
"Apache-2.0"
] | 1,083 | 2015-01-05T01:16:52.000Z | 2022-03-31T12:14:10.000Z | # -*- coding: utf-8 -*-
# Auto-generated code by cachemaker.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
apicache = {u'authorize': {u'securitygroupingress': {u'name': u'authorizeSecurityGroupIngress', u'related': [u'authorizeSecurityGroupEgress'], u'isasync': True, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the security group. If the account parameter is used, domainId must also be used.'}, {u'name': u'startport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'start port for this ingress rule'}, {u'name': u'securitygroupid', u'required': False, u'related': [u'createSecurityGroup', u'listSecurityGroups'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the security group. Mutually exclusive with securityGroupName parameter'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list associated'}, {u'name': u'usersecuritygrouplist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'user to security group mapping'}, {u'name': u'securitygroupname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The name of the security group. Mutually exclusive with securityGroupName parameter'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the security group. Must be used with domainId.'}, {u'name': u'icmpcode', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'error code for this icmp message'}, {u'name': u'protocol', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'TCP is default. UDP is the other supported protocol'}, {u'name': u'icmptype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'type of the icmp message being sent'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'an optional project of the security group'}, {u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'end port for this ingress rule'}], u'requiredparams': [], u'description': u'Authorizes a particular ingress rule for this security group'}, u'securitygroupegress': {u'name': u'authorizeSecurityGroupEgress', u'related': [], u'isasync': True, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the security group. Must be used with domainId.'}, {u'name': u'securitygroupname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The name of the security group. Mutually exclusive with securityGroupName parameter'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the security group. If the account parameter is used, domainId must also be used.'}, {u'name': u'icmpcode', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'error code for this icmp message'}, {u'name': u'securitygroupid', u'required': False, u'related': [u'createSecurityGroup', u'listSecurityGroups'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the security group. Mutually exclusive with securityGroupName parameter'}, {u'name': u'icmptype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'type of the icmp message being sent'}, {u'name': u'protocol', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'TCP is default. UDP is the other supported protocol'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'an optional project of the security group'}, {u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'end port for this egress rule'}, {u'name': u'usersecuritygrouplist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'user to security group mapping'}, {u'name': u'startport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'start port for this egress rule'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list associated'}], u'requiredparams': [], u'description': u'Authorizes a particular egress rule for this security group'}}, u'restore': {u'virtualmachine': {u'name': u'restoreVirtualMachine', u'related': [u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine'], u'isasync': True, u'params': [{u'name': u'virtualmachineid', u'required': True, u'related': [u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Virtual Machine ID'}], u'requiredparams': [u'virtualmachineid'], u'description': u'Restore a VM to original template or specific snapshot'}}, u'suspend': {u'project': {u'name': u'suspendProject', u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to be suspended'}], u'requiredparams': [u'id'], u'description': u'Suspends a project'}}, u'revoke': {u'securitygroupingress': {u'name': u'revokeSecurityGroupIngress', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The ID of the ingress rule'}], u'requiredparams': [u'id'], u'description': u'Deletes a particular ingress rule from this security group'}, u'securitygroupegress': {u'name': u'revokeSecurityGroupEgress', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The ID of the egress rule'}], u'requiredparams': [u'id'], u'description': u'Deletes a particular egress rule from this security group'}}, u'disassociate': {u'ipaddress': {u'name': u'disassociateIpAddress', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the id of the public ip address to disassociate'}], u'requiredparams': [u'id'], u'description': u'Disassociates an ip address from the account.'}}, u'migrate': {u'volume': {u'name': u'migrateVolume', u'related': [u'detachVolume', u'resizeVolume', u'attachVolume', u'uploadVolume', u'createVolume'], u'isasync': True, u'params': [{u'name': u'volumeid', u'required': True, u'related': [u'migrateVolume', u'detachVolume', u'resizeVolume', u'attachVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the volume'}, {u'name': u'storageid', u'required': True, u'related': [u'cancelStorageMaintenance', u'enableStorageMaintenance', u'updateStoragePool', u'createStoragePool', u'listStoragePools'], u'length': 255, u'type': u'uuid', u'description': u'destination storage pool ID to migrate the volume to'}], u'requiredparams': [u'volumeid', u'storageid'], u'description': u'Migrate volume'}, u'systemvm': {u'name': u'migrateSystemVm', u'related': [], u'isasync': True, u'params': [{u'name': u'virtualmachineid', u'required': True, u'related': [u'rebootSystemVm', u'listSystemVms'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine'}, {u'name': u'hostid', u'required': True, u'related': [u'addHost', u'updateHost', u'listHosts', u'listExternalLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'destination Host ID to migrate VM to'}], u'requiredparams': [u'virtualmachineid', u'hostid'], u'description': u'Attempts Migration of a system virtual machine to the host specified.'}, u'virtualmachine': {u'name': u'migrateVirtualMachine', u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'deployVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'storageid', u'required': False, u'related': [u'cancelStorageMaintenance'], u'length': 255, u'type': u'long', u'description': u'Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine'}, {u'name': u'hostid', u'required': False, u'related': [u'addHost', u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'Destination Host ID to migrate VM to. Required for live migrating a VM from host to host'}], u'requiredparams': [u'virtualmachineid'], u'description': u'Attempts Migration of a VM to a different host or Root volume of the vm to a different storage pool'}}, u'lock': {u'account': {u'name': u'lockAccount', u'related': [u'markDefaultZoneForAccount'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Locks the specified account on this domain.'}, {u'name': u'account', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Locks the specified account.'}], u'requiredparams': [u'domainid', u'account'], u'description': u'Locks an account'}, u'user': {u'name': u'lockUser', u'related': [u'listUsers'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'lockUser', u'listUsers'], u'length': 255, u'type': u'uuid', u'description': u'Locks user by user ID.'}], u'requiredparams': [u'id'], u'description': u'Locks a user account'}}, u'dissociate': {u'lun': {u'name': u'dissociateLun', u'related': [], u'isasync': False, u'params': [{u'name': u'iqn', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Guest IQN.'}, {u'name': u'path', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'LUN path.'}], u'requiredparams': [u'iqn', u'path'], u'description': u'Dissociate a LUN'}}, u'activate': {u'project': {u'name': u'activateProject', u'related': [u'createProject', u'listProjectAccounts'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to be modified'}], u'requiredparams': [u'id'], u'description': u'Activates a project'}}, u'reconnect': {u'host': {u'name': u'reconnectHost', u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers', u'prepareHostForMaintenance'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'reconnectHost', u'listExternalLoadBalancers', u'prepareHostForMaintenance'], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}], u'requiredparams': [u'id'], u'description': u'Reconnects a host.'}}, u'cancel': {u'hostmaintenance': {u'name': u'cancelHostMaintenance', u'related': [u'listSwifts', u'addHost', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}], u'requiredparams': [u'id'], u'description': u'Cancels host maintenance.'}, u'storagemaintenance': {u'name': u'cancelStorageMaintenance', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'cancelStorageMaintenance'], u'length': 255, u'type': u'uuid', u'description': u'the primary storage ID'}], u'requiredparams': [u'id'], u'description': u'Cancels maintenance for primary storage'}}, u'query': {u'asyncjobresult': {u'name': u'queryAsyncJobResult', u'related': [], u'isasync': False, u'params': [{u'name': u'jobid', u'required': True, u'related': [u'queryAsyncJobResult'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the asychronous job'}], u'requiredparams': [u'jobid'], u'description': u'Retrieves the current status of asynchronous job.'}}, u'recover': {u'virtualmachine': {u'name': u'recoverVirtualMachine', u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'id'], u'description': u'Recovers a virtual machine.'}}, u'extract': {u'volume': {u'name': u'extractVolume', u'related': [u'extractTemplate', u'extractIso'], u'isasync': True, u'params': [{u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the url to which the volume would be extracted'}, {u'name': u'id', u'required': True, u'related': [u'migrateVolume', u'detachVolume', u'resizeVolume', u'attachVolume', u'listVolumes', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the volume'}, {u'name': u'mode', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone where the volume is located'}], u'requiredparams': [u'id', u'mode', u'zoneid'], u'description': u'Extracts volume'}, u'iso': {u'name': u'extractIso', u'related': [u'extractTemplate'], u'isasync': True, u'params': [{u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone where the ISO is originally located'}, {u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the url to which the ISO would be extracted'}, {u'name': u'mode', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD'}, {u'name': u'id', u'required': True, u'related': [u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the ISO file'}], u'requiredparams': [u'mode', u'id'], u'description': u'Extracts an ISO'}, u'template': {u'name': u'extractTemplate', u'related': [], u'isasync': True, u'params': [{u'name': u'mode', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD'}, {u'name': u'id', u'required': True, u'related': [u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the template'}, {u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the url to which the ISO would be extracted'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone where the ISO is originally located'}], u'requiredparams': [u'mode', u'id'], u'description': u'Extracts a template'}}, u'copy': {u'iso': {u'name': u'copyIso', u'related': [u'updateIso', u'listIsos'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'Template ID.'}, {u'name': u'destzoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'ID of the zone the template is being copied to.'}, {u'name': u'sourcezoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'ID of the zone the template is currently hosted on.'}], u'requiredparams': [u'id', u'destzoneid', u'sourcezoneid'], u'description': u'Copies an iso from one zone to another.'}, u'template': {u'name': u'copyTemplate', u'related': [u'listTemplates', u'registerIso', u'updateTemplate', u'prepareTemplate', u'registerTemplate', u'copyIso', u'updateIso', u'listIsos'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'copyTemplate', u'listTemplates', u'registerIso', u'updateTemplate', u'prepareTemplate', u'registerTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'Template ID.'}, {u'name': u'destzoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'ID of the zone the template is being copied to.'}, {u'name': u'sourcezoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'ID of the zone the template is currently hosted on.'}], u'requiredparams': [u'id', u'destzoneid', u'sourcezoneid'], u'description': u'Copies a template from one zone to another.'}}, u'prepare': {u'hostformaintenance': {u'name': u'prepareHostForMaintenance', u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers', u'prepareHostForMaintenance'], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}], u'requiredparams': [u'id'], u'description': u'Prepares a host for maintenance.'}, u'template': {u'name': u'prepareTemplate', u'related': [u'registerIso', u'updateTemplate', u'copyIso', u'updateIso', u'listIsos'], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'zone ID of the template to be prepared in primary storage(s).'}, {u'name': u'templateid', u'required': True, u'related': [u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'template ID of the template to be prepared in primary storage(s).'}], u'requiredparams': [u'zoneid', u'templateid'], u'description': u'load template into primary storage'}}, u'attach': {u'volume': {u'name': u'attachVolume', u'related': [u'detachVolume', u'resizeVolume', u'uploadVolume', u'createVolume'], u'isasync': True, u'params': [{u'name': u'deviceid', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'the ID of the device to map the volume to within the guest OS. If no deviceId is passed in, the next available deviceId will be chosen. Possible values for a Linux OS are:* 1 - /dev/xvdb* 2 - /dev/xvdc* 4 - /dev/xvde* 5 - /dev/xvdf* 6 - /dev/xvdg* 7 - /dev/xvdh* 8 - /dev/xvdi* 9 - /dev/xvdj'}, {u'name': u'id', u'required': True, u'related': [u'detachVolume', u'resizeVolume', u'attachVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u' the ID of the virtual machine'}], u'requiredparams': [u'id', u'virtualmachineid'], u'description': u'Attaches a disk volume to a virtual machine.'}, u'iso': {u'name': u'attachIso', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine'}, {u'name': u'id', u'required': True, u'related': [u'listTemplates', u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the ISO file'}], u'requiredparams': [u'virtualmachineid', u'id'], u'description': u'Attaches an ISO to a virtual machine.'}}, u'create': {u'loadbalancerrule': {u'name': u'createLoadBalancerRule', u'related': [u'updateLoadBalancerRule'], u'isasync': True, u'params': [{u'name': u'openfirewall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, firewall rule for source/end public port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when LB rule is being created for VPC guest network 2) in all other cases defaulted to true'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the load balancer. Must be used with the domainId parameter.'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the load balancer'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'zone where the load balancer is going to be created. This parameter is required when LB service provider is ElasticLoadBalancerVm'}, {u'name': u'publicipid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'public ip address id from where the network traffic will be load balanced from'}, {u'name': u'algorithm', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'load balancer algorithm (source, roundrobin, leastconn)'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the load balancer rule'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to forward traffic from'}, {u'name': u'publicport', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the public port from where the network traffic will be load balanced from'}, {u'name': u'description', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the description of the load balancer rule'}, {u'name': u'privateport', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the private port of the private ip address/virtual machine where the network traffic will be load balanced to'}, {u'name': u'networkid', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The guest network this rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)'}], u'requiredparams': [u'algorithm', u'name', u'publicport', u'privateport'], u'description': u'Creates a load balancer rule'}, u'domain': {u'name': u'createDomain', u'related': [], u'isasync': False, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'creates domain with this name'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Domain UUID, required for adding domain from another Region'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Network domain for networks in the domain'}, {u'name': u'parentdomainid', u'required': False, u'related': [u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.'}], u'requiredparams': [u'name'], u'description': u'Creates a domain'}, u'snapshotpolicy': {u'name': u'createSnapshotPolicy', u'related': [u'listSnapshotPolicies'], u'isasync': False, u'params': [{u'name': u'intervaltype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'valid values are HOURLY, DAILY, WEEKLY, and MONTHLY'}, {u'name': u'maxsnaps', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'maximum number of snapshots to retain'}, {u'name': u'schedule', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'time the snapshot is scheduled to be taken. Format is:* if HOURLY, MM* if DAILY, MM:HH* if WEEKLY, MM:HH:DD (1-7)* if MONTHLY, MM:HH:DD (1-28)'}, {u'name': u'timezone', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.'}, {u'name': u'volumeid', u'required': True, u'related': [u'detachVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}], u'requiredparams': [u'intervaltype', u'maxsnaps', u'schedule', u'timezone', u'volumeid'], u'description': u'Creates a snapshot policy for the account.'}, u'diskoffering': {u'name': u'createDiskOffering', u'related': [u'listDiskOfferings'], u'isasync': False, u'params': [{u'name': u'customized', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'whether disk offering is custom or not'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 4096, u'type': u'string', u'description': u'alternate display text of the disk offering'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the containing domain, null for public offerings'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the disk offering'}, {u'name': u'disksize', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'size of the disk offering in GB'}, {u'name': u'storagetype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the storage type of the disk offering. Values are local and shared.'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'tags for the disk offering'}], u'requiredparams': [u'displaytext', u'name'], u'description': u'Creates a disk offering.'}, u'securitygroup': {u'name': u'createSecurityGroup', u'related': [u'listSecurityGroups'], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the security group. Must be used with domainId.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the security group. If the account parameter is used, domainId must also be used.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the security group'}, {u'name': u'description', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the description of the security group'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Deploy vm for the project'}], u'requiredparams': [u'name'], u'description': u'Creates a security group'}, u'portforwardingrule': {u'name': u'createPortForwardingRule', u'related': [u'listIpForwardingRules'], u'isasync': True, u'params': [{u'name': u'privateport', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u"the starting port of port forwarding rule's private port range"}, {u'name': u'ipaddressid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the IP address id of the port forwarding rule'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the port fowarding rule. Valid values are TCP or UDP.'}, {u'name': u'openfirewall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when PF rule is being created for VPC guest network 2) in all other cases defaulted to true'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine for the port forwarding rule'}, {u'name': u'privateendport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u"the ending port of port forwarding rule's private port range"}, {u'name': u'networkid', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The network of the vm the Port Forwarding rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)'}, {u'name': u'publicendport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u"the ending port of port forwarding rule's private port range"}, {u'name': u'publicport', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u"the starting port of port forwarding rule's public port range"}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to forward traffic from'}], u'requiredparams': [u'privateport', u'ipaddressid', u'protocol', u'virtualmachineid', u'publicport'], u'description': u'Creates a port forwarding rule'}, u'pod': {u'name': u'createPod', u'related': [u'updatePod', u'listPods'], u'isasync': False, u'params': [{u'name': u'startip', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the starting IP address for the Pod'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the Pod'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID in which the Pod will be created'}, {u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address for the Pod'}, {u'name': u'netmask', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask for the Pod'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this Pod for allocation of new resources'}, {u'name': u'gateway', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway for the Pod'}], u'requiredparams': [u'startip', u'name', u'zoneid', u'netmask', u'gateway'], u'description': u'Creates a new Pod.'}, u'ipforwardingrule': {u'name': u'createIpForwardingRule', u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'listPortForwardingRules', u'createPortForwardingRule'], u'isasync': True, u'params': [{u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the end port for the rule'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to forward traffic from'}, {u'name': u'ipaddressid', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the public IP address id of the forwarding rule, already associated via associateIp'}, {u'name': u'openfirewall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default'}, {u'name': u'startport', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the start port for the rule'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the rule. Valid values are TCP or UDP.'}], u'requiredparams': [u'ipaddressid', u'startport', u'protocol'], u'description': u'Creates an ip forwarding rule'}, u'vpnconnection': {u'name': u'createVpnConnection', u'related': [u'listVpnConnections', u'resetVpnConnection'], u'isasync': True, u'params': [{u'name': u's2svpngatewayid', u'required': True, u'related': [u'createVpnGateway', u'listVpnGateways'], u'length': 255, u'type': u'uuid', u'description': u'id of the vpn gateway'}, {u'name': u's2scustomergatewayid', u'required': True, u'related': [u'updateVpnCustomerGateway', u'createVpnCustomerGateway', u'listVpnCustomerGateways'], u'length': 255, u'type': u'uuid', u'description': u'id of the customer gateway'}], u'requiredparams': [u's2svpngatewayid', u's2scustomergatewayid'], u'description': u'Create site to site vpn connection'}, u'vpncustomergateway': {u'name': u'createVpnCustomerGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.'}, {u'name': u'gateway', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'public ip address id of the customer gateway'}, {u'name': u'esplifetime', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Lifetime of phase 2 VPN connection to the customer gateway, in seconds'}, {u'name': u'esppolicy', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'ESP policy of the customer gateway'}, {u'name': u'ikepolicy', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'IKE policy of the customer gateway'}, {u'name': u'cidrlist', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'guest cidr list of the customer gateway'}, {u'name': u'dpd', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'If DPD is enabled for VPN connection'}, {u'name': u'ipsecpsk', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'IPsec Preshared-Key of the customer gateway'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the gateway. Must be used with the domainId parameter.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of this customer gateway'}, {u'name': u'ikelifetime', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Lifetime of phase 1 VPN connection to the customer gateway, in seconds'}], u'requiredparams': [u'gateway', u'esppolicy', u'ikepolicy', u'cidrlist', u'ipsecpsk'], u'description': u'Creates site to site vpn customer gateway'}, u'lbstickinesspolicy': {u'name': u'createLBStickinessPolicy', u'related': [], u'isasync': True, u'params': [{u'name': u'lbruleid', u'required': True, u'related': [u'listIpForwardingRules'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the LB Stickiness policy'}, {u'name': u'methodname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the LB Stickiness policy method, possible values can be obtained from ListNetworks API '}, {u'name': u'description', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the description of the LB Stickiness policy'}, {u'name': u'param', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'param list. Example: param[0].name=cookiename¶m[0].value=LBCookie '}], u'requiredparams': [u'lbruleid', u'name', u'methodname'], u'description': u'Creates a Load Balancer stickiness policy '}, u'vpcoffering': {u'name': u'createVPCOffering', u'related': [u'listVPCOfferings'], u'isasync': True, u'params': [{u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the vpc offering'}, {u'name': u'supportedservices', u'required': True, u'related': [], u'length': 255, u'type': u'list', u'description': u'services supported by the vpc offering'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the vpc offering'}], u'requiredparams': [u'displaytext', u'supportedservices', u'name'], u'description': u'Creates VPC offering'}, u'network': {u'name': u'createNetwork', u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'isasync': False, u'params': [{u'name': u'endipv6', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IPv6 address in the IPv6 network range'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'an optional project for the ssh key'}, {u'name': u'ip6cidr', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the CIDR of IPv6 network, must be at least /64'}, {u'name': u'acltype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Access control type; supported values are account and domain. In 3.0 all shared networks should have aclType=Domain, and all Isolated networks - Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network'}, {u'name': u'gateway', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway of the network. Required for Shared networks and Isolated networks when it belongs to VPC'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the network'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID the network belongs to'}, {u'name': u'subdomainaccess', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Defines whether to allow subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified'}, {u'name': u'startip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IP address in the network IP range'}, {u'name': u'netmask', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask of the network. Required for Shared networks and Isolated networks when it belongs to VPC'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'domain ID of the account owning a network'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'network domain'}, {u'name': u'ip6gateway', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'account who will own the network'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the network'}, {u'name': u'startipv6', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IPv6 address in the IPv6 network range'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the network'}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'the VPC network belongs to'}, {u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address in the network IP range. If not specified, will be defaulted to startIP'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ID or VID of the network'}, {u'name': u'networkofferingid', u'required': True, u'related': [u'createNetworkOffering', u'updateNetworkOffering'], u'length': 255, u'type': u'uuid', u'description': u'the network offering id'}], u'requiredparams': [u'displaytext', u'zoneid', u'name', u'networkofferingid'], u'description': u'Creates a network'}, u'zone': {u'name': u'createZone', u'related': [u'listZones'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the containing domain, null for public zones'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the Zone'}, {u'name': u'ip6dns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second DNS for IPv6 network in the Zone'}, {u'name': u'domain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Network domain name for the networks in the zone'}, {u'name': u'internaldns1', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first internal DNS for the Zone'}, {u'name': u'localstorageenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if local storage offering enabled, false otherwise'}, {u'name': u'securitygroupenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network is security group enabled, false otherwise'}, {u'name': u'networktype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'network type of the zone, can be Basic or Advanced'}, {u'name': u'internaldns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second internal DNS for the Zone'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this Zone for allocation of new resources'}, {u'name': u'guestcidraddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the guest CIDR address for the Zone'}, {u'name': u'dns1', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first DNS for the Zone'}, {u'name': u'ip6dns1', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first DNS for IPv6 network in the Zone'}, {u'name': u'dns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second DNS for the Zone'}], u'requiredparams': [u'name', u'internaldns1', u'networktype', u'dns1'], u'description': u'Creates a Zone.'}, u'remoteaccessvpn': {u'name': u'createRemoteAccessVpn', u'related': [], u'isasync': True, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the VPN. Must be used with domainId.'}, {u'name': u'openfirewall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default'}, {u'name': u'publicipid', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'public ip address id of the vpn server'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the VPN. If the account parameter is used, domainId must also be used.'}, {u'name': u'iprange', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the range of ip addresses to allocate to vpn clients. The first ip in the range will be taken by the vpn server'}], u'requiredparams': [u'publicipid'], u'description': u'Creates a l2tp/ipsec remote access vpn'}, u'instancegroup': {u'name': u'createInstanceGroup', u'related': [], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account of the instance group. The account parameter must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The project of the instance group'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the instance group'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID of account owning the instance group'}], u'requiredparams': [u'name'], u'description': u'Creates a vm group'}, u'autoscalepolicy': {u'name': u'createAutoScalePolicy', u'related': [u'updateAutoScalePolicy'], u'isasync': True, u'params': [{u'name': u'action', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the action to be executed if all the conditions evaluate to true for the specified duration.'}, {u'name': u'quiettime', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the cool down period for which the policy should not be evaluated after the action has been taken'}, {u'name': u'conditionids', u'required': True, u'related': [], u'length': 255, u'type': u'list', u'description': u'the list of IDs of the conditions that are being evaluated on every interval'}, {u'name': u'duration', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the duration for which the conditions have to be true before action is taken'}], u'requiredparams': [u'action', u'conditionids', u'duration'], u'description': u'Creates an autoscale policy for a provision or deprovision action, the action is taken when the all the conditions evaluates to true for the specified duration. The policy is in effect once it is attached to a autscale vm group.'}, u'tags': {u'name': u'createTags', u'related': [], u'isasync': True, u'params': [{u'name': u'tags', u'required': True, u'related': [], u'length': 255, u'type': u'map', u'description': u'Map of tags (key/value pairs)'}, {u'name': u'resourcetype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'type of the resource'}, {u'name': u'customer', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"identifies client specific tag. When the value is not null, the tag can't be used by cloudStack code internally"}, {u'name': u'resourceids', u'required': True, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of resources to create the tags for'}], u'requiredparams': [u'tags', u'resourcetype', u'resourceids'], u'description': u'Creates resource tag(s)'}, u'serviceoffering': {u'name': u'createServiceOffering', u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings'], u'isasync': False, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the service offering'}, {u'name': u'storagetype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the storage type of the service offering. Values are local and shared.'}, {u'name': u'issystem', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'is this a system vm offering'}, {u'name': u'cpunumber', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'the CPU number of the service offering'}, {u'name': u'systemvmtype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the system VM type. Possible types are "domainrouter", "consoleproxy" and "secondarystoragevm".'}, {u'name': u'limitcpuuse', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'restrict the CPU usage to committed service offering'}, {u'name': u'hosttags', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the host tag for this service offering.'}, {u'name': u'offerha', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'the HA for the service offering'}, {u'name': u'memory', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'the total memory of the service offering in MB'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the containing domain, null for public offerings'}, {u'name': u'cpuspeed', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'the CPU speed of the service offering in MHz.'}, {u'name': u'networkrate', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having "domainrouter" systemvmtype'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the service offering'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the tags for this service offering.'}], u'requiredparams': [u'name', u'cpunumber', u'memory', u'cpuspeed', u'displaytext'], u'description': u'Creates a service offering.'}, u'condition': {u'name': u'createCondition', u'related': [], u'isasync': True, u'params': [{u'name': u'threshold', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'Threshold value.'}, {u'name': u'counterid', u'required': True, u'related': [u'listConditions', u'listCounters', u'createCounter'], u'length': 255, u'type': u'uuid', u'description': u'ID of the Counter.'}, {u'name': u'relationaloperator', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Relational Operator to be used with threshold.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account of the condition. Must be used with the domainId parameter.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID of the account.'}], u'requiredparams': [u'threshold', u'counterid', u'relationaloperator'], u'description': u'Creates a condition'}, u'storagepool': {u'name': u'createStoragePool', u'related': [u'cancelStorageMaintenance', u'listStoragePools'], u'isasync': False, u'params': [{u'name': u'clusterid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the cluster ID for the storage pool'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the storage pool'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name for the storage pool'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the tags for the storage pool'}, {u'name': u'podid', u'required': True, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the storage pool'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL of the storage pool'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'the details for the storage pool'}], u'requiredparams': [u'clusterid', u'zoneid', u'name', u'podid', u'url'], u'description': u'Creates a storage pool.'}, u'vpngateway': {u'name': u'createVpnGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'vpcid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'public ip address id of the vpn gateway'}], u'requiredparams': [u'vpcid'], u'description': u'Creates site to site vpn local gateway'}, u'autoscalevmgroup': {u'name': u'createAutoScaleVmGroup', u'related': [u'updateAutoScaleVmGroup'], u'isasync': True, u'params': [{u'name': u'vmprofileid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the autoscale profile that contains information about the vms in the vm group.'}, {u'name': u'scaledownpolicyids', u'required': True, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'list', u'description': u'list of scaledown autoscale policies'}, {u'name': u'scaleuppolicyids', u'required': True, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'list', u'description': u'list of scaleup autoscale policies'}, {u'name': u'interval', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the frequency at which the conditions have to be evaluated'}, {u'name': u'minmembers', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.'}, {u'name': u'maxmembers', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.'}, {u'name': u'lbruleid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}], u'requiredparams': [u'vmprofileid', u'scaledownpolicyids', u'scaleuppolicyids', u'minmembers', u'maxmembers', u'lbruleid'], u'description': u'Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.'}, u'networkacl': {u'name': u'createNetworkACL', u'related': [], u'isasync': True, u'params': [{u'name': u'icmpcode', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'error code for this icmp message'}, {u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the ending port of ACL'}, {u'name': u'traffictype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the traffic type for the ACL,can be Ingress or Egress, defaulted to Ingress if not specified'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to allow traffic from/to'}, {u'name': u'networkid', u'required': True, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The network of the vm the ACL will be created for'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the ACL rule. Valid values are TCP/UDP/ICMP.'}, {u'name': u'startport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the starting port of ACL'}, {u'name': u'icmptype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'type of the icmp message being sent'}], u'requiredparams': [u'networkid', u'protocol'], u'description': u'Creates a ACL rule the given network (the network has to belong to VPC)'}, u'template': {u'name': u'createTemplate', u'related': [u'cancelStorageMaintenance', u'enableStorageMaintenance', u'updateStoragePool', u'createStoragePool', u'listStoragePools'], u'isasync': True, u'params': [{u'name': u'ostypeid', u'required': True, u'related': [u'listOsTypes'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS Type that best represents the OS of this template.'}, {u'name': u'templatetag', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the tag for this template.'}, {u'name': u'bits', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'32 or 64 bit'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this template is a public template, false otherwise'}, {u'name': u'volumeid', u'required': False, u'related': [u'migrateVolume', u'detachVolume', u'resizeVolume', u'attachVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in'}, {u'name': u'passwordenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template supports the password reset feature; default is false'}, {u'name': u'snapshotid', u'required': False, u'related': [u'createSnapshot', u'listSnapshots'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'listLoadBalancerRuleInstances', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Optional, VM ID. If this presents, it is going to create a baremetal template for VM this ID refers to. This is only for VM whose hypervisor type is BareMetal'}, {u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Optional, only for baremetal hypervisor. The directory name where template stored on CIFS server'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the display text of the template. This is usually used for display purposes.'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'Template details in key/value pairs.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the template'}, {u'name': u'isfeatured', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this template is a featured template, false otherwise'}, {u'name': u'requireshvm', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template requres HVM, false otherwise'}], u'requiredparams': [u'ostypeid', u'displaytext', u'name'], u'description': u'Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.'}, u'privategateway': {u'name': u'createPrivateGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'vlan', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the Vlan for the private gateway'}, {u'name': u'gateway', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway of the Private gateway'}, {u'name': u'netmask', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask of the Private gateway'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID the network belongs to'}, {u'name': u'vpcid', u'required': True, u'related': [u'restartVPC'], u'length': 255, u'type': u'uuid', u'description': u'the VPC network belongs to'}, {u'name': u'ipaddress', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the IP address of the Private gateaway'}], u'requiredparams': [u'vlan', u'gateway', u'netmask', u'vpcid', u'ipaddress'], u'description': u'Creates a private gateway'}, u'volumeonfiler': {u'name': u'createVolumeOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'volumename', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'volume name.'}, {u'name': u'aggregatename', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'aggregate name.'}, {u'name': u'poolname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}, {u'name': u'snapshotpolicy', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'snapshot policy.'}, {u'name': u'ipaddress', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'ip address.'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'password.'}, {u'name': u'size', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'volume size.'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'user name.'}, {u'name': u'snapshotreservation', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'snapshot reservation.'}], u'requiredparams': [u'volumename', u'aggregatename', u'poolname', u'ipaddress', u'password', u'size', u'username'], u'description': u'Create a volume'}, u'staticroute': {u'name': u'createStaticRoute', u'related': [], u'isasync': True, u'params': [{u'name': u'gatewayid', u'required': True, u'related': [u'createPrivateGateway'], u'length': 255, u'type': u'uuid', u'description': u'the gateway id we are creating static route for'}, {u'name': u'cidr', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'static route cidr'}], u'requiredparams': [u'gatewayid', u'cidr'], u'description': u'Creates a static route'}, u'volume': {u'name': u'createVolume', u'related': [u'detachVolume', u'uploadVolume'], u'isasync': True, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the disk volume'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the availability zone'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts'], u'length': 255, u'type': u'uuid', u'description': u'the project associated with the volume. Mutually exclusive with account parameter'}, {u'name': u'diskofferingid', u'required': False, u'related': [u'updateDiskOffering', u'createDiskOffering', u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the disk volume. Must be used with the domainId parameter.'}, {u'name': u'size', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Arbitrary volume size'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.'}, {u'name': u'snapshotid', u'required': False, u'related': [u'createSnapshot', u'listSnapshots'], u'length': 255, u'type': u'uuid', u'description': u'the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.'}], u'requiredparams': [u'name'], u'description': u'Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.'}, u'user': {u'name': u'createUser', u'related': [u'lockUser', u'listUsers'], u'isasync': False, u'params': [{u'name': u'account', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Creates the user under the specified account. If no account is specified, the username will be used as the account name.'}, {u'name': u'userid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'User UUID, required for adding account from external provisioning system'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Unique username.'}, {u'name': u'timezone', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Creates the user under the specified domain. Has to be accompanied with the account parameter'}, {u'name': u'email', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'email'}, {u'name': u'lastname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'lastname'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.'}, {u'name': u'firstname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'firstname'}], u'requiredparams': [u'account', u'username', u'email', u'lastname', u'password', u'firstname'], u'description': u'Creates a user for an account that already exists'}, u'vpc': {u'name': u'createVPC', u'related': [u'updateVPC', u'restartVPC', u'listVPCs'], u'isasync': True, u'params': [{u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the VPC'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the availability zone'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the VPC'}, {u'name': u'vpcofferingid', u'required': True, u'related': [u'listVPCOfferings', u'createVPCOffering'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the VPC offering'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'VPC network domain. All networks inside the VPC will belong to this domain'}, {u'name': u'cidr', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u"the cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the VPC. Must be used with the domainId parameter.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the VPC. If used with the account parameter returns the VPC associated with the account for the specified domain.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts'], u'length': 255, u'type': u'uuid', u'description': u'create VPC for the project'}], u'requiredparams': [u'displaytext', u'zoneid', u'name', u'vpcofferingid', u'cidr'], u'description': u'Creates a VPC'}, u'storagenetworkiprange': {u'name': u'createStorageNetworkIpRange', u'related': [u'listStorageNetworkIpRange', u'updateStorageNetworkIpRange'], u'isasync': True, u'params': [{u'name': u'startip', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IP address'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table'}, {u'name': u'podid', u'required': True, u'related': [u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'UUID of pod where the ip range belongs to'}, {u'name': u'netmask', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask for storage network'}, {u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address'}, {u'name': u'gateway', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway for storage network'}], u'requiredparams': [u'startip', u'podid', u'netmask', u'gateway'], u'description': u'Creates a Storage network IP range.'}, u'pool': {u'name': u'createPool', u'related': [], u'isasync': False, u'params': [{u'name': u'algorithm', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'algorithm.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'algorithm', u'name'], u'description': u'Create a pool'}, u'autoscalevmprofile': {u'name': u'createAutoScaleVmProfile', u'related': [u'updateAutoScaleVmProfile', u'listAutoScaleVmProfiles'], u'isasync': True, u'params': [{u'name': u'otherdeployparams', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'availability zone for the auto deployed virtual machine'}, {u'name': u'serviceofferingid', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings', u'createServiceOffering', u'updateServiceOffering'], u'length': 255, u'type': u'uuid', u'description': u'the service offering of the auto deployed virtual machine'}, {u'name': u'destroyvmgraceperiod', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the time allowed for existing connections to get closed before a vm is destroyed'}, {u'name': u'counterparam', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161'}, {u'name': u'templateid', u'required': True, u'related': [u'registerIso', u'updateTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the template of the auto deployed virtual machine'}, {u'name': u'autoscaleuserid', u'required': False, u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser', u'updateUser'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the user used to launch and destroy the VMs'}], u'requiredparams': [u'zoneid', u'serviceofferingid', u'templateid'], u'description': u'Creates a profile that contains information about the virtual machine which will be provisioned automatically by autoscale feature.'}, u'account': {u'name': u'createAccount', u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser', u'getUser', u'updateUser'], u'isasync': False, u'params': [{u'name': u'lastname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'lastname'}, {u'name': u'accounttype', u'required': True, u'related': [], u'length': 255, u'type': u'short', u'description': u'Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Unique username.'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.'}, {u'name': u'firstname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'firstname'}, {u'name': u'userid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'User UUID, required for adding account from external provisioning system'}, {u'name': u'timezone', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Creates the user under the specified account. If no account is specified, the username will be used as the account name.'}, {u'name': u'accountdetails', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'details for account used to store specific parameters'}, {u'name': u'email', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'email'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"Network domain for the account's networks"}, {u'name': u'accountid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Account UUID, required for adding account from external provisioning system'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'Creates the user under the specified domain.'}], u'requiredparams': [u'lastname', u'accounttype', u'username', u'password', u'firstname', u'email'], u'description': u'Creates an account'}, u'firewallrule': {u'name': u'createFirewallRule', u'related': [u'listEgressFirewallRules'], u'isasync': True, u'params': [{u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to forward traffic from'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'type of firewallrule: system/user'}, {u'name': u'ipaddressid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the IP address id of the port forwarding rule'}, {u'name': u'startport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the starting port of firewall rule'}, {u'name': u'icmptype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'type of the icmp message being sent'}, {u'name': u'icmpcode', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'error code for this icmp message'}, {u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the ending port of firewall rule'}], u'requiredparams': [u'protocol', u'ipaddressid'], u'description': u'Creates a firewall rule for a given ip address'}, u'networkoffering': {u'name': u'createNetworkOffering', u'related': [u'updateNetworkOffering'], u'isasync': False, u'params': [{u'name': u'serviceproviderlist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'provider to service mapping. If not specified, the provider for the service will be mapped to the default provider on the physical network'}, {u'name': u'serviceofferingid', u'required': False, u'related': [u'updateHypervisorCapabilities'], u'length': 255, u'type': u'uuid', u'description': u'the service offering ID used by virtual router provider'}, {u'name': u'supportedservices', u'required': True, u'related': [], u'length': 255, u'type': u'list', u'description': u'services supported by the network offering'}, {u'name': u'networkrate', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'data transfer rate in megabits per second allowed'}, {u'name': u'ispersistent', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network offering supports persistent networks; defaulted to false if not specified'}, {u'name': u'servicecapabilitylist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'desired service capabilities as part of network offering'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the network offering'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the tags for the network offering.'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the network offering'}, {u'name': u'conservemode', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the network offering is IP conserve mode enabled'}, {u'name': u'guestiptype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'guest type of the network offering: Shared or Isolated'}, {u'name': u'traffictype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the traffic type for the network offering. Supported type in current release is GUEST only'}, {u'name': u'specifyvlan', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network offering supports vlans'}, {u'name': u'availability', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the availability of network offering. Default value is Optional'}, {u'name': u'specifyipranges', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network offering supports specifying ip ranges; defaulted to false if not specified'}], u'requiredparams': [u'supportedservices', u'name', u'displaytext', u'guestiptype', u'traffictype'], u'description': u'Creates a network offering.'}, u'vlaniprange': {u'name': u'createVlanIpRange', u'related': [u'listVlanIpRanges'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'domain ID of the account owning a VLAN'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'project who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ID or VID of the VLAN. If not specified, will be defaulted to the vlan of the network or if vlan of the network is null - to Untagged'}, {u'name': u'networkid', u'required': False, u'related': [u'createNetwork', u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'the network id'}, {u'name': u'forvirtualnetwork', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if VLAN is of Virtual type, false if Direct'}, {u'name': u'podid', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'optional parameter. Have to be specified for Direct Untagged vlan only.'}, {u'name': u'ip6cidr', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the CIDR of IPv6 network, must be at least /64'}, {u'name': u'endipv6', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IPv6 address in the IPv6 network range'}, {u'name': u'startip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IP address in the VLAN IP range'}, {u'name': u'startipv6', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IPv6 address in the IPv6 network range'}, {u'name': u'gateway', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway of the VLAN IP range'}, {u'name': u'netmask', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask of the VLAN IP range'}, {u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address in the VLAN IP range'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited'}, {u'name': u'ip6gateway', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the physical network id'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID of the VLAN IP range'}], u'requiredparams': [], u'description': u'Creates a VLAN IP range.'}, u'counter': {u'name': u'createCounter', u'related': [u'listCounters'], u'isasync': True, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the counter.'}, {u'name': u'source', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Source of the counter.'}, {u'name': u'value', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Value of the counter e.g. oid in case of snmp.'}], u'requiredparams': [u'name', u'source', u'value'], u'description': u'Adds metric counter'}, u'lunonfiler': {u'name': u'createLunOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'size', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'LUN size.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'size', u'name'], u'description': u'Create a LUN from a pool'}, u'project': {u'name': u'createProject', u'related': [], u'isasync': True, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'account who will be Admin for the project'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the project'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'domain ID of the account owning a project'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'display text of the project'}], u'requiredparams': [u'name', u'displaytext'], u'description': u'Creates a project'}, u'physicalnetwork': {u'name': u'createPhysicalNetwork', u'related': [u'listPhysicalNetworks'], u'isasync': True, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the physical network'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the physical network'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'Tag the physical network'}, {u'name': u'networkspeed', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the speed for the physical network[1G/10G]'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the VLAN for the physical network'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'domain ID of the account owning a physical network'}, {u'name': u'broadcastdomainrange', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the broadcast domain range for the physical network[Pod or Zone]. In Acton release it can be Zone only in Advance zone, and Pod in Basic'}, {u'name': u'isolationmethods', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the isolation method for the physical network[VLAN/L3/GRE]'}], u'requiredparams': [u'name', u'zoneid'], u'description': u'Creates a physical network'}, u'snapshot': {u'name': u'createSnapshot', u'related': [u'listSnapshots'], u'isasync': True, u'params': [{u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The account of the snapshot. The account parameter must be used with the domainId parameter.'}, {u'name': u'volumeid', u'required': True, u'related': [u'detachVolume'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the disk volume'}, {u'name': u'policyid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'policy id of the snapshot, if this is null, then use MANUAL_POLICY.'}], u'requiredparams': [u'volumeid'], u'description': u'Creates an instant snapshot of a volume.'}, u'virtualrouterelement': {u'name': u'createVirtualRouterElement', u'related': [], u'isasync': True, u'params': [{u'name': u'nspid', u'required': True, u'related': [u'updateNetworkServiceProvider'], u'length': 255, u'type': u'uuid', u'description': u'the network service provider ID of the virtual router element'}], u'requiredparams': [u'nspid'], u'description': u'Create a virtual router element.'}, u'egressfirewallrule': {u'name': u'createEgressFirewallRule', u'related': [u'createFirewallRule', u'listEgressFirewallRules'], u'isasync': True, u'params': [{u'name': u'networkid', u'required': True, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'the network id of the port forwarding rule'}, {u'name': u'startport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the starting port of firewall rule'}, {u'name': u'icmpcode', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'error code for this icmp message'}, {u'name': u'icmptype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'type of the icmp message being sent'}, {u'name': u'cidrlist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the cidr list to forward traffic from'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'type of firewallrule: system/user'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.'}, {u'name': u'endport', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the ending port of firewall rule'}], u'requiredparams': [u'networkid', u'protocol'], u'description': u'Creates a egress firewall rule for a given network '}, u'sshkeypair': {u'name': u'createSSHKeyPair', u'related': [u'listSSHKeyPairs'], u'isasync': False, u'params': [{u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'an optional project for the ssh key'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the keypair'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the ssh key. Must be used with domainId.'}], u'requiredparams': [u'name'], u'description': u'Create a new keypair and returns the private key'}}, u'deploy': {u'virtualmachine': {u'name': u'deployVirtualMachine', u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'keypair', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the ssh key pair used to login to the virtual machine'}, {u'name': u'userdata', u'required': False, u'related': [], u'length': 2048, u'type': u'string', u'description': u'an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the hypervisor on which to deploy the virtual machine'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.'}, {u'name': u'size', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId'}, {u'name': u'diskofferingid', u'required': False, u'related': [u'createDiskOffering', u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.'}, {u'name': u'securitygroupids', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter'}, {u'name': u'serviceofferingid', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the service offering for the virtual machine'}, {u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"the ip address for default vm's network"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the virtual machine. Must be used with domainId.'}, {u'name': u'hostid', u'required': False, u'related': [u'addHost', u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'destination Host ID to deploy the VM to - parameter available for root admin only'}, {u'name': u'iptonetworklist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u"ip to network mapping. Can't be specified with networkIds parameter. Example: iptonetworklist[0].ip=10.10.10.11&iptonetworklist[0].ipv6=fc00:1234:5678::abcd&iptonetworklist[0].networkid=uuid - requests to use ip 10.10.10.11 in network id=uuid"}, {u'name': u'ip6address', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"the ipv6 address for default vm's network"}, {u'name': u'keyboard', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'Deploy vm for the project'}, {u'name': u'networkids', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'list', u'description': u"list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter"}, {u'name': u'displayname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional user generated name for the virtual machine'}, {u'name': u'securitygroupnames', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'comma separated list of security groups names that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter'}, {u'name': u'templateid', u'required': True, u'related': [u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the template for the virtual machine'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'availability zone for the virtual machine'}, {u'name': u'group', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional group for the virtual machine'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'host name for the virtual machine'}, {u'name': u'startvm', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network offering supports specifying ip ranges; defaulted to true if not specified'}], u'requiredparams': [u'serviceofferingid', u'templateid', u'zoneid'], u'description': u'Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.'}}, u'restart': {u'network': {u'name': u'restartNetwork', u'related': [u'associateIpAddress'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The id of the network to restart.'}, {u'name': u'cleanup', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'If cleanup old network elements'}], u'requiredparams': [u'id'], u'description': u'Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules'}, u'vpc': {u'name': u'restartVPC', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': False, u'related': [u'restartVPC'], u'length': 255, u'type': u'uuid', u'description': u'the id of the VPC'}], u'requiredparams': [], u'description': u'Restarts a VPC'}}, u'reboot': {u'systemvm': {u'name': u'rebootSystemVm', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'rebootSystemVm'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the system virtual machine'}], u'requiredparams': [u'id'], u'description': u'Reboots a system VM.'}, u'router': {u'name': u'rebootRouter', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'rebootRouter'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the router'}], u'requiredparams': [u'id'], u'description': u'Starts a router.'}, u'virtualmachine': {u'name': u'rebootVirtualMachine', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'id'], u'description': u'Reboots a virtual machine.'}}, u'mark': {u'defaultzoneforaccount': {u'name': u'markDefaultZoneForAccount', u'related': [], u'isasync': True, u'params': [{u'name': u'account', u'required': True, u'related': [u'markDefaultZoneForAccount'], u'length': 255, u'type': u'string', u'description': u'Name of the account that is to be marked.'}, {u'name': u'domainid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Marks the account that belongs to the specified domain.'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The Zone ID with which the account is to be marked.'}], u'requiredparams': [u'account', u'domainid', u'zoneid'], u'description': u'Marks a default zone for this account'}}, u'start': {u'systemvm': {u'name': u'startSystemVm', u'related': [u'rebootSystemVm', u'listSystemVms', u'changeServiceForSystemVm'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'startSystemVm', u'rebootSystemVm', u'listSystemVms', u'changeServiceForSystemVm'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the system virtual machine'}], u'requiredparams': [u'id'], u'description': u'Starts a system virtual machine.'}, u'router': {u'name': u'startRouter', u'related': [u'destroyRouter', u'rebootRouter'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'destroyRouter', u'rebootRouter', u'startRouter'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the router'}], u'requiredparams': [u'id'], u'description': u'Starts a router.'}, u'virtualmachine': {u'name': u'startVirtualMachine', u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}, {u'name': u'hostid', u'required': False, u'related': [u'addHost', u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'destination Host ID to deploy the VM to - parameter available for root admin only'}], u'requiredparams': [u'id'], u'description': u'Starts a virtual machine.'}}, u'add': {u'trafficmonitor': {u'name': u'addTrafficMonitor', u'related': [u'listTrafficMonitors'], u'isasync': False, u'params': [{u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the traffic monitor Host'}, {u'name': u'includezones', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Traffic going into the listed zones will be metered'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'Zone in which to add the external firewall appliance.'}, {u'name': u'excludezones', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Traffic going into the listed zones will not be metered'}], u'requiredparams': [u'url', u'zoneid'], u'description': u'Adds Traffic Monitor Host for Direct Network Usage'}, u'secondarystorage': {u'name': u'addSecondaryStorage', u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the secondary storage'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL for the secondary storage'}], u'requiredparams': [u'url'], u'description': u'Adds secondary storage.'}, u'nictovirtualmachine': {u'name': u'addNicToVirtualMachine', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'listLoadBalancerRuleInstances', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'networkid', u'required': True, u'related': [u'createNetwork', u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'Network ID'}, {u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'IP Address for the new network'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'addNicToVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'listLoadBalancerRuleInstances', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Virtual Machine ID'}], u'requiredparams': [u'networkid', u'virtualmachineid'], u'description': u'Adds VM to specified network by creating a NIC'}, u'netscalerloadbalancer': {u'name': u'addNetscalerLoadBalancer', u'related': [u'listNetscalerLoadBalancers', u'configureNetscalerLoadBalancer'], u'isasync': True, u'params': [{u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach netscaler load balancer device'}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach netscaler load balancer device'}, {u'name': u'networkdevicetype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Netscaler device type supports NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the netscaler load balancer appliance.'}], u'requiredparams': [u'password', u'physicalnetworkid', u'username', u'networkdevicetype', u'url'], u'description': u'Adds a netscaler load balancer device'}, u'cluster': {u'name': u'addCluster', u'related': [u'listClusters', u'updateCluster'], u'isasync': False, u'params': [{u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this cluster for allocation of new resources'}, {u'name': u'vsmpassword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the password for the VSM associated with this cluster'}, {u'name': u'podid', u'required': True, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the host'}, {u'name': u'vsmipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ipaddress of the VSM associated with this cluster'}, {u'name': u'hypervisor', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator'}, {u'name': u'vsmusername', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for the VSM associated with this cluster'}, {u'name': u'username', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for the cluster'}, {u'name': u'clustertype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'type of the cluster: CloudManaged, ExternalManaged'}, {u'name': u'clustername', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the cluster name'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the cluster'}, {u'name': u'password', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the password for the host'}], u'requiredparams': [u'podid', u'hypervisor', u'clustertype', u'clustername', u'zoneid'], u'description': u'Adds a new cluster'}, u's3': {u'name': u'addS3', u'related': [], u'isasync': False, u'params': [{u'name': u'connectiontimeout', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'connection timeout (milliseconds)'}, {u'name': u'accesskey', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'S3 access key'}, {u'name': u'bucket', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the template storage bucket'}, {u'name': u'endpoint', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'S3 host name'}, {u'name': u'secretkey', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'S3 secret key'}, {u'name': u'sockettimeout', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'socket timeout (milliseconds)'}, {u'name': u'maxerrorretry', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'maximum number of times to retry on error'}, {u'name': u'usehttps', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'connect to the S3 endpoint via HTTPS?'}], u'requiredparams': [u'accesskey', u'bucket', u'secretkey'], u'description': u'Adds S3'}, u'accounttoproject': {u'name': u'addAccountToProject', u'related': [], u'isasync': True, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the account to be added to the project'}, {u'name': u'email', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'email to which invitation to the project is going to be sent'}, {u'name': u'projectid', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to add the account to'}], u'requiredparams': [u'projectid'], u'description': u'Adds acoount to a project'}, u'region': {u'name': u'addRegion', u'related': [], u'isasync': False, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the region'}, {u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Id of the Region'}, {u'name': u'endpoint', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Region service endpoint'}], u'requiredparams': [u'name', u'id', u'endpoint'], u'description': u'Adds a Region'}, u'externalloadbalancer': {u'name': u'addExternalLoadBalancer', u'related': [], u'isasync': False, u'params': [{u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Username of the external load balancer appliance.'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the external load balancer appliance.'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Password of the external load balancer appliance.'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'Zone in which to add the external load balancer appliance.'}], u'requiredparams': [u'username', u'url', u'password', u'zoneid'], u'description': u'Adds F5 external load balancer appliance.'}, u'vpnuser': {u'name': u'addVpnUser', u'related': [u'listVpnUsers'], u'isasync': True, u'params': [{u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'password for the username'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'username for the vpn user'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the vpn user. Must be used with domainId.'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'add vpn user to the specific project'}], u'requiredparams': [u'password', u'username'], u'description': u'Adds vpn users'}, u'baremetalhost': {u'name': u'addBaremetalHost', u'related': [u'listSwifts', u'addHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'isasync': False, u'params': [{u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'ip address intentionally allocated to this host after provisioning'}, {u'name': u'hosttags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of tags to be added to the host'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the host URL'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for the host'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the host'}, {u'name': u'clustername', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the cluster name for the host'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the cluster ID for the host'}, {u'name': u'hypervisor', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'hypervisor type of the host'}, {u'name': u'podid', u'required': True, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the host'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the password for the host'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this Host for allocation of new resources'}], u'requiredparams': [u'url', u'username', u'zoneid', u'hypervisor', u'podid', u'password'], u'description': u'add a baremetal host'}, u'traffictype': {u'name': u'addTrafficType', u'related': [u'updateTrafficType'], u'isasync': True, u'params': [{u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The VLAN id to be used for Management traffic by VMware host'}, {u'name': u'kvmnetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a KVM host'}, {u'name': u'traffictype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the trafficType to be added to the physical network'}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'vmwarenetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a VMware host'}, {u'name': u'xennetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a XenServer host'}], u'requiredparams': [u'traffictype', u'physicalnetworkid'], u'description': u'Adds traffic type to a physical network'}, u'niciranvpdevice': {u'name': u'addNiciraNvpDevice', u'related': [], u'isasync': True, u'params': [{u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'hostname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hostname of ip address of the Nicira NVP Controller.'}, {u'name': u'l3gatewayserviceuuid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The L3 Gateway Service UUID configured on the Nicira Controller'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to access the Nicira Controller API'}, {u'name': u'transportzoneuuid', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'The Transportzone UUID configured on the Nicira Controller'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to access the Nicira Controller API'}], u'requiredparams': [u'physicalnetworkid', u'hostname', u'username', u'transportzoneuuid', u'password'], u'description': u'Adds a Nicira NVP device'}, u'host': {u'name': u'addHost', u'related': [u'updateHost', u'listHosts'], u'isasync': False, u'params': [{u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for the host'}, {u'name': u'podid', u'required': True, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the host'}, {u'name': u'clustername', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the cluster name for the host'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the host'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the host URL'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the cluster ID for the host'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the password for the host'}, {u'name': u'hosttags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of tags to be added to the host'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this Host for allocation of new resources'}, {u'name': u'hypervisor', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'hypervisor type of the host'}], u'requiredparams': [u'username', u'podid', u'zoneid', u'url', u'password', u'hypervisor'], u'description': u'Adds a new host.'}, u'f5loadbalancer': {u'name': u'addF5LoadBalancer', u'related': [u'configureF5LoadBalancer', u'listF5LoadBalancers'], u'isasync': True, u'params': [{u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach F5 BigIP load balancer device'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach F5 BigIP load balancer device'}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'networkdevicetype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'supports only F5BigIpLoadBalancer'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the F5 load balancer appliance.'}], u'requiredparams': [u'password', u'username', u'physicalnetworkid', u'networkdevicetype', u'url'], u'description': u'Adds a F5 BigIP load balancer device'}, u'networkdevice': {u'name': u'addNetworkDevice', u'related': [], u'isasync': False, u'params': [{u'name': u'networkdevicetype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall'}, {u'name': u'networkdeviceparameterlist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'parameters for network device'}], u'requiredparams': [], u'description': u'Adds a network device of one of the following types: ExternalDhcp, ExternalFirewall, ExternalLoadBalancer, PxeServer'}, u'bigswitchvnsdevice': {u'name': u'addBigSwitchVnsDevice', u'related': [], u'isasync': True, u'params': [{u'name': u'physicalnetworkid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'hostname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hostname of ip address of the BigSwitch VNS Controller.'}], u'requiredparams': [u'physicalnetworkid', u'hostname'], u'description': u'Adds a BigSwitch VNS device'}, u'srxfirewall': {u'name': u'addSrxFirewall', u'related': [], u'isasync': True, u'params': [{u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach SRX firewall device'}, {u'name': u'networkdevicetype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'supports only JuniperSRXFirewall'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Credentials to reach SRX firewall device'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the SRX appliance.'}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}], u'requiredparams': [u'password', u'networkdevicetype', u'username', u'url', u'physicalnetworkid'], u'description': u'Adds a SRX firewall device'}, u'swift': {u'name': u'addSwift', u'related': [u'listSwifts', u'addHost', u'updateHost', u'listHosts', u'listExternalLoadBalancers'], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account for swift'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL for swift'}, {u'name': u'username', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for swift'}, {u'name': u'key', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u' key for the user for swift'}], u'requiredparams': [u'url'], u'description': u'Adds Swift.'}, u'externalfirewall': {u'name': u'addExternalFirewall', u'related': [], u'isasync': False, u'params': [{u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'URL of the external firewall appliance.'}, {u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Password of the external firewall appliance.'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Zone in which to add the external firewall appliance.'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Username of the external firewall appliance.'}], u'requiredparams': [u'url', u'password', u'zoneid', u'username'], u'description': u'Adds an external firewall appliance'}, u'networkserviceprovider': {u'name': u'addNetworkServiceProvider', u'related': [u'updateNetworkServiceProvider'], u'isasync': True, u'params': [{u'name': u'destinationphysicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the destination Physical Network ID to bridge to'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name for the physical network service provider'}, {u'name': u'servicelist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the list of services to be enabled for this physical network service provider'}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID to add the provider to'}], u'requiredparams': [u'name', u'physicalnetworkid'], u'description': u'Adds a network serviceProvider to a physical network'}}, u'verbs': [u'authorize', u'restore', u'suspend', u'revoke', u'disassociate', u'migrate', u'lock', u'dissociate', u'activate', u'reconnect', u'cancel', u'query', u'recover', u'extract', u'detach', u'prepare', u'start', u'create', u'associate', u'reboot', u'mark', u'attach', u'add', u'change', u'deploy', u'ldap', u'destroy', u'enable', u'configure', u'get', u'modify', u'stop', u'update', u'disable', u'resize', u'copy', u'generate', u'restart', u'reset', u'register', u'list', u'upload', u'remove', u'assign', u'delete'], u'resize': {u'volume': {u'name': u'resizeVolume', u'related': [u'detachVolume', u'uploadVolume', u'createVolume'], u'isasync': True, u'params': [{u'name': u'diskofferingid', u'required': False, u'related': [u'updateDiskOffering', u'createDiskOffering', u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'new disk offering id'}, {u'name': u'id', u'required': False, u'related': [u'detachVolume', u'resizeVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'shrinkok', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Verify OK to Shrink'}, {u'name': u'size', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'New volume size in G'}], u'requiredparams': [], u'description': u'Resizes a volume'}}, u'ldap': {u'config': {u'name': u'ldapConfig', u'related': [u'ldapRemove'], u'isasync': False, u'params': [{u'name': u'hostname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hostname or ip address of the ldap server eg: my.ldap.com'}, {u'name': u'ssl', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Check Use SSL if the external LDAP server is configured for LDAP over SSL.'}, {u'name': u'truststore', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enter the path to trust certificates store.'}, {u'name': u'queryfilter', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'You specify a query filter here, which narrows down the users, who can be part of this domain.'}, {u'name': u'searchbase', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com.'}, {u'name': u'port', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Specify the LDAP port if required, default is 389.'}, {u'name': u'binddn', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Specify the distinguished name of a user with the search permission on the directory.'}, {u'name': u'truststorepass', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enter the password for trust store.'}, {u'name': u'bindpass', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enter the password.'}], u'requiredparams': [u'hostname', u'queryfilter', u'searchbase'], u'description': u'Configure the LDAP context for this site.'}, u'remove': {u'name': u'ldapRemove', u'related': [], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'Remove the LDAP context for this site.'}}, u'destroy': {u'systemvm': {u'name': u'destroySystemVm', u'related': [u'startSystemVm', u'rebootSystemVm', u'listSystemVms', u'stopSystemVm', u'changeServiceForSystemVm'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'startSystemVm', u'destroySystemVm', u'rebootSystemVm', u'listSystemVms', u'stopSystemVm', u'changeServiceForSystemVm'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the system virtual machine'}], u'requiredparams': [u'id'], u'description': u'Destroyes a system virtual machine.'}, u'router': {u'name': u'destroyRouter', u'related': [u'rebootRouter'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'destroyRouter', u'rebootRouter'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the router'}], u'requiredparams': [u'id'], u'description': u'Destroys a router.'}, u'volumeonfiler': {u'name': u'destroyVolumeOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'volumename', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'volume name.'}, {u'name': u'ipaddress', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'ip address.'}, {u'name': u'aggregatename', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'aggregate name.'}], u'requiredparams': [u'volumename', u'ipaddress', u'aggregatename'], u'description': u'Destroy a Volume'}, u'lunonfiler': {u'name': u'destroyLunOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'path', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'LUN path.'}], u'requiredparams': [u'path'], u'description': u'Destroy a LUN'}, u'virtualmachine': {u'name': u'destroyVirtualMachine', u'related': [u'listVirtualMachines'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listVirtualMachines', u'destroyVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'id'], u'description': u'Destroys a virtual machine. Once destroyed, only the administrator can recover it.'}}, u'get': {u'apilimit': {u'name': u'getApiLimit', u'related': [u'resetApiLimit'], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'Get API limit count for the caller'}, u'vmpassword': {u'name': u'getVMPassword', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'id'], u'description': u'Returns an encrypted password for the VM'}, u'user': {u'name': u'getUser', u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser', u'updateUser'], u'isasync': False, u'params': [{u'name': u'userapikey', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'API key of the user'}], u'requiredparams': [u'userapikey'], u'description': u'Find user account by API key'}, u'cloudidentifier': {u'name': u'getCloudIdentifier', u'related': [], u'isasync': False, u'params': [{u'name': u'userid', u'required': True, u'related': [u'lockUser', u'listUsers', u'createUser'], u'length': 255, u'type': u'uuid', u'description': u'the user ID for the cloud identifier'}], u'requiredparams': [u'userid'], u'description': u'Retrieves a cloud identifier.'}}, u'count': 355, u'enable': {u'account': {u'name': u'enableAccount', u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount', u'disableAccount'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'Enables specified account in this domain.'}, {u'name': u'id', u'required': False, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount', u'enableAccount', u'disableAccount'], u'length': 255, u'type': u'uuid', u'description': u'Account id'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enables specified account.'}], u'requiredparams': [], u'description': u'Enables an account'}, u'storagemaintenance': {u'name': u'enableStorageMaintenance', u'related': [u'cancelStorageMaintenance', u'updateStoragePool', u'createStoragePool', u'listStoragePools'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'cancelStorageMaintenance', u'enableStorageMaintenance', u'updateStoragePool', u'createStoragePool', u'listStoragePools'], u'length': 255, u'type': u'uuid', u'description': u'Primary storage ID'}], u'requiredparams': [u'id'], u'description': u'Puts storage pool into maintenance state'}, u'cisconexusvsm': {u'name': u'enableCiscoNexusVSM', u'related': [u'disableCiscoNexusVSM'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'disableCiscoNexusVSM', u'enableCiscoNexusVSM'], u'length': 255, u'type': u'uuid', u'description': u'Id of the Cisco Nexus 1000v VSM device to be enabled'}], u'requiredparams': [u'id'], u'description': u'Enable a Cisco Nexus VSM device'}, u'staticnat': {u'name': u'enableStaticNat', u'related': [], u'isasync': False, u'params': [{u'name': u'ipaddressid', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the public IP address id for which static nat feature is being enabled'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine for enabling static nat feature'}, {u'name': u'networkid', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The network of the vm the static nat will be enabled for. Required when public Ip address is not associated with any Guest network yet (VPC case)'}], u'requiredparams': [u'ipaddressid', u'virtualmachineid'], u'description': u'Enables static nat for given ip address'}, u'user': {u'name': u'enableUser', u'related': [u'lockUser', u'listUsers', u'createUser'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'length': 255, u'type': u'uuid', u'description': u'Enables user by user ID.'}], u'requiredparams': [u'id'], u'description': u'Enables a user account'}, u'autoscalevmgroup': {u'name': u'enableAutoScaleVmGroup', u'related': [u'createAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale group'}], u'requiredparams': [u'id'], u'description': u'Enables an AutoScale Vm Group'}}, u'configure': {u'srxfirewall': {u'name': u'configureSrxFirewall', u'related': [u'listSrxFirewalls', u'addSrxFirewall'], u'isasync': True, u'params': [{u'name': u'fwdeviceid', u'required': True, u'related': [u'listSrxFirewalls', u'configureSrxFirewall', u'addSrxFirewall'], u'length': 255, u'type': u'uuid', u'description': u'SRX firewall device ID'}, {u'name': u'fwdevicecapacity', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'capacity of the firewall device, Capacity will be interpreted as number of networks device can handle'}], u'requiredparams': [u'fwdeviceid'], u'description': u'Configures a SRX firewall device'}, u'f5loadbalancer': {u'name': u'configureF5LoadBalancer', u'related': [], u'isasync': True, u'params': [{u'name': u'lbdeviceid', u'required': True, u'related': [u'configureF5LoadBalancer'], u'length': 255, u'type': u'uuid', u'description': u'F5 load balancer device ID'}, {u'name': u'lbdevicecapacity', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'capacity of the device, Capacity will be interpreted as number of networks device can handle'}], u'requiredparams': [u'lbdeviceid'], u'description': u'configures a F5 load balancer device'}, u'netscalerloadbalancer': {u'name': u'configureNetscalerLoadBalancer', u'related': [u'listNetscalerLoadBalancers'], u'isasync': True, u'params': [{u'name': u'podids', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'list', u'description': u"Used when NetScaler device is provider of EIP service. This parameter represents the list of pod's, for which there exists a policy based route on datacenter L3 router to route pod's subnet IP to a NetScaler device."}, {u'name': u'lbdevicecapacity', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'capacity of the device, Capacity will be interpreted as number of networks device can handle'}, {u'name': u'lbdeviceid', u'required': True, u'related': [u'listNetscalerLoadBalancers', u'configureNetscalerLoadBalancer'], u'length': 255, u'type': u'uuid', u'description': u'Netscaler load balancer device ID'}, {u'name': u'inline', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if netscaler load balancer is intended to be used in in-line with firewall, false if netscaler load balancer will side-by-side with firewall'}, {u'name': u'lbdevicededicated', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this netscaler device to dedicated for a account, false if the netscaler device will be shared by multiple accounts'}], u'requiredparams': [u'lbdeviceid'], u'description': u'configures a netscaler load balancer device'}, u'virtualrouterelement': {u'name': u'configureVirtualRouterElement', u'related': [u'createVirtualRouterElement'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createVirtualRouterElement', u'configureVirtualRouterElement'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual router provider'}, {u'name': u'enabled', u'required': True, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Enabled/Disabled the service provider'}], u'requiredparams': [u'id', u'enabled'], u'description': u'Configures a virtual router element.'}}, u'associate': {u'ipaddress': {u'name': u'associateIpAddress', u'related': [], u'isasync': True, u'params': [{u'name': u'networkid', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'The network this ip address should be associated to.'}, {u'name': u'vpcid', u'required': False, u'related': [u'restartVPC', u'listVPCs'], u'length': 255, u'type': u'uuid', u'description': u'the VPC you want the ip address to be associated with'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account to associate with this IP address'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the availability zone you want to acquire an public IP address from'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts'], u'length': 255, u'type': u'uuid', u'description': u'Deploy vm for the project'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the domain to associate with this IP address'}], u'requiredparams': [], u'description': u'Acquires and associates a public IP to an account.'}, u'lun': {u'name': u'associateLun', u'related': [], u'isasync': False, u'params': [{u'name': u'iqn', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Guest IQN to which the LUN associate.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'LUN name.'}], u'requiredparams': [u'iqn', u'name'], u'description': u'Associate a LUN with a guest IQN'}}, u'stop': {u'systemvm': {u'name': u'stopSystemVm', u'related': [u'startSystemVm', u'rebootSystemVm', u'listSystemVms', u'changeServiceForSystemVm'], u'isasync': True, u'params': [{u'name': u'forced', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force stop the VM. The caller knows the VM is stopped.'}, {u'name': u'id', u'required': True, u'related': [u'startSystemVm', u'rebootSystemVm', u'listSystemVms', u'stopSystemVm', u'changeServiceForSystemVm'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the system virtual machine'}], u'requiredparams': [u'id'], u'description': u'Stops a system VM.'}, u'router': {u'name': u'stopRouter', u'related': [u'changeServiceForRouter', u'destroyRouter', u'rebootRouter', u'startRouter'], u'isasync': True, u'params': [{u'name': u'forced', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force stop the VM. The caller knows the VM is stopped.'}, {u'name': u'id', u'required': True, u'related': [u'changeServiceForRouter', u'stopRouter', u'destroyRouter', u'rebootRouter', u'startRouter'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the router'}], u'requiredparams': [u'id'], u'description': u'Stops a router.'}, u'virtualmachine': {u'name': u'stopVirtualMachine', u'related': [u'listVirtualMachines', u'destroyVirtualMachine'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}, {u'name': u'forced', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend). The caller knows the VM is stopped.'}], u'requiredparams': [u'id'], u'description': u'Stops a virtual machine.'}}, u'modify': {u'pool': {u'name': u'modifyPool', u'related': [], u'isasync': False, u'params': [{u'name': u'algorithm', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'algorithm.'}, {u'name': u'poolname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'algorithm', u'poolname'], u'description': u'Modify pool'}}, u'update': {u'loadbalancerrule': {u'name': u'updateLoadBalancerRule', u'related': [], u'isasync': True, u'params': [{u'name': u'description', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the description of the load balancer rule'}, {u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the id of the load balancer rule to update'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the load balancer rule'}, {u'name': u'algorithm', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'load balancer algorithm (source, roundrobin, leastconn)'}], u'requiredparams': [u'id'], u'description': u'Updates load balancer'}, u'domain': {u'name': u'updateDomain', u'related': [u'listDomainChildren', u'createDomain'], u'isasync': False, u'params': [{u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"Network domain for the domain's networks; empty string will update domainName with NULL value"}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'updates domain with this name'}, {u'name': u'id', u'required': True, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'ID of domain to update'}], u'requiredparams': [u'id'], u'description': u'Updates a domain with a new name'}, u'projectinvitation': {u'name': u'updateProjectInvitation', u'related': [], u'isasync': True, u'params': [{u'name': u'accept', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, accept the invitation, decline if false. True by default'}, {u'name': u'projectid', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to join'}, {u'name': u'token', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list invitations for specified account; this parameter has to be specified with domainId'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'account that is joining the project'}], u'requiredparams': [u'projectid'], u'description': u'Accepts or declines project invitation'}, u'diskoffering': {u'name': u'updateDiskOffering', u'related': [u'createDiskOffering', u'listDiskOfferings'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateDiskOffering', u'createDiskOffering', u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'ID of the disk offering'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'updates alternate display text of the disk offering with this value'}, {u'name': u'sortkey', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'sort key of the disk offering, integer'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'updates name of the disk offering with this value'}], u'requiredparams': [u'id'], u'description': u'Updates a disk offering.'}, u'virtualmachine': {u'name': u'updateVirtualMachine', u'related': [u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': False, u'params': [{u'name': u'displayname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'user generated name'}, {u'name': u'group', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'group of the virtual machine'}, {u'name': u'haenable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if high-availability is enabled for the virtual machine, false otherwise'}, {u'name': u'id', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}, {u'name': u'ostypeid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS type that best represents this VM.'}, {u'name': u'userdata', u'required': False, u'related': [], u'length': 2048, u'type': u'string', u'description': u'an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.'}], u'requiredparams': [u'id'], u'description': u'Updates properties of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. Therefore, stop the VM manually before issuing this call.'}, u'portforwardingrule': {u'name': u'updatePortForwardingRule', u'related': [u'listIpForwardingRules', u'listPortForwardingRules', u'createPortForwardingRule'], u'isasync': True, u'params': [{u'name': u'privateport', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the private port of the port forwarding rule'}, {u'name': u'publicport', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the public port of the port forwarding rule'}, {u'name': u'privateip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the private IP address of the port forwarding rule'}, {u'name': u'ipaddressid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the IP address id of the port forwarding rule'}, {u'name': u'protocol', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the protocol for the port fowarding rule. Valid values are TCP or UDP.'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine for the port forwarding rule'}], u'requiredparams': [u'privateport', u'publicport', u'ipaddressid', u'protocol'], u'description': u'Updates a port forwarding rule. Only the private port and the virtual machine can be updated.'}, u'cluster': {u'name': u'updateCluster', u'related': [], u'isasync': False, u'params': [{u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'hypervisor type of the cluster'}, {u'name': u'id', u'required': True, u'related': [u'updateCluster'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Cluster'}, {u'name': u'managedstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'whether this cluster is managed by cloudstack'}, {u'name': u'clustername', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the cluster name'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this cluster for allocation of new resources'}, {u'name': u'clustertype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'hypervisor type of the cluster'}], u'requiredparams': [u'id'], u'description': u'Updates an existing cluster'}, u'hostpassword': {u'name': u'updateHostPassword', u'related': [], u'isasync': False, u'params': [{u'name': u'password', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the new password for the host/cluster'}, {u'name': u'hostid', u'required': False, u'related': [u'listSwifts', u'addHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the cluster ID'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username for the host/cluster'}], u'requiredparams': [u'password', u'username'], u'description': u'Update password of a host/pool on management server.'}, u'pod': {u'name': u'updatePod', u'related': [], u'isasync': False, u'params': [{u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address for the Pod'}, {u'name': u'gateway', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the gateway for the Pod'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this cluster for allocation of new resources'}, {u'name': u'id', u'required': True, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Pod'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the Pod'}, {u'name': u'startip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the starting IP address for the Pod'}, {u'name': u'netmask', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask of the Pod'}], u'requiredparams': [u'id'], u'description': u'Updates a Pod.'}, u'isopermissions': {u'name': u'updateIsoPermissions', u'related': [], u'isasync': False, u'params': [{u'name': u'isextractable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template/iso is extractable, false other wise. Can be set only by root admin'}, {u'name': u'isfeatured', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true for featured template/iso, false otherwise'}, {u'name': u'accounts', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'a comma delimited list of accounts. If specified, "op" parameter has to be passed in.'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true for public template/iso, false for private templates/isos'}, {u'name': u'projectids', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'list', u'description': u'a comma delimited list of projects. If specified, "op" parameter has to be passed in.'}, {u'name': u'op', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'permission operator (add, remove, reset)'}, {u'name': u'id', u'required': True, u'related': [u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the template ID'}], u'requiredparams': [u'id'], u'description': u'Updates iso permissions'}, u'resourcelimit': {u'name': u'updateResourceLimit', u'related': [], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Update resource for a specified account. Must be used with the domainId parameter.'}, {u'name': u'resourcetype', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Update resource limits for project'}, {u'name': u'max', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u' Maximum resource limit.'}], u'requiredparams': [u'resourcetype'], u'description': u'Updates resource limits for an account or domain.'}, u'vpcoffering': {u'name': u'updateVPCOffering', u'related': [u'listVPCOfferings', u'createVPCOffering'], u'isasync': True, u'params': [{u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the VPC offering'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'update state for the VPC offering; supported states - Enabled/Disabled'}, {u'name': u'id', u'required': False, u'related': [u'listVPCOfferings', u'createVPCOffering', u'updateVPCOffering'], u'length': 255, u'type': u'uuid', u'description': u'the id of the VPC offering'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the VPC offering'}], u'requiredparams': [], u'description': u'Updates VPC offering'}, u'network': {u'name': u'updateNetwork', u'related': [u'listNetscalerLoadBalancerNetworks'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network'}, {u'name': u'networkofferingid', u'required': False, u'related': [u'updateNetworkOffering'], u'length': 255, u'type': u'uuid', u'description': u'network offering ID'}, {u'name': u'changecidr', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force update even if cidr type is different'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the new name for the network'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the new display text for the network'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'network domain'}], u'requiredparams': [u'id'], u'description': u'Updates a network'}, u'zone': {u'name': u'updateZone', u'related': [u'listZones', u'createZone'], u'isasync': False, u'params': [{u'name': u'internaldns1', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first internal DNS for the Zone'}, {u'name': u'dnssearchorder', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the dns search order list'}, {u'name': u'internaldns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second internal DNS for the Zone'}, {u'name': u'domain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Network domain name for the networks in the zone; empty string will update domain with NULL value'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'the details for the Zone'}, {u'name': u'ip6dns1', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first DNS for IPv6 network in the Zone'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Allocation state of this cluster for allocation of new resources'}, {u'name': u'ip6dns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second DNS for IPv6 network in the Zone'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the Zone'}, {u'name': u'id', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Zone'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'updates a private zone to public if set, but not vice-versa'}, {u'name': u'dns2', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the second DNS for the Zone'}, {u'name': u'guestcidraddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the guest CIDR address for the Zone'}, {u'name': u'dhcpprovider', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the dhcp Provider for the Zone'}, {u'name': u'dns1', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the first DNS for the Zone'}, {u'name': u'localstorageenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if local storage offering enabled, false otherwise'}], u'requiredparams': [u'id'], u'description': u'Updates a Zone.'}, u'instancegroup': {u'name': u'updateInstanceGroup', u'related': [u'createInstanceGroup'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateInstanceGroup', u'createInstanceGroup'], u'length': 255, u'type': u'uuid', u'description': u'Instance group ID'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'new instance group name'}], u'requiredparams': [u'id'], u'description': u'Updates a vm group'}, u'autoscalepolicy': {u'name': u'updateAutoScalePolicy', u'related': [], u'isasync': True, u'params': [{u'name': u'duration', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the duration for which the conditions have to be true before action is taken'}, {u'name': u'id', u'required': True, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale policy'}, {u'name': u'quiettime', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the cool down period for which the policy should not be evaluated after the action has been taken'}, {u'name': u'conditionids', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the list of IDs of the conditions that are being evaluated on every interval'}], u'requiredparams': [u'id'], u'description': u'Updates an existing autoscale policy.'}, u'serviceoffering': {u'name': u'updateServiceOffering', u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings', u'createServiceOffering'], u'isasync': False, u'params': [{u'name': u'sortkey', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'sort key of the service offering, integer'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the service offering to be updated'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the service offering to be updated'}, {u'name': u'id', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings', u'createServiceOffering', u'updateServiceOffering'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the service offering to be updated'}], u'requiredparams': [u'id'], u'description': u'Updates a service offering.'}, u'storagepool': {u'name': u'updateStoragePool', u'related': [u'cancelStorageMaintenance', u'createStoragePool', u'listStoragePools'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'cancelStorageMaintenance', u'updateStoragePool', u'createStoragePool', u'listStoragePools'], u'length': 255, u'type': u'uuid', u'description': u'the Id of the storage pool'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'comma-separated list of tags for the storage pool'}], u'requiredparams': [u'id'], u'description': u'Updates a storage pool.'}, u'hypervisorcapabilities': {u'name': u'updateHypervisorCapabilities', u'related': [], u'isasync': False, u'params': [{u'name': u'securitygroupenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'set true to enable security group for this hypervisor.'}, {u'name': u'maxguestslimit', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'the max number of Guest VMs per host for this hypervisor.'}, {u'name': u'id', u'required': False, u'related': [u'listHypervisorCapabilities'], u'length': 255, u'type': u'uuid', u'description': u'ID of the hypervisor capability'}], u'requiredparams': [], u'description': u'Updates a hypervisor capabilities.'}, u'template': {u'name': u'updateTemplate', u'related': [u'registerIso', u'copyIso', u'updateIso', u'listIsos'], u'isasync': False, u'params': [{u'name': u'bootable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if image is bootable, false otherwise'}, {u'name': u'passwordenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the image supports the password reset feature; default is false'}, {u'name': u'format', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the format for the image'}, {u'name': u'ostypeid', u'required': False, u'related': [u'listOsTypes'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS type that best represents the OS of this image.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the image file'}, {u'name': u'id', u'required': True, u'related': [u'registerIso', u'updateTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the image file'}, {u'name': u'sortkey', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'sort key of the template, integer'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the display text of the image'}], u'requiredparams': [u'id'], u'description': u'Updates attributes of a template.'}, u'defaultnicforvirtualmachine': {u'name': u'updateDefaultNicForVirtualMachine', u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'nicid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'NIC ID'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Virtual Machine ID'}], u'requiredparams': [u'nicid', u'virtualmachineid'], u'description': u'Changes the default NIC on a VM'}, u'traffictype': {u'name': u'updateTrafficType', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateTrafficType'], u'length': 255, u'type': u'uuid', u'description': u'traffic type id'}, {u'name': u'xennetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a XenServer host'}, {u'name': u'vmwarenetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a VMware host'}, {u'name': u'kvmnetworklabel', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The network name label of the physical device dedicated to this traffic on a KVM host'}], u'requiredparams': [u'id'], u'description': u'Updates traffic type of a physical network'}, u'host': {u'name': u'updateHost', u'related': [u'listHosts'], u'isasync': False, u'params': [{u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Change resource state of host, valid values are [Enable, Disable]. Operation may failed if host in states not allowing Enable/Disable'}, {u'name': u'oscategoryid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the id of Os category to update the host with'}, {u'name': u'hosttags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of tags to be added to the host'}, {u'name': u'id', u'required': True, u'related': [u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the host to update'}, {u'name': u'url', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the new uri for the secondary storage: nfs://host/path'}], u'requiredparams': [u'id'], u'description': u'Updates a host.'}, u'user': {u'name': u'updateUser', u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser', u'updateUser'], u'length': 255, u'type': u'uuid', u'description': u'User uuid'}, {u'name': u'timezone', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.'}, {u'name': u'email', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'email'}, {u'name': u'usersecretkey', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The secret key for the user. Must be specified with userApiKey'}, {u'name': u'username', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Unique username'}, {u'name': u'firstname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'first name'}, {u'name': u'lastname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'last name'}, {u'name': u'password', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Hashed password (default is MD5). If you wish to use any other hasing algorithm, you would need to write a custom authentication adapter'}, {u'name': u'userapikey', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The API key for the user. Must be specified with userSecretKey'}], u'requiredparams': [u'id'], u'description': u'Updates a user account'}, u'vpc': {u'name': u'updateVPC', u'related': [u'restartVPC', u'listVPCs'], u'isasync': True, u'params': [{u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the VPC'}, {u'name': u'id', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs'], u'length': 255, u'type': u'uuid', u'description': u'the id of the VPC'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the VPC'}], u'requiredparams': [], u'description': u'Updates a VPC'}, u'resourcecount': {u'name': u'updateResourceCount', u'related': [], u'isasync': False, u'params': [{u'name': u'resourcetype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Type of resource to update. If specifies valid values are 0, 1, 2, 3, and 4. If not specified will update all resource counts0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Update resource limits for project'}, {u'name': u'domainid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'If account parameter specified then updates resource counts for a specified account in this domain else update resource counts for all accounts & child domains in specified domain.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Update resource count for a specified account. Must be used with the domainId parameter.'}], u'requiredparams': [u'domainid'], u'description': u'Recalculate and update resource count for an account or domain.'}, u'storagenetworkiprange': {u'name': u'updateStorageNetworkIpRange', u'related': [], u'isasync': True, u'params': [{u'name': u'endip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ending IP address'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Optional. the vlan the ip range sits on'}, {u'name': u'netmask', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the netmask for storage network'}, {u'name': u'id', u'required': True, u'related': [u'updateStorageNetworkIpRange'], u'length': 255, u'type': u'uuid', u'description': u'UUID of storage network ip range'}, {u'name': u'startip', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the beginning IP address'}], u'requiredparams': [u'id'], u'description': u'Update a Storage network IP range, only allowed when no IPs in this range have been allocated.'}, u'configuration': {u'name': u'updateConfiguration', u'related': [u'listConfigurations'], u'isasync': False, u'params': [{u'name': u'value', u'required': False, u'related': [], u'length': 4095, u'type': u'string', u'description': u'the value of the configuration'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the configuration'}], u'requiredparams': [u'name'], u'description': u'Updates a configuration.'}, u'templatepermissions': {u'name': u'updateTemplatePermissions', u'related': [], u'isasync': False, u'params': [{u'name': u'isfeatured', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true for featured template/iso, false otherwise'}, {u'name': u'isextractable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template/iso is extractable, false other wise. Can be set only by root admin'}, {u'name': u'projectids', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'a comma delimited list of projects. If specified, "op" parameter has to be passed in.'}, {u'name': u'op', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'permission operator (add, remove, reset)'}, {u'name': u'id', u'required': True, u'related': [u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the template ID'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true for public template/iso, false for private templates/isos'}, {u'name': u'accounts', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'a comma delimited list of accounts. If specified, "op" parameter has to be passed in.'}], u'requiredparams': [u'id'], u'description': u'Updates a template visibility permissions. A public template is visible to all accounts within the same domain. A private template is visible only to the owner of the template. A priviledged template is a private template with account permissions added. Only accounts specified under the template permissions are visible to them.'}, u'autoscalevmprofile': {u'name': u'updateAutoScaleVmProfile', u'related': [u'listAutoScaleVmProfiles'], u'isasync': True, u'params': [{u'name': u'destroyvmgraceperiod', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the time allowed for existing connections to get closed before a vm is destroyed'}, {u'name': u'autoscaleuserid', u'required': False, u'related': [u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the user used to launch and destroy the VMs'}, {u'name': u'templateid', u'required': False, u'related': [u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the template of the auto deployed virtual machine'}, {u'name': u'id', u'required': True, u'related': [u'updateAutoScaleVmProfile', u'listAutoScaleVmProfiles'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale vm profile'}, {u'name': u'counterparam', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161'}], u'requiredparams': [u'id'], u'description': u'Updates an existing autoscale vm profile.'}, u'account': {u'name': u'updateAccount', u'related': [u'markDefaultZoneForAccount', u'listAccounts', u'lockAccount'], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount'], u'length': 255, u'type': u'uuid', u'description': u'Account id'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the domain where the account exists'}, {u'name': u'networkdomain', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"Network domain for the account's networks; empty string will update domainName with NULL value"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the current account name'}, {u'name': u'accountdetails', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'details for account used to store specific parameters'}, {u'name': u'newname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'new name for the account'}], u'requiredparams': [u'newname'], u'description': u'Updates account information for the authenticated user'}, u'networkoffering': {u'name': u'updateNetworkOffering', u'related': [], u'isasync': False, u'params': [{u'name': u'sortkey', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'sort key of the network offering, integer'}, {u'name': u'id', u'required': False, u'related': [u'updateNetworkOffering'], u'length': 255, u'type': u'uuid', u'description': u'the id of the network offering'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the display text of the network offering'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the network offering'}, {u'name': u'availability', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the availability of network offering. Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'update state for the network offering'}], u'requiredparams': [], u'description': u'Updates a network offering.'}, u'vpncustomergateway': {u'name': u'updateVpnCustomerGateway', u'related': [u'createVpnCustomerGateway'], u'isasync': True, u'params': [{u'name': u'ikelifetime', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Lifetime of phase 1 VPN connection to the customer gateway, in seconds'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of this customer gateway'}, {u'name': u'id', u'required': True, u'related': [u'updateVpnCustomerGateway', u'createVpnCustomerGateway'], u'length': 255, u'type': u'uuid', u'description': u'id of customer gateway'}, {u'name': u'esplifetime', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Lifetime of phase 2 VPN connection to the customer gateway, in seconds'}, {u'name': u'ikepolicy', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'IKE policy of the customer gateway'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the gateway. Must be used with the domainId parameter.'}, {u'name': u'esppolicy', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'ESP policy of the customer gateway'}, {u'name': u'gateway', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'public ip address id of the customer gateway'}, {u'name': u'ipsecpsk', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'IPsec Preshared-Key of the customer gateway'}, {u'name': u'dpd', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'If DPD is enabled for VPN connection'}, {u'name': u'cidrlist', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'guest cidr of the customer gateway'}], u'requiredparams': [u'id', u'ikepolicy', u'esppolicy', u'gateway', u'ipsecpsk', u'cidrlist'], u'description': u'Update site to site vpn customer gateway'}, u'region': {u'name': u'updateRegion', u'related': [u'addRegion', u'listRegions'], u'isasync': False, u'params': [{u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'updates region with this name'}, {u'name': u'endpoint', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'updates region with this end point'}, {u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Id of region to update'}], u'requiredparams': [u'id'], u'description': u'Updates a region'}, u'project': {u'name': u'updateProject', u'related': [u'createProject', u'listProjectAccounts', u'activateProject'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to be modified'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'display text of the project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'new Admin account for the project'}], u'requiredparams': [u'id'], u'description': u'Updates a project'}, u'physicalnetwork': {u'name': u'updatePhysicalNetwork', u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'isasync': True, u'params': [{u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the VLAN for the physical network'}, {u'name': u'id', u'required': True, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'physical network id'}, {u'name': u'networkspeed', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the speed for the physical network[1G/10G]'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'Tag the physical network'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enabled/Disabled'}], u'requiredparams': [u'id'], u'description': u'Updates a physical network'}, u'iso': {u'name': u'updateIso', u'related': [u'listIsos'], u'isasync': False, u'params': [{u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the image file'}, {u'name': u'id', u'required': True, u'related': [u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the image file'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the display text of the image'}, {u'name': u'format', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the format for the image'}, {u'name': u'sortkey', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'sort key of the template, integer'}, {u'name': u'ostypeid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS type that best represents the OS of this image.'}, {u'name': u'passwordenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the image supports the password reset feature; default is false'}, {u'name': u'bootable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if image is bootable, false otherwise'}], u'requiredparams': [u'id'], u'description': u'Updates an ISO file.'}, u'networkserviceprovider': {u'name': u'updateNetworkServiceProvider', u'related': [], u'isasync': True, u'params': [{u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Enabled/Disabled/Shutdown the physical network service provider'}, {u'name': u'id', u'required': True, u'related': [u'updateNetworkServiceProvider'], u'length': 255, u'type': u'uuid', u'description': u'network service provider id'}, {u'name': u'servicelist', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'the list of services to be enabled for this physical network service provider'}], u'requiredparams': [u'id'], u'description': u'Updates a network serviceProvider of a physical network'}, u'autoscalevmgroup': {u'name': u'updateAutoScaleVmGroup', u'related': [], u'isasync': True, u'params': [{u'name': u'scaledownpolicyids', u'required': False, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'list', u'description': u'list of scaledown autoscale policies'}, {u'name': u'interval', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the frequency at which the conditions have to be evaluated'}, {u'name': u'minmembers', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.'}, {u'name': u'maxmembers', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.'}, {u'name': u'id', u'required': True, u'related': [u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale group'}, {u'name': u'scaleuppolicyids', u'required': False, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'list', u'description': u'list of scaleup autoscale policies'}], u'requiredparams': [u'id'], u'description': u'Updates an existing autoscale vm group.'}}, u'disable': {u'account': {u'name': u'disableAccount', u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount'], u'isasync': True, u'params': [{u'name': u'lock', u'required': True, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'If true, only lock the account; else disable the account'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Disables specified account.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'Disables specified account in this domain.'}, {u'name': u'id', u'required': False, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount', u'disableAccount'], u'length': 255, u'type': u'uuid', u'description': u'Account id'}], u'requiredparams': [u'lock'], u'description': u'Disables an account'}, u'autoscalevmgroup': {u'name': u'disableAutoScaleVmGroup', u'related': [u'listAutoScaleVmGroups', u'createAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listAutoScaleVmGroups', u'createAutoScaleVmGroup', u'disableAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale group'}], u'requiredparams': [u'id'], u'description': u'Disables an AutoScale Vm Group'}, u'cisconexusvsm': {u'name': u'disableCiscoNexusVSM', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'disableCiscoNexusVSM'], u'length': 255, u'type': u'uuid', u'description': u'Id of the Cisco Nexus 1000v VSM device to be deleted'}], u'requiredparams': [u'id'], u'description': u'disable a Cisco Nexus VSM device'}, u'staticnat': {u'name': u'disableStaticNat', u'related': [], u'isasync': True, u'params': [{u'name': u'ipaddressid', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the public IP address id for which static nat feature is being disableed'}], u'requiredparams': [u'ipaddressid'], u'description': u'Disables static rule for given ip address'}, u'user': {u'name': u'disableUser', u'related': [u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'disableUser', u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'length': 255, u'type': u'uuid', u'description': u'Disables user by user ID.'}], u'requiredparams': [u'id'], u'description': u'Disables a user account'}}, u'detach': {u'volume': {u'name': u'detachVolume', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': False, u'related': [u'detachVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'deviceid', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'the device ID on the virtual machine where volume is detached from'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'listVirtualMachines'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine where the volume is detached from'}], u'requiredparams': [], u'description': u'Detaches a disk volume from a virtual machine.'}, u'iso': {u'name': u'detachIso', u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'virtualmachineid', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'virtualmachineid'], u'description': u'Detaches any ISO file (if any) currently attached to a virtual machine.'}}, u'generate': {u'usagerecords': {u'name': u'generateUsageRecords', u'related': [], u'isasync': False, u'params': [{u'name': u'enddate', u'required': True, u'related': [], u'length': 255, u'type': u'date', u'description': u'End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'List events for the specified domain.'}, {u'name': u'startdate', u'required': True, u'related': [], u'length': 255, u'type': u'date', u'description': u'Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.'}], u'requiredparams': [u'enddate', u'startdate'], u'description': u'Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed'}}, u'change': {u'serviceforvirtualmachine': {u'name': u'changeServiceForVirtualMachine', u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}, {u'name': u'serviceofferingid', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings'], u'length': 255, u'type': u'uuid', u'description': u'the service offering ID to apply to the virtual machine'}], u'requiredparams': [u'id', u'serviceofferingid'], u'description': u'Changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect.'}, u'serviceforsystemvm': {u'name': u'changeServiceForSystemVm', u'related': [u'rebootSystemVm', u'listSystemVms'], u'isasync': False, u'params': [{u'name': u'serviceofferingid', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings', u'createServiceOffering'], u'length': 255, u'type': u'uuid', u'description': u'the service offering ID to apply to the system vm'}, {u'name': u'id', u'required': True, u'related': [u'rebootSystemVm', u'listSystemVms', u'changeServiceForSystemVm'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the system vm'}], u'requiredparams': [u'serviceofferingid', u'id'], u'description': u'Changes the service offering for a system vm (console proxy or secondary storage). The system vm must be in a "Stopped" state for this command to take effect.'}, u'serviceforrouter': {u'name': u'changeServiceForRouter', u'related': [u'destroyRouter', u'rebootRouter', u'startRouter'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'changeServiceForRouter', u'destroyRouter', u'rebootRouter', u'startRouter'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the router'}, {u'name': u'serviceofferingid', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings', u'createServiceOffering', u'updateServiceOffering'], u'length': 255, u'type': u'uuid', u'description': u'the service offering ID to apply to the domain router'}], u'requiredparams': [u'id', u'serviceofferingid'], u'description': u'Upgrades domain router to a new service offering'}}, u'reset': {u'apilimit': {u'name': u'resetApiLimit', u'related': [], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the acount whose limit to be reset'}], u'requiredparams': [], u'description': u'Reset api count'}, u'sshkeyforvirtualmachine': {u'name': u'resetSSHKeyForVirtualMachine', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'an optional project for the ssh key'}, {u'name': u'keypair', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the ssh key pair used to login to the virtual machine'}, {u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the ssh key. Must be used with domainId.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.'}], u'requiredparams': [u'keypair', u'id'], u'description': u'Resets the SSH Key for virtual machine. The virtual machine must be in a "Stopped" state. [async]'}, u'passwordforvirtualmachine': {u'name': u'resetPasswordForVirtualMachine', u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the virtual machine'}], u'requiredparams': [u'id'], u'description': u'Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and the template must already support this feature for this command to take effect. [async]'}, u'vpnconnection': {u'name': u'resetVpnConnection', u'related': [u'listVpnConnections'], u'isasync': True, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for connection. Must be used with domainId.'}, {u'name': u'id', u'required': True, u'related': [u'listVpnConnections', u'resetVpnConnection'], u'length': 255, u'type': u'uuid', u'description': u'id of vpn connection'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for connection. If the account parameter is used, domainId must also be used.'}], u'requiredparams': [u'id'], u'description': u'Reset site to site vpn connection'}}, u'register': {u'userkeys': {u'name': u'registerUserKeys', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'lockUser', u'listUsers', u'enableUser', u'createUser'], u'length': 255, u'type': u'uuid', u'description': u'User id'}], u'requiredparams': [u'id'], u'description': u'This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user'}, u'iso': {u'name': u'registerIso', u'related': [u'copyIso', u'updateIso', u'listIsos'], u'isasync': False, u'params': [{u'name': u'ostypeid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS Type that best represents the OS of this ISO. If the iso is bootable this parameter needs to be passed'}, {u'name': u'checksum', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the MD5 checksum value of this ISO'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the ISO'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId. If the account parameter is used, domainId must also be used.'}, {u'name': u'bootable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this ISO is bootable. If not passed explicitly its assumed to be true'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts'], u'length': 255, u'type': u'uuid', u'description': u'Register iso for the project'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if you want to register the ISO to be publicly available to all users, false otherwise.'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone you wish to register the ISO to.'}, {u'name': u'isextractable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the iso or its derivatives are extractable; default is false'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the display text of the ISO. This is usually used for display purposes.'}, {u'name': u'isfeatured', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if you want this ISO to be featured'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL to where the ISO is currently being hosted'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account name. Must be used with domainId.'}], u'requiredparams': [u'name', u'zoneid', u'displaytext', u'url'], u'description': u'Registers an existing ISO into the CloudStack Cloud.'}, u'sshkeypair': {u'name': u'registerSSHKeyPair', u'related': [u'createSSHKeyPair', u'listSSHKeyPairs'], u'isasync': False, u'params': [{u'name': u'publickey', u'required': True, u'related': [], u'length': 5120, u'type': u'string', u'description': u'Public key material of the keypair'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the keypair'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'an optional project for the ssh key'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the ssh key. Must be used with domainId.'}], u'requiredparams': [u'publickey', u'name'], u'description': u'Register a public key in a keypair under a certain name'}, u'template': {u'name': u'registerTemplate', u'related': [u'listTemplates', u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'isasync': False, u'params': [{u'name': u'isextractable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template or its derivatives are extractable; default is false'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone the template is to be hosted on'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId. If the account parameter is used, domainId must also be used.'}, {u'name': u'checksum', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the MD5 checksum value of this template'}, {u'name': u'templatetag', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the tag for this template.'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template is available to all accounts; default is true'}, {u'name': u'passwordenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template supports the password reset feature; default is false'}, {u'name': u'displaytext', u'required': True, u'related': [], u'length': 4096, u'type': u'string', u'description': u'the display text of the template. This is usually used for display purposes.'}, {u'name': u'sshkeyenabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the template supports the sshkey upload feature; default is false'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'Register template for the project'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the template'}, {u'name': u'isfeatured', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this template is a featured template, false otherwise'}, {u'name': u'format', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the format for the template. Possible values include QCOW2, RAW, and VHD.'}, {u'name': u'requireshvm', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this template requires HVM'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional accountName. Must be used with domainId.'}, {u'name': u'ostypeid', u'required': True, u'related': [u'listOsTypes'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the OS Type that best represents the OS of this template.'}, {u'name': u'hypervisor', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the target hypervisor for the template'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL of where the template is hosted. Possible URL include http:// and https://'}, {u'name': u'bits', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'32 or 64 bits support. 64 by default'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'Template details in key/value pairs.'}], u'requiredparams': [u'zoneid', u'displaytext', u'name', u'format', u'ostypeid', u'hypervisor', u'url'], u'description': u'Registers an existing template into the CloudStack cloud. '}}, u'list': {u'instancegroups': {u'name': u'listInstanceGroups', u'related': [u'updateInstanceGroup', u'createInstanceGroup'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listInstanceGroups', u'updateInstanceGroup', u'createInstanceGroup'], u'length': 255, u'type': u'uuid', u'description': u'list instance groups by ID'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list instance groups by name'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}], u'requiredparams': [], u'description': u'Lists vm groups'}, u'physicalnetworks': {u'name': u'listPhysicalNetworks', u'related': [], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the physical network'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listPhysicalNetworks'], u'length': 255, u'type': u'uuid', u'description': u'list physical network by id'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'search by name'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists physical networks'}, u'networks': {u'name': u'listNetworks', u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks'], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'issystem', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if network is system, false otherwise'}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'List networks by VPC'}, {u'name': u'acltype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list networks by ACL (access control list) type. Supported values are Account and Domain'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'specifyipranges', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if need to list only networks which support specifying ip ranges'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID of the network'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'restartrequired', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list networks by restartRequired'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the type of the network. Supported values are: Isolated and Shared'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'list networks by physical network id'}, {u'name': u'supportedservices', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list networks supporting certain services'}, {u'name': u'traffictype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'type of the traffic'}, {u'name': u'id', u'required': False, u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'list networks by id'}, {u'name': u'canusefordeploy', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list networks available for vm deployment'}, {u'name': u'forvpc', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'the network belongs to vpc'}], u'requiredparams': [], u'description': u'Lists all available networks.'}, u'capabilities': {u'name': u'listCapabilities', u'related': [], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'Lists capabilities'}, u'clusters': {u'name': u'listClusters', u'related': [u'updateCluster'], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'listClusters', u'updateCluster'], u'length': 255, u'type': u'uuid', u'description': u'lists clusters by the cluster ID'}, {u'name': u'managedstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'whether this cluster is managed by cloudstack'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists clusters by hypervisor type'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists clusters by allocation state'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'lists clusters by Zone ID'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists clusters by the cluster name'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'clustertype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists clusters by cluster type'}, {u'name': u'showcapacities', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'flag to display the capacity of the clusters'}, {u'name': u'podid', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'lists clusters by Pod ID'}], u'requiredparams': [], u'description': u'Lists clusters.'}, u'resourcelimits': {u'name': u'listResourceLimits', u'related': [u'updateResourceLimit'], u'isasync': False, u'params': [{u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'resourcetype', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.'}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'Lists resource limits by ID.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [], u'description': u'Lists resource limits.'}, u'firewallrules': {u'name': u'listFirewallRules', u'related': [u'createEgressFirewallRule', u'createFirewallRule', u'listEgressFirewallRules'], u'isasync': False, u'params': [{u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'Lists rule with the specified ID.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'ipaddressid', u'required': False, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the id of IP address of the firwall services'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}], u'requiredparams': [], u'description': u'Lists all firewall rules for an IP address.'}, u'supportednetworkservices': {u'name': u'listSupportedNetworkServices', u'related': [], u'isasync': False, u'params': [{u'name': u'service', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'network service name to list providers and capabilities of'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'provider', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'network service provider name'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists all network services provided by CloudStack or for the given Provider.'}, u'loadbalancerrules': {u'name': u'listLoadBalancerRules', u'related': [u'createLoadBalancerRule', u'updateLoadBalancerRule'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the availability zone ID'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine of the load balancer rule'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'id', u'required': False, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'publicipid', u'required': False, u'related': [u'restartNetwork', u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'the public IP address id of the load balancer rule '}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the load balancer rule'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [], u'description': u'Lists load balancer rules.'}, u'autoscalepolicies': {u'name': u'listAutoScalePolicies', u'related': [u'createAutoScalePolicy', u'updateAutoScalePolicy'], u'isasync': False, u'params': [{u'name': u'action', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the action to be executed if all the conditions evaluate to true for the specified duration.'}, {u'name': u'id', u'required': False, u'related': [u'createAutoScalePolicy', u'updateAutoScalePolicy', u'listAutoScalePolicies'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale policy'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'vmgroupid', u'required': False, u'related': [u'createAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale vm group'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'conditionid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the condition of the policy'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists autoscale policies.'}, u'niciranvpdevices': {u'name': u'listNiciraNvpDevices', u'related': [u'addNiciraNvpDevice'], u'isasync': False, u'params': [{u'name': u'nvpdeviceid', u'required': False, u'related': [u'addNiciraNvpDevice', u'listNiciraNvpDevices'], u'length': 255, u'type': u'uuid', u'description': u'nicira nvp device ID'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists Nicira NVP devices'}, u'f5loadbalancernetworks': {u'name': u'listF5LoadBalancerNetworks', u'related': [u'createNetwork', u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'lbdeviceid', u'required': True, u'related': [u'configureF5LoadBalancer', u'addF5LoadBalancer', u'listF5LoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'f5 load balancer device ID'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [u'lbdeviceid'], u'description': u'lists network that are using a F5 load balancer device'}, u'templatepermissions': {u'name': u'listTemplatePermissions', u'related': [u'listIsoPermissions'], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listIsoPermissions', u'listTemplatePermissions'], u'length': 255, u'type': u'uuid', u'description': u'the template ID'}], u'requiredparams': [u'id'], u'description': u'List template visibility and all accounts that have permissions to view this template.'}, u'projects': {u'name': u'listProjects', u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List projects by tags (key/value pairs)'}, {u'name': u'id', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list projects by project ID'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list projects by name'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list projects by state'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list projects by display text'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [], u'description': u'Lists projects and provides detailed information for listed projects'}, u'systemvms': {u'name': u'listSystemVms', u'related': [u'rebootSystemVm'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID of the system VM'}, {u'name': u'hostid', u'required': False, u'related': [u'addHost', u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'the host ID of the system VM'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the state of the system VM'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'storageid', u'required': False, u'related': [u'cancelStorageMaintenance'], u'length': 255, u'type': u'uuid', u'description': u"the storage ID where vm's volumes belong to"}, {u'name': u'systemvmtype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the system VM type. Possible types are "consoleproxy" and "secondarystoragevm".'}, {u'name': u'podid', u'required': False, u'related': [u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID of the system VM'}, {u'name': u'id', u'required': False, u'related': [u'rebootSystemVm', u'listSystemVms'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the system VM'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the system VM'}], u'requiredparams': [], u'description': u'List system virtual machines.'}, u'portforwardingrules': {u'name': u'listPortForwardingRules', u'related': [u'listIpForwardingRules', u'createPortForwardingRule'], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'id', u'required': False, u'related': [u'listIpForwardingRules', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'Lists rule with the specified ID.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'ipaddressid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the id of IP address of the port forwarding services'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}], u'requiredparams': [], u'description': u'Lists all port forwarding rules for an IP address.'}, u'hypervisors': {u'name': u'listHypervisors', u'related': [], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the zone id for listing hypervisors.'}], u'requiredparams': [], u'description': u'List hypervisors'}, u'publicipaddresses': {u'name': u'listPublicIpAddresses', u'related': [u'restartNetwork', u'associateIpAddress'], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'lists all public IP addresses by Zone ID'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'allocatedonly', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'limits search results to allocated public IP addresses'}, {u'name': u'id', u'required': False, u'related': [u'restartNetwork', u'listPublicIpAddresses', u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'lists ip address by id'}, {u'name': u'forloadbalancing', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list only ips used for load balancing'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'isstaticnat', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list only static nat ip addresses'}, {u'name': u'issourcenat', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list only source nat ip addresses'}, {u'name': u'vlanid', u'required': False, u'related': [u'listVlanIpRanges'], u'length': 255, u'type': u'uuid', u'description': u'lists all public IP addresses by VLAN ID'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists the specified IP address'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'lists all public IP addresses by physical network id'}, {u'name': u'associatednetworkid', u'required': False, u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'lists all public IP addresses associated to the network specified'}, {u'name': u'forvirtualnetwork', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'the virtual network for the IP address'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'List ips belonging to the VPC'}], u'requiredparams': [], u'description': u'Lists all public ip addresses'}, u'vpngateways': {u'name': u'listVpnGateways', u'related': [u'createVpnGateway'], u'isasync': False, u'params': [{u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'id', u'required': False, u'related': [u'createVpnGateway', u'listVpnGateways'], u'length': 255, u'type': u'uuid', u'description': u'id of the vpn gateway'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'id of vpc'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [], u'description': u'Lists site 2 site vpn gateways'}, u'loadbalancerruleinstances': {u'name': u'listLoadBalancerRuleInstances', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'applied', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if listing all virtual machines currently applied to the load balancer rule; default is true'}, {u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}], u'requiredparams': [u'id'], u'description': u'List all virtual machine instances that are assigned to a load balancer rule.'}, u'hosts': {u'name': u'listHosts', u'related': [], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'podid', u'required': False, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the host'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the state of the host'}, {u'name': u'resourcestate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list hosts by resource state. Resource state represents current state determined by admin of host, valule can be one of [Enabled, Disabled, Unmanaged, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error]'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the host'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the host'}, {u'name': u'virtualmachineid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'lists hosts existing in particular cluster'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the host type'}, {u'name': u'id', u'required': False, u'related': [u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'the id of the host'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'comma separated list of host details requested, value can be a list of [ min, all, capacity, events, stats]'}, {u'name': u'hahost', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, list only hosts dedicated to HA'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists hosts.'}, u'pools': {u'name': u'listPools', u'related': [], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'List Pool'}, u'counters': {u'name': u'listCounters', u'related': [], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'source', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Source of the counter.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'listCounters'], u'length': 255, u'type': u'uuid', u'description': u'ID of the Counter.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the counter.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'List the counters'}, u'configurations': {u'name': u'listConfigurations', u'related': [], u'isasync': False, u'params': [{u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists configuration by name'}, {u'name': u'category', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists configurations by category'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all configurations.'}, u'usagerecords': {u'name': u'listUsageRecords', u'related': [], u'isasync': False, u'params': [{u'name': u'enddate', u'required': True, u'related': [], u'length': 255, u'type': u'date', u'description': u'End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.'}, {u'name': u'startdate', u'required': True, u'related': [], u'length': 255, u'type': u'date', u'description': u'Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'List usage records for the specified usage type'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'List usage records for specified project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List usage records for the specified user.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'List usage records for the specified domain.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'accountid', u'required': False, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount'], u'length': 255, u'type': u'uuid', u'description': u'List usage records for the specified account'}], u'requiredparams': [u'enddate', u'startdate'], u'description': u'Lists usage records for accounts'}, u'storagepools': {u'name': u'listStoragePools', u'related': [u'cancelStorageMaintenance'], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID for the storage pool'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'path', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the storage pool path'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list storage pools belongig to the specific cluster'}, {u'name': u'id', u'required': False, u'related': [u'cancelStorageMaintenance', u'listStoragePools'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the storage pool'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the IP address for the storage pool'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the storage pool'}, {u'name': u'podid', u'required': False, u'related': [u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID for the storage pool'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists storage pools.'}, u'vpncustomergateways': {u'name': u'listVpnCustomerGateways', u'related': [u'updateVpnCustomerGateway', u'createVpnCustomerGateway'], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'updateVpnCustomerGateway', u'createVpnCustomerGateway', u'listVpnCustomerGateways'], u'length': 255, u'type': u'uuid', u'description': u'id of the customer gateway'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}], u'requiredparams': [], u'description': u'Lists site to site vpn customer gateways'}, u'zones': {u'name': u'listZones', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone'}, {u'name': u'available', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the zone'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the domain associated with the zone'}, {u'name': u'showcapacities', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'flag to display the capacity of the zones'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists zones'}, u'serviceofferings': {u'name': u'listServiceOfferings', u'related': [u'updateHypervisorCapabilities'], u'isasync': False, u'params': [{u'name': u'systemvmtype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the system VM type. Possible types are "consoleproxy", "secondarystoragevm" or "domainrouter".'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the domain associated with the service offering'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the service offering'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'issystem', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'is this a system vm offering'}, {u'name': u'id', u'required': False, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings'], u'length': 255, u'type': u'uuid', u'description': u'ID of the service offering'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all available service offerings.'}, u'externalfirewalls': {u'name': u'listExternalFirewalls', u'related': [u'addExternalFirewall'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'zoneid', u'required': True, u'related': [u'listZones'], u'length': 255, u'type': u'uuid', u'description': u'zone Id'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [u'zoneid'], u'description': u'List external firewall appliances.'}, u'networkserviceproviders': {u'name': u'listNetworkServiceProviders', u'related': [u'addNetworkServiceProvider', u'listTrafficTypes', u'updateNetworkServiceProvider'], u'isasync': False, u'params': [{u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list providers by state'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list providers by name'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists network serviceproviders for a given physical network.'}, u'capacity': {u'name': u'listCapacity', u'related': [], u'isasync': False, u'params': [{u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'lists capacity by type* CAPACITY_TYPE_MEMORY = 0* CAPACITY_TYPE_CPU = 1* CAPACITY_TYPE_STORAGE = 2* CAPACITY_TYPE_STORAGE_ALLOCATED = 3* CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4* CAPACITY_TYPE_PRIVATE_IP = 5* CAPACITY_TYPE_SECONDARY_STORAGE = 6* CAPACITY_TYPE_VLAN = 7* CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8* CAPACITY_TYPE_LOCAL_STORAGE = 9.'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'lists capacity by the Cluster ID'}, {u'name': u'sortby', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Sort the results. Available values: Usage'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'fetchlatest', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'recalculate capacities and fetch the latest'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'lists capacity by the Zone ID'}, {u'name': u'podid', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'lists capacity by the Pod ID'}], u'requiredparams': [], u'description': u'Lists all the system wide capacities.'}, u'diskofferings': {u'name': u'listDiskOfferings', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'ID of the disk offering'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the disk offering'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the domain of the disk offering.'}], u'requiredparams': [], u'description': u'Lists all available disk offerings.'}, u'lbstickinesspolicies': {u'name': u'listLBStickinessPolicies', u'related': [u'createLBStickinessPolicy'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'lbruleid', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [u'lbruleid'], u'description': u'Lists LBStickiness policies.'}, u'srxfirewallnetworks': {u'name': u'listSrxFirewallNetworks', u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'isasync': False, u'params': [{u'name': u'lbdeviceid', u'required': True, u'related': [u'addSrxFirewall'], u'length': 255, u'type': u'uuid', u'description': u'netscaler load balancer device ID'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [u'lbdeviceid'], u'description': u'lists network that are using SRX firewall device'}, u'securitygroups': {u'name': u'listSecurityGroups', u'related': [], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'id', u'required': False, u'related': [u'listSecurityGroups'], u'length': 255, u'type': u'uuid', u'description': u'list the security group by the id provided'}, {u'name': u'securitygroupname', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists security groups by name'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'lists security groups by virtual machine id'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists security groups'}, u'conditions': {u'name': u'listConditions', u'related': [u'listCounters', u'createCounter'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'ID of the Condition.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'counterid', u'required': False, u'related': [u'listConditions', u'listCounters', u'createCounter'], u'length': 255, u'type': u'uuid', u'description': u'Counter-id of the condition.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'policyid', u'required': False, u'related': [u'createAutoScalePolicy', u'updateAutoScalePolicy'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the policy'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}], u'requiredparams': [], u'description': u'List Conditions for the specific user'}, u'swifts': {u'name': u'listSwifts', u'related': [u'addHost', u'updateHost', u'listHosts', u'listExternalLoadBalancers'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'the id of the swift'}], u'requiredparams': [], u'description': u'List Swift.'}, u'hypervisorcapabilities': {u'name': u'listHypervisorCapabilities', u'related': [], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listHypervisorCapabilities'], u'length': 255, u'type': u'uuid', u'description': u'ID of the hypervisor capability'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the hypervisor for which to restrict the search'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists all hypervisor capabilities.'}, u'tags': {u'name': u'listTags', u'related': [], u'isasync': False, u'params': [{u'name': u'resourceid', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by resource id'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'resourcetype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by resource type'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'key', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by key'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'customer', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by customer name'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'value', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by value'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'List resource tag(s)'}, u'routers': {u'name': u'listRouters', u'related': [u'changeServiceForRouter', u'stopRouter', u'destroyRouter', u'rebootRouter', u'startRouter'], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the state of the router'}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'List networks by VPC'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'podid', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID of the router'}, {u'name': u'hostid', u'required': False, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers', u'prepareHostForMaintenance'], u'length': 255, u'type': u'uuid', u'description': u'the host ID of the router'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the router'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID of the router'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'id', u'required': False, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'addNicToVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'listLoadBalancerRuleInstances', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk router'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'networkid', u'required': False, u'related': [u'createNetwork', u'listNiciraNvpDeviceNetworks', u'updateNetwork', u'listF5LoadBalancerNetworks', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'list by network id'}, {u'name': u'forvpc', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true is passed for this parameter, list only VPC routers'}], u'requiredparams': [], u'description': u'List routers.'}, u'traffictypes': {u'name': u'listTrafficTypes', u'related': [u'addNetworkServiceProvider', u'updateNetworkServiceProvider'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'physicalnetworkid', u'required': True, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [u'physicalnetworkid'], u'description': u'Lists traffic types of a given physical network.'}, u'projectinvitations': {u'name': u'listProjectInvitations', u'related': [], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'activeonly', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'if true, list only active invitations - having Pending state and ones that are not timed out yet'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list by project id'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list invitations by state'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'id', u'required': False, u'related': [u'listProjectInvitations'], u'length': 255, u'type': u'uuid', u'description': u'list invitations by id'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}], u'requiredparams': [], u'description': u'Lists projects and provides detailed information for listed projects'}, u'isos': {u'name': u'listIsos', u'related': [], u'isasync': False, u'params': [{u'name': u'bootable', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the ISO is bootable, false otherwise'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list all isos by name'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'id', u'required': False, u'related': [u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'list ISO by id'}, {u'name': u'ispublic', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if the ISO is publicly available to all users, false otherwise.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isofilter', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the hypervisor for which to restrict the search'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'isready', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if this ISO is ready to be deployed'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all available ISO files.'}, u'users': {u'name': u'listUsers', u'related': [], u'isasync': False, u'params': [{u'name': u'username', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List user by the username'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'accounttype', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.'}, {u'name': u'id', u'required': False, u'related': [u'listUsers'], u'length': 255, u'type': u'uuid', u'description': u'List user by ID.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List users by state of the user account.'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists user accounts'}, u'sshkeypairs': {u'name': u'listSSHKeyPairs', u'related': [], u'isasync': False, u'params': [{u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'fingerprint', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'A public key fingerprint to look for'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'A key pair name to look for'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}], u'requiredparams': [], u'description': u'List registered keypairs'}, u'privategateways': {u'name': u'listPrivateGateways', u'related': [u'createPrivateGateway'], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'createPrivateGateway', u'listPrivateGateways'], u'length': 255, u'type': u'uuid', u'description': u'list private gateway by id'}, {u'name': u'ipaddress', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list gateways by ip address'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'list gateways by vpc'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list gateways by state'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list gateways by vlan'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}], u'requiredparams': [], u'description': u'List private gateways'}, u'usagetypes': {u'name': u'listUsageTypes', u'related': [], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'List Usage Types'}, u'domainchildren': {u'name': u'listDomainChildren', u'related': [u'createDomain'], u'isasync': False, u'params': [{u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list children domains by name'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list children domain by parent domain ID.'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'to return the entire tree, use the value "true". To return the first level children, use the value "false".'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all children domains belonging to a specified domain'}, u'domains': {u'name': u'listDomains', u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'List domain by domain ID.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List domain by domain name.'}, {u'name': u'level', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'List domains by domain level.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}], u'requiredparams': [], u'description': u'Lists domains and provides detailed information for listed domains'}, u'externalloadbalancers': {u'name': u'listExternalLoadBalancers', u'related': [u'addHost', u'updateHost', u'listHosts'], u'isasync': False, u'params': [{u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'zone Id'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists F5 external load balancer appliances added in a zone.'}, u'netscalerloadbalancers': {u'name': u'listNetscalerLoadBalancers', u'related': [], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'lbdeviceid', u'required': False, u'related': [u'listNetscalerLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'netscaler load balancer device ID'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'lists netscaler load balancer devices'}, u's3s': {u'name': u'listS3s', u'related': [u'addS3'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists S3s'}, u'bigswitchvnsdevices': {u'name': u'listBigSwitchVnsDevices', u'related': [u'addBigSwitchVnsDevice'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'vnsdeviceid', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'bigswitch vns device ID'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}], u'requiredparams': [], u'description': u'Lists BigSwitch Vns devices'}, u'accounts': {u'name': u'listAccounts', u'related': [u'markDefaultZoneForAccount', u'lockAccount'], u'isasync': False, u'params': [{u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list accounts by state. Valid states are enabled, disabled, and locked.'}, {u'name': u'iscleanuprequired', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list accounts by cleanuprequred attribute (values are true or false)'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'accounttype', u'required': False, u'related': [], u'length': 255, u'type': u'long', u'description': u'list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'markDefaultZoneForAccount', u'listAccounts', u'lockAccount'], u'length': 255, u'type': u'uuid', u'description': u'list account by account ID'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list account by account name'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [], u'description': u'Lists accounts and provides detailed account information for listed accounts'}, u'networkdevice': {u'name': u'listNetworkDevice', u'related': [u'addNetworkDevice'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'networkdevicetype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall'}, {u'name': u'networkdeviceparameterlist', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'parameters for network device'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'List network devices'}, u'vlanipranges': {u'name': u'listVlanIpRanges', u'related': [], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'networkid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'network id of the VLAN IP range'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.'}, {u'name': u'id', u'required': False, u'related': [u'listVlanIpRanges'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the VLAN IP range'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks'], u'length': 255, u'type': u'uuid', u'description': u'physical network id of the VLAN IP range'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'project who will own the VLAN'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account with which the VLAN IP range is associated. Must be used with the domainId parameter.'}, {u'name': u'vlan', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the ID or VID of the VLAN. Default is an "untagged" VLAN.'}, {u'name': u'podid', u'required': False, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'the Pod ID of the VLAN IP range'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Zone ID of the VLAN IP range'}, {u'name': u'forvirtualnetwork', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if VLAN is of Virtual type, false if Direct'}], u'requiredparams': [], u'description': u'Lists all VLAN IP ranges.'}, u'traffictypeimplementors': {u'name': u'listTrafficTypeImplementors', u'related': [], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'traffictype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'Optional. The network traffic type, if specified, return its implementor. Otherwise, return all traffic types with their implementor'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists implementors of implementor of a network traffic type or implementors of all network traffic types'}, u'storagenetworkiprange': {u'name': u'listStorageNetworkIpRange', u'related': [u'updateStorageNetworkIpRange'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'optional parameter. Zone uuid, if specicied and both pod uuid and range uuid are absent, using it to search the range.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'listStorageNetworkIpRange', u'updateStorageNetworkIpRange'], u'length': 255, u'type': u'uuid', u'description': u'optional parameter. Storaget network IP range uuid, if specicied, using it to search the range.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'podid', u'required': False, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'optional parameter. Pod uuid, if specicied and range uuid is absent, using it to search the range.'}], u'requiredparams': [], u'description': u'List a storage network IP range.'}, u'isopermissions': {u'name': u'listIsoPermissions', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listIsoPermissions'], u'length': 255, u'type': u'uuid', u'description': u'the template ID'}], u'requiredparams': [u'id'], u'description': u'List iso visibility and all accounts that have permissions to view this iso.'}, u'snapshotpolicies': {u'name': u'listSnapshotPolicies', u'related': [], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'volumeid', u'required': True, u'related': [u'detachVolume', u'uploadVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [u'volumeid'], u'description': u'Lists snapshot policies.'}, u'autoscalevmgroups': {u'name': u'listAutoScaleVmGroups', u'related': [u'createAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'isasync': False, u'params': [{u'name': u'policyid', u'required': False, u'related': [u'createAutoScalePolicy', u'updateAutoScalePolicy', u'listAutoScalePolicies'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the policy'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'vmprofileid', u'required': False, u'related': [u'updateAutoScaleVmProfile', u'createAutoScaleVmProfile', u'listAutoScaleVmProfiles'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the profile'}, {u'name': u'lbruleid', u'required': False, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the loadbalancer'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the availability zone ID'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'id', u'required': False, u'related': [u'listAutoScaleVmGroups', u'createAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale vm group'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists autoscale vm groups.'}, u'projectaccounts': {u'name': u'listProjectAccounts', u'related': [u'createProject'], u'isasync': False, u'params': [{u'name': u'projectid', u'required': True, u'related': [u'createProject', u'listProjectAccounts'], u'length': 255, u'type': u'uuid', u'description': u'id of the project'}, {u'name': u'role', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list accounts of the project by role'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list accounts of the project by account name'}], u'requiredparams': [u'projectid'], u'description': u"Lists project's accounts"}, u'autoscalevmprofiles': {u'name': u'listAutoScaleVmProfiles', u'related': [], u'isasync': False, u'params': [{u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'domainid', u'required': False, u'related': [u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'id', u'required': False, u'related': [u'listAutoScaleVmProfiles'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale vm profile'}, {u'name': u'templateid', u'required': False, u'related': [u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the templateid of the autoscale vm profile'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'otherdeployparams', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the otherdeployparameters of the autoscale vm profile'}], u'requiredparams': [], u'description': u'Lists autoscale vm profiles.'}, u'apis': {u'name': u'listApis', u'related': [], u'isasync': False, u'params': [{u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'API name'}], u'requiredparams': [], u'description': u'lists all available apis on the server, provided by the Api Discovery plugin'}, u'vpcs': {u'name': u'listVPCs', u'related': [u'restartVPC'], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'domainid', u'required': False, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by name of the VPC'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'cidr', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u"list by cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR"}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'restartrequired', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list VPCs by restartRequired option'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list VPCs by state'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by display text of the VPC'}, {u'name': u'id', u'required': False, u'related': [u'restartVPC', u'listVPCs'], u'length': 255, u'type': u'uuid', u'description': u'list VPC by id'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list by zone'}, {u'name': u'supportedservices', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list VPC supporting certain services'}, {u'name': u'vpcofferingid', u'required': False, u'related': [u'listVPCOfferings', u'createVPCOffering'], u'length': 255, u'type': u'uuid', u'description': u'list by ID of the VPC offering'}], u'requiredparams': [], u'description': u'Lists VPCs'}, u'f5loadbalancers': {u'name': u'listF5LoadBalancers', u'related': [u'configureF5LoadBalancer'], u'isasync': False, u'params': [{u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'updatePhysicalNetwork', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'lbdeviceid', u'required': False, u'related': [u'configureF5LoadBalancer', u'listF5LoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'f5 load balancer device ID'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'lists F5 load balancer devices'}, u'snapshots': {u'name': u'listSnapshots', u'related': [], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'id', u'required': False, u'related': [u'listSnapshots'], u'length': 255, u'type': u'uuid', u'description': u'lists snapshot by snapshot ID'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'intervaltype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'volumeid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'lists snapshot by snapshot name'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'snapshottype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'valid values are MANUAL or RECURRING.'}], u'requiredparams': [], u'description': u'Lists all available snapshots for the account.'}, u'networkofferings': {u'name': u'listNetworkOfferings', u'related': [u'createNetworkOffering', u'updateNetworkOffering'], u'isasync': False, u'params': [{u'name': u'isdefault', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if need to list only default network offerings. Default value is false'}, {u'name': u'sourcenatsupported', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if need to list only netwok offerings where source nat is supported, false otherwise'}, {u'name': u'supportedservices', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list network offerings supporting certain services'}, {u'name': u'networkid', u'required': False, u'related': [u'createNetwork', u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to.'}, {u'name': u'specifyipranges', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if need to list only network offerings which support specifying ip ranges'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list network offerings by name'}, {u'name': u'id', u'required': False, u'related': [u'listNetworkOfferings', u'createNetworkOffering', u'updateNetworkOffering'], u'length': 255, u'type': u'uuid', u'description': u'list network offerings by id'}, {u'name': u'specifyvlan', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'the tags for the network offering.'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'list netowrk offerings available for network creation in specific zone'}, {u'name': u'forvpc', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'the network offering can be used only for network creation inside the VPC'}, {u'name': u'traffictype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by traffic type'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'guestiptype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list network offerings by guest type: Shared or Isolated'}, {u'name': u'istagged', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if offering has tags specified'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 4096, u'type': u'string', u'description': u'list network offerings by tags'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list network offerings by display text'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list network offerings by state'}, {u'name': u'availability', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the availability of network offering. Default value is Required'}], u'requiredparams': [], u'description': u'Lists all available network offerings.'}, u'virtualmachines': {u'name': u'listVirtualMachines', u'related': [], u'isasync': False, u'params': [{u'name': u'templateid', u'required': False, u'related': [u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'list vms by template'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'networkid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list by network id'}, {u'name': u'storageid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u"the storage ID where vm's volumes belong to"}, {u'name': u'isoid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list vms by iso'}, {u'name': u'vpcid', u'required': False, u'related': [u'restartVPC'], u'length': 255, u'type': u'uuid', u'description': u'list vms by vpc'}, {u'name': u'podid', u'required': False, u'related': [u'updatePod'], u'length': 255, u'type': u'uuid', u'description': u'the pod ID'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the virtual machine'}, {u'name': u'details', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'comma separated list of host details requested, value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]. If no parameter is passed in, the details will be defaulted to all'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the target hypervisor for the template'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'groupid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the group ID'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the availability zone ID'}, {u'name': u'hostid', u'required': False, u'related': [u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}, {u'name': u'id', u'required': False, u'related': [u'listVirtualMachines'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine'}, {u'name': u'forvirtualnetwork', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list by network type; true if need to list vms using Virtual Network, false otherwise'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'state of the virtual machine'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'List the virtual machines owned by the account.'}, u'netscalerloadbalancernetworks': {u'name': u'listNetscalerLoadBalancerNetworks', u'related': [], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'lbdeviceid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'netscaler load balancer device ID'}], u'requiredparams': [u'lbdeviceid'], u'description': u'lists network that are using a netscaler load balancer device'}, u'oscategories': {u'name': u'listOsCategories', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'listOsCategories'], u'length': 255, u'type': u'uuid', u'description': u'list Os category by id'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list os category by name'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists all supported OS categories for this cloud.'}, u'virtualrouterelements': {u'name': u'listVirtualRouterElements', u'related': [u'createVirtualRouterElement', u'configureVirtualRouterElement'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'nspid', u'required': False, u'related': [u'addNetworkServiceProvider', u'listTrafficTypes', u'updateNetworkServiceProvider'], u'length': 255, u'type': u'uuid', u'description': u'list virtual router elements by network service provider id'}, {u'name': u'id', u'required': False, u'related': [u'createVirtualRouterElement', u'configureVirtualRouterElement', u'listVirtualRouterElements'], u'length': 255, u'type': u'uuid', u'description': u'list virtual router elements by id'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'enabled', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'list network offerings by enabled state'}], u'requiredparams': [], u'description': u'Lists all available virtual router elements.'}, u'lunsonfiler': {u'name': u'listLunsOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'poolname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'poolname'], u'description': u'List LUN'}, u'asyncjobs': {u'name': u'listAsyncJobs', u'related': [u'queryAsyncJobResult'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'startdate', u'required': False, u'related': [], u'length': 255, u'type': u'tzdate', u'description': u'the start date of the async job'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}], u'requiredparams': [], u'description': u'Lists all pending asynchronous jobs for the account.'}, u'ostypes': {u'name': u'listOsTypes', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [u'listOsTypes'], u'length': 255, u'type': u'uuid', u'description': u'list by Os type Id'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'oscategoryid', u'required': False, u'related': [u'listOsCategories'], u'length': 255, u'type': u'uuid', u'description': u'list by Os Category id'}, {u'name': u'description', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list os by description'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all supported OS types for this cloud.'}, u'networkacls': {u'name': u'listNetworkACLs', u'related': [u'createNetworkACL'], u'isasync': False, u'params': [{u'name': u'traffictype', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list network ACLs by traffic type - Ingress or Egress'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'Lists network ACL with the specified ID.'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'networkid', u'required': False, u'related': [u'createNetwork', u'listNiciraNvpDeviceNetworks', u'updateNetwork', u'listF5LoadBalancerNetworks', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'length': 255, u'type': u'uuid', u'description': u'list network ACLs by network Id'}], u'requiredparams': [], u'description': u'Lists all network ACLs'}, u'volumesonfiler': {u'name': u'listVolumesOnFiler', u'related': [], u'isasync': False, u'params': [{u'name': u'poolname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'poolname'], u'description': u'List Volumes'}, u'eventtypes': {u'name': u'listEventTypes', u'related': [], u'isasync': False, u'params': [], u'requiredparams': [], u'description': u'List Event Types'}, u'remoteaccessvpns': {u'name': u'listRemoteAccessVpns', u'related': [u'createRemoteAccessVpn'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'publicipid', u'required': True, u'related': [u'restartNetwork', u'listPublicIpAddresses', u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'public ip address id of the vpn server'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}], u'requiredparams': [u'publicipid'], u'description': u'Lists remote access vpns'}, u'alerts': {u'name': u'listAlerts', u'related': [], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list by alert type'}, {u'name': u'id', u'required': False, u'related': [u'listAlerts'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the alert'}], u'requiredparams': [], u'description': u'Lists all alerts.'}, u'regions': {u'name': u'listRegions', u'related': [u'addRegion'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'List Region by region ID.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List Region by region name.'}], u'requiredparams': [], u'description': u'Lists Regions'}, u'vpcofferings': {u'name': u'listVPCOfferings', u'related': [], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listVPCOfferings'], u'length': 255, u'type': u'uuid', u'description': u'list VPC offerings by id'}, {u'name': u'state', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list VPC offerings by state'}, {u'name': u'supportedservices', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list VPC offerings supporting certain services'}, {u'name': u'displaytext', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list VPC offerings by display text'}, {u'name': u'isdefault', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if need to list only default VPC offerings. Default value is false'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list VPC offerings by name'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists VPC offerings'}, u'niciranvpdevicenetworks': {u'name': u'listNiciraNvpDeviceNetworks', u'related': [u'createNetwork', u'updateNetwork', u'listF5LoadBalancerNetworks', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks', u'listNetworks'], u'isasync': False, u'params': [{u'name': u'nvpdeviceid', u'required': True, u'related': [u'addNiciraNvpDevice', u'listNiciraNvpDevices'], u'length': 255, u'type': u'uuid', u'description': u'nicira nvp device ID'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [u'nvpdeviceid'], u'description': u'lists network that are using a nicira nvp device'}, u'events': {u'name': u'listEvents', u'related': [], u'isasync': False, u'params': [{u'name': u'startdate', u'required': False, u'related': [], u'length': 255, u'type': u'date', u'description': u'the start date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'enddate', u'required': False, u'related': [], u'length': 255, u'type': u'date', u'description': u'the end date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")'}, {u'name': u'duration', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the duration of the event'}, {u'name': u'id', u'required': False, u'related': [u'listEvents'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the event'}, {u'name': u'level', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the event level (INFO, WARN, ERROR)'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'entrytime', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'the time the event was entered'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the event type (see event types)'}], u'requiredparams': [], u'description': u'A command to list events.'}, u'templates': {u'name': u'listTemplates', u'related': [u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'isasync': False, u'params': [{u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'templatefilter', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listTemplates', u'registerIso', u'updateTemplate', u'prepareTemplate', u'copyIso', u'updateIso', u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the template ID'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the template name'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'hypervisor', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the hypervisor for which to restrict the search'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'list templates by zoneId'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}], u'requiredparams': [u'templatefilter'], u'description': u'List all public, private, and privileged templates.'}, u'cisconexusvsms': {u'name': u'listCiscoNexusVSMs', u'related': [u'disableCiscoNexusVSM', u'enableCiscoNexusVSM'], u'isasync': False, u'params': [{u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'clusterid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Id of the CloudStack cluster in which the Cisco Nexus 1000v VSM appliance.'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'Id of the CloudStack cluster in which the Cisco Nexus 1000v VSM appliance.'}], u'requiredparams': [], u'description': u'Retrieves a Cisco Nexus 1000v Virtual Switch Manager device associated with a Cluster'}, u'ipforwardingrules': {u'name': u'listIpForwardingRules', u'related': [], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'id', u'required': False, u'related': [u'listIpForwardingRules'], u'length': 255, u'type': u'uuid', u'description': u'Lists rule with the specified ID.'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'listVirtualMachines', u'destroyVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Lists all rules applied to the specified Vm.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'ipaddressid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list the rule belonging to this public ip address'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}], u'requiredparams': [], u'description': u'List the ip forwarding rules'}, u'srxfirewalls': {u'name': u'listSrxFirewalls', u'related': [u'addSrxFirewall'], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'physicalnetworkid', u'required': False, u'related': [u'listPhysicalNetworks', u'createPhysicalNetwork'], u'length': 255, u'type': u'uuid', u'description': u'the Physical Network ID'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'fwdeviceid', u'required': False, u'related': [u'listSrxFirewalls', u'addSrxFirewall'], u'length': 255, u'type': u'uuid', u'description': u'SRX firewall device ID'}], u'requiredparams': [], u'description': u'lists SRX firewall devices in a physical network'}, u'vpnconnections': {u'name': u'listVpnConnections', u'related': [], u'isasync': False, u'params': [{u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'vpcid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'id of vpc'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'id', u'required': False, u'related': [u'listVpnConnections'], u'length': 255, u'type': u'uuid', u'description': u'id of the vpn connection'}], u'requiredparams': [], u'description': u'Lists site to site vpn connection gateways'}, u'trafficmonitors': {u'name': u'listTrafficMonitors', u'related': [], u'isasync': False, u'params': [{u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'zoneid', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'zone Id'}], u'requiredparams': [u'zoneid'], u'description': u'List traffic monitor Hosts.'}, u'vpnusers': {u'name': u'listVpnUsers', u'related': [], u'isasync': False, u'params': [{u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'id', u'required': False, u'related': [u'listVpnUsers'], u'length': 255, u'type': u'uuid', u'description': u'The uuid of the Vpn user'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'username', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the username of the vpn user.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}], u'requiredparams': [], u'description': u'Lists vpn users'}, u'egressfirewallrules': {u'name': u'listEgressFirewallRules', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Lists rule with the specified ID.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'networkid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the id network network for the egress firwall services'}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Lists rule with the specified ID.'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'ipaddressid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the id of IP address of the firwall services'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}], u'requiredparams': [], u'description': u'Lists all egress firewall rules for network id.'}, u'staticroutes': {u'name': u'listStaticRoutes', u'related': [u'createStaticRoute'], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'gatewayid', u'required': False, u'related': [u'createPrivateGateway'], u'length': 255, u'type': u'uuid', u'description': u'list static routes by gateway id'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'vpcid', u'required': False, u'related': [u'updateVPC', u'restartVPC', u'listVPCs', u'createVPC'], u'length': 255, u'type': u'uuid', u'description': u'list static routes by vpc id'}, {u'name': u'id', u'required': False, u'related': [u'createStaticRoute', u'listStaticRoutes'], u'length': 255, u'type': u'uuid', u'description': u'list static route by id'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}], u'requiredparams': [], u'description': u'Lists all static routes'}, u'volumes': {u'name': u'listVolumes', u'related': [u'migrateVolume', u'detachVolume', u'resizeVolume', u'attachVolume', u'uploadVolume', u'createVolume'], u'isasync': False, u'params': [{u'name': u'isrecursive', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the disk volume'}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'listProjects', u'suspendProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'list objects by project'}, {u'name': u'hostid', u'required': False, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addSecondaryStorage', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers', u'prepareHostForMaintenance'], u'length': 255, u'type': u'uuid', u'description': u'list volumes on specified host'}, {u'name': u'id', u'required': False, u'related': [u'migrateVolume', u'detachVolume', u'resizeVolume', u'attachVolume', u'listVolumes', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the disk volume'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'List resources by tags (key/value pairs)'}, {u'name': u'zoneid', u'required': False, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the availability zone'}, {u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'list only resources belonging to the domain specified'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list resources by account. Must be used with the domainId parameter.'}, {u'name': u'virtualmachineid', u'required': False, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'rebootVirtualMachine', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'attachIso', u'listLoadBalancerRuleInstances', u'deployVirtualMachine', u'detachIso', u'resetSSHKeyForVirtualMachine', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the virtual machine'}, {u'name': u'type', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the type of disk volume'}, {u'name': u'listall', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u"If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false"}, {u'name': u'podid', u'required': False, u'related': [u'createPod', u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the pod id the disk volume belongs to'}], u'requiredparams': [], u'description': u'Lists all volumes.'}, u'pods': {u'name': u'listPods', u'related': [u'updatePod'], u'isasync': False, u'params': [{u'name': u'showcapacities', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'flag to display the capacity of the pods'}, {u'name': u'allocationstate', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list pods by allocation state'}, {u'name': u'pagesize', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'list Pods by Zone ID'}, {u'name': u'id', u'required': False, u'related': [u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'list Pods by ID'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'list Pods by name'}, {u'name': u'page', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u''}, {u'name': u'keyword', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'List by keyword'}], u'requiredparams': [], u'description': u'Lists all Pods.'}}, u'upload': {u'volume': {u'name': u'uploadVolume', u'related': [u'detachVolume'], u'isasync': True, u'params': [{u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the name of the volume'}, {u'name': u'format', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the format for the volume. Possible values include QCOW2, OVA, and VHD.'}, {u'name': u'url', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'the URL of where the volume is hosted. Possible URL include http:// and https://'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional accountName. Must be used with domainId.'}, {u'name': u'domainid', u'required': False, u'related': [u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId. If the account parameter is used, domainId must also be used.'}, {u'name': u'checksum', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the MD5 checksum value of this volume'}, {u'name': u'zoneid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone the volume is to be hosted on'}], u'requiredparams': [u'name', u'format', u'url', u'zoneid'], u'description': u'Uploads a data disk.'}, u'customcertificate': {u'name': u'uploadCustomCertificate', u'related': [], u'isasync': True, u'params': [{u'name': u'domainsuffix', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'DNS domain suffix that the certificate is granted for.'}, {u'name': u'certificate', u'required': True, u'related': [], u'length': 65535, u'type': u'string', u'description': u'The certificate to be uploaded.'}, {u'name': u'privatekey', u'required': False, u'related': [], u'length': 65535, u'type': u'string', u'description': u'The private key for the attached certificate.'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'A name / alias for the certificate.'}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'integer', u'description': u'An integer providing the location in a chain that the certificate will hold. Usually, this can be left empty. When creating a chain, the top level certificate should have an ID of 1, with each step in the chain incrementing by one. Example, CA with id = 1, Intermediate CA with id = 2, Site certificate with ID = 3'}], u'requiredparams': [u'domainsuffix', u'certificate'], u'description': u'Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.'}}, u'remove': {u'region': {u'name': u'removeRegion', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'integer', u'description': u'ID of the region to delete'}], u'requiredparams': [u'id'], u'description': u'Removes specified region'}, u'nicfromvirtualmachine': {u'name': u'removeNicFromVirtualMachine', u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': True, u'params': [{u'name': u'nicid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'NIC ID'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'startVirtualMachine', u'updateDefaultNicForVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'resetPasswordForVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'removeNicFromVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'Virtual Machine ID'}], u'requiredparams': [u'nicid', u'virtualmachineid'], u'description': u'Removes VM from specified network by deleting a NIC'}, u'fromloadbalancerrule': {u'name': u'removeFromLoadBalancerRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listIpForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the load balancer rule'}, {u'name': u'virtualmachineids', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'list', u'description': u'the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)'}], u'requiredparams': [u'id', u'virtualmachineids'], u'description': u'Removes a virtual machine or a list of virtual machines from a load balancer rule.'}, u'vpnuser': {u'name': u'removeVpnUser', u'related': [], u'isasync': True, u'params': [{u'name': u'domainid', u'required': False, u'related': [u'updateDomain', u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.'}, {u'name': u'projectid', u'required': False, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'remove vpn user from the project'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'an optional account for the vpn user. Must be used with domainId.'}, {u'name': u'username', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'username for the vpn user'}], u'requiredparams': [u'username'], u'description': u'Removes vpn user'}}, u'asyncapis': [u'createCondition', u'reconnectHost', u'copyTemplate', u'deleteBigSwitchVnsDevice', u'addNicToVirtualMachine', u'extractVolume', u'addAccountToProject', u'deleteEgressFirewallRule', u'deleteCiscoNexusVSM', u'createVpnConnection', u'suspendProject', u'addF5LoadBalancer', u'deleteAutoScaleVmGroup', u'authorizeSecurityGroupIngress', u'addNetscalerLoadBalancer', u'deleteDomain', u'configureNetscalerLoadBalancer', u'disableAutoScaleVmGroup', u'authorizeSecurityGroupEgress', u'createTemplate', u'migrateVolume', u'updatePhysicalNetwork', u'prepareHostForMaintenance', u'deletePrivateGateway', u'deleteStaticRoute', u'deleteTrafficType', u'deleteLoadBalancerRule', u'attachIso', u'destroySystemVm', u'deletePortForwardingRule', u'enableStorageMaintenance', u'stopRouter', u'configureSrxFirewall', u'attachVolume', u'updateVPCOffering', u'resetSSHKeyForVirtualMachine', u'updateProjectInvitation', u'createTags', u'enableAutoScaleVmGroup', u'deleteTags', u'deleteAccountFromProject', u'removeVpnUser', u'updateVpnCustomerGateway', u'stopSystemVm', u'uploadCustomCertificate', u'restartNetwork', u'createAutoScaleVmProfile', u'rebootVirtualMachine', u'enableCiscoNexusVSM', u'cancelHostMaintenance', u'deleteStorageNetworkIpRange', u'deleteFirewallRule', u'deleteVpnConnection', u'startSystemVm', u'deleteF5LoadBalancer', u'deleteNiciraNvpDevice', u'updateProject', u'deleteNetwork', u'deleteProject', u'deleteNetscalerLoadBalancer', u'deleteIpForwardingRule', u'addTrafficType', u'disableUser', u'resizeVolume', u'configureVirtualRouterElement', u'createStaticRoute', u'deleteProjectInvitation', u'migrateSystemVm', u'activateProject', u'removeNicFromVirtualMachine', u'revokeSecurityGroupIngress', u'updateDefaultNicForVirtualMachine', u'disableStaticNat', u'createNetworkACL', u'createVPC', u'configureF5LoadBalancer', u'disassociateIpAddress', u'createIpForwardingRule', u'createVolume', u'resetPasswordForVirtualMachine', u'assignToLoadBalancerRule', u'startRouter', u'extractIso', u'deleteRemoteAccessVpn', u'resetVpnConnection', u'createRemoteAccessVpn', u'extractTemplate', u'startVirtualMachine', u'detachIso', u'updateVPC', u'deleteAccount', u'associateIpAddress', u'updateAutoScaleVmProfile', u'disableAccount', u'updatePortForwardingRule', u'migrateVirtualMachine', u'createStorageNetworkIpRange', u'cancelStorageMaintenance', u'deployVirtualMachine', u'removeFromLoadBalancerRule', u'revokeSecurityGroupEgress', u'deleteCondition', u'createPortForwardingRule', u'addVpnUser', u'createVPCOffering', u'createEgressFirewallRule', u'deleteLBStickinessPolicy', u'destroyRouter', u'createPrivateGateway', u'disableCiscoNexusVSM', u'deleteAutoScaleVmProfile', u'updateTrafficType', u'deleteSnapshot', u'createProject', u'createLoadBalancerRule', u'addSrxFirewall', u'addNiciraNvpDevice', u'createAutoScalePolicy', u'restoreVirtualMachine', u'copyIso', u'uploadVolume', u'createLBStickinessPolicy', u'stopVirtualMachine', u'createCounter', u'createSnapshot', u'destroyVirtualMachine', u'updateNetwork', u'deleteVpnGateway', u'createAutoScaleVmGroup', u'rebootRouter', u'deleteNetworkServiceProvider', u'deleteIso', u'createVpnCustomerGateway', u'createFirewallRule', u'deleteAutoScalePolicy', u'deleteSrxFirewall', u'addNetworkServiceProvider', u'rebootSystemVm', u'detachVolume', u'deleteNetworkACL', u'markDefaultZoneForAccount', u'deleteVPC', u'restartVPC', u'updateAutoScaleVmGroup', u'updateLoadBalancerRule', u'createPhysicalNetwork', u'deleteTemplate', u'deletePhysicalNetwork', u'deleteVpnCustomerGateway', u'deleteVPCOffering', u'createVirtualRouterElement', u'updateAutoScalePolicy', u'addBigSwitchVnsDevice', u'createVpnGateway', u'updateNetworkServiceProvider', u'deleteCounter', u'updateStorageNetworkIpRange'], u'assign': {u'toloadbalancerrule': {u'name': u'assignToLoadBalancerRule', u'related': [], u'isasync': True, u'params': [{u'name': u'virtualmachineids', u'required': True, u'related': [u'startVirtualMachine', u'updateVirtualMachine', u'stopVirtualMachine', u'recoverVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'migrateVirtualMachine', u'changeServiceForVirtualMachine', u'deployVirtualMachine', u'detachIso', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'list', u'description': u'the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)'}, {u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}], u'requiredparams': [u'virtualmachineids', u'id'], u'description': u'Assigns virtual machine or a list of virtual machines to a load balancer rule.'}, u'virtualmachine': {u'name': u'assignVirtualMachine', u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'isasync': False, u'params': [{u'name': u'networkids', u'required': False, u'related': [u'updateNetwork', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'list', u'description': u'list of new network ids in which the moved VM will participate. In case no network ids are provided the VM will be part of the default network for that zone. In case there is no network yet created for the new account the default network will be created.'}, {u'name': u'domainid', u'required': True, u'related': [u'listDomainChildren', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'domain id of the new VM owner.'}, {u'name': u'securitygroupids', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of security group ids to be applied on the virtual machine. In case no security groups are provided the VM is part of the default security group.'}, {u'name': u'account', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'account name of the new VM owner.'}, {u'name': u'virtualmachineid', u'required': True, u'related': [u'updateVirtualMachine', u'stopVirtualMachine', u'assignVirtualMachine', u'listVirtualMachines', u'destroyVirtualMachine', u'restoreVirtualMachine'], u'length': 255, u'type': u'uuid', u'description': u'id of the VM to be moved'}], u'requiredparams': [u'domainid', u'account', u'virtualmachineid'], u'description': u'Assign a VM from one account to another under the same domain. This API is available for Basic zones with security groups and Advance zones with guest networks. The VM is restricted to move between accounts under same domain.'}}, u'delete': {u'loadbalancerrule': {u'name': u'deleteLoadBalancerRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the load balancer rule'}], u'requiredparams': [u'id'], u'description': u'Deletes a load balancer rule.'}, u'domain': {u'name': u'deleteDomain', u'related': [], u'isasync': True, u'params': [{u'name': u'cleanup', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise'}, {u'name': u'id', u'required': True, u'related': [u'updateDomain', u'listDomainChildren', u'listDomains', u'createDomain'], u'length': 255, u'type': u'uuid', u'description': u'ID of domain to delete'}], u'requiredparams': [u'id'], u'description': u'Deletes a specified domain'}, u'instancegroup': {u'name': u'deleteInstanceGroup', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the instance group'}], u'requiredparams': [u'id'], u'description': u'Deletes a vm group'}, u'diskoffering': {u'name': u'deleteDiskOffering', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateDiskOffering', u'createDiskOffering', u'listDiskOfferings'], u'length': 255, u'type': u'uuid', u'description': u'ID of the disk offering'}], u'requiredparams': [u'id'], u'description': u'Updates a disk offering.'}, u'externalloadbalancer': {u'name': u'deleteExternalLoadBalancer', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listSwifts', u'addHost', u'cancelHostMaintenance', u'addBaremetalHost', u'updateHost', u'addSwift', u'listHosts', u'listExternalLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'Id of the external loadbalancer appliance.'}], u'requiredparams': [u'id'], u'description': u'Deletes a F5 external load balancer appliance added in a zone.'}, u'securitygroup': {u'name': u'deleteSecurityGroup', u'related': [], u'isasync': False, u'params': [{u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the domain ID of account owning the security group'}, {u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'The ID of the security group. Mutually exclusive with name parameter'}, {u'name': u'name', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'The ID of the security group. Mutually exclusive with id parameter'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account of the security group. Must be specified with domain ID'}, {u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the project of the security group'}], u'requiredparams': [], u'description': u'Deletes security group'}, u'portforwardingrule': {u'name': u'deletePortForwardingRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the port forwarding rule'}], u'requiredparams': [u'id'], u'description': u'Deletes a port forwarding rule'}, u'cluster': {u'name': u'deleteCluster', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the cluster ID'}], u'requiredparams': [u'id'], u'description': u'Deletes a cluster.'}, u'accountfromproject': {u'name': u'deleteAccountFromProject', u'related': [], u'isasync': True, u'params': [{u'name': u'projectid', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject', u'updateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to remove the account from'}, {u'name': u'account', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'name of the account to be removed from the project'}], u'requiredparams': [u'projectid', u'account'], u'description': u'Deletes account from the project'}, u'networkdevice': {u'name': u'deleteNetworkDevice', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'addHost', u'updateHost', u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'Id of network device to delete'}], u'requiredparams': [u'id'], u'description': u'Deletes network device.'}, u'firewallrule': {u'name': u'deleteFirewallRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the firewall rule'}], u'requiredparams': [u'id'], u'description': u'Deletes a firewall rule'}, u'pod': {u'name': u'deletePod', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePod', u'listPods'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Pod'}], u'requiredparams': [u'id'], u'description': u'Deletes a Pod.'}, u'ipforwardingrule': {u'name': u'deleteIpForwardingRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the id of the forwarding rule'}], u'requiredparams': [u'id'], u'description': u'Deletes an ip forwarding rule'}, u'vpnconnection': {u'name': u'deleteVpnConnection', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listVpnConnections', u'resetVpnConnection'], u'length': 255, u'type': u'uuid', u'description': u'id of vpn connection'}], u'requiredparams': [u'id'], u'description': u'Delete site to site vpn connection'}, u'lbstickinesspolicy': {u'name': u'deleteLBStickinessPolicy', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createLBStickinessPolicy'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the LB stickiness policy'}], u'requiredparams': [u'id'], u'description': u'Deletes a LB stickiness policy.'}, u'vpcoffering': {u'name': u'deleteVPCOffering', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the VPC offering'}], u'requiredparams': [u'id'], u'description': u'Deletes VPC offering'}, u'network': {u'name': u'deleteNetwork', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateNetwork', u'listSrxFirewallNetworks', u'listNetscalerLoadBalancerNetworks'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network'}], u'requiredparams': [u'id'], u'description': u'Deletes a network'}, u'zone': {u'name': u'deleteZone', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateZone', u'listZones', u'createZone'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Zone'}], u'requiredparams': [u'id'], u'description': u'Deletes a Zone.'}, u'remoteaccessvpn': {u'name': u'deleteRemoteAccessVpn', u'related': [], u'isasync': True, u'params': [{u'name': u'publicipid', u'required': True, u'related': [u'associateIpAddress'], u'length': 255, u'type': u'uuid', u'description': u'public ip address id of the vpn server'}], u'requiredparams': [u'publicipid'], u'description': u'Destroys a l2tp/ipsec remote access vpn'}, u'storagenetworkiprange': {u'name': u'deleteStorageNetworkIpRange', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listStorageNetworkIpRange', u'createStorageNetworkIpRange', u'updateStorageNetworkIpRange'], u'length': 255, u'type': u'uuid', u'description': u'the uuid of the storage network ip range'}], u'requiredparams': [u'id'], u'description': u'Deletes a storage network IP Range.'}, u'bigswitchvnsdevice': {u'name': u'deleteBigSwitchVnsDevice', u'related': [], u'isasync': True, u'params': [{u'name': u'vnsdeviceid', u'required': True, u'related': [], u'length': 255, u'type': u'long', u'description': u'BigSwitch device ID'}], u'requiredparams': [u'vnsdeviceid'], u'description': u' delete a bigswitch vns device'}, u'projectinvitation': {u'name': u'deleteProjectInvitation', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listProjectInvitations'], u'length': 255, u'type': u'uuid', u'description': u'id of the invitation'}], u'requiredparams': [u'id'], u'description': u'Accepts or declines project invitation'}, u'autoscalepolicy': {u'name': u'deleteAutoScalePolicy', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateAutoScalePolicy'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale policy'}], u'requiredparams': [u'id'], u'description': u'Deletes a autoscale policy.'}, u'niciranvpdevice': {u'name': u'deleteNiciraNvpDevice', u'related': [], u'isasync': True, u'params': [{u'name': u'nvpdeviceid', u'required': True, u'related': [u'addNiciraNvpDevice', u'listNiciraNvpDevices'], u'length': 255, u'type': u'uuid', u'description': u'Nicira device ID'}], u'requiredparams': [u'nvpdeviceid'], u'description': u' delete a nicira nvp device'}, u'serviceoffering': {u'name': u'deleteServiceOffering', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'updateHypervisorCapabilities', u'listServiceOfferings'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the service offering'}], u'requiredparams': [u'id'], u'description': u'Deletes a service offering.'}, u'condition': {u'name': u'deleteCondition', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the condition.'}], u'requiredparams': [u'id'], u'description': u'Removes a condition'}, u'storagepool': {u'name': u'deleteStoragePool', u'related': [], u'isasync': False, u'params': [{u'name': u'forced', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force destroy storage pool (force expunge volumes in Destroyed state as a part of pool removal)'}, {u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'Storage pool id'}], u'requiredparams': [u'id'], u'description': u'Deletes a storage pool.'}, u'vpngateway': {u'name': u'deleteVpnGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createVpnGateway'], u'length': 255, u'type': u'uuid', u'description': u'id of customer gateway'}], u'requiredparams': [u'id'], u'description': u'Delete site to site vpn gateway'}, u'snapshot': {u'name': u'deleteSnapshot', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createSnapshot', u'listSnapshots'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the snapshot'}], u'requiredparams': [u'id'], u'description': u'Deletes a snapshot of a disk volume.'}, u'autoscalevmgroup': {u'name': u'deleteAutoScaleVmGroup', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listAutoScaleVmGroups', u'createAutoScaleVmGroup', u'disableAutoScaleVmGroup', u'enableAutoScaleVmGroup', u'updateAutoScaleVmGroup'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale group'}], u'requiredparams': [u'id'], u'description': u'Deletes a autoscale vm group.'}, u'trafficmonitor': {u'name': u'deleteTrafficMonitor', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'Id of the Traffic Monitor Host.'}], u'requiredparams': [u'id'], u'description': u'Deletes an traffic monitor host.'}, u'networkacl': {u'name': u'deleteNetworkACL', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network ACL'}], u'requiredparams': [u'id'], u'description': u'Deletes a Network ACL'}, u'template': {u'name': u'deleteTemplate', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the template'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of zone of the template'}], u'requiredparams': [u'id'], u'description': u'Deletes a template from the system. All virtual machines using the deleted template will not be affected.'}, u'tags': {u'name': u'deleteTags', u'related': [], u'isasync': True, u'params': [{u'name': u'resourceids', u'required': True, u'related': [], u'length': 255, u'type': u'list', u'description': u'Delete tags for resource id(s)'}, {u'name': u'tags', u'required': False, u'related': [], u'length': 255, u'type': u'map', u'description': u'Delete tags matching key/value pairs'}, {u'name': u'resourcetype', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Delete tag by resource type'}], u'requiredparams': [u'resourceids', u'resourcetype'], u'description': u'Deleting resource tag(s)'}, u'snapshotpolicies': {u'name': u'deleteSnapshotPolicies', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the Id of the snapshot policy'}, {u'name': u'ids', u'required': False, u'related': [], u'length': 255, u'type': u'list', u'description': u'list of snapshots policy IDs separated by comma'}], u'requiredparams': [], u'description': u'Deletes snapshot policies for the account.'}, u'privategateway': {u'name': u'deletePrivateGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createPrivateGateway', u'listPrivateGateways'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the private gateway'}], u'requiredparams': [u'id'], u'description': u'Deletes a Private gateway'}, u'traffictype': {u'name': u'deleteTrafficType', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'addTrafficType', u'updateTrafficType'], u'length': 255, u'type': u'uuid', u'description': u'traffic type id'}], u'requiredparams': [u'id'], u'description': u'Deletes traffic type of a physical network'}, u'host': {u'name': u'deleteHost', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the host ID'}, {u'name': u'forcedestroylocalstorage', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force destroy local storage on this host. All VMs created on this local storage will be destroyed'}, {u'name': u'forced', u'required': False, u'related': [], u'length': 255, u'type': u'boolean', u'description': u'Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped'}], u'requiredparams': [u'id'], u'description': u'Deletes a host.'}, u'staticroute': {u'name': u'deleteStaticRoute', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createStaticRoute', u'listStaticRoutes'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the static route'}], u'requiredparams': [u'id'], u'description': u'Deletes a static route'}, u'vpc': {u'name': u'deleteVPC', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'restartVPC'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the VPC'}], u'requiredparams': [u'id'], u'description': u'Deletes a VPC'}, u'srxfirewall': {u'name': u'deleteSrxFirewall', u'related': [], u'isasync': True, u'params': [{u'name': u'fwdeviceid', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'srx firewall device ID'}], u'requiredparams': [u'fwdeviceid'], u'description': u' delete a SRX firewall device'}, u'externalfirewall': {u'name': u'deleteExternalFirewall', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listHosts'], u'length': 255, u'type': u'uuid', u'description': u'Id of the external firewall appliance.'}], u'requiredparams': [u'id'], u'description': u'Deletes an external firewall appliance.'}, u'pool': {u'name': u'deletePool', u'related': [], u'isasync': False, u'params': [{u'name': u'poolname', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'pool name.'}], u'requiredparams': [u'poolname'], u'description': u'Delete a pool'}, u'autoscalevmprofile': {u'name': u'deleteAutoScaleVmProfile', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listAutoScaleVmProfiles'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the autoscale profile'}], u'requiredparams': [u'id'], u'description': u'Deletes a autoscale vm profile.'}, u'volume': {u'name': u'deleteVolume', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'detachVolume', u'resizeVolume', u'uploadVolume', u'createVolume'], u'length': 255, u'type': u'uuid', u'description': u'The ID of the disk volume'}], u'requiredparams': [u'id'], u'description': u'Deletes a detached disk volume.'}, u'account': {u'name': u'deleteAccount', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'markDefaultZoneForAccount', u'updateAccount', u'listAccounts', u'lockAccount', u'disableAccount'], u'length': 255, u'type': u'uuid', u'description': u'Account id'}], u'requiredparams': [u'id'], u'description': u'Deletes a account, and all users associated with this account'}, u'cisconexusvsm': {u'name': u'deleteCiscoNexusVSM', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'disableCiscoNexusVSM', u'listCiscoNexusVSMs', u'enableCiscoNexusVSM'], u'length': 255, u'type': u'uuid', u'description': u'Id of the Cisco Nexus 1000v VSM device to be deleted'}], u'requiredparams': [u'id'], u'description': u' delete a Cisco Nexus VSM device'}, u'netscalerloadbalancer': {u'name': u'deleteNetscalerLoadBalancer', u'related': [], u'isasync': True, u'params': [{u'name': u'lbdeviceid', u'required': True, u'related': [u'listNetscalerLoadBalancers'], u'length': 255, u'type': u'uuid', u'description': u'netscaler load balancer device ID'}], u'requiredparams': [u'lbdeviceid'], u'description': u' delete a netscaler load balancer device'}, u'networkoffering': {u'name': u'deleteNetworkOffering', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'createNetworkOffering', u'updateNetworkOffering'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network offering'}], u'requiredparams': [u'id'], u'description': u'Deletes a network offering.'}, u'vpncustomergateway': {u'name': u'deleteVpnCustomerGateway', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'id of customer gateway'}], u'requiredparams': [u'id'], u'description': u'Delete site to site vpn customer gateway'}, u'counter': {u'name': u'deleteCounter', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the counter'}], u'requiredparams': [u'id'], u'description': u'Deletes a counter'}, u'physicalnetwork': {u'name': u'deletePhysicalNetwork', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the Physical network'}], u'requiredparams': [u'id'], u'description': u'Deletes a Physical Network.'}, u'project': {u'name': u'deleteProject', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'createProject', u'listProjectAccounts', u'activateProject'], u'length': 255, u'type': u'uuid', u'description': u'id of the project to be deleted'}], u'requiredparams': [u'id'], u'description': u'Deletes a project'}, u'vlaniprange': {u'name': u'deleteVlanIpRange', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'listVlanIpRanges'], u'length': 255, u'type': u'uuid', u'description': u'the id of the VLAN IP range'}], u'requiredparams': [u'id'], u'description': u'Creates a VLAN IP range.'}, u'f5loadbalancer': {u'name': u'deleteF5LoadBalancer', u'related': [], u'isasync': True, u'params': [{u'name': u'lbdeviceid', u'required': True, u'related': [u'configureF5LoadBalancer'], u'length': 255, u'type': u'uuid', u'description': u'netscaler load balancer device ID'}], u'requiredparams': [u'lbdeviceid'], u'description': u' delete a F5 load balancer device'}, u'iso': {u'name': u'deleteIso', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'listIsos'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the ISO file'}, {u'name': u'zoneid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones'}], u'requiredparams': [u'id'], u'description': u'Deletes an ISO file.'}, u'egressfirewallrule': {u'name': u'deleteEgressFirewallRule', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'updatePortForwardingRule', u'listIpForwardingRules', u'createIpForwardingRule', u'listPortForwardingRules', u'createPortForwardingRule'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the firewall rule'}], u'requiredparams': [u'id'], u'description': u'Deletes an ggress firewall rule'}, u'networkserviceprovider': {u'name': u'deleteNetworkServiceProvider', u'related': [], u'isasync': True, u'params': [{u'name': u'id', u'required': True, u'related': [u'addNetworkServiceProvider', u'listTrafficTypes', u'updateNetworkServiceProvider'], u'length': 255, u'type': u'uuid', u'description': u'the ID of the network service provider'}], u'requiredparams': [u'id'], u'description': u'Deletes a Network Service Provider.'}, u'sshkeypair': {u'name': u'deleteSSHKeyPair', u'related': [], u'isasync': False, u'params': [{u'name': u'projectid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the project associated with keypair'}, {u'name': u'domainid', u'required': False, u'related': [], u'length': 255, u'type': u'uuid', u'description': u'the domain ID associated with the keypair'}, {u'name': u'name', u'required': True, u'related': [], u'length': 255, u'type': u'string', u'description': u'Name of the keypair'}, {u'name': u'account', u'required': False, u'related': [], u'length': 255, u'type': u'string', u'description': u'the account associated with the keypair. Must be used with the domainId parameter.'}], u'requiredparams': [u'name'], u'description': u'Deletes a keypair by name'}, u'user': {u'name': u'deleteUser', u'related': [], u'isasync': False, u'params': [{u'name': u'id', u'required': True, u'related': [u'lockUser', u'listUsers'], u'length': 255, u'type': u'uuid', u'description': u'id of the user to be deleted'}], u'requiredparams': [u'id'], u'description': u'Deletes a user for an account'}}}
| 20,598.25 | 411,116 | 0.691445 | 63,562 | 411,965 | 4.480885 | 0.028791 | 0.040395 | 0.047399 | 0.068167 | 0.877246 | 0.843519 | 0.82939 | 0.80949 | 0.796569 | 0.782914 | 0 | 0.015477 | 0.10429 | 411,965 | 19 | 411,117 | 21,682.368421 | 0.756375 | 0.001969 | 0 | 0 | 1 | 189 | 0.641505 | 0.05299 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 13 |
b7d9c1b15b0982b4e8fb3ffa080307ec0285e721 | 73 | py | Python | segment_tree/__init__.py | evgeth/segment_tree | c2c92810620e51729103bab891b8b4e3faaab4a3 | [
"MIT"
] | 24 | 2018-02-07T12:25:44.000Z | 2022-02-05T23:07:40.000Z | segment_tree/__init__.py | evgeth/segment_tree | c2c92810620e51729103bab891b8b4e3faaab4a3 | [
"MIT"
] | 1 | 2018-04-22T16:58:17.000Z | 2018-04-22T16:58:17.000Z | segment_tree/__init__.py | evgeth/segment_tree | c2c92810620e51729103bab891b8b4e3faaab4a3 | [
"MIT"
] | 3 | 2017-12-20T13:42:44.000Z | 2019-01-09T18:17:46.000Z | from .segment_tree import *
from .multidimensional_segment_tree import *
| 24.333333 | 44 | 0.835616 | 9 | 73 | 6.444444 | 0.555556 | 0.37931 | 0.586207 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109589 | 73 | 2 | 45 | 36.5 | 0.892308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 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 |
4d1e708161dc62a1c8d3247065181f56cd3cbf81 | 54,068 | py | Python | third_party/libSBML-5.11.0-Source/src/bindings/python/test/math/TestL3FormulaParserC.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | 5 | 2015-04-16T14:27:38.000Z | 2021-11-30T14:54:39.000Z | third_party/libSBML-5.11.0-Source/src/bindings/python/test/math/TestL3FormulaParserC.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | 8 | 2017-05-30T16:58:39.000Z | 2022-02-22T16:51:34.000Z | third_party/libSBML-5.11.0-Source/src/bindings/python/test/math/TestL3FormulaParserC.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | 7 | 2016-05-29T08:12:59.000Z | 2019-05-02T13:39:25.000Z | #
# @file TestL3FormulaParserC.py
# @brief L3FormulaParser unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the file located at
# src/sbml/test/TestL3FormulaParserC.c
# using the conversion program dev/utilities/translateTests/translateTests.pl.
# Any changes made here will be lost the next time the file is regenerated.
#
# -----------------------------------------------------------------------------
# This file is part of libSBML. Please visit http://sbml.org for more
# information about SBML, and the latest version of libSBML.
#
# Copyright 2005-2010 California Institute of Technology.
# Copyright 2002-2005 California Institute of Technology and
# Japan Science and Technology Corporation.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation. A copy of the license agreement is provided
# in the file named "LICENSE.txt" included with this software distribution
# and also available online as http://sbml.org/software/libsbml/license.html
# -----------------------------------------------------------------------------
import sys
import math
import unittest
import libsbml
def isnan(x):
return (x != x)
pass
def util_isInf(*x):
return ( (x[0] == util_PosInf()) or (x[0] == util_NegInf()) )
def util_NaN():
z = 1e300
z = z * z
return z - z
def util_PosInf():
z = 1e300
z = z * z
return z
def util_NegInf():
z = 1e300
z = z * z
return -z
class TestL3FormulaParserC(unittest.TestCase):
def test_SBML_C_parseL3Formula_1(self):
r = libsbml.parseL3Formula("1")
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == 1 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_10(self):
r = libsbml.parseL3Formula("1 + -2e100 / 3")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_DIVIDE )
self.assert_( c.getCharacter() == '/' )
self.assert_( c.getNumChildren() == 2 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getCharacter() == '-' )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL_E )
self.assert_( c.getMantissa() == 2 )
self.assert_( c.getExponent() == 100 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_11(self):
r = libsbml.parseL3Formula("1 - -foo / 3")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getCharacter() == '-' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_DIVIDE )
self.assert_( c.getCharacter() == '/' )
self.assert_( c.getNumChildren() == 2 )
c = r.getRightChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getCharacter() == '-' )
self.assert_( c.getNumChildren() == 1 )
c = r.getRightChild().getLeftChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "foo" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_12(self):
r = libsbml.parseL3Formula("2 * foo^bar + 3.0")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_TIMES )
self.assert_( c.getCharacter() == '*' )
self.assert_( c.getNumChildren() == 2 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 3.0 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_POWER )
self.assert_( c.getCharacter() == '^' )
self.assert_( c.getNumChildren() == 2 )
c = r.getLeftChild().getRightChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "foo" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "bar" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_13(self):
r = libsbml.parseL3Formula("foo()")
self.assert_( r.getType() == libsbml.AST_FUNCTION )
self.assert_(( "foo" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_14(self):
r = libsbml.parseL3Formula("foo(1)")
self.assert_( r.getType() == libsbml.AST_FUNCTION )
self.assert_(( "foo" == r.getName() ))
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_15(self):
r = libsbml.parseL3Formula("foo(1, bar)")
self.assert_( r.getType() == libsbml.AST_FUNCTION )
self.assert_(( "foo" == r.getName() ))
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "bar" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_16(self):
r = libsbml.parseL3Formula("foo(1, bar, 2^-3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION )
self.assert_(( "foo" == r.getName() ))
self.assert_( r.getNumChildren() == 3 )
c = r.getChild(0)
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getChild(1)
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "bar" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getChild(2)
self.assert_( c.getType() == libsbml.AST_POWER )
self.assert_( c.getCharacter() == '^' )
self.assert_( c.getNumChildren() == 2 )
c = r.getChild(2).getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getChild(2).getRightChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getCharacter() == '-' )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_17(self):
r = libsbml.parseL3Formula("1//1")
self.assert_( r == None )
self.assert_(( "Error when parsing input '1//1' at position 3: syntax error, unexpected '/'" == libsbml.getLastParseL3Error() ))
pass
def test_SBML_C_parseL3Formula_18(self):
r = libsbml.parseL3Formula("1+2*3 4")
self.assert_( r == None )
self.assert_(( "Error when parsing input '1+2*3 4' at position 7: syntax error, unexpected integer" == libsbml.getLastParseL3Error() ))
pass
def test_SBML_C_parseL3Formula_2(self):
r = libsbml.parseL3Formula("2.1")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( r.getReal() == 2.1 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_3(self):
r = libsbml.parseL3Formula("2.1e5")
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == 2.1 )
self.assert_( r.getExponent() == 5 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_4(self):
r = libsbml.parseL3Formula("foo")
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "foo" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_5(self):
r = libsbml.parseL3Formula("1 + foo")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "foo" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_6(self):
r = libsbml.parseL3Formula("1 + 2")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_7(self):
r = libsbml.parseL3Formula("1 + 2 * 3")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_TIMES )
self.assert_( c.getCharacter() == '*' )
self.assert_( c.getNumChildren() == 2 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_8(self):
r = libsbml.parseL3Formula("(1 - 2) * 3")
self.assert_( r.getType() == libsbml.AST_TIMES )
self.assert_( r.getCharacter() == '*' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getCharacter() == '-' )
self.assert_( c.getNumChildren() == 2 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_9(self):
r = libsbml.parseL3Formula("1 + -2 / 3")
self.assert_( r.getType() == libsbml.AST_PLUS )
self.assert_( r.getCharacter() == '+' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_DIVIDE )
self.assert_( c.getCharacter() == '/' )
self.assert_( c.getNumChildren() == 2 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getCharacter() == '-' )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_arguments(self):
r = libsbml.parseL3Formula("sin(x,y)")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'sin(x,y)' at position 8: The function 'sin' takes exactly one argument, but 2 were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("delay(x)")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'delay(x)' at position 8: The function 'delay' takes exactly two arguments, but 1 were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("piecewise()")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'piecewise()' at position 11: The function 'piecewise' takes at least one argument, but none were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("gt(x)")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'gt(x)' at position 5: The function 'gt' takes at least two arguments, but 1 were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("minus()")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'minus()' at position 7: The function 'minus' takes exactly one or two arguments, but 0 were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("root(x, y, z)")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'root(x, y, z)' at position 13: The function 'root' takes exactly one or two arguments, but 3 were found." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3Formula("power()")
self.assert_( r == None )
self.assert_(( "Error when parsing input 'power()' at position 7: The function 'power' takes exactly two arguments, but 0 were found." == libsbml.getLastParseL3Error() ))
pass
def test_SBML_C_parseL3Formula_avogadrosettings(self):
r = libsbml.parseL3Formula("avogadro")
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseAvogadroCsymbol(False)
self.assert_( settings.getParseAvogadroCsymbol() == False )
r = libsbml.parseL3FormulaWithSettings("avogadro", settings)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "avogadro" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseAvogadroCsymbol(True)
self.assert_( settings.getParseAvogadroCsymbol() == True )
r = libsbml.parseL3FormulaWithSettings("avogadro", settings)
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_collapseminussettings1(self):
r = libsbml.parseL3Formula("--4.4")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseCollapseMinus(True)
self.assert_( settings.getParseCollapseMinus() == True )
r = libsbml.parseL3FormulaWithSettings("--4.4", settings)
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( r.getReal() == 4.4 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseCollapseMinus(False)
self.assert_( settings.getParseCollapseMinus() == False )
r = libsbml.parseL3FormulaWithSettings("--4.4", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_collapseminussettings2(self):
r = libsbml.parseL3Formula("--x")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseCollapseMinus(True)
self.assert_( settings.getParseCollapseMinus() == True )
r = libsbml.parseL3FormulaWithSettings("--x", settings)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "x" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseCollapseMinus(False)
self.assert_( settings.getParseCollapseMinus() == False )
r = libsbml.parseL3FormulaWithSettings("--x", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_collapseminussettings3(self):
r = libsbml.parseL3Formula("x---4.4")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseCollapseMinus(True)
self.assert_( settings.getParseCollapseMinus() == True )
r = libsbml.parseL3FormulaWithSettings("x---4.4", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseCollapseMinus(False)
self.assert_( settings.getParseCollapseMinus() == False )
r = libsbml.parseL3FormulaWithSettings("x---4.4", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_collapseminussettings4(self):
r = libsbml.parseL3Formula("x---y")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "y" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseCollapseMinus(True)
self.assert_( settings.getParseCollapseMinus() == True )
r = libsbml.parseL3FormulaWithSettings("x---y", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "y" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseCollapseMinus(False)
self.assert_( settings.getParseCollapseMinus() == False )
r = libsbml.parseL3FormulaWithSettings("x---y", settings)
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_MINUS )
self.assert_( c.getNumChildren() == 1 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "y" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_collapseminussettings5(self):
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseCollapseMinus(True)
self.assert_( settings.getParseCollapseMinus() == True )
r = libsbml.parseL3FormulaWithSettings("---4", settings)
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == -4 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("---(3/8)", settings)
self.assert_( r.getType() == libsbml.AST_RATIONAL )
self.assert_( r.getNumerator() == -3 )
self.assert_( r.getDenominator() == 8 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("---(-3/8)", settings)
self.assert_( r.getType() == libsbml.AST_RATIONAL )
self.assert_( r.getNumerator() == 3 )
self.assert_( r.getDenominator() == 8 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("---4.4", settings)
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( r.getReal() == -4.4 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("---4e-3", settings)
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == -4 )
self.assert_( r.getExponent() == -3 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("---.4", settings)
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( r.getReal() == -.4 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants1(self):
r = libsbml.parseL3Formula("true")
self.assert_( r.getType() == libsbml.AST_CONSTANT_TRUE )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants10(self):
r = libsbml.parseL3Formula("notanumber")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( isnan(r.getReal()) == 1 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants11(self):
r = libsbml.parseL3Formula("nan")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( isnan(r.getReal()) == 1 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants12(self):
r = libsbml.parseL3Formula("NaN")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( isnan(r.getReal()) == 1 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants2(self):
r = libsbml.parseL3Formula("false")
self.assert_( r.getType() == libsbml.AST_CONSTANT_FALSE )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants3(self):
r = libsbml.parseL3Formula("pi")
self.assert_( r.getType() == libsbml.AST_CONSTANT_PI )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants4(self):
r = libsbml.parseL3Formula("exponentiale")
self.assert_( r.getType() == libsbml.AST_CONSTANT_E )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants5(self):
r = libsbml.parseL3Formula("avogadro")
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants6(self):
r = libsbml.parseL3Formula("time")
self.assert_( r.getType() == libsbml.AST_NAME_TIME )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants7(self):
r = libsbml.parseL3Formula("inf")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( util_isInf(r.getReal()) == True )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants8(self):
r = libsbml.parseL3Formula("infinity")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( util_isInf(r.getReal()) == True )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_constants9(self):
r = libsbml.parseL3Formula("INF")
self.assert_( r.getType() == libsbml.AST_REAL )
self.assert_( util_isInf(r.getReal()) == True )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_e1(self):
r = libsbml.parseL3Formula("2.001e+5")
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == 2.001 )
self.assert_( r.getExponent() == 5 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_e2(self):
r = libsbml.parseL3Formula(".001e+5")
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == .001 )
self.assert_( r.getExponent() == 5 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_e3(self):
r = libsbml.parseL3Formula(".001e-5")
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == .001 )
self.assert_( r.getExponent() == -5 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_e4(self):
r = libsbml.parseL3Formula("2.e-005")
self.assert_( r.getType() == libsbml.AST_REAL_E )
self.assert_( r.getMantissa() == 2 )
self.assert_( r.getExponent() == -5 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_e5(self):
r = libsbml.parseL3Formula(".e+5")
self.assert_( r == None )
self.assert_(( "Error when parsing input '.e+5' at position 1: syntax error, unexpected $undefined" == libsbml.getLastParseL3Error() ))
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_logic1(self):
r = libsbml.parseL3Formula("1 && 2 == 3")
self.assert_( r.getType() == libsbml.AST_LOGICAL_AND )
self.assert_(( "and" == r.getName() ))
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_RELATIONAL_EQ )
self.assert_(( "eq" == c.getName() ))
self.assert_( c.getNumChildren() == 2 )
c = c.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_logic2(self):
r = libsbml.parseL3Formula("(1 && 2) == 3")
self.assert_( r.getType() == libsbml.AST_RELATIONAL_EQ )
self.assert_(( "eq" == r.getName() ))
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_LOGICAL_AND )
self.assert_(( "and" == c.getName() ))
self.assert_( c.getNumChildren() == 2 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getLeftChild().getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent1(self):
model = libsbml.Model(3,1)
p = model.createParameter()
p.setId( "infinity")
r = libsbml.parseL3FormulaWithModel("infinity", model)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "infinity" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent2(self):
model = libsbml.Model(3,1)
p = model.createSpecies()
p.setId( "true")
r = libsbml.parseL3FormulaWithModel("true", model)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "true" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent3(self):
model = libsbml.Model(3,1)
p = model.createCompartment()
p.setId( "NaN")
r = libsbml.parseL3FormulaWithModel("NaN", model)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "NaN" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent4(self):
model = libsbml.Model(3,1)
p = model.createReaction()
p.setId( "pi")
r = libsbml.parseL3FormulaWithModel("pi", model)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "pi" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent5(self):
model = libsbml.Model(3,1)
p = model.createReaction()
sr = p.createProduct()
sr.setId( "avogadro")
r = libsbml.parseL3FormulaWithModel("avogadro", model)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "avogadro" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent6(self):
model = libsbml.Model(3,1)
p = model.createReaction()
sr = p.createProduct()
sr.setId( "AVOGADRO")
r = libsbml.parseL3FormulaWithModel("avogadro", model)
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_(( "avogadro" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modelPresent7(self):
model = libsbml.Model(3,1)
p = model.createFunctionDefinition()
p.setId( "sin")
r = libsbml.parseL3FormulaWithModel("sin(x, y)", model)
self.assert_( r.getType() == libsbml.AST_FUNCTION )
self.assert_(( "sin" == r.getName() ))
self.assert_( r.getNumChildren() == 2 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_modulo(self):
r = libsbml.parseL3Formula("x % y")
self.assert_(( "piecewise(x - y * ceil(x / y), xor(lt(x, 0), lt(y, 0)), x - y * floor(x / y))" == libsbml.formulaToString(r) ))
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_negInf(self):
r = libsbml.parseL3Formula("-inf")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getCharacter() == '-' )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( util_isInf(c.getReal()) == True )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_negZero(self):
r = libsbml.parseL3Formula("-0.0")
self.assert_( r.getType() == libsbml.AST_MINUS )
self.assert_( r.getCharacter() == '-' )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 0 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_oddMathML1(self):
r = libsbml.parseL3Formula("sqrt(3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_ROOT )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_oddMathML2(self):
r = libsbml.parseL3Formula("sqr(3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_POWER )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 2 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_oddMathML3(self):
r = libsbml.parseL3Formula("log10(3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_LOG )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 10 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_oddMathML4(self):
r = libsbml.parseL3Formula("log(4.4, 3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_LOG )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_oddMathML5(self):
r = libsbml.parseL3Formula("root(1.1, 3)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_ROOT )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 1.1 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_parselogsettings(self):
r = libsbml.parseL3Formula("log(4.4)")
self.assert_( r.getType() == libsbml.AST_FUNCTION_LOG )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 10 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.L3ParserSettings()
settings.setParseLog(libsbml.L3P_PARSE_LOG_AS_LN)
self.assert_( settings.getParseLog() == libsbml.L3P_PARSE_LOG_AS_LN )
r = libsbml.parseL3FormulaWithSettings("log(4.4)", settings)
self.assert_( r.getType() == libsbml.AST_FUNCTION_LN )
self.assert_( r.getNumChildren() == 1 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseLog(libsbml.L3P_PARSE_LOG_AS_LOG10)
self.assert_( settings.getParseLog() == libsbml.L3P_PARSE_LOG_AS_LOG10 )
r = libsbml.parseL3FormulaWithSettings("log(4.4)", settings)
self.assert_( r.getType() == libsbml.AST_FUNCTION_LOG )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 10 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseLog(libsbml.L3P_PARSE_LOG_AS_ERROR)
self.assert_( settings.getParseLog() == libsbml.L3P_PARSE_LOG_AS_ERROR )
r = libsbml.parseL3FormulaWithSettings("log(4.4)", settings)
self.assert_( r == None )
self.assert_(( "Error when parsing input 'log(4.4)' at position 8: Writing a function as 'log(x)' was legal in the L1 parser, but translated as the natural log, not the base-10 log. This construct is disallowed entirely as being ambiguous, and you are encouraged instead to use 'ln(x)', 'log10(x)', or 'log(base, x)'." == libsbml.getLastParseL3Error() ))
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_precedence(self):
root = libsbml.parseL3Formula("a && b == !(c - d * e^-f) ")
self.assert_( root.getType() == libsbml.AST_LOGICAL_AND )
self.assert_(( "and" == root.getName() ))
self.assert_( root.getNumChildren() == 2 )
left = root.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "a" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
right = root.getRightChild()
self.assert_( right.getType() == libsbml.AST_RELATIONAL_EQ )
self.assert_(( "eq" == right.getName() ))
self.assert_( right.getNumChildren() == 2 )
left = right.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "b" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
right = right.getRightChild()
self.assert_( right.getType() == libsbml.AST_LOGICAL_NOT )
self.assert_(( "not" == right.getName() ))
self.assert_( right.getNumChildren() == 1 )
right = right.getLeftChild()
self.assert_( right.getType() == libsbml.AST_MINUS )
self.assert_( right.getCharacter() == '-' )
self.assert_( right.getNumChildren() == 2 )
left = right.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "c" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
right = right.getRightChild()
self.assert_( right.getType() == libsbml.AST_TIMES )
self.assert_( right.getCharacter() == '*' )
self.assert_( right.getNumChildren() == 2 )
left = right.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "d" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
right = right.getRightChild()
self.assert_( right.getType() == libsbml.AST_POWER )
self.assert_( right.getCharacter() == '^' )
self.assert_( right.getNumChildren() == 2 )
left = right.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "e" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
right = right.getRightChild()
self.assert_( right.getType() == libsbml.AST_MINUS )
self.assert_( right.getCharacter() == '-' )
self.assert_( right.getNumChildren() == 1 )
left = right.getLeftChild()
self.assert_( left.getType() == libsbml.AST_NAME )
self.assert_(( "f" == left.getName() ))
self.assert_( left.getNumChildren() == 0 )
_dummyList = [ root ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational1(self):
r = libsbml.parseL3Formula("(3/4)")
self.assert_( r.getType() == libsbml.AST_RATIONAL )
self.assert_( r.getNumerator() == 3 )
self.assert_( r.getDenominator() == 4 )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational2(self):
r = libsbml.parseL3Formula("(3/4) mL")
self.assert_( r.getType() == libsbml.AST_RATIONAL )
self.assert_( r.getNumerator() == 3 )
self.assert_( r.getDenominator() == 4 )
self.assert_(( "mL" == r.getUnits() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational3(self):
r = libsbml.parseL3Formula("3/4")
self.assert_( r.getType() == libsbml.AST_DIVIDE )
self.assert_( r.getCharacter() == '/' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational4(self):
r = libsbml.parseL3Formula("(3/x)")
self.assert_( r.getType() == libsbml.AST_DIVIDE )
self.assert_( r.getCharacter() == '/' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_NAME )
self.assert_(( "x" == c.getName() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational5(self):
r = libsbml.parseL3Formula("(3/4.4)")
self.assert_( r.getType() == libsbml.AST_DIVIDE )
self.assert_( r.getCharacter() == '/' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_REAL )
self.assert_( c.getReal() == 4.4 )
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational6(self):
r = libsbml.parseL3Formula("3/4 ml")
self.assert_( r.getType() == libsbml.AST_DIVIDE )
self.assert_( r.getCharacter() == '/' )
self.assert_( r.getNumChildren() == 2 )
c = r.getLeftChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 3 )
self.assert_( c.getNumChildren() == 0 )
c = r.getRightChild()
self.assert_( c.getType() == libsbml.AST_INTEGER )
self.assert_( c.getInteger() == 4 )
self.assert_(( "ml" == c.getUnits() ))
self.assert_( c.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_rational7(self):
r = libsbml.parseL3Formula("(3/4.4) ml")
self.assert_( r == None )
self.assert_(( "Error when parsing input '(3/4.4) ml' at position 10: syntax error, unexpected element name" == libsbml.getLastParseL3Error() ))
pass
def test_SBML_C_parseL3Formula_targetl2settings(self):
r = libsbml.parseL3Formula("4 mL")
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == 4 )
self.assert_(( "mL" == r.getUnits() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3Formula("avogadro")
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseUnits(False)
settings.setParseAvogadroCsymbol(False)
self.assert_( settings.getParseUnits() == False )
self.assert_( settings.getParseAvogadroCsymbol() == False )
r = libsbml.parseL3FormulaWithSettings("4 mL", settings)
self.assert_( r == None )
self.assert_(( "Error when parsing input '4 mL' at position 4: The ability to associate units with numbers has been disabled." == libsbml.getLastParseL3Error() ))
r = libsbml.parseL3FormulaWithSettings("avogadro", settings)
self.assert_( r.getType() == libsbml.AST_NAME )
self.assert_(( "avogadro" == r.getName() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings.setParseUnits(True)
settings.setParseAvogadroCsymbol(True)
self.assert_( settings.getParseUnits() == True )
self.assert_( settings.getParseAvogadroCsymbol() == True )
r = libsbml.parseL3FormulaWithSettings("4 mL", settings)
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == 4 )
self.assert_(( "mL" == r.getUnits() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
r = libsbml.parseL3FormulaWithSettings("avogadro", settings)
self.assert_( r.getType() == libsbml.AST_NAME_AVOGADRO )
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def test_SBML_C_parseL3Formula_unitssettings(self):
r = libsbml.parseL3Formula("4 mL")
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == 4 )
self.assert_(( "mL" == r.getUnits() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
settings = libsbml.getDefaultL3ParserSettings()
settings.setParseUnits(False)
self.assert_( settings.getParseUnits() == False )
r = libsbml.parseL3FormulaWithSettings("4 mL", settings)
self.assert_( r == None )
self.assert_(( "Error when parsing input '4 mL' at position 4: The ability to associate units with numbers has been disabled." == libsbml.getLastParseL3Error() ))
settings.setParseUnits(True)
self.assert_( settings.getParseUnits() == True )
r = libsbml.parseL3FormulaWithSettings("4 mL", settings)
self.assert_( r.getType() == libsbml.AST_INTEGER )
self.assert_( r.getInteger() == 4 )
self.assert_(( "mL" == r.getUnits() ))
self.assert_( r.getNumChildren() == 0 )
_dummyList = [ r ]; _dummyList[:] = []; del _dummyList
_dummyList = [ settings ]; _dummyList[:] = []; del _dummyList
pass
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestL3FormulaParserC))
return suite
if __name__ == "__main__":
if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
sys.exit(0)
else:
sys.exit(1)
| 42.240625 | 361 | 0.640194 | 6,283 | 54,068 | 5.274232 | 0.055547 | 0.189812 | 0.092281 | 0.055948 | 0.887772 | 0.873227 | 0.859557 | 0.834027 | 0.809584 | 0.793681 | 0 | 0.019008 | 0.194348 | 54,068 | 1,279 | 362 | 42.273651 | 0.741736 | 0.024525 | 0 | 0.764807 | 0 | 0.011159 | 0.051128 | 0 | 0 | 0 | 0 | 0 | 0.539914 | 1 | 0.065236 | false | 0.060944 | 0.003433 | 0.000858 | 0.074678 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 9 |
4d2dbdd6c9fff278cfa26b1350d33bcbc0cd151b | 280 | bzl | Python | tools/bzl/plugin.bzl | michalgagat/plugins_oauth | 47cc344013bd43a4ac508c578f2d93f37a166ee6 | [
"Apache-2.0",
"MIT"
] | 143 | 2015-03-09T21:18:39.000Z | 2022-03-02T13:27:12.000Z | tools/bzl/plugin.bzl | michalgagat/plugins_oauth | 47cc344013bd43a4ac508c578f2d93f37a166ee6 | [
"Apache-2.0",
"MIT"
] | 162 | 2015-03-15T04:00:41.000Z | 2022-02-24T07:29:17.000Z | tools/bzl/plugin.bzl | michalgagat/plugins_oauth | 47cc344013bd43a4ac508c578f2d93f37a166ee6 | [
"Apache-2.0",
"MIT"
] | 97 | 2015-02-27T18:35:20.000Z | 2022-01-08T13:17:21.000Z | load(
"@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
_gerrit_plugin = "gerrit_plugin",
_plugin_deps = "PLUGIN_DEPS",
_plugin_test_deps = "PLUGIN_TEST_DEPS",
)
gerrit_plugin = _gerrit_plugin
PLUGIN_DEPS = _plugin_deps
PLUGIN_TEST_DEPS = _plugin_test_deps
| 25.454545 | 59 | 0.775 | 36 | 280 | 5.305556 | 0.25 | 0.314136 | 0.335079 | 0.376963 | 0.753927 | 0.753927 | 0.753927 | 0.753927 | 0.753927 | 0.753927 | 0 | 0 | 0.135714 | 280 | 10 | 60 | 28 | 0.789256 | 0 | 0 | 0 | 0 | 0 | 0.328571 | 0.185714 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
4d46d6391e9f6a3314bc9a7ea20882b5d4e5e641 | 2,705 | py | Python | GDLC/tests/test_strip_anchor.py | ptoche/Gran-Diccionari-de-la-llengua-catalana-Kindle-Edition- | a31412d2a6f05a6c1a9bd9854cdd6fee8abd65f4 | [
"BSD-3-Clause"
] | 1 | 2022-02-01T16:08:03.000Z | 2022-02-01T16:08:03.000Z | GDLC/tests/test_strip_anchor.py | ptoche/Gran-Diccionari-de-la-llengua-catalana-Kindle-Edition- | a31412d2a6f05a6c1a9bd9854cdd6fee8abd65f4 | [
"BSD-3-Clause"
] | null | null | null | GDLC/tests/test_strip_anchor.py | ptoche/Gran-Diccionari-de-la-llengua-catalana-Kindle-Edition- | a31412d2a6f05a6c1a9bd9854cdd6fee8abd65f4 | [
"BSD-3-Clause"
] | null | null | null | """
Strip anchor id and href while keeping content.
>>> from GDLC.GDLC import *
>>> dml = '''\
... <body>
... <div>
... <blockquote align="left" id="id0001"><span>Definition here.</span></blockquote>
... <blockquote align="left"><span>More details here.</span></blockquote>
... <blockquote align="left"><span>More details and an <a class="calibre17" href="part1234.xhtml#id1234">anchor</a>.</span></blockquote>
... </div>
... <div>
... <blockquote align="left" id="id1234"><span>Definition here.</span></blockquote>
... <blockquote align="left"><span>More details here.</span></blockquote>
... <blockquote align="left"><span>More details and an <a class="calibre17" href="part0001.xhtml#id0001">anchor</a>.</span></blockquote>
... </div>
... </body>'''
Strip the anchor in id:
>>> soup = BeautifulSoup(dml, features='lxml')
>>> print(strip_anchor_from_id(soup.body))
<body>
<div>
<blockquote align="left"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an <a class="calibre17" href="part1234.xhtml#id1234">anchor</a>.</span></blockquote>
</div>
<div>
<blockquote align="left"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an <a class="calibre17" href="part0001.xhtml#id0001">anchor</a>.</span></blockquote>
</div>
</body>
Strip the anchor in href:
>>> soup = BeautifulSoup(dml, features='lxml')
>>> print(strip_anchor_from_href(soup.body))
<body>
<div>
<blockquote align="left" id="id0001"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an anchor.</span></blockquote>
</div>
<div>
<blockquote align="left" id="id1234"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an anchor.</span></blockquote>
</div>
</body>
Strip the anchor in both id and href:
>>> soup = BeautifulSoup(dml, features='lxml')
>>> print(strip_anchor(soup.body))
<body>
<div>
<blockquote align="left"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an anchor.</span></blockquote>
</div>
<div>
<blockquote align="left"><span>Definition here.</span></blockquote>
<blockquote align="left"><span>More details here.</span></blockquote>
<blockquote align="left"><span>More details and an anchor.</span></blockquote>
</div>
</body>
"""
| 39.779412 | 140 | 0.695009 | 353 | 2,705 | 5.305949 | 0.110482 | 0.192205 | 0.24346 | 0.245595 | 0.958889 | 0.958889 | 0.958889 | 0.954618 | 0.946076 | 0.860651 | 0 | 0.022801 | 0.092052 | 2,705 | 67 | 141 | 40.373134 | 0.739821 | 0.995194 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
4d7bc35d0dbe00622b284388c7a9c0695588daf8 | 16,825 | py | Python | src/moving_floating_off.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | 3 | 2021-01-08T05:42:50.000Z | 2021-07-09T14:15:57.000Z | src/moving_floating_off.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | null | null | null | src/moving_floating_off.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | null | null | null | moving_floating_off = b'iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAgAElEQVR4XuV9CXQU15nuraW7q/d9U7f2XUhCIEAIMIjFgBDGAg84mTiOk4njeLy8xInt+M07z2TeOzOZJI6TmcTO4Emel9hOwICDbQyYRYhVgFgkIwntS6v3rXqpru6qrnrnttUsNksLBMaZPsenMVRX3Xu/+/37fwsBU/hpR9EXAQAbp/CWX7VbbazluJ/eyqCRW/nx53879YDA4fFTOcSbvFfG47irAZlypnAAIDyKo6LCQj2Tn13lDJFaEAyOa+j4iDAYCqChEMVzXPLiqqPopQ3HcTz8PXpTCF8LkIt/n57r3Q3Ijemb8c4DPM8jixcvFj322GMzFXLRw2EyuCIWjainVdaQxaXTLjDJ5A6BQPCBSqUaQxCEg9cD8FMEgBchxZD29nbi6NGj0p6entgrr7xCAQC4m6TLFT/7nFT4qgOS6ZIggOc5xOFwilmWWRaNhH/kcY3XiYRCgcWayycYxne+q3OHfdTx6rvvvdfR0tICWcJv3LgRffzxx/U2m22Rz2Ovi0T8Tg7Ed/7rv/5nb3t7O5Pp06933d8YIJkzBC4Kz/P44OBgPscyDxEi4ptCkTAHQQDS1Xkm8sFft318vvvEb3bt6zwJAEg+//zzih//+KmZ4XBsWduR1oWdZ08JUBx9q35h7taTJ59zb9z4N8WQqy/kVO+Wy3YmsnHjRqSiogJRKpVEWVnBEoTDngEIqMdxgaD3Qle45cDuj0bGe/794YefbZ85c6bC7XAsHR668DX7+GhtX0+XyO/37JMKRa+yYsPpl19+mf7MWpjchrgaU6Z6zrfTyrplefqZHgAAQZD04iHhcFhnt400D/f3/iOTZCuzrDlokk2GTxw/tudg69HfrmloODtz7tya9vNnHz994sgyv9elEIiE4xKZcpNcq397+vS59g0bNlxS/LcIyn8HQFJsePHFF/nPgACoTqeTNjcutS5qWFSck5NfPTY2tKSvt2umkBAr6uoXAhwXMCfbjo0q1bqP6mrn7fP4PeWHD37y0FB/V2mSjfMKlboTF0le0phUOzdu/I/wrdvSl5h1fUAmz8ApZAgC2lHkcsdw0gzhebhdecgIoFarFYtmlxTNnrewqqCwtEyt0+cLMdwaCHjNttFBQ5gkxZA7ZmsOIiIIPhIKM2KJshfgghaGjok6z51e0tt9LlcqFdNGo2m/SCX/9bZt+48NDw9DcTVln79ZhkDxBIHQ6XSyR9bdVzHnngULAYbWcVyyLMkyWTQVJRgmIQyRJOr3+xA6RgEEIECmUAKD0Qyyc/N5oZAI2W22PiaRiHZ2nis6efKESadTh4xG/bYECl49e3aos6urK3EJjcnv4Bs4w5PehJ+/XwYMyXzQN7NbJoCAoknwzW+uty6cU79Ea9SvxHFsFk3RepIMRoN+71goFPBhKJKUyZVaKkYXdHd1qQHgsaqq6bzZYkUMRhOIUbFkx7nTETLoj7ucDunQwLBEZ9AGNTrtdibCvtox/GhHV9eGywC5daLczJyv99QMAMl80JMcHMJDGYUgyBNPPKFetuyeWqVMuZJlEw1MIpEXCpH+cIjs8LgcZzwud7dQhPsMWeZkbnZBtkBErOrrG7zXMT6qs1gswGgyIgQhTgVZhoeG+YHe85zX7UAikSiKYsKoOStrr1mv/fWfP2w51t/fH898Rje+cpJzvuEN7yAgX2RaRUWF8H//5CeF2TnmZRKpvJFhEjNCoRBgEvGzHo97bygWOGrvGxzss/dH7zFVMUWNjUAsFsut1qzGWCTy1LkzJ2fQNIXrdHpeIBQiKrUGhEJhsH/3h6C3u4OXyuVApdYnCLH4BE6gP3938yf7bDZb7Iarct0LrpzHXQzIpJQ62tzcrNiwYc3MyrKqZoFAsNTjdeeSZCCMovgnYpniL06n51RLS4t/06ZNEx71Zwvx1FNPiV544YXF4VDgub4L5+cnWUaIoThPx2gkKzsbJJgk2PruW+DMqSO8RqNBSsqrkoRYet5pt/+ipe3Ajv5+/xRYWZcQu4sBASDDweHr1682PtC85p6S8hnrRULRAqfDrnY5xkMIiuzR6E3/1d8/dKKlpSVWX1+vHL7QoXWM98VtvkDk2LGuyPr167Ef/eAHywf7up6PRCOzVWoVnmRZPkZRSEl5JUAxHGz581vgyIE9gON4vqqmFuQXFox5XZ7fnz3b86fWkycd0JO/ddP3M1A+mzOycSJmeSeUeuYEzwAQpKCgQPHcD757b0XlzO8bzda6MduobHhwiFYq5G16g+Z3badadz3//M8jtbW14qcefbR+YOj8qpGBHkYilbhEUqWdoZFAAnAVWqX0GwqZdHqWxYpr9UYARVZWdh6IhCPg3bf+CA7u3wNQBOPr6ueD0rIih8/tfq3vdMcb01DJ2MaJWFfmM7v2lRnMeVKPuc06hP/pZdFu+CzBD773UOWK1fc/LlfrHhwdGZEN9V9gVGr1QEVF1ZueQPtbXV3/y/HiRsCvWF4teeKxF5b2nO948nzn6WIUwxCd3kR63F73+LgjabGYCioqKrLzCotFGp0BQVO+ixY4HE6w+S/vAvv4KFAplMBs0nMqtXJ4ZNT2Tm93zwcOMtE7PDwcmny0986Ei24zIFdkz/Dmxnm5C+Yv/vqMugXfDgTI/O3vbUnS0aCnft6cbZpc8yvHWz/t27RpEwvFSUNDA/7jHz+Z09/TtbK7s6M5FCbnyRUKaZJhEnbbOJ1MJrHK6hmimto5WDxOI6FwGFit2SAYCILT7aeAVqcGKOD4wb6eZCxGO7zeUKs3GNrDCxKtPT3OcQDA30K09/o+yXXoi8yZU6ZZsWjp/aUVlf8olStrPu38FDndfoIBHPupwaT+d3/4wp+3bOliGhoasNde+5mE4wi5XJ+D9fX0KL1j/es/7Tj3nf7eLjOGAiTJsojT4QQAFYCS8mlAIiZAMEgCgUgMEnQExCJhoNFqQSQc5AcHevkYFQ9yvOAThk/+KcYFjvf2hgMTemRS4uRvKbgobJg/p7ppdeP/KC4qWd/X2yc8e7qNl4hFdMDva1WozC89+K1/ODZ9+nQDFQplc3wiT0CICigqxiXoBGUwmup7zncs2rljm9zrcWJSqQSNRsLI0NAo4BEM5ORYAcswIBAMARwFgGVoQNM0+EzZR3mOB8MKlXpTtkLz7tjeI/aWKVfq6ToCZGMtl7xrc+ppiwNRKoFqTnXNA/MXNPzAkp07rePMKW5ooJcXS6VBh8O5Y+aM+v967sUXRTgmWOGyj9WGwyGzXKlS9fd28+FgKJGdl69mWVbS/elZJBIJ4wKBAA0FfaC3txcMj4wBhVIBskwmgAsEgOc44PN6gMvp4tkkk8RxQUgsFrWYjcZXnv6fQ0fnzbNNhN5vmRyXWVkXCzu+TCvri+KrHcVehIm6iammB4dNL9AVFpWXP1VUXP4tjuPk/X1dXDQUYty+YJdWbXzjf/2ffx4oLaveEA4Flo0MDxhdDhvKcTzo+vQcCPi8QERIAIZjHGRBVnY2otMZEI/LAQb7e0Fv3wCIMxyoqq4GWSYj8Pv8wOPxAp/PzYeCIVoiJ4Y0es1HuBh7y+Np7W5pAVBHTdnnK2ZlpZQ6sai2tD6/sPA5a07uyoDfxw8O9oFINBa02Rzblixe+uYvfvNqXZAMPDc+NqwbGxkCLsc47/O6QcDvB9FoFFBUFNCxGAJrFrQ6Pciy5gCRiAA+rwsM9A8AtzcEplVPB5WV5SDg8wGH3Q6cThvw+32UWCzuF0vkx3AcbC02lR7/+R//GJkqH+SSH3JXMOSLm+wqu+WfAQDyJfUVKwoKCn8skcrn+LwezufzcV5/eEAqVf7nz3/2y1MSjfJJKhJ6IOD3osMDfcDltCMsywBcIIR5WxAM+EE0EgYMmwCRUAAIBGIY3QVCoRCMDA+CgYFhUFBaCZYtXwFQngVDg33g/KcdwGG3sRKCIBGEdwEU+UTAIW/0e5nzXV1d0MKakvqirxpDICCK+pripoqKsmcEQqLWNjqa9LqdcTKcOJpbVPqHf3/1v5QO2+BzjvHhvEgkgowODyJO+3gKCFwgSllLhJgAVDQCYMjd43YAMhAAaq0OqNRaECKDoL9/ABBSDaifvwAoFQQgfV5wobcXjI2OAI1aATAM5eh4/IJQKHkJV1je3759O7SyICC3DMrUAHJJ/N9uPyQFSG1ZblNJeckzKpWm1u/3JMdGRqJkILKzevr0P/7flzdVOW0Dz3eePakfHOgFfq8XYZg4gAyhY3Gg1RtAUUlp6v8j4TDwe93AYR9LiSyFSgMtKTAyPAxcniAwZWWBvBwzEImEwG53A4/HzatVMiARi0GUigR5gLyDi7SbuvpHLvT390NdAkuBbgmUuzhjeNVYVkpkzZuWtyq/tPQZlVozm4qGOdvYeNgXCO2omV6+6akfvlAeCAR+MtDXnXe+8ywUV6gSmmVqDfB5vSm5mF9YDAixGJDBYIohTrsNSKSy1DXJJAuGB4fAmMPN5ebms+XlJSAei7Iup4dLJOJYgqY4oVCAoijKMUn2DC6UvDkyFmjrGRz0UBRFAgBg9PemQZkahlyZMrsJiyPjMAIERFY/vXBZYVHRj7U6w7xQMJjs6+ulotHonuKi4tcWLVtm5hHkWT6ZLCWDAXR0aACh6RjQavUgGg2ngCgqqQA4jgOPxwmcdicYGRoEcrkMaHU6wDAJMDo6zPvIWKCqptZRkGONjgwPeMORSFSAY5rxsfE44DmRzqDNE0tkAoBgfUOj7u5AOHxYpxO12WwRR39/P0xa3RQodxCQzDOFaUSvMTjxrEprnV5n/pHBlLWKTybBUH9PPBQOn5GrNL+fWTvHXlRY+KTRbGpCMRwf6LuA9JzvBCiKAqFQkLKorDn5IOj3Amh52cZsYKh/AGh0aqDV60AkFIRWFeclwxeycoo+zLZYup0OV4BmYgkME+hIkuIQwEkNOmWF3mAsjidYtZ+MsgqlpsNkMZ3gEb4j35o/8sMf/jCEIMikTeI7CMjkiXONwWFWvaLAajU/mZ+X/4hIJJTbR4eTXr9/nEpwb1TV1mz/xoN/3yQWi59iGEZPRaOIbXQYiVExIJGIYRQXQMa43U4QDATA6NAQiEZCwJqdA2QKBfB5XGB8zJZ0+8gTwVjyP3hUdFQoFOIoihIYhgnkcrlYKBRLCEKgkBCEAUF4DSGRqcxmsz4/P0+p02mdhYUFx8rLS9qs1gJYhgozihmz5eYASW/2L276263UoR+CFBXJdCqR7iGVUvEEIZbkUdEIEgj4YqFQ/LBar33jvvtWsUKB6FtyhXyJwWAmYlQUicViABfgwO10pkRXmCTBwOAAcDocQCGXAHOWBWAYxgf8XmB3uKO+ALUXI2SvYUJxT5RlBXgyiWEYBr16QiQSEUJUSOACXIyLcFkyyStUKlVWeXlpudFoNJeWFoVNBuPhJM/uOnbsVPezzz4La38zAuXmAPn8Zr9zVlYKkDVr5sui/sgiJhZ7mOPAQoEQ0/M8x0VjjD8cpY/otOq9tbNq89Qq9SNJhtXiAgHCsgkERTGQYBKpHMfYyDCwjQ4DgVCQ0h0YigAqQvIRiuKCofhwMMa9K5Wrt2EYFoxEIgIcxzGRSCTEcVwEAdHr9YrS0iKzTCZXxuOMyOfzAbfbjaIoZqisLCuxWq2ERCw5JZbI3mtoaDhnNptjE3Vh1xUVXzUrKxVog6F0hiENclxQJ8LBwyJCuAJBESIcoXm32xcSiYnuRQ1LQwjH1h47ckgLAI7IFXLAcRyIMwwIkkEQCQaBTCoCRpMeCEVCEA2F+EDAzwciVJSi+cO4SP4GKiDOwMp3juNS7JBIJCIoulQqlWTBggXFK5Yvu8doMmUzTBIZHR0d37Jly6dnzpxjcBw1Go3GXKs1SyNTKA7IJLK/rF69emDWrFk3DNFPDUNu2cq6+qa5XvgdMmVFRb0KaKPrcBR7GkGRciaRRMNRCmF5njMYsjiMT2LjtiE0HKIAkmrtwACPYQDHUaBWyIBCLgNJjk05iHE6xocisUQ0zl7AxdL3RGL5Ho7DAvF4HBaycDAAKZFICARBxDqdWv7AA+vmNq1q2mA0GovjcSY2NDzSvW3btv179+51UhSlBgDRS6WSHLVazcpksm05OTm7RSJRYOPGjddtW5g8IGktcXWJeJt1yJUZw0bQKIzN6i3mUeTrAhTfQBCSXB4BeJJHAB1jkKDPA6QSASwNBRwPAEEQsDgxZdqKCQJgOJ7yTYKBIJ9gk3EW4KM4Id0lkct2cZzATlEUz/N8gqZpGoobsVgsFIvFEqlUKrn//tXT1q//u29YsixV4+P2/kOth48dO3q0t6evLxqLxZQYhhlRFDVIpdIcqVTarVar//Tss892VlZWXqOO6zO5P3lArm8s3WZAvtBvh2RlAbFRo6yQ4IoHVUpNs1gmzyXEUhyGzWHSSYDjgGU5xOcPAIVcDDAU5WE2UICjECgkEqF4XyBE0wl+UKpW7dfqjQcRBHdEIhGYRUxyHMfGYjEymUzGWZYVQJagKCqsr6/XPfzwQ+tKS4vnt59sP/L2u3854nQ6KZZlhQAAJcdxRqFQqBMKhblSqVQkFAq3C4XCD7dseS+QiuNc43N1QCbvMqRvf6cBgc9NgaImtNNUCul6tVp9v1qty0cwIUbRcV6I4SAQCCIDQ8OIWiEFGrUKmr0cyyZAIs4AOsGyNAPsLILvUWr0BzQaTYSmaSin3Gq1WiiRSJR+v981OjrqCIfDIB6PC6EZnJeXJ7zvvvtmVVWVLzx3prNr565dHcFgEIojIYqiCgzDDBiGmYRCoVGpVOYTBHEaQZh3tm//qA+Aa4fsv+oMubgRsrKyxJUF4nIECNcmWf4+QiLNkitVccDxWDQcJnz+gEAoFPICXMDE4zRUKpxcKQdCIeFheb4zSiVOYgKZS6JSoTzP+nMsOaC6unqWQqHI9Xg8J48ePbqvq6uLdDgcQph/hw+ura01zJlTW+v3+yPHj5/s9/v9LIIgQhTFZAQhggwx4ziuVygUxQqFIiQSYX+JROgjH3zwwTXDK38rgKSYUlubJS6SZxUgClUzw/GLIlQsEg2TNAY4Ic8xGJNgE1SMDXEcEtJbLET5tGkyXCDsGR4cah93OeMSiUIhk8liFoslOnfu3PnV1dXrFQqFzu127zl8+PAfdu/e3dfT0yOAogvqF4PBICouLrbAeuLh4WF/LBZjk8mkQCAQSMRisZ4gCDNkiFgszlMqlVKJRPIhz/M7t2zZAqtUriq2MgMkcxE2CZF145tmNrgrhDG6prRUmn/v4nkUlVjjcLlibo+zn4nEvElAB5IsE+JphEIVCqy8pCQvOy9P5/OR/e3tbUPBYJAwGAwmgiDYuro65f3337+hrKysCfoeY2Njew8dOvTKu+++e3ZwcBCjaVo88VQe6hSBQIBFo9FUmITneRT6KQKBQC2VSs0ikcgkEomypVKpRSqVtqpUqu2vv/66+1plQzcx54mhXH09JwHIjUMpmQ/u4mCQrKxa8dq1C+bTdGSN0+kMOZ3OXpKMjgSDIQeKssF4nEiYTCpVfn6WBVpOY2NjoyMjIzGpVCrTaDRqjUYjbGxsrGpubv5WXl7ebBiPstvtxw4dOvTq5s2bD3V0dHAURUkhK1AUTXdOQWcFJQgi9Z1MJkWwZlgmkxkgS3Acz1KpVKUKhaJTp9NtDgQCw1u2bLms6+rSWmQ+5xuvX0psZHZZZlfdzODmz39OXlvLLAmHg6scDofD7Xb3BwKBkXA47ILWEoqirMVikUskEgVN09TY2FgAKmu1Wi1VKpWSoqIi1de//vWVS5cu/XpWVlYhBC0QCPQdP378j9u2bXvv8OHDUZ/Pl2IIBAT+OwRnol0u9Q29eYFAICMIQiuRSEw4jpt0Ol21XC4fk8vlfyEIovtSjfGVa3Ezc77ean7ZgCCvvPKKyu/3rHK5vCv6+vp6HQ5HH0mSI4FAwJ1MJsORSIQxmUwwFCJkWRb6GAzLJgU4jkllMplg5syZ5m9/+9t/V1dXt1av1xuTyWQiEAiMdnR0bN2xY8ef9+/f74/H4/JEIgGZQsO8CNQnEonk4twZhoHhFQi6WiQSGaAe0Rl0MxQyhV8oFG6JRCLnPv7446u2MUwekOuL/i8dkLa245ozp9qbR2y25WfOnDlrt9t74YKGw2EISCQcDsOFgONMzwSVSqWETCaTwN0+e/Zs6SOPPNJUW1v7DaVSqQ+Hw4MjIyO9PT09Z/fv399y+vRpL8MwWoIgsEAgEGBZNk5RFGxrQOA39Oqh3oGJNIIgVBKJRI/juNFisdQqlUpKJBJtdTgcsBL/qq1wkwdkyhzD26LUkVOnTmk7OzvXDg4OLjt+/Hj7+Pj4hUAgMEbTtBcCEgqFoKecrlaHg4AhdSFBELhUKgXz5s2TNzU1LS4rK2vEMCze19fXeubMmQtDQ0PU4OCgd2hoKCSTyZQEQUh8Ph8ZiUSoCbGFQp0OASEIQgABEYlEamhtcRynKygomGUymYFUKtnm9/uPbtmy5ap9JV8iIDfWIzcxOLS1tVU7Nja6dnBw6N62traTIyMjF3w+3ygEhGXZ6GWAQCfuswAXAJhKpUILCwsVzc3NsxYsWHAvhmHinp6e1oMHD57s6enx+v1+LhaLQfGUFAqFIolEIobiLx6PJyAIcDaQGRKJhKdpmkMQRCIUCvUQkHg8rqqsrp5dVFgolUml2xNqdcsvn302erUVuIk5X3chMxRZN2YHfMpNDA7dvHmzFkGQ9Xa7venUqVOnent7Ox0Ox1A4HPZMMARGXCFD0gUJsE0ah4tcXV2d//DDD62trZ29PBqNuD/6aOdf9+/ff9blckFMQzSNMZAN0DHkOA6yIGXpQkCggi8rK9NZrVY9wzDB7u5uOhqNpkRWJBJRL1iwYF5VVZVEq9W+pywpaX14xYrPAfKlxbIyA+MmAUF++csfafPy6r4Wo+gHey5c6GhvP3FycHCky+12p3VIWmRBQFIsUavVIrVarayvn139ta99ff2M6TUL44kEdfLUyaOtra3HOzu7esbGxsZ9Pl8YKnFo2kJ/I21VQkD0ej2zYMGC3CUNS5azHBt+//33Ozo7O+MYhqmj0ajh3nvvvbd6ejWm0+reKisrOzJv3rz/FiILaWioUX7/+89ukIgl33W5PCMtBw9CRdwO41E8z1OJRCIeDAahE5dmCapQKMQwgXHvvUvr1q29v7mivGIWPOphYGCg/+Spk8fa2k4cP3Om44LD4fBBsxmCMQFI6kQIBAFcVlZW4oEHHii+r+m+Jymaot98882P9uzZ47JYLNDKKp89e3ZTYWE+KZXKXy0vLz9UX1+fiiB/Xt5kJhUy39QZiqwb64+bZAjQ6/Wy3/72t/ep1aonSTIU3bt37562trZjdrvdyXFcChAcx1kYd5pgCCqTyaRlZYXWxYuXLVizetV9xcUlVQiCYE6n09HR0XnmyLG21vb29tPDw8NOaCZDZqQBmVhUPjs7O/7oo49WLVmy5JlgMOD9/e//c9vOnTsDa9eurbZmW1fo9fp7DBptOyGVvlRTU3M8Ly8PBjBvEpDM1m8SjmFmCGe2Wy4NDjplL7/8MlFeXr5YqZQ9TZIR+a5dH3905MjRoyMjI+NpQKCImVDuEJQUINOmleQsW3LvosaVK5oKi4umQUcl4Av4unu6Pz1y9Fjr4aPH23p6esYSiQQ0V68ARKlUcjNnzmRWrVo1Z+7cuY9DZ/RXv/rVh62trbFnnnlmSe2s2gc1KlW1TC7boZIp/q2gpOQcbPC5iwDJDOGbAQQaO/v27Z6t1RqeDofDBR988OFfd+/efdjr9dppmo6mrSKBQAAdvlRKVS6XS0pLC7IhQxpXLF9VVlY6nSAIEUmGyL6+wZ7jx460thw6crSnp2c4HA7DgoVUzCqt0LVabbK8vJxbsWJFfXFx8XKn09n1+9//vv3ChQuCZ599duXqpqYHs7JMpTzgtrIs8zOLJe88DMFfG5CvbtPn55FFdu7cKbTbRyqmTav+RxgA3rlr90fbt25tJUmPI5EAUZhoouk4i2EoQ5JkqkhaLpcTBQUFpnnz5s5ZuXLFqhkzps+RS+WKSCQSGRwc6jvW1nbowIGDh86dO9cfiUTS1lGK5pBtUARarVa0tra2Uq1W62w221BbW1soHo8bHn/88ZUbNmz4O7PZVBQkyXfO953/xakjp/o2btx41c7dyW7CG2xt5EvXIbDNGcOw7O985zsP4zi29MMPP9q/a9eutmg0CmNZoWQySUM9As1UkiRTEVqLxSKUyWS6urpZNU1NTavmzJ59j0ql0sZiFDU6MjJ0su3kkf2thw+ePHmyJxAIhC/b2Ty8TygUSlqtVsxsNpt5nmdHRkZghhFXKpVZq1atWvTNb35zQ3Z2Tp7fH3jt8OHW3z3++OOwlfqqufUpBuTLDy5C+V5VVaX69a9/3RwMBpr++tcdJ8+dO3c+FAq5I5FIIK1HJgBJ+SLQU9fr9Zq6ullVa9asWVVXV9egVasN8ThN28bto+2nTh/bd6Cl5dSpU112uz2QjvJCdkzoo6RKpYKHoYlpmk5Go1Ee+jUEQejnzp1b+9hjjz1UWFiYHYlQv7PZRv/f6tWrg7eWD7mhyL9IjC+dIXCoRqNR+odNm5Y6nM7mg4cODfX09HSFQiFXJBLx0jQdSSQSCWi+Qp8CXg/z4AaDQVVbWzutuXn1qvq6uQ16vc7EMCzjcDjGT58507Z3X8uB06dPd9jtdhhchAo5BSa8B0mSqT+r1epUtBcmsAQCgVggEKimT59e/eijj36zsLBQz7Ls7zQazZaioqLLWXbF6k4hQ1LxursCkKKiInhcxuwwSa4739PDdHZ0dFAUBXPi3kAgQDIMA0UWVKopQGDsCcanampqyprXrF45r75+icGot3Acl3Q6nfb29tPH9+w9sK+9vb0zEAj4SZJMhUsm/uPyqJkAABDxSURBVOPTgGg0Glj7hUKApVKplOM4ZWFhYem6deseLCzMF+M49lo8zu7ZsGED1EO3kDHMmCFfPiBwh27atAmGQgoDAV/zwMCQtaOj42wkEhknSdIzIbZiNE1PAMIDghDjQrlcMaOioqipqXHZogULllqsWXkcz/EOh9N2/NiJ1p27du89ceJETyQSgcqamciFpACFLJkocABKpRJjWRbGumA+RCWVSnMbGhpW5+fn0gQheQtBVrU//XTxNavjp4gh6Wj2lw9I2kfYtGmTwefzrRofH5/T29vbBXMi0FunKMo/Yf6mGcLzYjGmIQhpcXFx7op7ly5csnTp8oL83FIEQdAx2/jQocNH9r7//s593d2dQ7FYLDYhspIQlMvASJ3nq1Ao8AlAYMZQjaKotaFh4eKiopJRlUr13oEDB0aulS28WWf4KnyBJnlqr9wVIgsuzOHDh2X79u1b6PP5GoeHh11er7cvHA47SJKE+YwIwzAJGL1N+xTQ9LVYLMalixfXNTYuX1leVlqN4bhwdGxsYN/+lj07d+w6MDAyYINJKcguKPIwDGMnxNXFQCUERCgUEjzPw4IJjVShyJ9fP7e2KC/3XH6R6YMNG74bgH7ltWqvp5gh2C0CcqUHf+PBXdPjR4aGhkSbN79d4/H41wwPj6Iej+dCOBy2Q2uLJMkw9EfgDoegQCdPLpeLYE597tzZVU1Nq5bXVFfPgTmPkbGx/pb9LXs++vjDQ6OjDkc0Go2njQIIyISoSofy4X2gQieEQqESQRBNQVFB6cyamnyLJeuoXK46+MQTT8Cu3Wt+bjzn9E+vPfc0O67CkMxCJNcaXeaD++IdTp06Jfj44/fzvN7gaq8nkOdyu/pCoZANWluhUAhm+hi12oSLxSjncrkSySSHSSRiRU1NVWFj48qG2bNmz5PLpKpR2/jAvn0tn+zbt/vY+LgLWmqJCaOAwTAsGQwGLxYrqFQqqD9SFpZUKlWxLKutrq6umjlzpjg/P69FKBSde+SRR64aw0rP4Oar369Y63Qk+lYZcuXC3gogUGw9/PDDGoVCsYSiqHugtUSS5BgUW36/36PRmPimpmUlJpNZd/r06Z5Dhw45eZ4X5+fnZy1pWDh33rz6BSqNWj8+bh9qaTm4/+DBQ6ccDocHMiQNSDgcvqzRE0FUqpRCh2EwqVgs1ohEmGH69Nqa0qKioM5o3KdUKocfe+yx1GE4t2MTTtwzrdAhKHeNDkmNLS8vj1i9enVtPB5v8vl8fDAYHCZJ0g7z61qtln3ooYfqq6ZNm3Whr+/4+++/f7SjowOYzWZDXd3s6nvuWTDPaDRYHA7n2MGDhw8dP378tNvt9qUBwTAsEQqFLu+8RSFDYIEDjuMyuVyulcglltkzZ1fk5ORcSCQSLS+99JL/Rsc43eomvAwUCMhdxRBY6ilYunRpEUVRTX6/3+r1emE5kI0kSadEIomsWLGicvHixcsiodDA1u3bdx/85JOwxqRVV1VNL543d95cS7Y1N+Dzu2C0+PiJEx0+n89/PUCUSiXssIIlQnJYaK3X6wsqKyrMRr3+pEKjadu4cWMqMHmpWuqLRJkiQNCJN2ncXYBAyn7/+9/XKZXKZdFwuN5mt7t9Pt9YKBpysHHWX11dbVq9etViFMXoDz748JP9u3a51BqNoriiNLuubm5tfl5eUSgU8redaDvR3n720xsBAkMwsIwUeug4jusKCwsrrFYrp1AoDj355JO9125FuCTAbhGQlKk7gTj8xm/RypqMDsnMYKiurpauW7duNk1Rq4ZHbZzH4x0Nh4OOYDDosZpMwmXLl8+UK+Wyw4cPtR05ctwGd3heXp6pbnZtVWFhYXGEoiLt7WfaOzo6ur1ebwCavQzD0DiOJyaCk+k0cEpcYRgGa3g1YrHYWF5eXpWVZbQRhPQgTHZdz//ITKln5KFfrkMEdxCQG5p/KdlQW1uLf/uBB/L9LAudxLzRUZstGIR6JOhFUTQ2vbLSkpOfa+rr6x0+ffrcaDwex3IsFl3NjBml+YUFxSwbpzs7OzpOn+68QJJkkKKoGAQkGo1enpuHgcVUQ+hE+Y9Wp9PllJWV5JvNxnMmk/XoT37yk2sWWF++zLfIkPT6p/QHLHGaIkDSFRhXPZ7phtvkcxegb7/9tnJsbGyhy+VYNDQ0Qvr9flskEnHTkUhQqdUKS0pKTKFQKDYw0GMPh2nOYNCoSkvL8wvyCwuSHMt2dZ3v7uq60H8NQFLHxzIMAxtCYemPUiAQaAsKCkrLS0vlBpPpiFqtPvvMM89kdK7WFACSZshUAvLZkk5ucNd2lBobG4Xz58+viobDq0bGRiQul2eMJMlUGAU6iHq9HiphgdfrhQyAPYGy/PycrNzcvBxYttvf398/ODgILbQUQ1iWjUF/JG0xwZquCXElVyoVKp4HugXz5s0sKikJSySST7Zu3TrwxTfwXH28V59zZuL5sopM+AP8BgzJ+KYXN/jkALkucbAXX3zRwsTjy51ud5nD4XCGQiEHVNjxeDwiEolgQ6eIoqh4NBpNwtJSs9msy7aYzSiCISM22+jg4KAtGo2SsViMukyHQKcQkcvlKesKQRBYragpKioqXLZsSZ3ZbDk9NDT04b/8y7/A9oM71acOFzql0PV6/Y1E1uRAmUJAQGlpqby5uXkeRVGLx8bGon6/H4ZRfDCLCPsIZTIZ7IziIUOgq63TqZVGo14HG6LcbrfTbrfbISBpHQKVerpGK5nkYLF2yrrKzs62NjU1LppeXZkjlUney88v3VVWVgZPv87oMwVzTjmEEBCdTncjQDIa0+cYMjUJf3gu/JqvrZnGkPHG8XGHFHru0WgUJqxCMKUrEAhgUBCFZT48wyAKpVKq1GhUOI6gfj/pczqdrng8HoKRYsiQiXwKn+4HUalUcq1Wa6qsqKhevnzpiuzcXB+KCv7o9XpPrF+//qo1WJd8kkvkuUVALrewbhcgU3Pc3YEDB/CWlpYshmGW+Xy+8pGREXcwGHTTNE3SNB2Dfeiw4DoajTIcx8EWaBFMMgkEKBIIhMhgMOiD4H0GSIJGUSyVj+c4DhZpS1UqlS4rKyu/sqKiZu68ObNMpqyjsVj8T6tXrx5CECTjo8ivcc5kpjs5La7gt0Cj0dwOhkwNIJDGTz31lEyr1c6NRaOLB4eHEx6PB7Y/BxOJRBQWLsD2WpZlWRheh4yBpUAYhgFYfRIORwI0HYOApIrtIEPgKsESIolSotMp1UaVSptTUlJUObNmhklv1L5/+HDbRz/72b8FL1MfN9QjU8CQtGOIw26wKTJ701bWlJi9F3cXFFvf/e53S4PB4EqbzWa02WzOSCTig4o9mUzCLhtomfDQgoKZR5FIJIBAsSxLkSRJQpE1odRhxDapVCpFKpVKI5FIdFKC0ItlMnN5eXlFeWkxKVeqt77wwguw2vHyxpw7CQimVquJKQbkipcT3/IZtpAlr776qs7v8Sxxe71zRkZHQ/5g0BOPxUKQGALBZwyPxWJQbMGKdgwa8zTDUBAMSBQosmA+RCwWA61WC7uktCKRSCUUivRarSa7srKyKCfH0mY0Zu1obm62T9QQZ2zNTAFDLlpZsIj8bgcEqa+vJ9auXTszGPQ3Dg+Pij0+nzseiwXj8TiVTCZhFpBPJGDKg+Gw1Bv2EC6RTMZhLp3juHA8HoeeegI2eEokEpiNUkBTVy6XW3Jzc8vKy8slRotxR8ATOPj8889P+gjZWwQknbpN6ZDbZGVNmQ6ZCKXMxL/1rUdyAgHvyvFxZ7nT6QykxRZsT4OgTHxSihgCAvsMY7EYLB+CDKFhcgtaZCKRSAxPepBKpUa5XJ47bVr5tLyCPJtMoti2fPny7uLiaxczXEtLTxEg8PY3cgwzNRSmNPJ5WSvhxfuijzzyiMJqtS6gKOpep9MJYMIKdugmEgkomiAoDAQFlgGlAYH/BnUJLLZmWTaJ4/CdoAKJQqGAOsRsMOjyq6srs416cwtF0x//0z/9k+ey3MedElmpTTcx0zsROrniNKAMEL76OsA8ybp1902Lx7n7nU5njsfjgYknWI0SjsVisCAbHjTDwLJQHsOg2ZWAJagwU8hxHKzJgsyB7WtysVisE4vFlsKiwpLyslJGq5VvffPNzW3Hjh27SkPOjXG5RYZcviZQfN3VZu/FwcKiht/85jd6mqZX+P3+BofDAftF3LF4LBijY6E4FYfhkRQoE8DAb6jLoaiCZ/2hsAdRLBYrYduzXCnPrqyoLCgoKDgjEom2z5o1aziTw8qutqOmEJBUPOtuV+qpNYAm7U9/+lORUqmcEQ6H17ndbovb7fbCykYYSqEoCuoKiuO4NCgpLQ9NXRxPzRF27coICaGWEBKT2WzOLysrE5hMxvcvXOg98PLLL8MTSW/q/epTCMidTlBlILGucwmskl+4cKGRoqjGYDC4xOVyJSFLKIqCSaggVOLQooIKHbIE6hOBQABFFYaiKFTmCoIgdHK53Jybm5uTk5PTAw8F+MMf/tB95ds/JzfOKQQEMxqNt+qHXCljp3BwV1sVBIblFy1aBIsgNni93lyv1wtZAhU8DLNDRxDGrSBLUpUiGIYhGIZBh14y0YNuMBj0ltzcPEKrVf9VIBDtfvrpp+Hx2Td0AG+TlXX5bbGcnBzFV0JkpUcNWXLPPfeYSZK8LxaLLXO5PDxJBpyxWAwWM/gpioIsoaFy/+yt3wg8mRQeE5sKs0Nzt6Ag32I1mftlKtU7v/jFL8729fWllP7keDEZy/LGhkHayioqKpJ+pQCBi9zQ0CBatXxVHcDA37td7hyXx+WDbQsweQXD7QzDxHieT0JDAEVRATxzETqDsO5Kr9WaS0pLRRqFYgdns33wvZoaN3LFu9UnD8sXpcJkLcuLz0ylr79qgEAFj73zzjvWYDDY7PP5VjjtTj5ABmC3VQACkkgkoB6BRdXwA89OlBIEoYDxq6LCQn1+Qd55gkD/9Nprb3VcOr8k4138BcSmWEzfXYVyGe5P5Fe/+hU8i3cORUX/ftxmK3K5PWQ0GvElEgwMlcDDMGEvCGyVg4CkGGIwGHTl5aWsXq/ZrNcrPmxoWO2/Wcvq8nFOMSB3RTtChjhcugyKo507dxo8HmeTw+GGB5/JgsFgKr0Lg47wQCxYxYFhGDyRFNbtKgvy8qRFRQXHFCrNWz/60Y96puotO3+jgExeZEDR9e6775b5/f6vOZ3OuX6/Hx4iE50weXmApAARYigm1eq0spLiwnGNUvn6z1/6dUtbW9uUvaB4igG5K5o+J82QtLP4yiuvwCK3eofD8aDP5yuF+fUkn2R5lgMohqAAoDBcIrVmZUUsWVlbCal029tvv23PpAAu00HdYsbw8sek9PlXTqlfPgMoul5//XWD3+9fFYvRa8PhsDkWo+DZJqkcA6ws0el0XG5u7gGr1fr6b3/72/NbtmyZsheCwbFMniFpafAFqQD/4q6r7c10Y6avQzZv3ozGYrFCAMCDfr9vhc/rV8UTceiEQJMXmM2ms1ar+bU33nj7yObNm69TvJDJo78oWicPyHWf89Uze68yHeR73/se3tjYOC0Wi23w+72LgmRYC3PoUomkWyxG/6xSiQ+sX/8PwfTBM5ksfabX3GKh3Ocfc3vN3kwndcvXoSgsE0ERg05Fm8x5jFRmQBOJqMDjGRG5XE4kHk/AV1/AD3oLYZLrjPPzbze96SndTh1y04P66v3woijLoI7g+hblVwCQyZvEXyKgGQCStqXS4bMr53c7ALnD6/FFwLiJdqQ7PJDU42q5L7yiY1LD+P+6+z6q8QSaWAAAAABJRU5ErkJggg==' | 16,825 | 16,825 | 0.966181 | 510 | 16,825 | 31.870588 | 0.994118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144029 | 0.000119 | 16,825 | 1 | 16,825 | 16,825 | 0.822148 | 0 | 0 | 0 | 0 | 1 | 0.998455 | 0.998455 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
4d8254186a3e4abcd2ecf32c9bf26547095b5056 | 27,808 | py | Python | docs/jnpr_healthbot_swagger/swagger_client/api/services_api.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | docs/jnpr_healthbot_swagger/swagger_client/api/services_api.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | docs/jnpr_healthbot_swagger/swagger_client/api/services_api.py | minefuto/healthbot-py-client | bb81452c974456af44299aebf32a73abeda8a943 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Healthbot APIs
API interface for Healthbot application # noqa: E501
OpenAPI spec version: 1.0.0
Contact: healthbot-hackers@juniper.net
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 swagger_client.api_client import ApiClient
class ServicesApi(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_services_device_groups_device_group_by_device_group_name(self, device_group_name, **kwargs): # noqa: E501
"""Start a device-group's services. # noqa: E501
Start services of a device group. Use this to start stopped services. # 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_services_device_groups_device_group_by_device_group_name(device_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_group_name: Name of device group (required)
:param str authorization: authentication header object
: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_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, **kwargs) # noqa: E501
else:
(data) = self.create_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, **kwargs) # noqa: E501
return data
def create_services_device_groups_device_group_by_device_group_name_with_http_info(self, device_group_name, **kwargs): # noqa: E501
"""Start a device-group's services. # noqa: E501
Start services of a device group. Use this to start stopped services. # 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_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_group_name: Name of device group (required)
:param str authorization: authentication header object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_group_name', 'authorization'] # 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_services_device_groups_device_group_by_device_group_name" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_group_name' is set
if ('device_group_name' not in params or
params['device_group_name'] is None):
raise ValueError("Missing the required parameter `device_group_name` when calling `create_services_device_groups_device_group_by_device_group_name`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_group_name' in params:
path_params['device_group_name'] = params['device_group_name'] # noqa: E501
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/octet-stream']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json', 'multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/device-group/{device_group_name}/', '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 create_services_network_group_by_network_group_name(self, network_group_name, **kwargs): # noqa: E501
"""Start a network-group's services. # noqa: E501
Start services of a network group. Use this to start stopped services. # 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_services_network_group_by_network_group_name(network_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str network_group_name: Name of network group (required)
:param str authorization: authentication header object
: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_services_network_group_by_network_group_name_with_http_info(network_group_name, **kwargs) # noqa: E501
else:
(data) = self.create_services_network_group_by_network_group_name_with_http_info(network_group_name, **kwargs) # noqa: E501
return data
def create_services_network_group_by_network_group_name_with_http_info(self, network_group_name, **kwargs): # noqa: E501
"""Start a network-group's services. # noqa: E501
Start services of a network group. Use this to start stopped services. # 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_services_network_group_by_network_group_name_with_http_info(network_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str network_group_name: Name of network group (required)
:param str authorization: authentication header object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['network_group_name', 'authorization'] # 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_services_network_group_by_network_group_name" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'network_group_name' is set
if ('network_group_name' not in params or
params['network_group_name'] is None):
raise ValueError("Missing the required parameter `network_group_name` when calling `create_services_network_group_by_network_group_name`") # noqa: E501
collection_formats = {}
path_params = {}
if 'network_group_name' in params:
path_params['network_group_name'] = params['network_group_name'] # noqa: E501
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/octet-stream']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json', 'multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/network-group/{network_group_name}/', '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_services_device_groups_device_group_by_device_group_name(self, device_group_name, **kwargs): # noqa: E501
"""Stop and remove a device-group's services. # noqa: E501
Stop and clean services of a device-group. This will remove all the services for a device-group, however, it will not clean up the collected data. # 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_services_device_groups_device_group_by_device_group_name(device_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_group_name: Name of device group (required)
:param str authorization: authentication header object
: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_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, **kwargs) # noqa: E501
else:
(data) = self.delete_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, **kwargs) # noqa: E501
return data
def delete_services_device_groups_device_group_by_device_group_name_with_http_info(self, device_group_name, **kwargs): # noqa: E501
"""Stop and remove a device-group's services. # noqa: E501
Stop and clean services of a device-group. This will remove all the services for a device-group, however, it will not clean up the collected data. # 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_services_device_groups_device_group_by_device_group_name_with_http_info(device_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_group_name: Name of device group (required)
:param str authorization: authentication header object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_group_name', 'authorization'] # 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_services_device_groups_device_group_by_device_group_name" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_group_name' is set
if ('device_group_name' not in params or
params['device_group_name'] is None):
raise ValueError("Missing the required parameter `device_group_name` when calling `delete_services_device_groups_device_group_by_device_group_name`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_group_name' in params:
path_params['device_group_name'] = params['device_group_name'] # noqa: E501
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/octet-stream']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json', 'multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/device-group/{device_group_name}/', '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_services_network_group_by_network_group_name(self, network_group_name, **kwargs): # noqa: E501
"""Stop and remove a network-group's services. # noqa: E501
Stop and clean the services of a network group. This will remove all the services for a network-group, however, it will not clean up the collected data. # 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_services_network_group_by_network_group_name(network_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str network_group_name: Name of network group (required)
:param str authorization: authentication header object
: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_services_network_group_by_network_group_name_with_http_info(network_group_name, **kwargs) # noqa: E501
else:
(data) = self.delete_services_network_group_by_network_group_name_with_http_info(network_group_name, **kwargs) # noqa: E501
return data
def delete_services_network_group_by_network_group_name_with_http_info(self, network_group_name, **kwargs): # noqa: E501
"""Stop and remove a network-group's services. # noqa: E501
Stop and clean the services of a network group. This will remove all the services for a network-group, however, it will not clean up the collected data. # 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_services_network_group_by_network_group_name_with_http_info(network_group_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str network_group_name: Name of network group (required)
:param str authorization: authentication header object
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['network_group_name', 'authorization'] # 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_services_network_group_by_network_group_name" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'network_group_name' is set
if ('network_group_name' not in params or
params['network_group_name'] is None):
raise ValueError("Missing the required parameter `network_group_name` when calling `delete_services_network_group_by_network_group_name`") # noqa: E501
collection_formats = {}
path_params = {}
if 'network_group_name' in params:
path_params['network_group_name'] = params['network_group_name'] # noqa: E501
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/octet-stream']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json', 'multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/network-group/{network_group_name}/', '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 retrieve_services_device_groups_device_group_device_group(self, **kwargs): # noqa: E501
"""Get running `device-group-name`s. # noqa: E501
Get the list of `device-group-name`s of device-groups whose services are running. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.retrieve_services_device_groups_device_group_device_group(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str authorization: authentication header object
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.retrieve_services_device_groups_device_group_device_group_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.retrieve_services_device_groups_device_group_device_group_with_http_info(**kwargs) # noqa: E501
return data
def retrieve_services_device_groups_device_group_device_group_with_http_info(self, **kwargs): # noqa: E501
"""Get running `device-group-name`s. # noqa: E501
Get the list of `device-group-name`s of device-groups whose services are running. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.retrieve_services_device_groups_device_group_device_group_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str authorization: authentication header object
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['authorization'] # 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 retrieve_services_device_groups_device_group_device_group" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/device-group/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[str]', # 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 retrieve_services_network_group(self, **kwargs): # noqa: E501
"""Get running `network-group-name`s # noqa: E501
Get the list of `network-group-name`s of network-groups whose services are running. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.retrieve_services_network_group(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str authorization: authentication header object
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.retrieve_services_network_group_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.retrieve_services_network_group_with_http_info(**kwargs) # noqa: E501
return data
def retrieve_services_network_group_with_http_info(self, **kwargs): # noqa: E501
"""Get running `network-group-name`s # noqa: E501
Get the list of `network-group-name`s of network-groups whose services are running. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.retrieve_services_network_group_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str authorization: authentication header object
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['authorization'] # 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 retrieve_services_network_group" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
if 'authorization' in params:
header_params['Authorization'] = params['authorization'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/services/network-group/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[str]', # 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)
| 43.654631 | 175 | 0.647907 | 3,312 | 27,808 | 5.131341 | 0.052536 | 0.057193 | 0.047661 | 0.025419 | 0.972639 | 0.972227 | 0.972227 | 0.967049 | 0.964637 | 0.962283 | 0 | 0.015052 | 0.268951 | 27,808 | 636 | 176 | 43.72327 | 0.820945 | 0.346339 | 0 | 0.835821 | 1 | 0 | 0.213467 | 0.075233 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038806 | false | 0 | 0.01194 | 0 | 0.107463 | 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 |
4dbe645031eb8b2a1e226481868e112a378efe01 | 53 | py | Python | my_classes/.history/ModulesPackages_PackageNamespaces/main_20210725190138.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/main_20210725190138.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/main_20210725190138.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | # main.py
print('=================================') | 17.666667 | 42 | 0.207547 | 3 | 53 | 3.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056604 | 53 | 3 | 42 | 17.666667 | 0.22 | 0.132075 | 0 | 0 | 0 | 0 | 0.733333 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 7 |
12b6830a513a8e0bdc44e8d8f39397cdadae2585 | 64 | py | Python | Encryption/__init__.py | CalebUAz/Stock-Trader-App | 24713b52f2a3a3b9df5984b9ddb45f4f90703255 | [
"MIT"
] | null | null | null | Encryption/__init__.py | CalebUAz/Stock-Trader-App | 24713b52f2a3a3b9df5984b9ddb45f4f90703255 | [
"MIT"
] | null | null | null | Encryption/__init__.py | CalebUAz/Stock-Trader-App | 24713b52f2a3a3b9df5984b9ddb45f4f90703255 | [
"MIT"
] | null | null | null | from .hashes import make_hashes
from .hashes import check_hashes | 32 | 32 | 0.859375 | 10 | 64 | 5.3 | 0.5 | 0.377358 | 0.603774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109375 | 64 | 2 | 32 | 32 | 0.929825 | 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 |
12eb867960ca88bf540110f75588fec399e59498 | 6,545 | py | Python | loldib/getratings/models/NA/na_rengar/na_rengar_sup.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_rengar/na_rengar_sup.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_rengar/na_rengar_sup.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
class NA_Rengar_Sup_Aatrox(Ratings):
pass
class NA_Rengar_Sup_Ahri(Ratings):
pass
class NA_Rengar_Sup_Akali(Ratings):
pass
class NA_Rengar_Sup_Alistar(Ratings):
pass
class NA_Rengar_Sup_Amumu(Ratings):
pass
class NA_Rengar_Sup_Anivia(Ratings):
pass
class NA_Rengar_Sup_Annie(Ratings):
pass
class NA_Rengar_Sup_Ashe(Ratings):
pass
class NA_Rengar_Sup_AurelionSol(Ratings):
pass
class NA_Rengar_Sup_Azir(Ratings):
pass
class NA_Rengar_Sup_Bard(Ratings):
pass
class NA_Rengar_Sup_Blitzcrank(Ratings):
pass
class NA_Rengar_Sup_Brand(Ratings):
pass
class NA_Rengar_Sup_Braum(Ratings):
pass
class NA_Rengar_Sup_Caitlyn(Ratings):
pass
class NA_Rengar_Sup_Camille(Ratings):
pass
class NA_Rengar_Sup_Cassiopeia(Ratings):
pass
class NA_Rengar_Sup_Chogath(Ratings):
pass
class NA_Rengar_Sup_Corki(Ratings):
pass
class NA_Rengar_Sup_Darius(Ratings):
pass
class NA_Rengar_Sup_Diana(Ratings):
pass
class NA_Rengar_Sup_Draven(Ratings):
pass
class NA_Rengar_Sup_DrMundo(Ratings):
pass
class NA_Rengar_Sup_Ekko(Ratings):
pass
class NA_Rengar_Sup_Elise(Ratings):
pass
class NA_Rengar_Sup_Evelynn(Ratings):
pass
class NA_Rengar_Sup_Ezreal(Ratings):
pass
class NA_Rengar_Sup_Fiddlesticks(Ratings):
pass
class NA_Rengar_Sup_Fiora(Ratings):
pass
class NA_Rengar_Sup_Fizz(Ratings):
pass
class NA_Rengar_Sup_Galio(Ratings):
pass
class NA_Rengar_Sup_Gangplank(Ratings):
pass
class NA_Rengar_Sup_Garen(Ratings):
pass
class NA_Rengar_Sup_Gnar(Ratings):
pass
class NA_Rengar_Sup_Gragas(Ratings):
pass
class NA_Rengar_Sup_Graves(Ratings):
pass
class NA_Rengar_Sup_Hecarim(Ratings):
pass
class NA_Rengar_Sup_Heimerdinger(Ratings):
pass
class NA_Rengar_Sup_Illaoi(Ratings):
pass
class NA_Rengar_Sup_Irelia(Ratings):
pass
class NA_Rengar_Sup_Ivern(Ratings):
pass
class NA_Rengar_Sup_Janna(Ratings):
pass
class NA_Rengar_Sup_JarvanIV(Ratings):
pass
class NA_Rengar_Sup_Jax(Ratings):
pass
class NA_Rengar_Sup_Jayce(Ratings):
pass
class NA_Rengar_Sup_Jhin(Ratings):
pass
class NA_Rengar_Sup_Jinx(Ratings):
pass
class NA_Rengar_Sup_Kalista(Ratings):
pass
class NA_Rengar_Sup_Karma(Ratings):
pass
class NA_Rengar_Sup_Karthus(Ratings):
pass
class NA_Rengar_Sup_Kassadin(Ratings):
pass
class NA_Rengar_Sup_Katarina(Ratings):
pass
class NA_Rengar_Sup_Kayle(Ratings):
pass
class NA_Rengar_Sup_Kayn(Ratings):
pass
class NA_Rengar_Sup_Kennen(Ratings):
pass
class NA_Rengar_Sup_Khazix(Ratings):
pass
class NA_Rengar_Sup_Kindred(Ratings):
pass
class NA_Rengar_Sup_Kled(Ratings):
pass
class NA_Rengar_Sup_KogMaw(Ratings):
pass
class NA_Rengar_Sup_Leblanc(Ratings):
pass
class NA_Rengar_Sup_LeeSin(Ratings):
pass
class NA_Rengar_Sup_Leona(Ratings):
pass
class NA_Rengar_Sup_Lissandra(Ratings):
pass
class NA_Rengar_Sup_Lucian(Ratings):
pass
class NA_Rengar_Sup_Lulu(Ratings):
pass
class NA_Rengar_Sup_Lux(Ratings):
pass
class NA_Rengar_Sup_Malphite(Ratings):
pass
class NA_Rengar_Sup_Malzahar(Ratings):
pass
class NA_Rengar_Sup_Maokai(Ratings):
pass
class NA_Rengar_Sup_MasterYi(Ratings):
pass
class NA_Rengar_Sup_MissFortune(Ratings):
pass
class NA_Rengar_Sup_MonkeyKing(Ratings):
pass
class NA_Rengar_Sup_Mordekaiser(Ratings):
pass
class NA_Rengar_Sup_Morgana(Ratings):
pass
class NA_Rengar_Sup_Nami(Ratings):
pass
class NA_Rengar_Sup_Nasus(Ratings):
pass
class NA_Rengar_Sup_Nautilus(Ratings):
pass
class NA_Rengar_Sup_Nidalee(Ratings):
pass
class NA_Rengar_Sup_Nocturne(Ratings):
pass
class NA_Rengar_Sup_Nunu(Ratings):
pass
class NA_Rengar_Sup_Olaf(Ratings):
pass
class NA_Rengar_Sup_Orianna(Ratings):
pass
class NA_Rengar_Sup_Ornn(Ratings):
pass
class NA_Rengar_Sup_Pantheon(Ratings):
pass
class NA_Rengar_Sup_Poppy(Ratings):
pass
class NA_Rengar_Sup_Quinn(Ratings):
pass
class NA_Rengar_Sup_Rakan(Ratings):
pass
class NA_Rengar_Sup_Rammus(Ratings):
pass
class NA_Rengar_Sup_RekSai(Ratings):
pass
class NA_Rengar_Sup_Renekton(Ratings):
pass
class NA_Rengar_Sup_Rengar(Ratings):
pass
class NA_Rengar_Sup_Riven(Ratings):
pass
class NA_Rengar_Sup_Rumble(Ratings):
pass
class NA_Rengar_Sup_Ryze(Ratings):
pass
class NA_Rengar_Sup_Sejuani(Ratings):
pass
class NA_Rengar_Sup_Shaco(Ratings):
pass
class NA_Rengar_Sup_Shen(Ratings):
pass
class NA_Rengar_Sup_Shyvana(Ratings):
pass
class NA_Rengar_Sup_Singed(Ratings):
pass
class NA_Rengar_Sup_Sion(Ratings):
pass
class NA_Rengar_Sup_Sivir(Ratings):
pass
class NA_Rengar_Sup_Skarner(Ratings):
pass
class NA_Rengar_Sup_Sona(Ratings):
pass
class NA_Rengar_Sup_Soraka(Ratings):
pass
class NA_Rengar_Sup_Swain(Ratings):
pass
class NA_Rengar_Sup_Syndra(Ratings):
pass
class NA_Rengar_Sup_TahmKench(Ratings):
pass
class NA_Rengar_Sup_Taliyah(Ratings):
pass
class NA_Rengar_Sup_Talon(Ratings):
pass
class NA_Rengar_Sup_Taric(Ratings):
pass
class NA_Rengar_Sup_Teemo(Ratings):
pass
class NA_Rengar_Sup_Thresh(Ratings):
pass
class NA_Rengar_Sup_Tristana(Ratings):
pass
class NA_Rengar_Sup_Trundle(Ratings):
pass
class NA_Rengar_Sup_Tryndamere(Ratings):
pass
class NA_Rengar_Sup_TwistedFate(Ratings):
pass
class NA_Rengar_Sup_Twitch(Ratings):
pass
class NA_Rengar_Sup_Udyr(Ratings):
pass
class NA_Rengar_Sup_Urgot(Ratings):
pass
class NA_Rengar_Sup_Varus(Ratings):
pass
class NA_Rengar_Sup_Vayne(Ratings):
pass
class NA_Rengar_Sup_Veigar(Ratings):
pass
class NA_Rengar_Sup_Velkoz(Ratings):
pass
class NA_Rengar_Sup_Vi(Ratings):
pass
class NA_Rengar_Sup_Viktor(Ratings):
pass
class NA_Rengar_Sup_Vladimir(Ratings):
pass
class NA_Rengar_Sup_Volibear(Ratings):
pass
class NA_Rengar_Sup_Warwick(Ratings):
pass
class NA_Rengar_Sup_Xayah(Ratings):
pass
class NA_Rengar_Sup_Xerath(Ratings):
pass
class NA_Rengar_Sup_XinZhao(Ratings):
pass
class NA_Rengar_Sup_Yasuo(Ratings):
pass
class NA_Rengar_Sup_Yorick(Ratings):
pass
class NA_Rengar_Sup_Zac(Ratings):
pass
class NA_Rengar_Sup_Zed(Ratings):
pass
class NA_Rengar_Sup_Ziggs(Ratings):
pass
class NA_Rengar_Sup_Zilean(Ratings):
pass
class NA_Rengar_Sup_Zyra(Ratings):
pass
| 15.695444 | 46 | 0.766692 | 972 | 6,545 | 4.736626 | 0.151235 | 0.209818 | 0.389661 | 0.479583 | 0.803432 | 0.803432 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169748 | 6,545 | 416 | 47 | 15.733173 | 0.847258 | 0 | 0 | 0.498195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.498195 | 0.00361 | 0 | 0.501805 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 7 |
12fa3acf099b39fc1397262c16a2d09b7f68d22f | 130 | py | Python | nuimo/__init__.py | adamhurm/nuimo-sonos-controller | 950f79a243783ef5df5286141086a9109cd3dda5 | [
"MIT"
] | 50 | 2016-07-26T09:13:52.000Z | 2022-03-01T05:54:28.000Z | nuimo/__init__.py | adamhurm/nuimo-sonos-controller | 950f79a243783ef5df5286141086a9109cd3dda5 | [
"MIT"
] | 34 | 2016-08-11T15:31:17.000Z | 2019-03-24T12:55:10.000Z | nuimo/__init__.py | adamhurm/nuimo-sonos-controller | 950f79a243783ef5df5286141086a9109cd3dda5 | [
"MIT"
] | 24 | 2016-08-18T08:28:04.000Z | 2022-02-15T01:00:00.000Z | from .nuimo import ControllerManager, ControllerManagerListener, Controller, ControllerListener, GestureEvent, Gesture, LedMatrix
| 65 | 129 | 0.869231 | 10 | 130 | 11.3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 130 | 1 | 130 | 130 | 0.941667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
420d3d13cf208ec571a23ad813736063e6dc9bd0 | 14,904 | py | Python | tests/list_utils_tests.py | Brickster/pretty-markdown | c0b189a91a8aa1bf4e65e89e697858b6d3bf2ff7 | [
"MIT"
] | null | null | null | tests/list_utils_tests.py | Brickster/pretty-markdown | c0b189a91a8aa1bf4e65e89e697858b6d3bf2ff7 | [
"MIT"
] | null | null | null | tests/list_utils_tests.py | Brickster/pretty-markdown | c0b189a91a8aa1bf4e65e89e697858b6d3bf2ff7 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from utils import list_utils
import unittest
class ListUtilsTests(unittest.TestCase):
#
# _tab_count
#
def test__tabCount_none(self):
text = None
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 0)
def test__tabCount_empty(self):
text = ''
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 0)
def test__tabCount_blank(self):
text = ' '
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 0)
def test__tabCount_zero(self):
text = 'No tabs'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 0)
def test__tabCount_one(self):
text = '\tOne tab'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 1)
def test__tabCount_two(self):
text = '\t\tTwo tab'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 2)
def test__tabCount_many(self):
text = '\t\t\t\t\t\tMany tabs'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 6)
def test__tabCount_spaces_one(self):
text = ' One tab'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 1)
def test__tabCount_spaces_many(self):
text = ' ' * 6 + 'Many tab'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 6)
def test__tabCount_mixed(self):
text = '\t \t\t Mixed tab types'
tab_count = list_utils._tab_count(text)
self.assertEqual(tab_count, 6)
#
# _is_unordered_list_item
#
def test__isUnorderedListItem_dash(self):
text = '- item'
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_plus(self):
text = '+ item'
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_asterisk(self):
text = '* item'
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_subItem_spaces(self):
text = ' - item'
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_subItem_tab(self):
text = '\t- item'
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_false(self):
text = 'This is just text.'
is_item = list_utils._is_unordered_list_item(text)
self.assertFalse(is_item)
def test__isUnorderedListItem_orderedItem(self):
text = '1. This is an ordered item.'
is_item = list_utils._is_unordered_list_item(text)
self.assertFalse(is_item)
def test__isUnorderedListItem_empty(self):
text = ''
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_blank(self):
text = ' '
is_item = list_utils._is_unordered_list_item(text)
self.assertTrue(is_item)
def test__isUnorderedListItem_none(self):
text = None
is_item = list_utils._is_unordered_list_item(text)
self.assertFalse(is_item)
def test__isUnorderedListItem_multipleItems(self):
text = '- item one\n- item two'
is_item = list_utils._is_unordered_list_item(text)
self.assertFalse(is_item)
#
# _is_ordered_list_item
#
def test__isOrderedListItem(self):
text = '1. item'
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_multipleDigits(self):
text = '11. item'
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_subItem_spaces(self):
text = ' 2. item'
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_subItem_tab(self):
text = '\t3. item'
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_false(self):
text = 'This is just text.'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_false_notPeriodDelimited(self):
text = '1, Item'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_unorderedItem(self):
text = '1 This is an unordered item'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_empty(self):
text = ''
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_blank(self):
text = ' '
is_item = list_utils._is_ordered_list_item(text)
self.assertTrue(is_item)
def test__isOrderedListItem_none(self):
text = None
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_multipleItems(self):
text = '1. item one\n2. item two'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_escaped(self):
text = '\1986. It was a great year.'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
def test__isOrderedListItem_notAnOrderedList(self):
text = '+ item one'
is_item = list_utils._is_ordered_list_item(text)
self.assertFalse(is_item)
#
# _format_unordered_list
#
def test__formatUnorderedList(self):
text = ['- item 1', ' * sub item', ' - sub sub item', '* item 2']
expected = ['- item 1', ' + sub item', ' * sub sub item', '- item 2']
actual = list_utils._format_unordered_list(text)
self.assertEqual(actual, expected)
def test__formatUnorderedList_withDelimiters(self):
text = ['- item 1', ' * sub item', ' - sub sub item', '* item 2']
delimiters = ['+', '*', '-']
expected = ['+ item 1', ' * sub item', ' - sub sub item', '+ item 2']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_spaces(self):
text = ['- item', ' - subitem', ' - subsubitem']
delimiters = ['-', '+', '*']
expected = ['- item', ' + subitem', ' * subsubitem']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_tabs(self):
text = ['- item', '\t- subitem', '\t\t- subsubitem']
delimiters = ['-', '+', '*']
expected = ['- item', '\t+ subitem', '\t\t* subsubitem']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_tabsAndSpaces(self):
text = ['- item', '\t- subitem', '\t - subsubitem', ' \t- subsubitem', ' \t - subsubsubitem']
delimiters = ['-', '+', '*']
expected = ['- item', '\t+ subitem', '\t * subsubitem', ' \t* subsubitem', ' \t - subsubsubitem']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_rollOver(self):
text = ['+ item', '\t+ subitem', '\t\t+ subsubitem', '\t\t\t+ subsubsubitem']
delimiters = ['-', '+', '*']
expected = ['- item', '\t+ subitem', '\t\t* subsubitem', '\t\t\t- subsubsubitem']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_convertToSingleDelimiter(self):
text = ['* item one', '* item two', '* item three']
delimiters = ['-']
expected = ['- item one', '- item two', '- item three']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_convertToSingleDelimiter_withSubItems(self):
text = ['- item', ' * sub item', ' + sub sub item']
delimiters = ['-']
expected = ['- item', ' - sub item', ' - sub sub item']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_allSameLevel_oneOfEach(self):
text = ['- item one', '+ item two', '* item three']
delimiters = ['-', '+', '*']
expected = ['- item one', '- item two', '- item three']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_newLineBetweenItems(self):
text = ['- Item one', '', '+ Item two', '', '* Item three']
delimiters = ['-', '*']
expected = ['- Item one', '', '- Item two', '', '- Item three']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_newLineBetweenItems_multipleLevels(self):
text = ['- Item one', '', '\t+ Sub item one', '', '* Item two']
delimiters = ['-', '*']
expected = ['- Item one', '', '\t* Sub item one', '', '- Item two']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
def test__formatUnorderedList_lastItemIsDuplicate(self):
text = ['* item', '* item']
delimiters = ['-', '+', '*']
expected = ['- item', '- item']
actual = list_utils._format_unordered_list(text, delimiters)
self.assertEqual(actual, expected)
#
# _format_ordered_list
#
def test__formatOrderedList(self):
text = ['2. item one']
expected = ['1. item one']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_noChange(self):
text = ['1. item one']
expected = text
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_oneLevel(self):
text = ['2. item one', '3. item two', '1. item three']
expected = ['1. item one', '2. item two', '3. item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_twoLevels(self):
text = ['2. item one', '\t2. sub item', '3. item two', '1. item three']
expected = ['1. item one', '\t1. sub item', '2. item two', '3. item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_twoLevels_spaces(self):
text = ['2. item one', ' 2. sub item', '3. item two', '1. item three']
expected = ['1. item one', ' 1. sub item', '2. item two', '3. item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_manyLevels(self):
text = ['2. item one', '\t2. sub item', '3. item two', '\t55. sub item', '\t\t2. sub sub item 1', '\t\t3. sub sub item 2', '1. item three']
expected = ['1. item one', '\t1. sub item', '2. item two', '\t1. sub item', '\t\t1. sub sub item 1', '\t\t2. sub sub item 2', '3. item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_manyLevels_tabsAndSpaces(self):
text = ['2. item one', '\t2. sub item', '3. item two', ' 55. sub item', '\t 2. sub sub item 1', ' 3. sub sub item 2', '1. item three']
expected = ['1. item one', '\t1. sub item', '2. item two', ' 1. sub item', '\t 1. sub sub item 1', ' 2. sub sub item 2', '3. item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_newLineBetweenItems(self):
text = ['1. Item one', '', '1. Item two', '', '4. Item three']
expected = ['1. Item one', '', '2. Item two', '', '3. Item three']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_newLineBetweenItems_multipleLevels(self):
text = ['1. Item one', '', '\t2. Sub item one', '', '3. Item two']
expected = ['1. Item one', '', '\t1. Sub item one', '', '2. Item two']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
def test__formatOrderedList_newLineAtEnd(self):
text = ['1. Item one', '1. Item two', '']
expected = ['1. Item one', '2. Item two', '']
actual = list_utils._format_ordered_list(text)
self.assertEqual(actual, expected)
#
# alternate_unordered_list_delimiters
#
@patch('util_utils.process_groups')
def test_alternateUnorderedListDelimiters(self, mock_process_groups):
input_text = 'this is the input'
delimiters = ['-']
expected = 'this is the different'
mock_process_groups.return_value = expected
actual = list_utils.alternate_unordered_list_delimiters(input_text, delimiters)
mock_process_groups.assert_called_with(input_text,
is_group_member=list_utils._is_unordered_list_item,
process_group=list_utils._format_unordered_list,
process_group_parameters={'delimiters': delimiters})
self.assertEqual(actual, expected)
#
# fix_ordered_list_numbering
#
@patch('util_utils.process_groups')
def test_fixOrderedListNumbering(self, mock_process_groups):
input_text = 'this is the input'
expected = 'this is the different'
mock_process_groups.return_value = expected
actual = list_utils.fix_ordered_list_numbering(input_text)
mock_process_groups.assert_called_with(input_text,
is_group_member=list_utils._is_ordered_list_item,
process_group=list_utils._format_ordered_list)
self.assertEqual(actual, expected)
| 28.716763 | 158 | 0.618626 | 1,718 | 14,904 | 5.034342 | 0.070431 | 0.065557 | 0.033067 | 0.041623 | 0.840444 | 0.812233 | 0.799746 | 0.776506 | 0.746213 | 0.733033 | 0 | 0.010195 | 0.262882 | 14,904 | 518 | 159 | 28.772201 | 0.77708 | 0.010937 | 0 | 0.530035 | 0 | 0 | 0.165636 | 0.003397 | 0 | 0 | 0 | 0 | 0.212014 | 1 | 0.204947 | false | 0 | 0.010601 | 0 | 0.219081 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
4210c9dc2f486ebf1a97a5e1498f8ac4653af4d8 | 4,960 | py | Python | easy_rec/python/test/rtp_convert_test.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 285 | 2021-10-11T03:39:43.000Z | 2022-03-31T09:12:33.000Z | easy_rec/python/test/rtp_convert_test.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 84 | 2021-10-15T03:48:58.000Z | 2022-03-31T12:38:53.000Z | easy_rec/python/test/rtp_convert_test.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 71 | 2021-10-15T03:33:44.000Z | 2022-03-31T08:37:11.000Z | # -*- encoding:utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
import logging
import os
import tensorflow as tf
from easy_rec.python.utils import config_util
from easy_rec.python.utils import test_utils
class RTPConvertTest(tf.test.TestCase):
def setUp(self):
logging.info('Testing %s.%s' % (type(self).__name__, self._testMethodName))
def tearDown(self):
test_utils.set_gpu_id(None)
def test_rtp_convert(self):
test_dir = test_utils.get_tmp_dir()
logging.info('test dir: %s' % test_dir)
pipeline_config_path = os.path.join(test_dir, 'fg_multi_tower.config')
convert_cmd = """
python -m easy_rec.python.tools.convert_rtp_fg
--rtp_fg samples/rtp_fg/fg.json
--label clk
--output_path %s
--input_type RTPInput
--model_type multi_tower
--train_input_path data/test/rtp/taobao_train_feature.txt
--eval_input_path data/test/rtp/taobao_test_feature.txt
--selected_cols 0,3 --num_steps 400
""" % pipeline_config_path
proc = test_utils.run_cmd(convert_cmd,
'%s/log_%s.txt' % (test_dir, 'convert'))
proc.wait()
self.assertTrue(proc.returncode == 0)
self.assertTrue(
test_utils.test_single_train_eval(
pipeline_config_path, test_dir=test_dir))
test_utils.clean_up(test_dir)
def test_rtp_convert_bucketize(self):
test_dir = test_utils.get_tmp_dir()
logging.info('test dir: %s' % test_dir)
pipeline_config_path = os.path.join(test_dir, 'fg_multi_tower.config')
convert_cmd = """
python -m easy_rec.python.tools.convert_rtp_fg
--rtp_fg samples/rtp_fg/fg_bucketize.json
--label clk
--output_path %s
--input_type RTPInput
--model_type multi_tower
--train_input_path data/test/rtp/taobao_train_bucketize_feature.txt
--eval_input_path data/test/rtp/taobao_test_bucketize_feature.txt
--selected_cols 0,3 --num_steps 400
""" % pipeline_config_path
proc = test_utils.run_cmd(convert_cmd,
'%s/log_%s.txt' % (test_dir, 'convert'))
proc.wait()
self.assertTrue(proc.returncode == 0)
self.assertTrue(
test_utils.test_single_train_eval(
pipeline_config_path, test_dir=test_dir))
test_utils.clean_up(test_dir)
def test_rtp_convert_bucketize_v2(self):
test_dir = test_utils.get_tmp_dir()
logging.info('test dir: %s' % test_dir)
pipeline_config_path = os.path.join(test_dir, 'fg_multi_tower.config')
convert_cmd = """
python -m easy_rec.python.tools.convert_rtp_fg
--rtp_fg samples/rtp_fg/fg_bucketize_v2.json
--label clk
--output_path %s
--input_type RTPInput
--model_type multi_tower
--train_input_path data/test/rtp/taobao_train_feature.txt
--eval_input_path data/test/rtp/taobao_test_feature.txt
--selected_cols 0,3 --num_steps 400
""" % pipeline_config_path
proc = test_utils.run_cmd(convert_cmd,
'%s/log_%s.txt' % (test_dir, 'convert'))
proc.wait()
self.assertTrue(proc.returncode == 0)
tmp_config = config_util.get_configs_from_pipeline_file(
pipeline_config_path)
for feature_config in tmp_config.feature_configs:
if feature_config.input_names[0] == 'price':
assert len(feature_config.boundaries) == 6
self.assertTrue(
test_utils.test_single_train_eval(
pipeline_config_path, test_dir=test_dir))
test_utils.clean_up(test_dir)
def test_rtp_convert_test_model_config(self):
test_dir = test_utils.get_tmp_dir()
logging.info('test dir: %s' % test_dir)
pipeline_config_path = os.path.join(test_dir, 'fg_wide_and_deep.config')
convert_cmd = """
python -m easy_rec.python.tools.convert_rtp_fg
--rtp_fg samples/rtp_fg/fg_bucketize_model_config.json
--label clk
--output_path %s
--input_type RTPInput
--train_input_path data/test/rtp/taobao_train_feature.txt
--eval_input_path data/test/rtp/taobao_test_feature.txt
--selected_cols 0,3 --num_steps 400
""" % pipeline_config_path
proc = test_utils.run_cmd(convert_cmd,
'%s/log_%s.txt' % (test_dir, 'convert'))
proc.wait()
self.assertTrue(proc.returncode == 0)
tmp_config = config_util.get_configs_from_pipeline_file(
pipeline_config_path)
assert len(tmp_config.model_config.wide_and_deep.dnn.hidden_units) == 2
assert tmp_config.model_config.wide_and_deep.dnn.hidden_units[0] == 48
assert tmp_config.model_config.wide_and_deep.dnn.hidden_units[1] == 24
assert tmp_config.model_dir == 'experiments/rtp_fg/wide_and_deep_update_model'
self.assertTrue(
test_utils.test_single_train_eval(
pipeline_config_path, test_dir=test_dir))
test_utils.clean_up(test_dir)
if __name__ == '__main__':
tf.test.main()
| 37.014925 | 82 | 0.684274 | 707 | 4,960 | 4.408769 | 0.155587 | 0.071864 | 0.080847 | 0.041065 | 0.834135 | 0.834135 | 0.816169 | 0.816169 | 0.816169 | 0.803337 | 0 | 0.009184 | 0.209677 | 4,960 | 133 | 83 | 37.293233 | 0.785969 | 0.014113 | 0 | 0.736842 | 0 | 0 | 0.376918 | 0.149171 | 0 | 0 | 0 | 0 | 0.114035 | 1 | 0.052632 | false | 0 | 0.04386 | 0 | 0.105263 | 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 |
4210df83a69c0e2b5208f8e0e73bb4d07a7ec61f | 163,071 | py | Python | open_words/inflects.py | MT-GoCode/whitaker_microservice | a8bd81ed750294149235bf5d7814f52a52b1855a | [
"MIT"
] | 27 | 2018-01-10T10:57:54.000Z | 2022-03-12T15:51:32.000Z | open_words/inflects.py | MT-GoCode/whitaker_microservice | a8bd81ed750294149235bf5d7814f52a52b1855a | [
"MIT"
] | 9 | 2017-11-12T17:07:27.000Z | 2020-07-27T14:19:32.000Z | open_words/inflects.py | MT-GoCode/whitaker_microservice | a8bd81ed750294149235bf5d7814f52a52b1855a | [
"MIT"
] | 7 | 2018-04-27T19:32:40.000Z | 2020-10-26T18:27:44.000Z | """
inflects.py
Corresponding to Whitaker's Words INFLECTS.LAT
"""
Inflects = [{"ending": "", "pos": "ADV", "note": "", "n": ["X", 1, 0], "form": "X 1 0"}, {"ending": "", "pos": "ADV", "note": "", "n": ["X", 2, 0], "form": "X 2 0"}, {"ending": "", "pos": "ADV", "note": "", "n": ["X", 3, 0], "form": "X 3 0"}, {"ending": "", "pos": "ADV", "note": "", "n": ["POS", 1, 0], "form": "POS 1 0"}, {"ending": "", "pos": "ADV", "note": "", "n": ["COMP", 1, 0], "form": "COMP 1 0"}, {"ending": "", "pos": "ADV", "note": "", "n": ["SUPER", 1, 0], "form": "SUPER 1 0"}, {"ending": "", "pos": "PREP", "note": "", "n": ["GEN", 1, 0], "form": "GEN 1 0"}, {"ending": "", "pos": "PREP", "note": "", "n": ["ACC", 1, 0], "form": "ACC 1 0"}, {"ending": "", "pos": "PREP", "note": "", "n": ["ABL", 1, 0], "form": "ABL 1 0"}, {"ending": "", "pos": "CONJ", "note": "", "n": [1, 0], "form": "1 0"}, {"ending": "", "pos": "INTERJ", "note": "", "n": [1, 0], "form": "1 0"}, {"ending": "a", "pos": "N", "note": "", "n": [1, 1], "form": "NOM S C"}, {"ending": "as", "pos": "N", "note": "", "n": [1, 1], "form": "NOM S M"}, {"ending": "a", "pos": "N", "note": "", "n": [1, 1], "form": "VOC S C"}, {"ending": "ae", "pos": "N", "note": "", "n": [1, 1], "form": "GEN S C"}, {"ending": "ai", "pos": "N", "note": "", "n": [1, 1], "form": "GEN S C"}, {"ending": "ae", "pos": "N", "note": "", "n": [1, 1], "form": "LOC S C"}, {"ending": "ae", "pos": "N", "note": "", "n": [1, 0], "form": "DAT S C"}, {"ending": "ai", "pos": "N", "note": "", "n": [1, 0], "form": "DAT S C"}, {"ending": "a", "pos": "N", "note": "", "n": [1, 1], "form": "ABL S C"}, {"ending": "ad", "pos": "N", "note": "", "n": [1, 1], "form": "ABL S C"}, {"ending": "am", "pos": "N", "note": "", "n": [1, 1], "form": "ACC S C"}, {"ending": "ae", "pos": "N", "note": "", "n": [1, 0], "form": "NOM P C"}, {"ending": "ae", "pos": "N", "note": "", "n": [1, 0], "form": "VOC P C"}, {"ending": "arum", "pos": "N", "note": "", "n": [1, 0], "form": "GEN P C"}, {"ending": "um", "pos": "N", "note": "", "n": [1, 0], "form": "GEN P C"}, {"ending": "is", "pos": "N", "note": "", "n": [1, 0], "form": "LOC P C"}, {"ending": "is", "pos": "N", "note": "", "n": [1, 0], "form": "DAT P C"}, {"ending": "abus", "pos": "N", "note": "", "n": [1, 0], "form": "DAT P C"}, {"ending": "is", "pos": "N", "note": "", "n": [1, 0], "form": "ABL P C"}, {"ending": "abus", "pos": "N", "note": "", "n": [1, 0], "form": "ABL P C"}, {"ending": "as", "pos": "N", "note": "", "n": [1, 0], "form": "ACC P C"}, {"ending": "e", "pos": "N", "note": "greek", "n": [1, 6], "form": "NOM S C"}, {"ending": "e", "pos": "N", "note": "greek", "n": [1, 6], "form": "VOC S C"}, {"ending": "es", "pos": "N", "note": "greek", "n": [1, 6], "form": "GEN S C"}, {"ending": "es", "pos": "N", "note": "greek", "n": [1, 6], "form": "LOC S C"}, {"ending": "e", "pos": "N", "note": "greek", "n": [1, 6], "form": "ABL S C"}, {"ending": "en", "pos": "N", "note": "greek", "n": [1, 6], "form": "ACC S C"}, {"ending": "es", "pos": "N", "note": "greek", "n": [1, 7], "form": "NOM S C"}, {"ending": "e", "pos": "N", "note": "greek", "n": [1, 7], "form": "VOC S C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [1, 7], "form": "VOC S C"}, {"ending": "ae", "pos": "N", "note": "greek", "n": [1, 7], "form": "GEN S C"}, {"ending": "ai", "pos": "N", "note": "greek", "n": [1, 7], "form": "GEN S C"}, {"ending": "ae", "pos": "N", "note": "greek", "n": [1, 7], "form": "LOC S C"}, {"ending": "e", "pos": "N", "note": "greek", "n": [1, 7], "form": "ABL S C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [1, 7], "form": "ABL S C"}, {"ending": "en", "pos": "N", "note": "greek", "n": [1, 7], "form": "ACC S C"}, {"ending": "am", "pos": "N", "note": "greek", "n": [1, 7], "form": "ACC S C"}, {"ending": "as", "pos": "N", "note": "greek", "n": [1, 8], "form": "NOM S M"}, {"ending": "a", "pos": "N", "note": "greek", "n": [1, 8], "form": "NOM S F"}, {"ending": "a", "pos": "N", "note": "greek", "n": [1, 8], "form": "VOC S C"}, {"ending": "ae", "pos": "N", "note": "greek", "n": [1, 8], "form": "GEN S C"}, {"ending": "ai", "pos": "N", "note": "greek", "n": [1, 8], "form": "GEN S C"}, {"ending": "ae", "pos": "N", "note": "greek", "n": [1, 8], "form": "LOC S C"}, {"ending": "an", "pos": "N", "note": "greek", "n": [1, 8], "form": "ACC S C"}, {"ending": "am", "pos": "N", "note": "greek", "n": [1, 8], "form": "ACC S C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [1, 8], "form": "ABL S C"}, {"ending": "os", "pos": "N", "note": "", "n": [2, 1], "form": "NOM S C"}, {"ending": "e", "pos": "N", "note": "", "n": [2, 1], "form": "VOC S X"}, {"ending": "i", "pos": "N", "note": "", "n": [2, 1], "form": "GEN S X"}, {"ending": "i", "pos": "N", "note": "", "n": [2, 0], "form": "LOC S X"}, {"ending": "o", "pos": "N", "note": "", "n": [2, 0], "form": "DAT S X"}, {"ending": "o", "pos": "N", "note": "", "n": [2, 0], "form": "ABL S X"}, {"ending": "um", "pos": "N", "note": "", "n": [2, 0], "form": "ACC S C"}, {"ending": "us", "pos": "N", "note": "", "n": [2, 1], "form": "ACC S N"}, {"ending": "om", "pos": "N", "note": "", "n": [2, 0], "form": "ACC S C"}, {"ending": "i", "pos": "N", "note": "", "n": [2, 0], "form": "NOM P C"}, {"ending": "e", "pos": "N", "note": "", "n": [2, 1], "form": "NOM P N"}, {"ending": "i", "pos": "N", "note": "", "n": [2, 0], "form": "VOC P C"}, {"ending": "orum", "pos": "N", "note": "", "n": [2, 0], "form": "GEN P X"}, {"ending": "um", "pos": "N", "note": "", "n": [2, 0], "form": "GEN P X"}, {"ending": "is", "pos": "N", "note": "", "n": [2, 0], "form": "LOC P X"}, {"ending": "is", "pos": "N", "note": "", "n": [2, 0], "form": "DAT P X"}, {"ending": "is", "pos": "N", "note": "", "n": [2, 0], "form": "ABL P X"}, {"ending": "os", "pos": "N", "note": "", "n": [2, 0], "form": "ACC P C"}, {"ending": "e", "pos": "N", "note": "", "n": [2, 1], "form": "ACC P N"}, {"ending": "um", "pos": "N", "note": "", "n": [2, 2], "form": "NOM S N"}, {"ending": "om", "pos": "N", "note": "", "n": [2, 2], "form": "NOM S N"}, {"ending": "um", "pos": "N", "note": "", "n": [2, 2], "form": "VOC S N"}, {"ending": "i", "pos": "N", "note": "", "n": [2, 2], "form": "GEN S N"}, {"ending": "um", "pos": "N", "note": "", "n": [2, 2], "form": "ACC S N"}, {"ending": "a", "pos": "N", "note": "", "n": [2, 0], "form": "NOM P N"}, {"ending": "a", "pos": "N", "note": "", "n": [2, 0], "form": "VOC P N"}, {"ending": "a", "pos": "N", "note": "", "n": [2, 0], "form": "ACC P N"}, {"ending": "", "pos": "N", "note": "er", "n": [2, 3], "form": "NOM S X"}, {"ending": "", "pos": "N", "note": "er", "n": [2, 3], "form": "VOC S X"}, {"ending": "i", "pos": "N", "note": "er", "n": [2, 3], "form": "GEN S X"}, {"ending": "us", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "NOM S C"}, {"ending": "e", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "VOC S C"}, {"ending": "um", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "NOM S N"}, {"ending": "um", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "VOC S N"}, {"ending": "i", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "GEN S X"}, {"ending": "", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "GEN S X"}, {"ending": "um", "pos": "N", "note": "ius/ium", "n": [2, 4], "form": "ACC S X"}, {"ending": "us", "pos": "N", "note": "ius/ium", "n": [2, 5], "form": "NOM S M"}, {"ending": "", "pos": "N", "note": "ius/ium", "n": [2, 5], "form": "VOC S M"}, {"ending": "", "pos": "N", "note": "ius/ium", "n": [2, 5], "form": "GEN S M"}, {"ending": "i", "pos": "N", "note": "ius/ium", "n": [2, 5], "form": "GEN S M"}, {"ending": "um", "pos": "N", "note": "ius/ium", "n": [2, 5], "form": "ACC S M"}, {"ending": "os", "pos": "N", "note": "greek", "n": [2, 6], "form": "NOM S X"}, {"ending": "e", "pos": "N", "note": "greek", "n": [2, 6], "form": "VOC S X"}, {"ending": "i", "pos": "N", "note": "greek", "n": [2, 6], "form": "GEN S X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [2, 6], "form": "ACC S C"}, {"ending": "os", "pos": "N", "note": "greek", "n": [2, 6], "form": "ACC S N"}, {"ending": "oe", "pos": "N", "note": "greek", "n": [2, 6], "form": "NOM P X"}, {"ending": "e", "pos": "N", "note": "greek", "n": [2, 6], "form": "NOM P N"}, {"ending": "e", "pos": "N", "note": "greek", "n": [2, 6], "form": "ACC P N"}, {"ending": "", "pos": "N", "note": "greek", "n": [2, 7], "form": "NOM S X"}, {"ending": "", "pos": "N", "note": "greek", "n": [2, 7], "form": "VOC S X"}, {"ending": "", "pos": "N", "note": "greek", "n": [2, 7], "form": "VOC S X"}, {"ending": "o", "pos": "N", "note": "greek", "n": [2, 7], "form": "GEN S X"}, {"ending": "i", "pos": "N", "note": "greek", "n": [2, 7], "form": "GEN S X"}, {"ending": "yos", "pos": "N", "note": "greek", "n": [2, 7], "form": "GEN S X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [2, 7], "form": "ACC S X"}, {"ending": "yn", "pos": "N", "note": "greek", "n": [2, 7], "form": "ACC S X"}, {"ending": "o", "pos": "N", "note": "greek", "n": [2, 7], "form": "ACC S X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [2, 8], "form": "NOM S N"}, {"ending": "on", "pos": "N", "note": "greek", "n": [2, 8], "form": "VOC S N"}, {"ending": "i", "pos": "N", "note": "greek", "n": [2, 8], "form": "GEN S N"}, {"ending": "on", "pos": "N", "note": "greek", "n": [2, 8], "form": "ACC S N"}, {"ending": "us", "pos": "N", "note": "greek", "n": [2, 9], "form": "NOM S C"}, {"ending": "u", "pos": "N", "note": "greek", "n": [2, 9], "form": "VOC S C"}, {"ending": "i", "pos": "N", "note": "greek", "n": [2, 9], "form": "GEN S C"}, {"ending": "un", "pos": "N", "note": "greek", "n": [2, 9], "form": "ACC S C"}, {"ending": "", "pos": "N", "note": "", "n": [3, 0], "form": "NOM S X"}, {"ending": "", "pos": "N", "note": "", "n": [3, 0], "form": "VOC S X"}, {"ending": "is", "pos": "N", "note": "", "n": [3, 0], "form": "GEN S X"}, {"ending": "i", "pos": "N", "note": "", "n": [3, 0], "form": "LOC S X"}, {"ending": "e", "pos": "N", "note": "", "n": [3, 0], "form": "LOC S X"}, {"ending": "i", "pos": "N", "note": "", "n": [3, 0], "form": "DAT S X"}, {"ending": "e", "pos": "N", "note": "", "n": [3, 0], "form": "DAT S X"}, {"ending": "e", "pos": "N", "note": "", "n": [3, 0], "form": "ABL S C"}, {"ending": "em", "pos": "N", "note": "", "n": [3, 1], "form": "ACC S C"}, {"ending": "es", "pos": "N", "note": "", "n": [3, 0], "form": "NOM P C"}, {"ending": "is", "pos": "N", "note": "", "n": [3, 0], "form": "NOM P C"}, {"ending": "es", "pos": "N", "note": "", "n": [3, 0], "form": "VOC P C"}, {"ending": "um", "pos": "N", "note": "", "n": [3, 1], "form": "GEN P C"}, {"ending": "ium", "pos": "N", "note": "", "n": [3, 1], "form": "GEN P C"}, {"ending": "ibus", "pos": "N", "note": "", "n": [3, 0], "form": "LOC P X"}, {"ending": "ibus", "pos": "N", "note": "", "n": [3, 0], "form": "DAT P X"}, {"ending": "ibus", "pos": "N", "note": "", "n": [3, 0], "form": "ABL P X"}, {"ending": "is", "pos": "N", "note": "", "n": [3, 1], "form": "ACC P C"}, {"ending": "es", "pos": "N", "note": "", "n": [3, 1], "form": "ACC P C"}, {"ending": "e", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "ABL S N"}, {"ending": "", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "ACC S N"}, {"ending": "a", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "NOM P N"}, {"ending": "a", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "VOC P N"}, {"ending": "um", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "GEN P N"}, {"ending": "ium", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "GEN P N"}, {"ending": "a", "pos": "N", "note": "stem_ends_in_cons", "n": [3, 2], "form": "ACC P N"}, {"ending": "i", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ABL S C"}, {"ending": "em", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ACC S C"}, {"ending": "im", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ACC S C"}, {"ending": "is", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "NOM P C"}, {"ending": "ium", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "GEN P C"}, {"ending": "um", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "GEN P C"}, {"ending": "is", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ACC P C"}, {"ending": "es", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ACC P C"}, {"ending": "eis", "pos": "N", "note": "i-stems_m-f", "n": [3, 3], "form": "ACC P C"}, {"ending": "i", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "ABL S N"}, {"ending": "", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "ACC S N"}, {"ending": "ia", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "NOM P N"}, {"ending": "ia", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "VOC P N"}, {"ending": "ium", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "GEN P N"}, {"ending": "um", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "GEN P N"}, {"ending": "ia", "pos": "N", "note": "i-stems_n", "n": [3, 4], "form": "ACC P N"}, {"ending": "is", "pos": "N", "note": "greek", "n": [3, 6], "form": "GEN S C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 6], "form": "ACC S C"}, {"ending": "em", "pos": "N", "note": "greek", "n": [3, 6], "form": "ACC S C"}, {"ending": "um", "pos": "N", "note": "greek", "n": [3, 6], "form": "GEN S C"}, {"ending": "as", "pos": "N", "note": "greek", "n": [3, 6], "form": "ACC S C"}, {"ending": "os", "pos": "N", "note": "greek", "n": [3, 7], "form": "GEN S X"}, {"ending": "e", "pos": "N", "note": "greek", "n": [3, 7], "form": "ABL S N"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 7], "form": "ACC S X"}, {"ending": "em", "pos": "N", "note": "greek", "n": [3, 7], "form": "ACC S X"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 7], "form": "NOM P N"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 7], "form": "VOC P N"}, {"ending": "um", "pos": "N", "note": "greek", "n": [3, 7], "form": "GEN P X"}, {"ending": "as", "pos": "N", "note": "greek", "n": [3, 7], "form": "ACC P C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 7], "form": "ACC P N"}, {"ending": "e", "pos": "N", "note": "greek", "n": [3, 8], "form": "VOC S X"}, {"ending": "eu", "pos": "N", "note": "greek", "n": [3, 8], "form": "VOC S X"}, {"ending": "os", "pos": "N", "note": "greek", "n": [3, 8], "form": "GEN S X"}, {"ending": "i", "pos": "N", "note": "greek", "n": [3, 8], "form": "GEN S X"}, {"ending": "em", "pos": "N", "note": "greek", "n": [3, 8], "form": "ACC S X"}, {"ending": "es", "pos": "N", "note": "greek", "n": [3, 8], "form": "ACC S X"}, {"ending": "en", "pos": "N", "note": "greek", "n": [3, 8], "form": "ACC S X"}, {"ending": "um", "pos": "N", "note": "greek", "n": [3, 8], "form": "GEN P C"}, {"ending": "ium", "pos": "N", "note": "greek", "n": [3, 8], "form": "GEN P C"}, {"ending": "is", "pos": "N", "note": "greek", "n": [3, 8], "form": "ACC P C"}, {"ending": "is", "pos": "N", "note": "greek", "n": [3, 9], "form": "NOM S X"}, {"ending": "os", "pos": "N", "note": "greek", "n": [3, 9], "form": "GEN S X"}, {"ending": "i", "pos": "N", "note": "greek", "n": [3, 9], "form": "ABL S X"}, {"ending": "in", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "in", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC S X"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 9], "form": "NOM P N"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 9], "form": "VOC P N"}, {"ending": "ium", "pos": "N", "note": "greek", "n": [3, 9], "form": "GEN P X"}, {"ending": "on", "pos": "N", "note": "greek", "n": [3, 9], "form": "GEN P X"}, {"ending": "is", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC P C"}, {"ending": "as", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC P C"}, {"ending": "a", "pos": "N", "note": "greek", "n": [3, 9], "form": "ACC P N"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "NOM S C"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "VOC S C"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "GEN S C"}, {"ending": "os", "pos": "N", "note": "", "n": [4, 1], "form": "GEN S C"}, {"ending": "i", "pos": "N", "note": "", "n": [4, 1], "form": "GEN S C"}, {"ending": "ui", "pos": "N", "note": "", "n": [4, 1], "form": "DAT S C"}, {"ending": "u", "pos": "N", "note": "", "n": [4, 1], "form": "DAT S C"}, {"ending": "u", "pos": "N", "note": "", "n": [4, 0], "form": "ABL S X"}, {"ending": "um", "pos": "N", "note": "", "n": [4, 1], "form": "ACC S C"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "NOM P C"}, {"ending": "uus", "pos": "N", "note": "", "n": [4, 1], "form": "NOM P C"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "VOC P C"}, {"ending": "uus", "pos": "N", "note": "", "n": [4, 1], "form": "VOC P C"}, {"ending": "uum", "pos": "N", "note": "", "n": [4, 0], "form": "GEN P X"}, {"ending": "um", "pos": "N", "note": "", "n": [4, 0], "form": "GEN P X"}, {"ending": "ibus", "pos": "N", "note": "", "n": [4, 0], "form": "DAT P X"}, {"ending": "ubus", "pos": "N", "note": "", "n": [4, 0], "form": "DAT P X"}, {"ending": "ibus", "pos": "N", "note": "", "n": [4, 0], "form": "ABL P X"}, {"ending": "ubus", "pos": "N", "note": "", "n": [4, 0], "form": "ABL P X"}, {"ending": "us", "pos": "N", "note": "", "n": [4, 1], "form": "ACC P C"}, {"ending": "uus", "pos": "N", "note": "", "n": [4, 1], "form": "ACC P C"}, {"ending": "u", "pos": "N", "note": "u", "n": [4, 2], "form": "NOM S N"}, {"ending": "u", "pos": "N", "note": "u", "n": [4, 2], "form": "VOC S N"}, {"ending": "us", "pos": "N", "note": "u", "n": [4, 2], "form": "GEN S N"}, {"ending": "u", "pos": "N", "note": "u", "n": [4, 2], "form": "DAT S N"}, {"ending": "u", "pos": "N", "note": "u", "n": [4, 2], "form": "ACC S N"}, {"ending": "ua", "pos": "N", "note": "u", "n": [4, 2], "form": "NOM P N"}, {"ending": "ua", "pos": "N", "note": "u", "n": [4, 2], "form": "VOC P N"}, {"ending": "ua", "pos": "N", "note": "u", "n": [4, 2], "form": "ACC P N"}, {"ending": "us", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "NOM S C"}, {"ending": "u", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "VOC S C"}, {"ending": "u", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "GEN S C"}, {"ending": "u", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "DAT S C"}, {"ending": "em", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "ACC S C"}, {"ending": "um", "pos": "N", "note": "jesus_jesu", "n": [4, 3], "form": "ACC S C"}, {"ending": "es", "pos": "N", "note": "", "n": [5, 1], "form": "NOM S C"}, {"ending": "es", "pos": "N", "note": "", "n": [5, 1], "form": "VOC S C"}, {"ending": "ei", "pos": "N", "note": "", "n": [5, 1], "form": "GEN S C"}, {"ending": "e", "pos": "N", "note": "", "n": [5, 1], "form": "GEN S C"}, {"ending": "i", "pos": "N", "note": "", "n": [5, 1], "form": "GEN S C"}, {"ending": "ei", "pos": "N", "note": "", "n": [5, 1], "form": "DAT S C"}, {"ending": "e", "pos": "N", "note": "", "n": [5, 1], "form": "DAT S C"}, {"ending": "i", "pos": "N", "note": "", "n": [5, 1], "form": "DAT S C"}, {"ending": "e", "pos": "N", "note": "", "n": [5, 1], "form": "ABL S C"}, {"ending": "em", "pos": "N", "note": "", "n": [5, 1], "form": "ACC S C"}, {"ending": "es", "pos": "N", "note": "", "n": [5, 1], "form": "NOM P C"}, {"ending": "es", "pos": "N", "note": "", "n": [5, 1], "form": "VOC P C"}, {"ending": "erum", "pos": "N", "note": "", "n": [5, 1], "form": "GEN P C"}, {"ending": "ebus", "pos": "N", "note": "", "n": [5, 1], "form": "DAT P C"}, {"ending": "ebus", "pos": "N", "note": "", "n": [5, 1], "form": "ABL P C"}, {"ending": "eis", "pos": "N", "note": "", "n": [5, 1], "form": "ABL P C"}, {"ending": "es", "pos": "N", "note": "", "n": [5, 1], "form": "ACC P C"}, {"ending": "X A", "pos": "N", "note": "abbreviation", "n": [9, 8], "form": "X X X"}, {"ending": "X A", "pos": "N", "note": "not_declined", "n": [9, 9], "form": "X X X"}, {"ending": "1 2 us", "pos": "ADJ", "note": "", "n": [1, 1], "form": "NOM S M"}, {"ending": "2 1 i", "pos": "ADJ", "note": "", "n": [1, 1], "form": "GEN S M"}, {"ending": "2 1 o", "pos": "ADJ", "note": "", "n": [1, 1], "form": "DAT S M"}, {"ending": "2 2 um", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ACC S M"}, {"ending": "2 1 o", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ABL S M"}, {"ending": "1 1 e", "pos": "ADJ", "note": "", "n": [1, 1], "form": "VOC S M"}, {"ending": "2 1 i", "pos": "ADJ", "note": "", "n": [1, 0], "form": "NOM P M"}, {"ending": "2 4 orum", "pos": "ADJ", "note": "", "n": [1, 0], "form": "GEN P M"}, {"ending": "2 2 is", "pos": "ADJ", "note": "", "n": [1, 0], "form": "DAT P X"}, {"ending": "2 2 os", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ACC P M"}, {"ending": "2 2 is", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ABL P X"}, {"ending": "2 1 i", "pos": "ADJ", "note": "", "n": [1, 0], "form": "VOC P M"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "NOM S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "", "n": [1, 1], "form": "GEN S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "", "n": [1, 1], "form": "DAT S F"}, {"ending": "2 2 am", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ACC S F"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ABL S F"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "VOC S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "", "n": [1, 0], "form": "NOM P F"}, {"ending": "2 4 arum", "pos": "ADJ", "note": "", "n": [1, 0], "form": "GEN P F"}, {"ending": "2 2 as", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ACC P F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "", "n": [1, 0], "form": "VOC P F"}, {"ending": "2 2 um", "pos": "ADJ", "note": "", "n": [1, 1], "form": "NOM S N"}, {"ending": "2 1 i", "pos": "ADJ", "note": "", "n": [1, 1], "form": "GEN S N"}, {"ending": "2 1 o", "pos": "ADJ", "note": "", "n": [1, 1], "form": "DAT S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "", "n": [1, 1], "form": "ACC S N"}, {"ending": "2 1 o", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ABL S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "", "n": [1, 1], "form": "VOC S N"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "NOM P N"}, {"ending": "2 4 orum", "pos": "ADJ", "note": "", "n": [1, 0], "form": "GEN P N"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "ACC P N"}, {"ending": "2 1 a", "pos": "ADJ", "note": "", "n": [1, 0], "form": "VOC P N"}, {"ending": "3 2 or", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM S C"}, {"ending": "3 4 oris", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN S C"}, {"ending": "3 3 ori", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT S X"}, {"ending": "3 4 orem", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC S C"}, {"ending": "3 3 ore", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL S X"}, {"ending": "3 3 ori", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL S X"}, {"ending": "3 2 or", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC S C"}, {"ending": "3 4 ores", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM P C"}, {"ending": "3 4 orum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN P X"}, {"ending": "3 6 oribu", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT P X"}, {"ending": "3 4 ores", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC P C"}, {"ending": "3 6 oribu", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL P X"}, {"ending": "3 4 ores", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC P C"}, {"ending": "3 2 us", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM S N"}, {"ending": "3 4 oris", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN S N"}, {"ending": "3 2 us", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC S N"}, {"ending": "3 2 us", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC S N"}, {"ending": "3 3 ora", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM P N"}, {"ending": "3 3 ora", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC P N"}, {"ending": "3 3 ora", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC P N"}, {"ending": "4 3 mus", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM S M"}, {"ending": "4 2 mi", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN S M"}, {"ending": "4 2 mo", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT S M"}, {"ending": "4 3 mum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC S M"}, {"ending": "4 2 mo", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL S M"}, {"ending": "4 2 me", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC S M"}, {"ending": "4 2 mi", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM P M"}, {"ending": "4 5 morum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN P M"}, {"ending": "4 3 mis", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT P X"}, {"ending": "4 3 mos", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC P M"}, {"ending": "4 3 mis", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL P X"}, {"ending": "4 2 mi", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC P M"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM S F"}, {"ending": "4 3 mae", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN S F"}, {"ending": "4 3 mae", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT S F"}, {"ending": "4 3 mam", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC S F"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL S F"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC S F"}, {"ending": "4 3 mae", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM P F"}, {"ending": "4 5 marum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN P F"}, {"ending": "4 3 mas", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC P F"}, {"ending": "4 3 mae", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC P F"}, {"ending": "4 3 mum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM S N"}, {"ending": "4 2 mi", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN S N"}, {"ending": "4 2 mo", "pos": "ADJ", "note": "", "n": [0, 0], "form": "DAT S N"}, {"ending": "4 3 mum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC S N"}, {"ending": "4 2 mo", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ABL S N"}, {"ending": "4 3 mum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC S N"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "NOM P N"}, {"ending": "4 5 morum", "pos": "ADJ", "note": "", "n": [0, 0], "form": "GEN P N"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "ACC P N"}, {"ending": "4 2 ma", "pos": "ADJ", "note": "", "n": [0, 0], "form": "VOC P N"}, {"ending": "1 0", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "NOM S M"}, {"ending": "2 1 i", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "GEN S M"}, {"ending": "2 1 o", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "DAT S M"}, {"ending": "1 0", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "VOC S M"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "GEN S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "DAT S F"}, {"ending": "2 2 um", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "NOM S N"}, {"ending": "2 1 i", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "GEN S N"}, {"ending": "2 1 o", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "DAT S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "ACC S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "first_and_second", "n": [1, 2], "form": "VOC S N"}, {"ending": "1 2 us", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "NOM S M"}, {"ending": "2 3 ius", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "GEN S X"}, {"ending": "2 1 i", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "DAT S X"}, {"ending": "2 1 o", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "DAT S X"}, {"ending": "1 2 us", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "VOC S M"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "NOM S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "ACC S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 3], "form": "VOC S N"}, {"ending": "1 0", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "NOM S M"}, {"ending": "2 3 ius", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "GEN S X"}, {"ending": "2 1 i", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "DAT S X"}, {"ending": "1 0", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "VOC S M"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "NOM S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "ACC S N"}, {"ending": "2 2 um", "pos": "ADJ", "note": "nullus_alius", "n": [1, 4], "form": "VOC S N"}, {"ending": "1 2 us", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "NOM S M"}, {"ending": "2 2 us", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S X"}, {"ending": "2 4 enus", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S X"}, {"ending": "2 1 i", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S M"}, {"ending": "2 1 i", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "DAT S X"}, {"ending": "2 1 o", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "DAT S M"}, {"ending": "2 0", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "DAT S M"}, {"ending": "1 2 us", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "VOC S M"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "DAT S F"}, {"ending": "2 2 ud", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "NOM S N"}, {"ending": "2 1 d", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "NOM S N"}, {"ending": "2 2 ut", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "NOM S N"}, {"ending": "2 1 s", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S N"}, {"ending": "2 1 i", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "GEN S N"}, {"ending": "2 2 ud", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "ACC S N"}, {"ending": "2 1 d", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "ACC S N"}, {"ending": "2 2 ut", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "ACC S N"}, {"ending": "2 2 ud", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "VOC S N"}, {"ending": "2 3 eis", "pos": "ADJ", "note": "nullus_alius", "n": [1, 5], "form": "ABL P N"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "NOM S F"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "VOC S F"}, {"ending": "es", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "GEN S F"}, {"ending": "es", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "LOC S F"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "DAT S F"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "ABL S F"}, {"ending": "en", "pos": "ADJ", "note": "greek", "n": [2, 1], "form": "ACC S F"}, {"ending": "2 1 a", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "NOM S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "GEN S F"}, {"ending": "2 2 ae", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "DAT S F"}, {"ending": "2 2 am", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "ACC S F"}, {"ending": "2 1 a", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "ABL S F"}, {"ending": "2 1 a", "pos": "ADJ", "note": "greek", "n": [2, 2], "form": "VOC S F"}, {"ending": "es", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "NOM S X"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "VOC S X"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "VOC S X"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "GEN S X"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "LOC S X"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "DAT S X"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "ABL S X"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "ABL S X"}, {"ending": "en", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "ACC S X"}, {"ending": "am", "pos": "ADJ", "note": "greek", "n": [2, 3], "form": "ACC S X"}, {"ending": "os", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "NOM S C"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "VOC S C"}, {"ending": "i", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "GEN S C"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "DAT S C"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "ABL S C"}, {"ending": "on", "pos": "ADJ", "note": "greek", "n": [2, 6], "form": "ACC S C"}, {"ending": "os", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "NOM S M"}, {"ending": "e", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "VOC S M"}, {"ending": "i", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "GEN S M"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "DAT S M"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "ABL S M"}, {"ending": "on", "pos": "ADJ", "note": "greek", "n": [2, 7], "form": "ACC S M"}, {"ending": "on", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "NOM S N"}, {"ending": "on", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "VOC S N"}, {"ending": "i", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "GEN S N"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "DAT S N"}, {"ending": "o", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "ABL S N"}, {"ending": "on", "pos": "ADJ", "note": "greek", "n": [2, 8], "form": "ACC S N"}, {"ending": "i", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "GEN P M"}, {"ending": "is", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "DAT P X"}, {"ending": "os", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "ACC P M"}, {"ending": "is", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "ABL P X"}, {"ending": "i", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "VOC P M"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "GEN P F"}, {"ending": "as", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "ACC P F"}, {"ending": "ae", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "VOC P F"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "GEN P N"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "ACC P N"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [2, 0], "form": "VOC P N"}, {"ending": "", "pos": "ADJ", "note": "", "n": [3, 1], "form": "NOM S X"}, {"ending": "is", "pos": "ADJ", "note": "", "n": [3, 0], "form": "GEN S X"}, {"ending": "i", "pos": "ADJ", "note": "", "n": [3, 0], "form": "DAT S X"}, {"ending": "em", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ACC S C"}, {"ending": "i", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ABL S X"}, {"ending": "e", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ABL S X"}, {"ending": "", "pos": "ADJ", "note": "", "n": [3, 1], "form": "VOC S X"}, {"ending": "es", "pos": "ADJ", "note": "", "n": [3, 0], "form": "NOM P C"}, {"ending": "ium", "pos": "ADJ", "note": "", "n": [3, 0], "form": "GEN P X"}, {"ending": "um", "pos": "ADJ", "note": "", "n": [3, 0], "form": "GEN P X"}, {"ending": "ibus", "pos": "ADJ", "note": "", "n": [3, 0], "form": "DAT P X"}, {"ending": "es", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ACC P C"}, {"ending": "is", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ACC P C"}, {"ending": "ibus", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ABL P X"}, {"ending": "es", "pos": "ADJ", "note": "", "n": [3, 0], "form": "VOC P C"}, {"ending": "", "pos": "ADJ", "note": "", "n": [3, 1], "form": "ACC S N"}, {"ending": "ia", "pos": "ADJ", "note": "", "n": [3, 0], "form": "NOM P N"}, {"ending": "ia", "pos": "ADJ", "note": "", "n": [3, 0], "form": "ACC P N"}, {"ending": "ia", "pos": "ADJ", "note": "", "n": [3, 0], "form": "VOC P N"}, {"ending": "is", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "NOM S C"}, {"ending": "is", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "VOC S C"}, {"ending": "e", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "NOM S N"}, {"ending": "e", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "ACC S N"}, {"ending": "e", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "VOC S N"}, {"ending": "eis", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "NOM P C"}, {"ending": "eis", "pos": "ADJ", "note": "two_endings", "n": [3, 2], "form": "ACC P C"}, {"ending": "", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "NOM S M"}, {"ending": "", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "VOC S M"}, {"ending": "is", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "NOM S F"}, {"ending": "is", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "VOC S F"}, {"ending": "e", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "NOM S N"}, {"ending": "e", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "ACC S N"}, {"ending": "e", "pos": "ADJ", "note": "three_endings", "n": [3, 3], "form": "VOC S N"}, {"ending": "", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "NOM S X"}, {"ending": "os", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "GEN S X"}, {"ending": "a", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "ACC S C"}, {"ending": "", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "ACC S N"}, {"ending": "", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "VOC S X"}, {"ending": "as", "pos": "ADJ", "note": "greek", "n": [3, 6], "form": "ACC P C"}, {"ending": "", "pos": "ADJ", "note": "greek", "n": [9, 8], "form": "X X X X"}, {"ending": "", "pos": "ADJ", "note": "greek", "n": [9, 9], "form": "X X X X"}, {"ending": "o", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 1 S"}, {"ending": "as", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 2 S"}, {"ending": "at", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 3 S"}, {"ending": "amus", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 1 P"}, {"ending": "atis", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 2 P"}, {"ending": "ant", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IND 3 P"}, {"ending": "abam", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "abas", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "abat", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "abamus", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "abatis", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "abant", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "abo", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 1 S"}, {"ending": "abis", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 2 S"}, {"ending": "abit", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 3 S"}, {"ending": "abimus", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 1 P"}, {"ending": "abitis", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 2 P"}, {"ending": "abunt", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IND 3 P"}, {"ending": "i", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 1 S"}, {"ending": "isti", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 1 P"}, {"ending": "istis", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 2 P"}, {"ending": "erunt", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 3 P"}, {"ending": "ere", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE IND 3 P"}, {"ending": "eram", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 1 S"}, {"ending": "eras", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 2 S"}, {"ending": "erat", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 3 S"}, {"ending": "eramus", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 1 P"}, {"ending": "eratis", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 2 P"}, {"ending": "erant", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE IND 3 P"}, {"ending": "ero", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 2 S"}, {"ending": "erit", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 3 S"}, {"ending": "erimus", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 1 P"}, {"ending": "eritis", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 2 P"}, {"ending": "erint", "pos": "V", "note": "", "n": [0, 0], "form": "FUTP ACTIVE IND 3 P"}, {"ending": "or", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 1 S"}, {"ending": "aris", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "are", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "atur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 3 S"}, {"ending": "amur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 1 P"}, {"ending": "amini", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 2 P"}, {"ending": "antur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IND 3 P"}, {"ending": "abar", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 1 S"}, {"ending": "abaris", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "abare", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "abatur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 3 S"}, {"ending": "abamur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 1 P"}, {"ending": "abamini", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 2 P"}, {"ending": "abantur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE IND 3 P"}, {"ending": "abor", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 1 S"}, {"ending": "aberis", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "abere", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "abitur", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 3 S"}, {"ending": "abimur", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 1 P"}, {"ending": "abimini", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 2 P"}, {"ending": "abuntur", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IND 3 P"}, {"ending": "em", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "es", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "et", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "emus", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "etis", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "ent", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "arem", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "ares", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "aret", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "aremus", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "aretis", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "arent", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "erim", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 2 S"}, {"ending": "erit", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 3 S"}, {"ending": "erimus", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 1 P"}, {"ending": "eritis", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 2 P"}, {"ending": "erint", "pos": "V", "note": "", "n": [0, 0], "form": "PERF ACTIVE SUB 3 P"}, {"ending": "issem", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 1 S"}, {"ending": "isses", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 2 S"}, {"ending": "isset", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 3 S"}, {"ending": "issemus", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 1 P"}, {"ending": "issetis", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 2 P"}, {"ending": "issent", "pos": "V", "note": "", "n": [0, 0], "form": "PLUP ACTIVE SUB 3 P"}, {"ending": "er", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "ere", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "etur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 3 S"}, {"ending": "emur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 1 P"}, {"ending": "emini", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 2 P"}, {"ending": "entur", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE SUB 3 P"}, {"ending": "arer", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "areris", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "arere", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "aretur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "aremur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "aremini", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "arentur", "pos": "V", "note": "", "n": [1, 1], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "a", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ate", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "ato", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ato", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "atote", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "anto", "pos": "V", "note": "", "n": [1, 1], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "are", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "amini", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "ator", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "ator", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "antor", "pos": "V", "note": "", "n": [1, 1], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "are", "pos": "V", "note": "", "n": [1, 1], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "", "n": [1, 1], "form": "PERF ACTIVE INF 0 X"}, {"ending": "ari", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "arier", "pos": "V", "note": "", "n": [1, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "eo", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 1 S"}, {"ending": "es", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 2 S"}, {"ending": "et", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 3 S"}, {"ending": "emus", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 1 P"}, {"ending": "etis", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 2 P"}, {"ending": "ent", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IND 3 P"}, {"ending": "ebam", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ebas", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ebat", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ebamus", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ebatis", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ebant", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "ebo", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 1 S"}, {"ending": "ebis", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 2 S"}, {"ending": "ebit", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 3 S"}, {"ending": "ebimus", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 1 P"}, {"ending": "ebitis", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 2 P"}, {"ending": "ebunt", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IND 3 P"}, {"ending": "eor", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "ere", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "etur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 3 S"}, {"ending": "emur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 1 P"}, {"ending": "emini", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 2 P"}, {"ending": "entur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IND 3 P"}, {"ending": "ebar", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 1 S"}, {"ending": "ebaris", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "ebare", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "ebatur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 3 S"}, {"ending": "ebamur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 1 P"}, {"ending": "ebamini", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 2 P"}, {"ending": "ebantur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE IND 3 P"}, {"ending": "ebor", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 1 S"}, {"ending": "eberis", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "ebere", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "ebitur", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 3 S"}, {"ending": "ebimur", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 1 P"}, {"ending": "ebimini", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 2 P"}, {"ending": "ebuntur", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IND 3 P"}, {"ending": "eam", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "eas", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "eat", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "eamus", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "eatis", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "eant", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "erem", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "eres", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "eret", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "eremus", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "eretis", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "erent", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "ear", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 1 S"}, {"ending": "earis", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "eare", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "eatur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 3 S"}, {"ending": "eamur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 1 P"}, {"ending": "eamini", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 2 P"}, {"ending": "eantur", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE SUB 3 P"}, {"ending": "erer", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "ereris", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "erere", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "eretur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "eremur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "eremini", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "erentur", "pos": "V", "note": "", "n": [2, 1], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "e", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ete", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "eto", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "eto", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "etote", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "ento", "pos": "V", "note": "", "n": [2, 1], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "ere", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "emini", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "etor", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "etor", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "entor", "pos": "V", "note": "", "n": [2, 1], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "ere", "pos": "V", "note": "", "n": [2, 1], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "", "n": [2, 1], "form": "PERF ACTIVE INF 0 X"}, {"ending": "eri", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "erier", "pos": "V", "note": "", "n": [2, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "o", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE IND 1 S"}, {"ending": "is", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IND 1 P"}, {"ending": "itis", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IND 2 P"}, {"ending": "unt", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE IND 3 P"}, {"ending": "ebam", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ebas", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ebat", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ebamus", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ebatis", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ebant", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "am", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 1 S"}, {"ending": "es", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 2 S"}, {"ending": "et", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 3 S"}, {"ending": "emus", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 1 P"}, {"ending": "etis", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 2 P"}, {"ending": "ent", "pos": "V", "note": "", "n": [3, 0], "form": "FUT ACTIVE IND 3 P"}, {"ending": "or", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "ere", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "itur", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE IND 3 S"}, {"ending": "imur", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE IND 1 P"}, {"ending": "imini", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE IND 2 P"}, {"ending": "untur", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE IND 3 P"}, {"ending": "ebar", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 1 S"}, {"ending": "ebaris", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "ebare", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "ebatur", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 3 S"}, {"ending": "ebamur", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 1 P"}, {"ending": "ebamini", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 2 P"}, {"ending": "ebantur", "pos": "V", "note": "", "n": [3, 0], "form": "IMPF PASSIVE IND 3 P"}, {"ending": "ar", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 2 S"}, {"ending": "ere", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 2 S"}, {"ending": "etur", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 3 S"}, {"ending": "emur", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 1 P"}, {"ending": "emini", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 2 P"}, {"ending": "entur", "pos": "V", "note": "", "n": [3, 0], "form": "FUT PASSIVE IND 3 P"}, {"ending": "am", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "as", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "at", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "amus", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "atis", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "ant", "pos": "V", "note": "", "n": [3, 0], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "erem", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "eres", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "eret", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "eremus", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "eretis", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "erent", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "ar", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 1 S"}, {"ending": "aris", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "are", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "atur", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 3 S"}, {"ending": "amur", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 1 P"}, {"ending": "amini", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 2 P"}, {"ending": "antur", "pos": "V", "note": "", "n": [3, 0], "form": "PRES PASSIVE SUB 3 P"}, {"ending": "erer", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "ereris", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "erere", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "eretur", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "eremur", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "eremini", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "erentur", "pos": "V", "note": "", "n": [3, 1], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "e", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ite", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "ito", "pos": "V", "note": "", "n": [3, 1], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "", "n": [3, 1], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "itote", "pos": "V", "note": "", "n": [3, 1], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "", "n": [3, 1], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "ere", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "imini", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "itor", "pos": "V", "note": "", "n": [3, 1], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "itor", "pos": "V", "note": "", "n": [3, 1], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "untor", "pos": "V", "note": "", "n": [3, 1], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "ere", "pos": "V", "note": "", "n": [3, 1], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "", "n": [3, 1], "form": "PERF ACTIVE INF 0 X"}, {"ending": "i", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "ier", "pos": "V", "note": "", "n": [3, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "s", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IND 2 S"}, {"ending": "t", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IND 1 P"}, {"ending": "tis", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IND 2 P"}, {"ending": "ris", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE IND 2 S"}, {"ending": "re", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE IND 2 S"}, {"ending": "tur", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE IND 3 S"}, {"ending": "rem", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "res", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "ret", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "remus", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "retis", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "rent", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "rer", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "reris", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "rere", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "retur", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "remur", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "remini", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "rentur", "pos": "V", "note": "irregular", "n": [3, 2], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "te", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "re", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "imini", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "to", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "to", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "tote", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "tor", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "tor", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "untor", "pos": "V", "note": "irregular", "n": [3, 2], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "re", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PERF ACTIVE INF 0 X"}, {"ending": "ri", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE INF 0 X"}, {"ending": "rier", "pos": "V", "note": "irregular", "n": [3, 2], "form": "PRES PASSIVE INF 0 X"}, {"ending": "is", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IND 1 P"}, {"ending": "itis", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IND 2 P"}, {"ending": "eris", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES PASSIVE IND 2 S"}, {"ending": "itur", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES PASSIVE IND 3 S"}, {"ending": "erem", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "eres", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "eret", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "eremus", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "eretis", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "erent", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "erer", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "ereris", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "eretur", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "eremur", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "eremini", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "erentur", "pos": "V", "note": "irregular", "n": [3, 3], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "i", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ite", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "ito", "pos": "V", "note": "irregular", "n": [3, 3], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "irregular", "n": [3, 3], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "itote", "pos": "V", "note": "irregular", "n": [3, 3], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "iere", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE INF 0 X"}, {"ending": "ieri", "pos": "V", "note": "irregular", "n": [3, 3], "form": "PRES ACTIVE INF 0 X"}, {"ending": "is", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IND 1 P"}, {"ending": "itis", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IND 2 P"}, {"ending": "bam", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "bas", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "bat", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "bamus", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "batis", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "bant", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "bo", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 1 S"}, {"ending": "bis", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 2 S"}, {"ending": "bit", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 3 S"}, {"ending": "bimus", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 1 P"}, {"ending": "bitis", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 2 P"}, {"ending": "bunt", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IND 3 P"}, {"ending": "iris", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE IND 2 S"}, {"ending": "ire", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE IND 2 S"}, {"ending": "itur", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE IND 3 S"}, {"ending": "bor", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 1 S"}, {"ending": "beris", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 2 S"}, {"ending": "berit", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 3 S"}, {"ending": "bimur", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 1 P"}, {"ending": "bimini", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 2 P"}, {"ending": "buntur", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IND 3 P"}, {"ending": "irem", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "ires", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "iret", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "iremus", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "iretis", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "irent", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "irer", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "ireris", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "irere", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "iretur", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "iremur", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "iremini", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "irentur", "pos": "V", "note": "", "n": [3, 4], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "i", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ite", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "ito", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "itote", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "", "n": [3, 4], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "ire", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "imini", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "itor", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "itor", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "untor", "pos": "V", "note": "", "n": [3, 4], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "ire", "pos": "V", "note": "", "n": [3, 4], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "", "n": [3, 4], "form": "PERF ACTIVE INF 0 X"}, {"ending": "iri", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE INF 0 X"}, {"ending": "irier", "pos": "V", "note": "", "n": [3, 4], "form": "PRES PASSIVE INF 0 X"}, {"ending": "um", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 1 S"}, {"ending": "es", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 2 S"}, {"ending": "est", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 3 S"}, {"ending": "umus", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 1 P"}, {"ending": "estis", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 2 P"}, {"ending": "unt", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE IND 3 P"}, {"ending": "eram", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "eras", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "erat", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "eramus", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "eratis", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "erant", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "ero", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 2 S"}, {"ending": "erit", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 3 S"}, {"ending": "erimus", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 1 P"}, {"ending": "eritis", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 2 P"}, {"ending": "erunt", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 3 P"}, {"ending": "erint", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE IND 3 P"}, {"ending": "im", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "is", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "it", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "imus", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "itis", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "int", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "essem", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "esses", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "esset", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "essemus", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "essetis", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "essent", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "forem", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "fores", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "foret", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "foremus", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "foretis", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "forent", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "es", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "este", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "esto", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "esto", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "estote", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "esse", "pos": "V", "note": "like_to_be", "n": [5, 1], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "PERF ACTIVE INF 0 X"}, {"ending": "fore", "pos": "V", "note": "like_to_be", "n": [5, 0], "form": "FUT ACTIVE INF 0 X"}, {"ending": "em", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "es", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "et", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "emus", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "etis", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "ent", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "erint", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "FUT ACTIVE IND 3 P"}, {"ending": "e", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "like_to_be", "n": [5, 2], "form": "PERF ACTIVE INF 0 X"}, {"ending": "o", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 1 S"}, {"ending": "s", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 2 S"}, {"ending": "t", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 3 S"}, {"ending": "mus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 1 P"}, {"ending": "tis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 2 P"}, {"ending": "unt", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IND 3 P"}, {"ending": "bam", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "bas", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "bat", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "bamus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "batis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "bant", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "ebam", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ebas", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ebat", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ebamus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ebatis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ebant", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "bo", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 1 S"}, {"ending": "bis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 2 S"}, {"ending": "bit", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 3 S"}, {"ending": "bimus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 1 P"}, {"ending": "bitis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 2 P"}, {"ending": "bunt", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 3 P"}, {"ending": "am", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 1 S"}, {"ending": "es", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 2 S"}, {"ending": "et", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 3 S"}, {"ending": "emus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 1 P"}, {"ending": "etis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 2 P"}, {"ending": "ent", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IND 3 P"}, {"ending": "or", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 1 S"}, {"ending": "ris", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "re", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 2 S"}, {"ending": "tur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 3 S"}, {"ending": "mur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 1 P"}, {"ending": "mini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 2 P"}, {"ending": "untur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IND 3 P"}, {"ending": "bar X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 1 S"}, {"ending": "baris X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "bare X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 2 S"}, {"ending": "batur X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 3 S"}, {"ending": "bamur X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 1 P"}, {"ending": "bamini X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 2 P"}, {"ending": "bantur X", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE IND 3 P"}, {"ending": "bor", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 1 S"}, {"ending": "beris", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "bere", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "bitur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 3 S"}, {"ending": "bimur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 1 P"}, {"ending": "bimini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 P"}, {"ending": "buntur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 3 P"}, {"ending": "ar", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 1 S"}, {"ending": "eris", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "ere", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 S"}, {"ending": "etur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 3 S"}, {"ending": "emur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 1 P"}, {"ending": "emini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 2 P"}, {"ending": "entur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IND 3 P"}, {"ending": "am", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "as", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "at", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "amus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "atis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "ant", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "rem", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "res", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "ret", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "remus", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "retis", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "rent", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "ar", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 1 S"}, {"ending": "aris", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "are", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 2 S"}, {"ending": "atur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 3 S"}, {"ending": "amur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 1 P"}, {"ending": "amini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 2 P"}, {"ending": "antur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE SUB 3 P"}, {"ending": "rer", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 1 S"}, {"ending": "reris", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "rere", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 2 S"}, {"ending": "retur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 3 S"}, {"ending": "remur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 1 P"}, {"ending": "remini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 2 P"}, {"ending": "rentur", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "IMPF PASSIVE SUB 3 P"}, {"ending": "", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "te", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "to", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "to", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "tote", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "ere", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IMP 2 S"}, {"ending": "mini", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE IMP 2 P"}, {"ending": "tor", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IMP 2 S"}, {"ending": "tor", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IMP 3 S"}, {"ending": "untor", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "FUT PASSIVE IMP 3 P"}, {"ending": "re", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PERF ACTIVE INF 0 X"}, {"ending": "ri", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "rier", "pos": "V", "note": "eo_ire", "n": [6, 1], "form": "PRES PASSIVE INF 0 X"}, {"ending": "o", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE IND 1 S"}, {"ending": "umus", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE IND 1 P"}, {"ending": "unt", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE IND 3 P"}, {"ending": "ebam", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ebas", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ebat", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ebamus", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ebatis", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ebant", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "am", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 1 S"}, {"ending": "es", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 2 S"}, {"ending": "et", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 3 S"}, {"ending": "emus", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 1 P"}, {"ending": "etis", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 2 P"}, {"ending": "ent", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IND 3 P"}, {"ending": "im", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "is", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "it", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "imus", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "itis", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "int", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "lem", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "les", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "let", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "lemus", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "letis", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "lent", "pos": "V", "note": "volere", "n": [6, 2], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "i", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ite", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "ito", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "itote", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "unto", "pos": "V", "note": "volere", "n": [6, 2], "form": "FUT ACTIVE IMP 3 P"}, {"ending": "le", "pos": "V", "note": "volere", "n": [6, 2], "form": "PRES ACTIVE INF 0 X"}, {"ending": "isse", "pos": "V", "note": "volere", "n": [6, 2], "form": "PERF ACTIVE INF 0 X"}, {"ending": "o", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE IND 1 S"}, {"ending": "is", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE IND 3 S"}, {"ending": "unt", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE IND 3 P"}, {"ending": "ebam", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ebas", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ebat", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ebamus", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ebatis", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ebant", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "ibam", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 1 S"}, {"ending": "ibas", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 2 S"}, {"ending": "ibat", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "ibamus", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 1 P"}, {"ending": "ibatis", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 2 P"}, {"ending": "ibant", "pos": "V", "note": "defective", "n": [7, 1], "form": "IMPF ACTIVE IND 3 P"}, {"ending": "it", "pos": "V", "note": "defective", "n": [7, 1], "form": "PERF ACTIVE IND 3 S"}, {"ending": "ias", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "iat", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "iant", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "i", "pos": "V", "note": "defective", "n": [7, 1], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "am", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 1 S"}, {"ending": "is", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 1 P"}, {"ending": "itis", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 2 P"}, {"ending": "unt", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IND 3 P"}, {"ending": "ebat", "pos": "V", "note": "defective", "n": [7, 2], "form": "IMPF ACTIVE IND 3 S"}, {"ending": "es", "pos": "V", "note": "defective", "n": [7, 2], "form": "FUT ACTIVE IND 2 S"}, {"ending": "et", "pos": "V", "note": "defective", "n": [7, 2], "form": "FUT ACTIVE IND 3 S"}, {"ending": "i", "pos": "V", "note": "defective", "n": [7, 2], "form": "PERF ACTIVE IND 1 S"}, {"ending": "isti", "pos": "V", "note": "defective", "n": [7, 2], "form": "PERF ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "defective", "n": [7, 2], "form": "PERF ACTIVE IND 3 S"}, {"ending": "e", "pos": "V", "note": "defective", "n": [7, 2], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "defective", "n": [7, 2], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "ito", "pos": "V", "note": "defective", "n": [7, 2], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IND 2 S"}, {"ending": "t", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IND 3 S"}, {"ending": "tis", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IND 2 P"}, {"ending": "tur", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IND 3 S"}, {"ending": "im", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 1 S"}, {"ending": "is", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 2 S"}, {"ending": "it", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 3 S"}, {"ending": "imus", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 1 P"}, {"ending": "itis", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 2 P"}, {"ending": "int", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE SUB 3 P"}, {"ending": "sem", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 1 S"}, {"ending": "ses", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 2 S"}, {"ending": "set", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "semus", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 1 P"}, {"ending": "setis", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 2 P"}, {"ending": "sent", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 3 P"}, {"ending": "setur", "pos": "V", "note": "defective", "n": [7, 3], "form": "IMPF ACTIVE SUB 3 S"}, {"ending": "", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IMP 2 S"}, {"ending": "te", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE IMP 2 P"}, {"ending": "to", "pos": "V", "note": "defective", "n": [7, 3], "form": "FUT ACTIVE IMP 2 S"}, {"ending": "to", "pos": "V", "note": "defective", "n": [7, 3], "form": "FUT ACTIVE IMP 3 S"}, {"ending": "tote", "pos": "V", "note": "defective", "n": [7, 3], "form": "FUT ACTIVE IMP 2 P"}, {"ending": "se", "pos": "V", "note": "defective", "n": [7, 3], "form": "PRES ACTIVE INF 0 X"}, {"ending": "o", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 1 S"}, {"ending": "is", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 2 S"}, {"ending": "it", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 3 S"}, {"ending": "imus", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 1 P"}, {"ending": "itis", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 2 P"}, {"ending": "int", "pos": "V", "note": "", "n": [8, 0], "form": "FUTP ACTIVE IND 3 P"}, {"ending": "im", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 1 S"}, {"ending": "is", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 2 S"}, {"ending": "it", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 3 S"}, {"ending": "imus", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 1 P"}, {"ending": "itis", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 2 P"}, {"ending": "int", "pos": "V", "note": "", "n": [8, 0], "form": "PERF ACTIVE SUB 3 P"}, {"ending": "em", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 1 S"}, {"ending": "es", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 2 S"}, {"ending": "et", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 3 S"}, {"ending": "emus", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 1 P"}, {"ending": "etis", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 2 P"}, {"ending": "ent", "pos": "V", "note": "", "n": [8, 0], "form": "PLUP ACTIVE SUB 3 P"}, {"ending": "e", "pos": "V", "note": "", "n": [8, 0], "form": "PRES ACTIVE INF 0 X"}, {"ending": "", "pos": "V", "note": "", "n": [9, 8], "form": "X X X 0 X 1 0"}, {"ending": "", "pos": "V", "note": "", "n": [9, 9], "form": "X X X 0 X 1 0"}, {"ending": "ans", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "antis", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "anti", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "antem", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "anti", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ante", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ans", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "antes", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "antium", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "antum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "antibus", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "antes", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "antibus", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "antes", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ans", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "antia", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "antia", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "antia", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "entis", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "entem", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ente", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "entium", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "entis", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "entem", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ente", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "entium", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "entis", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "entem", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ente", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "entium", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [5, 1], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "untis", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "unti", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "untem", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "unti", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "unte", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "untes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "untium", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "untibus", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "untes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "untibus", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "untes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "untia", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "untia", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "untia", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "entis", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "entem", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ente", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "entium", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "entis", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "GEN S X PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "DAT S X PRES ACTIVE PPL"}, {"ending": "entem", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ACC S C PRES ACTIVE PPL"}, {"ending": "enti", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ente", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ABL S X PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "VOC S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "entium", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "GEN P X PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "DAT P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ACC P C PRES ACTIVE PPL"}, {"ending": "entibus", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ABL P X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "VOC P C PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ACC S N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "NOM P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "ACC P N PRES ACTIVE PPL"}, {"ending": "entia", "pos": "VPAR", "note": "participles", "n": [6, 2], "form": "VOC P N PRES ACTIVE PPL"}, {"ending": "ens", "pos": "VPAR", "note": "participles", "n": [7, 2], "form": "NOM S X PRES ACTIVE PPL"}, {"ending": "entes", "pos": "VPAR", "note": "participles", "n": [7, 2], "form": "NOM P C PRES ACTIVE PPL"}, {"ending": "us", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S M PERF PASSIVE PPL"}, {"ending": "i", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S M PERF PASSIVE PPL"}, {"ending": "o", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S M PERF PASSIVE PPL"}, {"ending": "um", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S M PERF PASSIVE PPL"}, {"ending": "o", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S M PERF PASSIVE PPL"}, {"ending": "e", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S M PERF PASSIVE PPL"}, {"ending": "i", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P M PERF PASSIVE PPL"}, {"ending": "orum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P M PERF PASSIVE PPL"}, {"ending": "is", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT P X PERF PASSIVE PPL"}, {"ending": "os", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P M PERF PASSIVE PPL"}, {"ending": "is", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL P X PERF PASSIVE PPL"}, {"ending": "i", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P M PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S F PERF PASSIVE PPL"}, {"ending": "ae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S F PERF PASSIVE PPL"}, {"ending": "ae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S F PERF PASSIVE PPL"}, {"ending": "am", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S F PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S F PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S F PERF PASSIVE PPL"}, {"ending": "ae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P F PERF PASSIVE PPL"}, {"ending": "arum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P F PERF PASSIVE PPL"}, {"ending": "as", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P F PERF PASSIVE PPL"}, {"ending": "ae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P F PERF PASSIVE PPL"}, {"ending": "um", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S N PERF PASSIVE PPL"}, {"ending": "i", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S N PERF PASSIVE PPL"}, {"ending": "o", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S N PERF PASSIVE PPL"}, {"ending": "um", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S N PERF PASSIVE PPL"}, {"ending": "o", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S N PERF PASSIVE PPL"}, {"ending": "um", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S N PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P N PERF PASSIVE PPL"}, {"ending": "orum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P N PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P N PERF PASSIVE PPL"}, {"ending": "a", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P N PERF PASSIVE PPL"}, {"ending": "urus", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S M FUT ACTIVE PPL"}, {"ending": "uri", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S M FUT ACTIVE PPL"}, {"ending": "uro", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S M FUT ACTIVE PPL"}, {"ending": "urum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S M FUT ACTIVE PPL"}, {"ending": "uro", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S M FUT ACTIVE PPL"}, {"ending": "ure", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S M FUT ACTIVE PPL"}, {"ending": "uri", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P M FUT ACTIVE PPL"}, {"ending": "urorum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P M FUT ACTIVE PPL"}, {"ending": "uris", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT P X FUT ACTIVE PPL"}, {"ending": "uros", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P M FUT ACTIVE PPL"}, {"ending": "uris", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL P X FUT ACTIVE PPL"}, {"ending": "uri", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P M FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S F FUT ACTIVE PPL"}, {"ending": "urae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S F FUT ACTIVE PPL"}, {"ending": "urae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S F FUT ACTIVE PPL"}, {"ending": "uram", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S F FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S F FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S F FUT ACTIVE PPL"}, {"ending": "urae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P F FUT ACTIVE PPL"}, {"ending": "urarum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P F FUT ACTIVE PPL"}, {"ending": "uras", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P F FUT ACTIVE PPL"}, {"ending": "urae", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P F FUT ACTIVE PPL"}, {"ending": "urum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM S N FUT ACTIVE PPL"}, {"ending": "uri", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN S N FUT ACTIVE PPL"}, {"ending": "uro", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "DAT S N FUT ACTIVE PPL"}, {"ending": "urum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC S N FUT ACTIVE PPL"}, {"ending": "uro", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ABL S N FUT ACTIVE PPL"}, {"ending": "urum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC S N FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "NOM P N FUT ACTIVE PPL"}, {"ending": "urorum", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "GEN P N FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "ACC P N FUT ACTIVE PPL"}, {"ending": "ura", "pos": "VPAR", "note": "participles", "n": [0, 0], "form": "VOC P N FUT ACTIVE PPL"}, {"ending": "andus", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM S M FUT PASSIVE PPL"}, {"ending": "andi", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN S M FUT PASSIVE PPL"}, {"ending": "ando", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT S M FUT PASSIVE PPL"}, {"ending": "andum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC S M FUT PASSIVE PPL"}, {"ending": "ando", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL S M FUT PASSIVE PPL"}, {"ending": "ande", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC S M FUT PASSIVE PPL"}, {"ending": "andi", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM P M FUT PASSIVE PPL"}, {"ending": "andorum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN P M FUT PASSIVE PPL"}, {"ending": "andis", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT P X FUT PASSIVE PPL"}, {"ending": "andos", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC P M FUT PASSIVE PPL"}, {"ending": "andis", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL P X FUT PASSIVE PPL"}, {"ending": "andi", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC P M FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM S F FUT PASSIVE PPL"}, {"ending": "andae", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN S F FUT PASSIVE PPL"}, {"ending": "andae", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT S F FUT PASSIVE PPL"}, {"ending": "andam", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC S F FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL S F FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC S F FUT PASSIVE PPL"}, {"ending": "andae", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM P F FUT PASSIVE PPL"}, {"ending": "andarum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN P F FUT PASSIVE PPL"}, {"ending": "andas", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC P F FUT PASSIVE PPL"}, {"ending": "andae", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC P F FUT PASSIVE PPL"}, {"ending": "andum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM S N FUT PASSIVE PPL"}, {"ending": "andi", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN S N FUT PASSIVE PPL"}, {"ending": "ando", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "DAT S N FUT PASSIVE PPL"}, {"ending": "andum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC S N FUT PASSIVE PPL"}, {"ending": "ando", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ABL S N FUT PASSIVE PPL"}, {"ending": "andum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC S N FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "NOM P N FUT PASSIVE PPL"}, {"ending": "andorum", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "GEN P N FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "ACC P N FUT PASSIVE PPL"}, {"ending": "anda", "pos": "VPAR", "note": "participles", "n": [1, 0], "form": "VOC P N FUT PASSIVE PPL"}, {"ending": "endus", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM S M FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN S M FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT S M FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC S M FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL S M FUT PASSIVE PPL"}, {"ending": "ende", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC S M FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM P M FUT PASSIVE PPL"}, {"ending": "endorum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN P M FUT PASSIVE PPL"}, {"ending": "endis", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT P X FUT PASSIVE PPL"}, {"ending": "endos", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC P M FUT PASSIVE PPL"}, {"ending": "endis", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL P X FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC P M FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT S F FUT PASSIVE PPL"}, {"ending": "endam", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC S F FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL S F FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM P F FUT PASSIVE PPL"}, {"ending": "endarum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN P F FUT PASSIVE PPL"}, {"ending": "endas", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC P F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC P F FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM S N FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN S N FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "DAT S N FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC S N FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ABL S N FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC S N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "NOM P N FUT PASSIVE PPL"}, {"ending": "endorum", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "GEN P N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "ACC P N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [2, 0], "form": "VOC P N FUT PASSIVE PPL"}, {"ending": "endus", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S M FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S M FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S M FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S M FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S M FUT PASSIVE PPL"}, {"ending": "ende", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S M FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P M FUT PASSIVE PPL"}, {"ending": "endorum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P M FUT PASSIVE PPL"}, {"ending": "endis", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT P X FUT PASSIVE PPL"}, {"ending": "endos", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P M FUT PASSIVE PPL"}, {"ending": "endis", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL P X FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P M FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S F FUT PASSIVE PPL"}, {"ending": "endam", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S F FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S F FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P F FUT PASSIVE PPL"}, {"ending": "endarum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P F FUT PASSIVE PPL"}, {"ending": "endas", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P F FUT PASSIVE PPL"}, {"ending": "endae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P F FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S N FUT PASSIVE PPL"}, {"ending": "endi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S N FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S N FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S N FUT PASSIVE PPL"}, {"ending": "endo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S N FUT PASSIVE PPL"}, {"ending": "endum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P N FUT PASSIVE PPL"}, {"ending": "endorum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P N FUT PASSIVE PPL"}, {"ending": "enda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P N FUT PASSIVE PPL"}, {"ending": "undus", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S M FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S M FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S M FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S M FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S M FUT PASSIVE PPL"}, {"ending": "unde", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S M FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P M FUT PASSIVE PPL"}, {"ending": "undorum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P M FUT PASSIVE PPL"}, {"ending": "undis", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT P X FUT PASSIVE PPL"}, {"ending": "undos", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P M FUT PASSIVE PPL"}, {"ending": "undis", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL P X FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P M FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S F FUT PASSIVE PPL"}, {"ending": "undam", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S F FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S F FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P F FUT PASSIVE PPL"}, {"ending": "undarum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P F FUT PASSIVE PPL"}, {"ending": "undas", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P F FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM S N FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN S N FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "DAT S N FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC S N FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ABL S N FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC S N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "NOM P N FUT PASSIVE PPL"}, {"ending": "undorum", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "GEN P N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "ACC P N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [3, 0], "form": "VOC P N FUT PASSIVE PPL"}, {"ending": "undus", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM S M FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN S M FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT S M FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S M FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S M FUT PASSIVE PPL"}, {"ending": "unde", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC S M FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P M FUT PASSIVE PPL"}, {"ending": "undorum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN P M FUT PASSIVE PPL"}, {"ending": "undis", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT P X FUT PASSIVE PPL"}, {"ending": "undos", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P M FUT PASSIVE PPL"}, {"ending": "undis", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL P X FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P M FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT S F FUT PASSIVE PPL"}, {"ending": "undam", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S F FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S F FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC S F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P F FUT PASSIVE PPL"}, {"ending": "undarum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN P F FUT PASSIVE PPL"}, {"ending": "undas", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P F FUT PASSIVE PPL"}, {"ending": "undae", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P F FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM S N FUT PASSIVE PPL"}, {"ending": "undi", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN S N FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "DAT S N FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC S N FUT PASSIVE PPL"}, {"ending": "undo", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ABL S N FUT PASSIVE PPL"}, {"ending": "undum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC S N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "NOM P N FUT PASSIVE PPL"}, {"ending": "undorum", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "GEN P N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "ACC P N FUT PASSIVE PPL"}, {"ending": "unda", "pos": "VPAR", "note": "participles", "n": [6, 1], "form": "VOC P N FUT PASSIVE PPL"}, {"ending": "um", "pos": "SUPINE", "note": "supine", "n": [0, 0], "form": "ACC S N"}, {"ending": "u", "pos": "SUPINE", "note": "supine", "n": [0, 0], "form": "ABL S N"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [9, 9], "form": "X X X"}, {"ending": "jus", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "GEN S X"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "DAT S X"}, {"ending": "em", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ACC S M"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ABL S M"}, {"ending": "am", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ACC S F"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ABL S N"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "GEN P M"}, {"ending": "ibus", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "DAT P X"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "DAT P X"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ACC P M"}, {"ending": "ibus", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ABL P X"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ABL P X"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "GEN P F"}, {"ending": "as", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "ACC P F"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [1, 0], "form": "GEN P N"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [1, 1], "form": "NOM S M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [1, 2], "form": "NOM S C"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [1, 5], "form": "ABL S F"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [1, 3], "form": "NOM S F"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [1, 3], "form": "ABL S F"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [1, 4], "form": "NOM S F"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [1, 4], "form": "ABL S F"}, {"ending": "id", "pos": "PRON", "note": "pronoun", "n": [1, 6], "form": "NOM S N"}, {"ending": "id", "pos": "PRON", "note": "pronoun", "n": [1, 6], "form": "ACC S N"}, {"ending": "od", "pos": "PRON", "note": "pronoun", "n": [1, 7], "form": "NOM S N"}, {"ending": "od", "pos": "PRON", "note": "pronoun", "n": [1, 7], "form": "ACC S N"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [1, 8], "form": "NOM P N"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [1, 8], "form": "ACC P N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [1, 9], "form": "NOM P N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [1, 9], "form": "ACC P N"}, {"ending": "ic", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM S M"}, {"ending": "ius", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "GEN S X"}, {"ending": "ic", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "DAT S X"}, {"ending": "unc", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ACC S M"}, {"ending": "oc", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL S M"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM P M"}, {"ending": "ii", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "GEN P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "DAT P X"}, {"ending": "ibus", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "DAT P X"}, {"ending": "iis", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "DAT P X"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ACC P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL P X"}, {"ending": "ibus", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL P X"}, {"ending": "iis", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL P X"}, {"ending": "aec", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM S F"}, {"ending": "anc", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ACC S F"}, {"ending": "ac", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL S F"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "GEN P F"}, {"ending": "as", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ACC P F"}, {"ending": "oc", "pos": "PRON", "note": "pronoun", "n": [3, 1], "form": "NOM S N"}, {"ending": "oc", "pos": "PRON", "note": "pronoun", "n": [3, 1], "form": "ACC S N"}, {"ending": "oc", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ABL S N"}, {"ending": "aec", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "GEN P N"}, {"ending": "aec", "pos": "PRON", "note": "pronoun", "n": [3, 0], "form": "ACC P N"}, {"ending": "uc", "pos": "PRON", "note": "pronoun", "n": [3, 2], "form": "NOM S N"}, {"ending": "uc", "pos": "PRON", "note": "pronoun", "n": [3, 2], "form": "ACC S N"}, {"ending": "s", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "NOM S M"}, {"ending": "ius", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "GEN S X"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "DAT S X"}, {"ending": "um", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "ACC S M"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL S M"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "NOM P M"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "GEN P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "DAT P X"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "DAT P X"}, {"ending": "s", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "DAT P X"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ACC P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL P X"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL P X"}, {"ending": "s", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL P X"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "NOM S F"}, {"ending": "am", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "ACC S F"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL S F"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "GEN P F"}, {"ending": "as", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ACC P F"}, {"ending": "d", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "NOM S N"}, {"ending": "d", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "ACC S N"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ABL S N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [4, 1], "form": "GEN P N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 0], "form": "ACC P N"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "NOM S M"}, {"ending": "un", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "ACC S M"}, {"ending": "orun", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "GEN P M"}, {"ending": "an", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "ACC S F"}, {"ending": "arun", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "GEN P F"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "NOM S N"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "ACC S N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "NOM P N"}, {"ending": "orun", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "GEN P N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [4, 2], "form": "ACC P N"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "NOM S C"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "VOC S C"}, {"ending": "ei", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "GEN S C"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "GEN S C"}, {"ending": "ihi", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "DAT S C"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "DAT S C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ACC S C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ABL S C"}, {"ending": "ed", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ACC S C"}, {"ending": "ed", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ABL S C"}, {"ending": "eme", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ACC S C"}, {"ending": "eme", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "ABL S C"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [5, 1], "form": "VOC P C"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "NOM S C"}, {"ending": "", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "VOC S C"}, {"ending": "ui", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "GEN S C"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "GEN S C"}, {"ending": "ibi", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "DAT S C"}, {"ending": "ibei", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "DAT S C"}, {"ending": "ibe", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "DAT S C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ACC S C"}, {"ending": "ed", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ACC S C"}, {"ending": "ete", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ACC S C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ABL S C"}, {"ending": "ed", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ABL S C"}, {"ending": "ete", "pos": "PRON", "note": "pronoun", "n": [5, 2], "form": "ABL S C"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "NOM P C"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "VOC P C"}, {"ending": "um", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "GEN P C"}, {"ending": "om", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "GEN P C"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "GEN P C"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "GEN P M"}, {"ending": "arum", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "GEN P F"}, {"ending": "obis", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "DAT P C"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "ACC P C"}, {"ending": "obis", "pos": "PRON", "note": "pronoun", "n": [5, 3], "form": "ABL P C"}, {"ending": "ui", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "GEN X C"}, {"ending": "ibi", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "DAT X C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "ACC X C"}, {"ending": "ese", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "ACC X C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "ABL X C"}, {"ending": "ese", "pos": "PRON", "note": "pronoun", "n": [5, 4], "form": "ABL X C"}, {"ending": "e", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "NOM S M"}, {"ending": "ius", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "GEN S X"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "DAT S X"}, {"ending": "um", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ACC S M"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ABL S M"}, {"ending": "i", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "GEN P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "DAT P X"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ACC P M"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ABL P X"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "NOM S F"}, {"ending": "am", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ACC S F"}, {"ending": "ae", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "GEN P F"}, {"ending": "as", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ACC P F"}, {"ending": "is", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ABL P F"}, {"ending": "ud", "pos": "PRON", "note": "pronoun", "n": [6, 1], "form": "NOM S N"}, {"ending": "ud", "pos": "PRON", "note": "pronoun", "n": [6, 1], "form": "ACC S N"}, {"ending": "o", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ABL S N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "GEN P N"}, {"ending": "a", "pos": "PRON", "note": "pronoun", "n": [6, 0], "form": "ACC P N"}, {"ending": "us", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "NOM S M"}, {"ending": "os", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "NOM S M"}, {"ending": "um", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "NOM S N"}, {"ending": "um", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "ACC S N"}, {"ending": "ud", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "NOM S N"}, {"ending": "ud", "pos": "PRON", "note": "pronoun", "n": [6, 2], "form": "ACC S N"}, {"ending": "us", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "NOM S M"}, {"ending": "ius", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "GEN S X"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "DAT S X"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ACC S M"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ABL S M"}, {"ending": "e", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "VOC S M"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "NOM S F"}, {"ending": "am", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ACC S F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ABL S F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "VOC S F"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "NOM S N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ACC S N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "ABL S N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "VOC S N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "NOM P M"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P M"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P M"}, {"ending": "om", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P M"}, {"ending": "obus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "DAT P M"}, {"ending": "os", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ACC P M"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ACC P M"}, {"ending": "obus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ABL P M"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "VOC P M"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "NOM P F"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "NOM P F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "NOM P F"}, {"ending": "arum", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P F"}, {"ending": "abus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "DAT P F"}, {"ending": "as", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ACC P F"}, {"ending": "abus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ABL P F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "VOC P F"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "NOM P N"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P N"}, {"ending": "om", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "GEN P N"}, {"ending": "obus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "DAT P N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ACC P N"}, {"ending": "obus", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "ABL P N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "VOC P N"}, {"ending": "es", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "NOM P C"}, {"ending": "ium", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "GEN P X"}, {"ending": "ibus", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "DAT P X"}, {"ending": "es", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "ACC P C"}, {"ending": "is X A -- G", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "ACC P C"}, {"ending": "ibus", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "ABL P X"}, {"ending": "es", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "VOC P C"}, {"ending": "ia", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "NOM P N"}, {"ending": "ia", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "ACC P N"}, {"ending": "ia", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "VOC P N"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "NOM P M"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "GEN P M"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "GEN P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "DAT P M"}, {"ending": "os", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ACC P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ABL P M"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "VOC P M"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "NOM P F"}, {"ending": "arum", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "GEN P F"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "DAT P F"}, {"ending": "as", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ACC P F"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ABL P F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "VOC P F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "NOM P N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "GEN P N"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "DAT P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ACC P N"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "ABL P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "VOC P N"}, {"ending": "", "pos": "NUM", "note": "numeral", "n": [2, 0], "form": "X X X CA"}, {"ending": "us", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM S M"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN S M"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT S M"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC S M"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL S M"}, {"ending": "e", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC S M"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P M"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT P M"}, {"ending": "os", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL P M"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P M"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM S F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN S F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT S F"}, {"ending": "am", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC S F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL S F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC S F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P F"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT P F"}, {"ending": "as", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P F"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL P F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P F"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM S N"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN S N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT S N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC S N"}, {"ending": "o", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL S N"}, {"ending": "um", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC S N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P N"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P N"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P N"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P M"}, {"ending": "um X A --", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P C"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "DAT P X"}, {"ending": "os", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P M"}, {"ending": "is", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ABL P X"}, {"ending": "i", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P M"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P F"}, {"ending": "arum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P F"}, {"ending": "as", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P F"}, {"ending": "ae", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P F"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "NOM P N"}, {"ending": "orum", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "GEN P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "ACC P N"}, {"ending": "a", "pos": "NUM", "note": "numeral", "n": [0, 0], "form": "VOC P N"}, {"ending": "4 0", "pos": "NUM", "note": "numeral", "n": [1, 1], "form": "X X X"}, {"ending": "4 0", "pos": "NUM", "note": "numeral", "n": [1, 2], "form": "X X X"}, {"ending": "4 0", "pos": "NUM", "note": "numeral", "n": [1, 3], "form": "X X X"}, {"ending": "4 3 ies", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "X X X"}, {"ending": "4 4 iens", "pos": "NUM", "note": "numeral", "n": [1, 4], "form": "X X X"}, {"ending": "4 3 ies", "pos": "NUM", "note": "numeral", "n": [2, 0], "form": "X X X"}, {"ending": "4 4 iens", "pos": "NUM", "note": "numeral", "n": [2, 0], "form": "X X X"}]
| 16,307.1 | 162,999 | 0.46573 | 25,602 | 163,071 | 2.953793 | 0.021287 | 0.044166 | 0.069185 | 0.041178 | 0.983643 | 0.981302 | 0.973817 | 0.964574 | 0.932018 | 0.903971 | 0 | 0.033611 | 0.172765 | 163,071 | 9 | 163,000 | 18,119 | 0.526983 | 0.000362 | 0 | 0 | 0 | 0 | 0.496239 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 10 |
c41ee8f248d2a26ed27fb9f922053f0e68e0c784 | 8,355 | py | Python | backend/microservices/auth/__test__/core_test/entities/make_user.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | 3 | 2021-04-26T00:17:14.000Z | 2021-07-04T15:30:09.000Z | backend/microservices/auth/__test__/core_test/entities/make_user.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | backend/microservices/auth/__test__/core_test/entities/make_user.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | import unittest
from core.entities import make_user
from core.entities.exception import *
from config import *
from __test__.core_test.util.util import *
from datetime import datetime
class MakeUserTestCase(unittest.TestCase):
def test_creating_valid_user(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmail.com"
phone = "+201234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH)
gender = "m"
birthday = datetime(1999, 7, 24)
user = make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
self.assertNotEqual(user.id, "")
self.assertNotEqual(user.id, None)
self.assertEqual(user.first_name, first_name)
self.assertEqual(user.last_name, last_name)
self.assertEqual(user.email, email)
self.assertEqual(user.phone, phone)
self.assertNotEqual(user.hashed_password, password)
self.assertEqual(user.gender, gender)
self.assertIs(user.birthday, birthday)
def test_creating_user_with_invalid_email(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "l@gmail.com"
phone = "+201234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH)
gender = "m"
birthday = datetime(1999, 7, 24)
with self.assertRaises(EmailLengthLimitExceeded) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "gmail.com"
with self.assertRaises(EmailNotValid) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmailcom"
with self.assertRaises(EmailNotValid) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
def test_creating_user_with_invalid_first_name(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH + 1)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmail.com"
phone = "+201234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH)
gender = "m"
birthday = datetime(1999, 7, 24)
with self.assertRaises(NameLengthLimitExceeded) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
first_name = generate_lowercase_string_of_length(USER_NAME_MIN_LENGTH - 1)
with self.assertRaises(NameMinLengthBeyondLimit) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
def test_creating_user_with_invalid_last_name(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH + 1)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmail.com"
phone = "+201234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH)
gender = "m"
birthday = datetime(1999, 7, 24)
with self.assertRaises(NameLengthLimitExceeded) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
last_name = generate_lowercase_string_of_length(USER_NAME_MIN_LENGTH - 1)
with self.assertRaises(NameMinLengthBeyondLimit) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
def test_creating_user_with_invalid_phone(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmail.com"
phone = "01234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH)
gender = "m"
birthday = datetime(1999, 7, 24)
with self.assertRaises(PhoneNotValid) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
def test_creating_user_with_invalid_password_length(self):
first_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
last_name = generate_lowercase_string_of_length(USER_NAME_MAX_LENGTH)
email = generate_lowercase_string_of_length(USER_EMAIL_MAX_LENGTH - len("@gmail.com")) + "@gmail.com"
phone = "+201234567890"
password = generate_lowercase_string_of_length(USER_PASSWORD_MAX_LENGTH + 1)
gender = "m"
birthday = datetime(1999, 7, 24)
with self.assertRaises(PasswordLengthLimitExceeded) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
password = generate_lowercase_string_of_length(USER_PASSWORD_MIN_LENGTH - 1)
with self.assertRaises(PasswordMinLengthBeyondLimit) as e:
make_user(
first_name=first_name,
last_name=last_name,
email=email,
phone=phone,
password=password,
profile_picture_url=None,
gender=gender,
birthday=birthday,
)
| 40.756098 | 111 | 0.595332 | 858 | 8,355 | 5.405594 | 0.078089 | 0.062096 | 0.143812 | 0.156317 | 0.868693 | 0.86395 | 0.857482 | 0.857482 | 0.836567 | 0.834627 | 0 | 0.021445 | 0.335847 | 8,355 | 204 | 112 | 40.955882 | 0.814381 | 0 | 0 | 0.746032 | 0 | 0 | 0.029567 | 0 | 0 | 0 | 0 | 0 | 0.100529 | 1 | 0.031746 | false | 0.116402 | 0.031746 | 0 | 0.068783 | 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 |
c46d54764c29e0c7edd2841ecc35d6c4d01fb5f0 | 423 | py | Python | tests/parser/hanoi-wolfgang.7discs.dl.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/hanoi-wolfgang.7discs.dl.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/hanoi-wolfgang.7discs.dl.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
number_of_moves(127).
largest_disc(7).
%------ Initial state
move(0,7654321,0,0).
% ------ Goal state
query(X,Y,Z) :- move(J,X,Y,Z).
query(0,0,7654321)?
%#maxint=7654321.
"""
output = """
number_of_moves(127).
largest_disc(7).
%------ Initial state
move(0,7654321,0,0).
% ------ Goal state
query(X,Y,Z) :- move(J,X,Y,Z).
query(0,0,7654321)?
%#maxint=7654321.
"""
| 11.432432 | 31 | 0.541371 | 64 | 423 | 3.484375 | 0.328125 | 0.143498 | 0.053812 | 0.143498 | 0.950673 | 0.950673 | 0.950673 | 0.950673 | 0.950673 | 0.950673 | 0 | 0.178042 | 0.20331 | 423 | 36 | 32 | 11.75 | 0.48368 | 0 | 0 | 0.9 | 0 | 0 | 0.920716 | 0.107417 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
6747bcb4729d18c5c2293350f255c0091dcf8822 | 19,093 | py | Python | tests/deploy/test_deploy.py | calestar/cloudformation-helper | 3e329261518a8bef827adbaad59f8e46d4fa7e3a | [
"MIT"
] | null | null | null | tests/deploy/test_deploy.py | calestar/cloudformation-helper | 3e329261518a8bef827adbaad59f8e46d4fa7e3a | [
"MIT"
] | 7 | 2021-04-30T03:45:34.000Z | 2021-09-04T18:27:16.000Z | tests/deploy/test_deploy.py | calestar/cloudformation-helper | 3e329261518a8bef827adbaad59f8e46d4fa7e3a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for valid calls to deploy."""
import mock
import os
from cloudformation_helper.utils import aws
from ..helpers import call_cfhelper, cfhelper_mocks
HERE = os.path.dirname(os.path.realpath(__file__))
CONFIG_DIR = os.path.join(HERE, "..", "data", "config")
@mock.patch.object(aws, "stack_exists", return_value=False)
def test_create(mock_aws_stack_exists):
"""Create a new stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
client_mock.create_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
def test_update(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=False)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_create_with_changeset(mock_aws_has_changeset, mock_aws_stack_exists):
"""Create a new stack using changesets"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="y\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="CREATE",
)
client_mock.execute_change_set.assert_called_once_with(
StackName="MyStackName",
ChangeSetName=aws.CHANGESET_NAME,
)
@mock.patch.object(aws, "stack_exists", return_value=False)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_create_with_changeset_no_execute(
mock_aws_has_changeset, mock_aws_stack_exists
):
"""Create a new stack using changesets, but don't execute"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="n\ny\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="CREATE",
)
client_mock.execute_change_set.assert_not_called()
client_mock.delete_change_set.assert_not_called()
@mock.patch.object(aws, "stack_exists", return_value=False)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_create_with_changeset_no_execute_cleanup(
mock_aws_has_changeset, mock_aws_stack_exists
):
"""Create a new stack using changesets, don't execute and delete changeset"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="n\nn\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="CREATE",
)
client_mock.execute_change_set.assert_not_called()
client_mock.delete_change_set.assert_called_once_with(
StackName="MyStackName",
ChangeSetName=aws.CHANGESET_NAME,
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_update_with_changeset(mock_aws_has_changeset, mock_aws_stack_exists):
"""Update an existing stack using changesets"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="y\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="UPDATE",
)
client_mock.execute_change_set.assert_called_once_with(
StackName="MyStackName",
ChangeSetName=aws.CHANGESET_NAME,
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_update_with_changeset_no_execute(
mock_aws_has_changeset, mock_aws_stack_exists
):
"""Update an existing stack using changesets but don't execute"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="n\ny\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="UPDATE",
)
client_mock.execute_change_set.assert_not_called()
client_mock.delete_change_set.assert_not_called()
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_update_with_changeset_no_execute_cleanup(
mock_aws_has_changeset, mock_aws_stack_exists
):
"""Update an existing stack using changesets, don't execute but delete changeset"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_with_changeset.cfh"),
"deploy",
"MyStackAlias",
],
input="n\nn\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="UPDATE",
)
client_mock.execute_change_set.assert_not_called()
client_mock.delete_change_set.assert_called_once_with(
StackName="MyStackName",
ChangeSetName=aws.CHANGESET_NAME,
)
@mock.patch.object(aws, "stack_exists", return_value=False)
def test_create_with_capabilities(mock_aws_stack_exists):
"""Create a new stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_with_multiple_capabilities.cfh"
),
"deploy",
"MyStackAlias",
],
)
client_mock.create_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
def test_update_with_capabilities(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_with_multiple_capabilities.cfh"
),
"deploy",
"MyStackAlias",
],
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
)
@mock.patch.object(aws, "stack_exists", return_value=False)
@mock.patch.object(aws, "has_changeset", return_value=False)
def test_create_with_changeset_and_capabilities(
mock_aws_has_changeset, mock_aws_stack_exists
):
"""Create a new stack using changesets"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_capabilities_and_changeset.cfh"
),
"deploy",
"MyStackAlias",
],
input="y\n",
)
client_mock.create_change_set.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
ChangeSetName=aws.CHANGESET_NAME,
ChangeSetType="CREATE",
)
client_mock.execute_change_set.assert_called_once_with(
StackName="MyStackName",
ChangeSetName=aws.CHANGESET_NAME,
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_PROFILE": "MyProfile"})
def test_update_profile_override_env(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyProfile",
region_name=None,
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_PROFILE": "MyProfile"})
def test_update_profile_override_both(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-profile",
"MyOtherProfile",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyOtherProfile",
region_name=None,
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
def test_update_profile_override_cli(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-profile",
"MyOtherProfile",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyOtherProfile",
region_name=None,
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_REGION": "us-east-1"})
def test_update_region_override_env(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name=None,
region_name="us-east-1",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_REGION": "us-east-1"})
def test_update_region_override_both(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-region",
"us-west-2",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name=None,
region_name="us-west-2",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
def test_update_region_override_cli(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-region",
"us-west-2",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name=None,
region_name="us-west-2",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_PROFILE": "MyProfile"})
def test_update_mixed_override(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-region",
"us-west-2",
"--config",
os.path.join(CONFIG_DIR, "valid_multistacks.cfh"),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyProfile",
region_name="us-west-2",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
def test_update_config_override(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_with_region_and_profile.cfh"
),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyCanadianProfile",
region_name="ca-central-1",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_PROFILE": "MyProfile"})
def test_update_config_and_profile_override(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_with_region_and_profile.cfh"
),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyProfile",
region_name="ca-central-1",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
@mock.patch.object(aws, "stack_exists", return_value=True)
@mock.patch.dict(os.environ, {"AWS_PROFILE": "MyProfile"})
def test_update_all_override(mock_aws_stack_exists):
"""Update an existing stack"""
with cfhelper_mocks() as (boto3_mock, session_mock, client_mock):
call_cfhelper(
[
"stack",
"--aws-profile",
"MyExplicitProfile",
"--config",
os.path.join(
CONFIG_DIR, "valid_singlestack_with_region_and_profile.cfh"
),
"deploy",
"MyStackAlias",
],
)
boto3_mock.Session.assert_called_once_with(
profile_name="MyExplicitProfile",
region_name="ca-central-1",
)
client_mock.update_stack.assert_called_once_with(
StackName="MyStackName",
TemplateBody=mock.ANY,
Capabilities=[],
)
| 31.454695 | 87 | 0.57597 | 1,911 | 19,093 | 5.408687 | 0.058608 | 0.051277 | 0.056889 | 0.069659 | 0.968266 | 0.967009 | 0.962171 | 0.961784 | 0.961784 | 0.961784 | 0 | 0.003298 | 0.317184 | 19,093 | 606 | 88 | 31.506601 | 0.789522 | 0.040329 | 0 | 0.779116 | 0 | 0 | 0.138755 | 0.033604 | 0 | 0 | 0 | 0 | 0.084337 | 1 | 0.042169 | false | 0 | 0.008032 | 0 | 0.050201 | 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 |
676518ade2fd727409d6b829165e6f0fb81a51d3 | 22,531 | py | Python | davan/http/service/roxcore/RoxcoreSpeakerCommands.py | davandev/davanserver | 0be914268c8e34d4092251508bae213cff3ef621 | [
"MIT"
] | null | null | null | davan/http/service/roxcore/RoxcoreSpeakerCommands.py | davandev/davanserver | 0be914268c8e34d4092251508bae213cff3ef621 | [
"MIT"
] | null | null | null | davan/http/service/roxcore/RoxcoreSpeakerCommands.py | davandev/davanserver | 0be914268c8e34d4092251508bae213cff3ef621 | [
"MIT"
] | null | null | null | '''
Created on 18 feb. 2017
@author: davandev
'''
import requests
import logging
import os
global logger
logger = logging.getLogger(os.path.basename(__file__))
XML_START_TAG ="""<?xml version="1.0" encoding="utf-8" standalone="yes"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>"""
XML_END_TAG = """</s:Body></s:Envelope>"""
#replace_queue_tag ="""<u:ReplaceQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio> <SourceName>davanserver_tts_service</SourceName><TrackNumber>2</TrackNumber><SearchUrl></SearchUrl><Quality>2<Quality></ListInfo><Tracks><Track1><Source>davanserver_tts_service1</Source><URL>http://192.168.2.50:8080/mp3=announcement.mp3</URL><Source>davanserver_tts_service1</Source><Id>0</Id><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;202135&quot;&gt;http://192.168.2.50:8080/mp3=announcement.mp3&lt;/res&gt;&lt;dc:title&gt;Over the Horizon1&lt;/dc:title&gt; &lt;upnp:artist&gt;Samsung&lt;/upnp:artist&gt; &lt;upnp:album&gt;Brand Music&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1><Track2><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/mp3=<replace_with_mp3_file></URL><Source>davanserver_tts_service</Source><Id>1</Id><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;1&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;202135&quot;&gt;http://192.168.2.50:8080/mp3=<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Over the Horizon&lt;/dc:title&gt; &lt;upnp:artist&gt;Samsung&lt;/upnp:artist&gt; &lt;upnp:album&gt;Brand Music&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;DIDL-Lite&gt; </Metadata></Track2></Tracks></PlayList></QueueContext></u:ReplaceQueue>"""
#replace_queue_tag ="""<u:ReplaceQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio> <SourceName>davanserver_tts_service</SourceName><TrackNumber>2</TrackNumber><SearchUrl></SearchUrl><Quality>2<Quality></ListInfo><Tracks><Track1><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/mp3=announcement.mp3</URL><Source>davanserver_tts_service</Source><Id>0</Id><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;202135&quot;&gt;http://192.168.2.50:8080/mp3=announcement.mp3&lt;/res&gt;&lt;dc:title&gt;Over the Horizon&lt;/dc:title&gt; &lt;upnp:artist&gt;Samsung&lt;/upnp:artist&gt; &lt;upnp:album&gt;Brand Music&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1><Track2><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/mp3=<replace_with_mp3_file></URL><Source>davanserver_tts_service</Source><Id>0</Id><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;202135&quot;&gt;http://192.168.2.50:8080/mp3=<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Over the Horizon&lt;/dc:title&gt; &lt;upnp:artist&gt;Samsung&lt;/upnp:artist&gt; &lt;upnp:album&gt;Brand Music&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track2></Tracks></PlayList></QueueContext></u:ReplaceQueue>"""
replace_queue_tag = """<u:ReplaceQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio><SourceName>davanserver_tts_service</SourceName><TrackNumber>1</TrackNumber><SearchUrl></SearchUrl><Quality>2</Quality></ListInfo><Tracks><Track1><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/mp3=<replace_with_mp3_file></URL><Source>davanserver_tts_service</Source><Id>0</Id><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;202135&quot;&gt;http://192.168.2.50:8080/mp3=<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Over the Horizon&lt;/dc:title&gt; &lt;upnp:artist&gt;Samsung&lt;/upnp:artist&gt; &lt;upnp:album&gt;Brand Music&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1></Tracks></PlayList></QueueContext></u:ReplaceQueue>"""
CREATE_QUEUE_TAG = """<u:CreateQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio><SourceName>davanserver_tts_service</SourceName><TrackNumber>1</TrackNumber><SearchUrl></SearchUrl><Quality>2</Quality><RealIndex>4</RealIndex></ListInfo><Tracks><Track1><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/testb-mp3</URL><Source>davanserver_tts_service</Source><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;1071&quot;&gt;http://192.168.2.50:8080/mp3=<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Hangouts Message&lt;/dc:title&gt; &lt;upnp:artist&gt;&amp;lt;unknown&amp;gt;&lt;/upnp:artist&gt; &lt;upnp:album&gt;Notifications&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1></Tracks></PlayList></QueueContext></u:CreateQueue>"""
APPEND_TRACK_IN_QUEUE = """<u:AppendTracksInQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio><SourceName>davanserver_tts_service</SourceName><TrackNumber>1</TrackNumber><SearchUrl></SearchUrl><Quality>2</Quality><RealIndex>4</RealIndex></ListInfo><Tracks><Track1><Source>davanserver_tts_service</Source><URL>http://192.168.2.50:8080/mp3=<replace_with_mp3_file></URL><Source>davanserver_tts_service</Source><Id>0</Id><Key>http://so.ard.iyyin.com/s/song_with_out?q=Emergency_20170115_215820%20%3Cunknown%3E&amp;size=50&amp;page=1</Key><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;5480&quot;&gt;http://192.168.2.50:8080/mp3=<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Emergency_20170115_215820&lt;/dc:title&gt; &lt;upnp:artist&gt;&amp;lt;unknown&amp;gt;&lt;/upnp:artist&gt; &lt;upnp:album&gt;&amp;lt;unknown&amp;gt;&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1></Tracks></PlayList></QueueContext></u:AppendTracksInQueue>"""
APPEND_EXT_TRACK_IN_QUEUE = """<u:AppendTracksInQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueContext><?xml version="1.0" ?><PlayList><ListName>davanserver_tts_service</ListName><ListInfo><Radio>0</Radio><SourceName>davanserver_tts_service</SourceName><TrackNumber>1</TrackNumber><SearchUrl></SearchUrl><Quality>2</Quality><RealIndex>4</RealIndex></ListInfo><Tracks><Track1><Source>davanserver_tts_service</Source><URL><replace_with_mp3_file></URL><Source>davanserver_tts_service</Source><Id>0</Id><Key>http://so.ard.iyyin.com/s/song_with_out?q=Emergency_20170115_215820%20%3Cunknown%3E&amp;size=50&amp;page=1</Key><Metadata>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt; &lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt; &lt;item&gt; &lt;song:bitrate&gt;0&lt;/song:bitrate&gt; &lt;song:id&gt;0&lt;/song:id&gt;&lt;song:singerid&gt;0&lt;/song:singerid&gt;&lt;song:albumid&gt;0&lt;/song:albumid&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;5480&quot;&gt;<replace_with_mp3_file>&lt;/res&gt;&lt;dc:title&gt;Emergency_20170115_215820&lt;/dc:title&gt; &lt;upnp:artist&gt;&amp;lt;unknown&amp;gt;&lt;/upnp:artist&gt; &lt;upnp:album&gt;&amp;lt;unknown&amp;gt;&lt;/upnp:album&gt; &lt;upnp:albumArtURI&gt;&lt;/upnp:albumArtURI&gt; &lt;/item&gt; &lt;/DIDL-Lite&gt; </Metadata></Track1></Tracks></PlayList></QueueContext></u:AppendTracksInQueue>"""
BROWSE_QUEUE = """<u:BrowseQueue xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueName>CurrentQueue</QueueName></u:BrowseQueue></s:Body></s:Envelope>"""
SET_PLAY_MODE = """<u:SetPlayMode xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><NewPlayMode>NORMAL</NewPlayMode></u:SetPlayMode>"""
GET_PLAY_TYPE = """<u:GetPlayType xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:GetPlayType>"""
PLAY_QUEUE = """<u:PlayQueueWithIndex xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><QueueName>davanserver_tts_service</QueueName><Index>1</Index></u:PlayQueueWithIndex>"""
PLAY = """<u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play>"""
PAUSE = """<u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:Pause>"""
STOP = """<u:Stop xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:Stop>"""
SET_VOLUME = """<u:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Single</Channel><DesiredVolume>30</DesiredVolume></u:SetVolume>"""
GET_INFO = """<u:GetInfoEx xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:GetInfoEx>"""
headers = {'content-type': 'text/xml;charset="utf-8"'}
URL_PLAY_QUEUE = "/upnp/control/PlayQueue1"
URL_RENDER_TRANSPORT = "/upnp/control/rendertransport1"
URL_RENDER_CONTROL = "/upnp/control/rendercontrol1"
def set_queue_loop_mode(host_address):
logger.debug("execute command [set queue loop mode]")
url = host_address + URL_PLAY_QUEUE
headers = {'content-type': 'text/xml;charset="utf-8"','Soapaction':'"urn:schemas-wiimu-com:service:PlayQueue:1#SetQueueLoopMode"'}
body = """<?xml version="1.0" encoding="utf-8" standalone="yes"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetQueueLoopMode xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"><LoopMode>2</LoopMode></u:SetQueueLoopMode></s:Body></s:Envelope>"""
send_command(url, body, headers)
def get_queue_loop_mode(host_address):
logger.debug("execute command [get queue loop mode]")
url = host_address + URL_PLAY_QUEUE
headers = {'content-type': 'text/xml;charset="utf-8"','Soapaction':'"urn:schemas-wiimu-com:service:PlayQueue:1#GetQueueLoopMode"'}
body = """<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:GetQueueLoopMode xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1"></u:GetQueueLoopMode></s:Body></s:Envelope>"""
send_command(url, body, headers)
def create_queue(host_address):
logger.debug("execute command [create queue]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#CreateQueue"'
body = XML_START_TAG + CREATE_QUEUE_TAG + XML_END_TAG
send_command(url, body, headers)
def replace_queue(host_address, msg):
logger.debug("execute command [replace queue]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#ReplaceQueue"'
queue_cmd = replace_queue_tag.replace('<replace_with_mp3_file>', msg)
body = XML_START_TAG + queue_cmd + XML_END_TAG
send_command(url, body, headers)
def append_tracks_in_queue(host_address, msg):
logger.debug("execute command [append tracks in queue]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#AppendTracksInQueue"'
append = APPEND_TRACK_IN_QUEUE.replace('<replace_with_mp3_file>', msg)
body = XML_START_TAG + append + XML_END_TAG
send_command(url, body, headers)
def append_external_tracks_in_queue(host_address, msg):
logger.debug("execute command [append tracks in queue]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#AppendTracksInQueue"'
append = APPEND_EXT_TRACK_IN_QUEUE.replace('<replace_with_mp3_file>', msg)
body = XML_START_TAG + append + XML_END_TAG
send_command(url, body, headers)
def browse_queue(host_address):
logger.debug("execute command [browse queue]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#BrowseQueue"'
body = XML_START_TAG + BROWSE_QUEUE + XML_END_TAG
send_command(url, body, headers)
def send_play_with_index(host_address):
logger.debug("execute command [send play with index]")
url = host_address + URL_PLAY_QUEUE
headers['Soapaction'] = '"urn:schemas-wiimu-com:service:PlayQueue:1#PlayQueueWithIndex"'
body = XML_START_TAG + PLAY_QUEUE + XML_END_TAG
send_command(url, body, headers)
def set_play_mode(host_address):
logger.debug("execute command [set play mode]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] = '"urn:schemas-upnp-org:service:AVTransport:1#SetPlayMode"'
body = XML_START_TAG + SET_PLAY_MODE + XML_END_TAG
send_command(url, body, headers)
def get_play_type(host_address):
logger.debug("execute command [get play type]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] = '"urn:schemas-upnp-org:service:AVTransport:1#GetPlayType"'
body = XML_START_TAG + GET_PLAY_TYPE + XML_END_TAG
send_command(url, body, headers)
def pause(host_address):
logger.debug("execute command [send pause]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] ='"urn:schemas-upnp-org:service:AVTransport:1#Pause"'
body = XML_START_TAG + PAUSE + XML_END_TAG
send_command(url, body, headers)
def stop(host_address):
logger.debug("execute command [send stop]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] = '"urn:schemas-upnp-org:service:AVTransport:1#Stop"'
body = XML_START_TAG + STOP + XML_END_TAG
send_command(url, body, headers)
def send_play(host_address):
logger.debug("execute command [send play]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] = '"urn:schemas-upnp-org:service:AVTransport:1#Play"'
body = XML_START_TAG + PLAY + XML_END_TAG
send_command(url, body, headers)
def set_volume(host_address):
logger.debug("execute command [set volume]")
url = host_address + URL_RENDER_CONTROL
headers['Soapaction'] ='"urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"'
body = XML_START_TAG + SET_VOLUME + XML_END_TAG
send_command(url, body, headers)
def get_info(host_address):
logger.debug("execute command [get info]")
url = host_address + URL_RENDER_TRANSPORT
headers['Soapaction'] = '"urn:schemas-upnp-org:service:AVTransport:1#GetInfoEx"'
body = XML_START_TAG + GET_INFO + XML_END_TAG
return send_command(url, body, headers)
def send_command(url, body, headers):
r = requests.post(url,data=body,headers=headers)
logger.debug("Received response [" + str(r.status_code) +"]")
return r | 147.261438 | 3,311 | 0.736851 | 4,016 | 22,531 | 4.049054 | 0.052042 | 0.060574 | 0.05381 | 0.071951 | 0.913843 | 0.903388 | 0.903388 | 0.877437 | 0.864276 | 0.846381 | 0 | 0.025964 | 0.052994 | 22,531 | 153 | 3,312 | 147.261438 | 0.736139 | 0.295548 | 0 | 0.278689 | 0 | 0.131148 | 0.748091 | 0.441064 | 0 | 0 | 0 | 0 | 0 | 1 | 0.131148 | false | 0 | 0.02459 | 0 | 0.172131 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
67cf108e3c416064c549a81df8434d2f5ac27f12 | 161 | py | Python | asana/resources/custom_field_settings.py | shubhamdipt/python-asana | 8e05328fe8605638128be9fce449fbd34a646e01 | [
"MIT"
] | null | null | null | asana/resources/custom_field_settings.py | shubhamdipt/python-asana | 8e05328fe8605638128be9fce449fbd34a646e01 | [
"MIT"
] | null | null | null | asana/resources/custom_field_settings.py | shubhamdipt/python-asana | 8e05328fe8605638128be9fce449fbd34a646e01 | [
"MIT"
] | null | null | null |
from .gen.custom_field_settings import _CustomFieldSettings
class CustomFieldSettings(_CustomFieldSettings):
"""Custom Field Settings resource"""
pass
| 23 | 59 | 0.801242 | 15 | 161 | 8.333333 | 0.666667 | 0.176 | 0.304 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 161 | 6 | 60 | 26.833333 | 0.892857 | 0.186335 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 7 |
e1fb8bc7b6f16f4d02a6a3b1d9d14284e1208d2e | 167 | py | Python | chap5/5-3.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | 1 | 2022-02-21T07:05:48.000Z | 2022-02-21T07:05:48.000Z | chap5/5-3.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | null | null | null | chap5/5-3.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | null | null | null | alien_color='red'
if alien_color=='green':
print("The player can get 5 points.")
alien_color='green'
if alien_color=='green':
print("The player can get 5 points.")
| 20.875 | 38 | 0.718563 | 28 | 167 | 4.142857 | 0.428571 | 0.344828 | 0.387931 | 0.293103 | 0.758621 | 0.758621 | 0.758621 | 0.758621 | 0.758621 | 0.758621 | 0 | 0.013699 | 0.125749 | 167 | 7 | 39 | 23.857143 | 0.780822 | 0 | 0 | 0.666667 | 0 | 0 | 0.443114 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 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 | 0 | 0 | 10 |
c00800c58f704d4d2ffe632e87adaaf0189ac014 | 364 | py | Python | pava/implementation/natives/sun/java2d/loops/DrawGlyphList.py | laffra/pava | 54d10cf7f8def2f96e254c0356623d08f221536f | [
"MIT"
] | 4 | 2017-03-30T16:51:16.000Z | 2020-10-05T12:25:47.000Z | pava/implementation/natives/sun/java2d/loops/DrawGlyphList.py | laffra/pava | 54d10cf7f8def2f96e254c0356623d08f221536f | [
"MIT"
] | null | null | null | pava/implementation/natives/sun/java2d/loops/DrawGlyphList.py | laffra/pava | 54d10cf7f8def2f96e254c0356623d08f221536f | [
"MIT"
] | null | null | null | def add_native_methods(clazz):
def DrawGlyphList__sun_java2d_SunGraphics2D__sun_java2d_SurfaceData__sun_font_GlyphList__(a0, a1, a2, a3):
raise NotImplementedError()
clazz.DrawGlyphList__sun_java2d_SunGraphics2D__sun_java2d_SurfaceData__sun_font_GlyphList__ = DrawGlyphList__sun_java2d_SunGraphics2D__sun_java2d_SurfaceData__sun_font_GlyphList__
| 52 | 183 | 0.881868 | 43 | 364 | 6.44186 | 0.418605 | 0.194946 | 0.238267 | 0.379061 | 0.768953 | 0.768953 | 0.768953 | 0.768953 | 0.768953 | 0.768953 | 0 | 0.038922 | 0.082418 | 364 | 6 | 184 | 60.666667 | 0.790419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
c02166d2163b6dc3a8aed472e9043a880f42b08f | 235 | py | Python | classes/embeds/__init__.py | SushiPython/Sunny | 51d6a2019974e606191c9d33524102ddebb3f47a | [
"MIT"
] | 34 | 2019-02-06T14:07:37.000Z | 2022-01-18T08:18:26.000Z | classes/embeds/__init__.py | SushiPython/Sunny | 51d6a2019974e606191c9d33524102ddebb3f47a | [
"MIT"
] | 31 | 2019-04-25T08:29:14.000Z | 2022-01-14T15:26:34.000Z | classes/embeds/__init__.py | SushiPython/Sunny | 51d6a2019974e606191c9d33524102ddebb3f47a | [
"MIT"
] | 15 | 2018-08-21T20:35:26.000Z | 2021-07-18T03:05:54.000Z | from classes.embeds.OsuProfileEmbed import OsuProfileEmbed
from classes.embeds.OsuRecentEmbed import OsuRecentEmbed
from classes.embeds.OsuListEmbed import OsuListEmbed
from classes.embeds.OsuPerformanceEmbed import OsuPerformanceEmbed | 58.75 | 66 | 0.902128 | 24 | 235 | 8.833333 | 0.333333 | 0.207547 | 0.320755 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 235 | 4 | 66 | 58.75 | 0.963636 | 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 |
c023b34ed2d2b2c894d7a0a08445aba0a3e82994 | 153 | py | Python | account/forms.py | tienv2i/miiapp | e94ade6a02cfedd11fdbb456304cfa8ae4d4d9b6 | [
"MIT"
] | null | null | null | account/forms.py | tienv2i/miiapp | e94ade6a02cfedd11fdbb456304cfa8ae4d4d9b6 | [
"MIT"
] | null | null | null | account/forms.py | tienv2i/miiapp | e94ade6a02cfedd11fdbb456304cfa8ae4d4d9b6 | [
"MIT"
] | null | null | null | from django import forms
class LoginForm(forms.Form):
username = forms.CharField(max_length=20)
password = forms.CharField(max_length=255)
| 25.5 | 46 | 0.738562 | 20 | 153 | 5.55 | 0.7 | 0.252252 | 0.306306 | 0.414414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03937 | 0.169935 | 153 | 6 | 47 | 25.5 | 0.834646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.25 | 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 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 7 |
c02f1ca3797fba458e4e9d30a0d138fe9aa2f974 | 62,017 | py | Python | rl4circopt/rules_test.py | kiss2u/google-research | 2cd66234656f9e2f4218ed90a2d8aa9cf3139093 | [
"Apache-2.0"
] | 7 | 2020-03-15T12:14:07.000Z | 2021-12-01T07:01:09.000Z | rl4circopt/rules_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | rl4circopt/rules_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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.
# Lint as: python3
"""Tests for rules."""
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
from scipy import stats
from rl4circopt import architecture
from rl4circopt import circuit
from rl4circopt import rules
from rl4circopt import transform
# TODO(tfoesel):
# in the unit tests for the concrete Transformation rules (InvertCnot,
# CancelOperations, ExchangeCommutingOperations, ExchangePhasedXwithRotZ,
# ExchangePhasedXwithControlledZ, CompressLocalOperations), add an additional
# check that the operator for the output circuit matches that of the input
# circuit.
def _random_operation(*qubits):
return circuit.Operation(
circuit.MatrixGate(stats.unitary_group.rvs(2 ** len(qubits))),
qubits
)
def _elementwise_is(sequence_a, sequence_b):
sequence_a = tuple(sequence_a)
sequence_b = tuple(sequence_b)
if len(sequence_a) == len(sequence_b):
return all(
elem_a is elem_b
for elem_a, elem_b in zip(sequence_a, sequence_b)
)
else:
return False
def _cmp_attention_circs(attention_circ_a, attention_circ_b):
return (
_elementwise_is(
attention_circ_a.focus(),
attention_circ_b.focus()
)
and _elementwise_is(
attention_circ_a.context().before(),
attention_circ_b.context().before()
)
and _elementwise_is(
attention_circ_a.context().between(),
attention_circ_b.context().between()
)
and _elementwise_is(
attention_circ_a.context().after(),
attention_circ_b.context().after()
)
and attention_circ_a.locations() == attention_circ_b.locations()
)
class DummyArchitecture:
def __init__(self, test_case, *gates):
self.test_case = test_case
self.gates = gates
def decompose_single_qubit_gate(self, pauli_transform):
self.test_case.assertIs(type(pauli_transform), np.ndarray)
self.test_case.assertEqual(pauli_transform.dtype, float)
self.test_case.assertTupleEqual(pauli_transform.shape, (3, 3))
for gate in self.gates:
if np.allclose(pauli_transform, gate.get_pauli_transform()):
return [gate]
assert False, 'pauli_transform does not match any of the given gates'
class UncallableArchitecture:
def decompose_single_qubit_gate(self, pauli_transform): # argument needed to match signature, so pylint: disable=unused-argument
assert False, 'this method should never be called'
class TransformationRuleTest(parameterized.TestCase):
def test_scan(self):
# preparation work
# (Note that ExchangeCommutingOperations.transformations_from_scanner() is
# trusted from its own unit test.)
rule = rules.ExchangeCommutingOperations()
circ = circuit.Circuit(7, [
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.RotZGate(0.42), [0]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [1]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.ControlledZGate(), [1, 2])
])
# call the function to be tested
transformations = tuple(rule.scan(circ))
# check the length of transformations
self.assertLen(transformations, 4)
self.assertTrue(all(
isinstance(transformation, transform.Transformation)
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (0, 1))
self.assertTupleEqual(transformations[1].locations(), (0, 2))
self.assertTupleEqual(transformations[2].locations(), (1, 4))
self.assertTupleEqual(transformations[3].locations(), (4, 5))
def test_apply_first(self):
# preparation work
# (Note that CancelOperations.transformations_from_scanner() is trusted
# from its own unit test.)
rule = rules.CancelOperations()
operation_a = circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [0])
operation_b = circuit.Operation(circuit.ControlledZGate(), [1, 2])
operation_c = circuit.Operation(circuit.ControlledZGate(), [0, 1])
operation_d = circuit.Operation(circuit.RotZGate(0.137), [2])
operation_e = circuit.Operation(circuit.RotZGate(0.42), [0])
operation_f = circuit.Operation(circuit.RotZGate(-0.42), [0])
operation_g = circuit.Operation(circuit.ControlledZGate(), [0, 1])
operation_h = circuit.Operation(circuit.ControlledZGate(), [1, 2])
circ_0 = circuit.Circuit(3, [
operation_a,
operation_b,
operation_c,
operation_d,
operation_e,
operation_f,
operation_g,
operation_h
])
# call the function to be tested for the first time
circ_1 = rule.apply_first(circ_0)
# check type for circ_1
self.assertTrue(type(circ_1), circuit.Circuit)
# check value for circ_1
self.assertLen(circ_1, 6)
self.assertTrue(_elementwise_is(
circ_1.get_operation_sequence(),
[
operation_a,
operation_b,
operation_c,
operation_d,
operation_g,
operation_h
]
))
# call the function to be tested for the second time
circ_2 = rule.apply_first(circ_1)
# check type for circ_2
self.assertTrue(type(circ_2), circuit.Circuit)
# check value for circ_2
self.assertLen(circ_2, 4)
self.assertTrue(_elementwise_is(
circ_2.get_operation_sequence(),
[
operation_a,
operation_b,
operation_d,
operation_h
]
))
# call the function to be tested for the second time
circ_3 = rule.apply_first(circ_2)
self.assertIsNone(circ_3) # there was no transformation applicable anymore
def test_apply_greedily(self):
# preparation work
# (Note that CancelOperations.transformations_from_scanner() is trusted
# from its own unit test.)
rule = rules.CancelOperations()
operation_a = circuit.Operation(circuit.RotZGate(0.1234), [0])
operation_b = circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [0])
operation_c = circuit.Operation(circuit.ControlledZGate(), [1, 2])
operation_d = circuit.Operation(circuit.RotZGate(-0.42), [3])
operation_e = circuit.Operation(circuit.ControlledZGate(), [2, 3])
operation_f = circuit.Operation(circuit.RotZGate(0.42), [3])
operation_g = circuit.Operation(circuit.PhasedXGate(-0.815, 0.4711), [0])
operation_h = circuit.Operation(circuit.ControlledZGate(), [1, 2])
operation_i = circuit.Operation(circuit.RotZGate(0.137), [1])
operation_j = circuit.Operation(circuit.RotZGate(-0.137), [1])
operation_k = circuit.Operation(circuit.ControlledZGate(), [0, 1])
circ_in = circuit.Circuit(4, [
operation_a,
operation_b,
operation_c,
operation_d,
operation_e,
operation_f,
operation_g,
operation_h,
operation_i,
operation_j,
operation_k
])
# call the function to be tested
circ_out = rule.apply_greedily(circ_in)
# check type for circ_out
self.assertTrue(type(circ_out), circuit.Circuit)
# check value for circ_out
self.assertLen(circ_out, 7)
self.assertTrue(_elementwise_is(
circ_out.get_operation_sequence(),
[
operation_a,
operation_c,
operation_d,
operation_e,
operation_f,
operation_h,
operation_k
]
))
class InvertCnotTest(parameterized.TestCase):
@parameterized.parameters([
[1, 5],
[4, 3]
])
def test_normal_cnot(self, src_qubit, tgt_qubit):
# preparation work
cnot_gate = circuit.MatrixGate(np.array([
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
[0.0, 0.0, 1.0, 0.0]
]))
operation_in = circuit.Operation(cnot_gate, [src_qubit, tgt_qubit])
hadamard_gate = circuit.MatrixGate(np.sqrt(0.5) * np.array([
[1.0, 1.0],
[1.0, -1.0]
]))
rule = rules.InvertCnot(DummyArchitecture(self, hadamard_gate))
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform()
operations_out = tuple(rule.perform(operation_in))
# check the length of operations_out
self.assertLen(operations_out, 5)
self.assertTrue(all(
type(operation) is circuit.Operation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for operation in operations_out
))
# check that operations_out[0] is a Hadamard gate on src_qubit
self.assertIs(operations_out[0].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[0].get_qubits(), (src_qubit,))
# check that operations_out[1] is a Hadamard gate on tgt_qubit
self.assertIs(operations_out[1].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[1].get_qubits(), (tgt_qubit,))
# check that operations_out[2] is the CNOT gate on the inverted qubits
self.assertIs(operations_out[2].get_gate(), cnot_gate)
self.assertTupleEqual(operations_out[2].get_qubits(),
(tgt_qubit, src_qubit))
# check that operations_out[3] is a Hadamard gate on src_qubit
self.assertIs(operations_out[3].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[3].get_qubits(), (src_qubit,))
# check that operations_out[4] is a Hadamard gate on tgt_qubit
self.assertIs(operations_out[4].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[4].get_qubits(), (tgt_qubit,))
@parameterized.parameters([
[1, 5],
[4, 3]
])
def test_inverted_cnot(self, src_qubit, tgt_qubit):
# preparation work
inv_cnot_gate = circuit.MatrixGate(np.array([
[1.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, 1.0, 0.0, 0.0]
]))
operation_in = circuit.Operation(inv_cnot_gate, [src_qubit, tgt_qubit])
hadamard_gate = circuit.MatrixGate(np.sqrt(0.5) * np.array([
[1.0, 1.0],
[1.0, -1.0]
]))
rule = rules.InvertCnot(DummyArchitecture(self, hadamard_gate))
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform()
operations_out = tuple(rule.perform(operation_in))
# check the length of operations_out
self.assertLen(operations_out, 5)
self.assertTrue(all(
type(operation) is circuit.Operation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for operation in operations_out
))
# check that operations_out[0] is a Hadamard gate on src_qubit
self.assertIs(operations_out[0].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[0].get_qubits(), (src_qubit,))
# check that operations_out[1] is a Hadamard gate on tgt_qubit
self.assertIs(operations_out[1].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[1].get_qubits(), (tgt_qubit,))
# check that operations_out[2] is the inv_cnot_gate on the inverted qubits
self.assertIs(operations_out[2].get_gate(), inv_cnot_gate)
self.assertTupleEqual(operations_out[2].get_qubits(),
(tgt_qubit, src_qubit))
# check that operations_out[3] is a Hadamard gate on src_qubit
self.assertIs(operations_out[3].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[3].get_qubits(), (src_qubit,))
# check that operations_out[4] is a Hadamard gate on tgt_qubit
self.assertIs(operations_out[4].get_gate(), hadamard_gate)
self.assertTupleEqual(operations_out[4].get_qubits(), (tgt_qubit,))
@parameterized.parameters([
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [1]),
circuit.Operation(circuit.RotZGate(0.42), [3]),
circuit.Operation(circuit.ControlledZGate(), [1, 2])
])
def test_negative(self, operation):
# preparation work
rule = rules.InvertCnot(UncallableArchitecture())
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operation)
def test_transformations_from_scanner(self):
# preparation work
rule = rules.InvertCnot(UncallableArchitecture())
cnot_gate = circuit.MatrixGate(np.array([
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
[0.0, 0.0, 1.0, 0.0]
]))
inv_cnot_gate = circuit.MatrixGate(np.array([
[1.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, 1.0, 0.0, 0.0]
]))
scanner = rules.CircuitScanner(circuit.Circuit(7, [
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(inv_cnot_gate, [2, 3]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.ControlledZGate(), [3, 4]),
circuit.Operation(cnot_gate, [4, 5]),
circuit.Operation(circuit.RotZGate(0.42), [5]),
circuit.Operation(circuit.ControlledZGate(), [5, 6])
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 2)
self.assertTrue(all(
type(transformation) is transform.PointTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (1,))
self.assertTupleEqual(transformations[1].locations(), (4,))
class CancelOperationsTest(parameterized.TestCase):
@parameterized.parameters([
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.PhasedXGate(-0.815, 0.4711), (3,)
],
[
circuit.RotZGate(0.815),
circuit.RotZGate(-0.815), (3,)
],
[
circuit.ControlledZGate(),
circuit.ControlledZGate(),
(2, 5)
]
])
def test_positive(self, gate_first, gate_second, qubits):
# preparation work
rule = rules.CancelOperations()
operation_in_first = circuit.Operation(gate_first, qubits)
operation_in_second = circuit.Operation(gate_second, qubits)
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in_first, operation_in_second)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# check rule.perform(...)
operations_out_first, operations_out_second = \
rule.perform(operation_in_first, operation_in_second)
self.assertEmpty(tuple(operations_out_first))
self.assertEmpty(tuple(operations_out_second))
@parameterized.parameters([
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.PhasedXGate(0.42, 0.137), [3])
],
[
circuit.Operation(circuit.RotZGate(0.815), [2]),
circuit.Operation(circuit.RotZGate(0.4711), [2])
],
[
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.ControlledZGate(), [2, 3])
],
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [5]),
circuit.Operation(circuit.RotZGate(0.42), [5])
],
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [4]),
circuit.Operation(circuit.ControlledZGate(), [3, 4])
],
[
circuit.Operation(circuit.RotZGate(0.42), [5]),
circuit.Operation(circuit.ControlledZGate(), [4, 5])
]
])
def test_negative(self, operation_first, operation_second):
# preparation work
rule = rules.CancelOperations()
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_first, operation_second)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operation_first, operation_second)
def test_transformations_from_scanner(self):
# preparation work
rule = rules.CancelOperations()
scanner = rules.CircuitScanner(circuit.Circuit(7, [
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(-0.815, 0.4711), [3]),
circuit.Operation(circuit.ControlledZGate(), [3, 4]),
circuit.Operation(circuit.RotZGate(-0.42), [5]),
circuit.Operation(circuit.RotZGate(0.42), [5]),
circuit.Operation(circuit.ControlledZGate(), [4, 5])
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 2)
self.assertTrue(all(
type(transformation) is transform.PairTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (1, 3))
self.assertTupleEqual(transformations[1].locations(), (5, 6))
class ExchangeCommutingOperationsTest(parameterized.TestCase):
@parameterized.parameters([
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.PhasedXGate(0.42, 0.4711), [3])
],
[
circuit.Operation(circuit.RotZGate(0.815), [5]),
circuit.Operation(circuit.RotZGate(0.42), [5])
],
[
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.ControlledZGate(), [0, 1])
],
[
circuit.Operation(circuit.ControlledZGate(), [2, 3]),
circuit.Operation(circuit.ControlledZGate(), [3, 4])
],
[
circuit.Operation(circuit.RotZGate(0.815), [2]),
circuit.Operation(circuit.ControlledZGate(), [1, 2])
]
])
def test_positive(self, operation_in_first, operation_in_second):
# preparation work
rule = rules.ExchangeCommutingOperations()
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in_first, operation_in_second)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# check rule.perform(...)
operations_out_first, operations_out_second = \
rule.perform(operation_in_first, operation_in_second)
self.assertTrue(_elementwise_is(
operations_out_first,
[operation_in_second]
))
self.assertTrue(_elementwise_is(
operations_out_second,
[operation_in_first]
))
@parameterized.parameters([
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.PhasedXGate(0.42, 0.137), [3])
],
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [5]),
circuit.Operation(circuit.RotZGate(0.42), [5])
],
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [4]),
circuit.Operation(circuit.ControlledZGate(), [3, 4])
]
])
def test_negative(self, operation_first, operation_second):
# preparation work
rule = rules.ExchangeCommutingOperations()
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_first, operation_second)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operation_first, operation_second)
def test_transformations_from_scanner(self):
# preparation work
rule = rules.ExchangeCommutingOperations()
scanner = rules.CircuitScanner(circuit.Circuit(7, [
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.RotZGate(0.42), [0]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [1]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.ControlledZGate(), [1, 2])
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 4)
self.assertTrue(all(
type(transformation) is transform.PairTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (0, 1))
self.assertTupleEqual(transformations[1].locations(), (0, 2))
self.assertTupleEqual(transformations[2].locations(), (1, 4))
self.assertTupleEqual(transformations[3].locations(), (4, 5))
class ExchangePhasedXwithRotZTest(parameterized.TestCase):
@parameterized.parameters([
[
circuit.PhasedXGate(0.815, 0.42),
circuit.RotZGate(0.4711),
circuit.RotZGate(0.4711),
circuit.PhasedXGate(0.815, 0.42+0.4711)
],
[
circuit.RotZGate(0.4711),
circuit.PhasedXGate(0.815, 0.42),
circuit.PhasedXGate(0.815, 0.42-0.4711),
circuit.RotZGate(0.4711)
]
])
def test_positive(self,
gate_in_first, gate_in_second,
gate_out_expected_first, gate_out_expected_second):
# check consistency (note that the order is reversed)
np.testing.assert_allclose(
np.dot(gate_in_second.get_pauli_transform(),
gate_in_first.get_pauli_transform()),
np.dot(gate_out_expected_second.get_pauli_transform(),
gate_out_expected_first.get_pauli_transform()),
rtol=1e-5, atol=1e-8
)
# preparation work
rule = rules.ExchangePhasedXwithRotZ()
qubit = np.random.randint(10)
operation_in_first = circuit.Operation(gate_in_first, [qubit])
operation_in_second = circuit.Operation(gate_in_second, [qubit])
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in_first, operation_in_second)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform(...)
operations_out_first, operations_out_second = \
rule.perform(operation_in_first, operation_in_second)
# check operations_out_first
operations_out_first = tuple(operations_out_first)
self.assertLen(operations_out_first, 1)
operation_out_first, = operations_out_first
self.assertIs(type(operation_out_first), circuit.Operation)
gate_out_first = operation_out_first.get_gate()
self.assertIs(type(gate_out_first), type(gate_out_expected_first))
np.testing.assert_allclose(
gate_out_first.get_operator(),
gate_out_expected_first.get_operator(),
rtol=1e-5, atol=1e-8
)
self.assertTupleEqual(operation_out_first.get_qubits(), (qubit,))
# check operations_out_second
operations_out_second = tuple(operations_out_second)
self.assertLen(operations_out_second, 1)
operation_out_second, = operations_out_second
self.assertIs(type(operation_out_second), circuit.Operation)
gate_out_second = operation_out_second.get_gate()
self.assertIs(type(gate_out_second), type(gate_out_expected_second))
np.testing.assert_allclose(
gate_out_second.get_operator(),
gate_out_expected_second.get_operator(),
rtol=1e-5, atol=1e-8
)
self.assertTupleEqual(operation_out_second.get_qubits(), (qubit,))
@parameterized.parameters([
[
circuit.Operation(circuit.PhasedXGate(0.4711, 0.137), [4]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.42), [4])
],
[
circuit.Operation(circuit.RotZGate(0.4711), [2]),
circuit.Operation(circuit.RotZGate(0.815), [2])
],
[
circuit.Operation(circuit.PhasedXGate(0.4711, 0.137), [1]),
circuit.Operation(circuit.ControlledZGate(), [0, 1])
],
[
circuit.Operation(circuit.ControlledZGate(), [2, 3]),
circuit.Operation(circuit.PhasedXGate(0.4711, 0.137), [2])
],
[
circuit.Operation(circuit.RotZGate(0.815), [1]),
circuit.Operation(circuit.ControlledZGate(), [0, 1])
],
[
circuit.Operation(circuit.ControlledZGate(), [2, 3]),
circuit.Operation(circuit.RotZGate(0.815), [2])
]
])
def test_negative(self, operation_first, operation_second):
# preparation work
rule = rules.ExchangePhasedXwithRotZ()
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_first, operation_second)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operation_first, operation_second)
def test_transformations_from_scanner(self):
# preparation work
rule = rules.ExchangePhasedXwithRotZ()
scanner = rules.CircuitScanner(circuit.Circuit(7, [
circuit.Operation(circuit.RotZGate(0.42), [0]),
circuit.Operation(circuit.PhasedXGate(0.73, 0.37), [2]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.RotZGate(0.137), [2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [2]),
circuit.Operation(circuit.ControlledZGate(), [2, 3]),
circuit.Operation(circuit.RotZGate(0.1234), [2]),
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 2)
self.assertTrue(all(
type(transformation) is transform.PairTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (1, 3))
self.assertTupleEqual(transformations[1].locations(), (3, 4))
class ExchangePhasedXwithControlledZTest(parameterized.TestCase):
@parameterized.parameters([
[
circuit.Operation(circuit.PhasedXGate(np.pi, 0.4711), [3]),
circuit.Operation(circuit.ControlledZGate(), [3, 4]),
circuit.Operation(circuit.RotZGate(np.pi), [4])
],
[
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(np.pi, 0.4711), [1]),
circuit.Operation(circuit.RotZGate(np.pi), [2])
]
])
def test_positive(self,
operation_in_first,
operation_in_second,
operation_new):
# preparation work
arch = DummyArchitecture(self, operation_new.get_gate())
rule = rules.ExchangePhasedXwithControlledZ(arch)
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_in_first, operation_in_second)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform(...)
operations_out_first, operations_out_second = \
rule.perform(operation_in_first, operation_in_second)
# check operations_out_first
self.assertTrue(_elementwise_is(
operations_out_first,
[operation_in_second]
))
# check operations_out_second
operations_out_second = tuple(operations_out_second)
self.assertLen(operations_out_second, 2)
# check operations_out_second[0]
self.assertIs(type(operations_out_second[0]), circuit.Operation)
self.assertIs(operations_out_second[0].get_gate(),
operation_new.get_gate())
self.assertTupleEqual(operations_out_second[0].get_qubits(),
operation_new.get_qubits())
# check operations_out_second[1]
self.assertIs(operations_out_second[1], operation_in_first)
@parameterized.parameters([
[
# rotation angle of PhasedX is not pi (or equivalent)
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [3]),
circuit.Operation(circuit.ControlledZGate(), [3, 4])
],
[
# rotation angle of PhasedX is not pi (or equivalent)
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [1])
],
[
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [0]),
circuit.Operation(circuit.RotZGate(0.42), [0])
],
[
circuit.Operation(circuit.RotZGate(0.42), [2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [2])
],
[
circuit.Operation(circuit.RotZGate(0.42), [4]),
circuit.Operation(circuit.ControlledZGate(), [4, 5])
],
[
circuit.Operation(circuit.ControlledZGate(), [5, 6]),
circuit.Operation(circuit.RotZGate(0.42), [6])
]
])
def test_negative(self, operation_first, operation_second):
# preparation work
rule = rules.ExchangePhasedXwithControlledZ(UncallableArchitecture())
# check type and value for rule.accept(...)
is_accepted = rule.accept(operation_first, operation_second)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operation_first, operation_second)
def test_transformations_from_scanner(self):
# preparation work
rule = rules.ExchangePhasedXwithControlledZ(UncallableArchitecture())
scanner = rules.CircuitScanner(circuit.Circuit(3, [
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [1]),
circuit.Operation(circuit.PhasedXGate(np.pi, 0.42), [2]),
circuit.Operation(circuit.RotZGate(0.137), [0]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 2)
self.assertTrue(all(
type(transformation) is transform.PairTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (0, 2))
self.assertTupleEqual(transformations[1].locations(), (2, 5))
class CompressLocalOperationsTest(parameterized.TestCase):
@parameterized.parameters([
[
[
circuit.RotZGate(0.0)
],
[]
],
[
[
circuit.RotZGate(0.815),
circuit.RotZGate(0.4711)
],
[
circuit.RotZGate(0.815 + 0.4711)
]
],
[
[
circuit.RotZGate(0.815),
circuit.RotZGate(0.4711),
circuit.RotZGate(0.42)
],
[
circuit.RotZGate(0.815 + 0.4711 + 0.42)
]
],
[
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.PhasedXGate(0.42, 0.4711)
],
[
circuit.PhasedXGate(0.815 + 0.42, 0.4711)
]
],
[
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.0), # identity
circuit.RotZGate(0.42)
],
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.42)
]
],
[
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.0)
],
[
circuit.PhasedXGate(0.815, 0.4711)
]
]
])
def test_positive_for_given_decomposition(self, gates_in, gates_out_expected):
# preparation workpauli_transform = np.eye(3)
arch = architecture.XmonArchitecture()
rule = rules.CompressLocalOperations(arch)
qubit = np.random.randint(10)
operations_in = tuple(circuit.Operation(gate, [qubit]) for gate in gates_in)
# check type and value for rule.accept(...)
is_accepted = rule.accept(operations_in)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform(...)
operations_out = tuple(rule.perform(operations_in))
# check types for operations_out
self.assertTrue(all(
type(operation) is circuit.Operation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for operation in operations_out
))
# check the qubits for operations_out
self.assertTrue(all(
operation.get_qubits() == (qubit,)
for operation in operations_out
))
# check the length of operations_out
self.assertLen(operations_out, len(gates_out_expected))
# check that gate types and operators match the expectation
self.assertTrue(all(
type(operation.get_gate()) is type(gate)
for operation, gate in zip(operations_out, gates_out_expected)
))
self.assertTrue(all(
np.allclose(operation.get_gate().get_operator(), gate.get_operator())
for operation, gate in zip(operations_out, gates_out_expected)
))
@parameterized.parameters([
[
circuit.RotZGate(0.42),
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.137)
],
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.PhasedXGate(0.42, 0.137),
circuit.PhasedXGate(0.37, 0.73)
]
])
def test_positive_for_unknown_decomposition(self, *gates_in):
# preparation work
arch = architecture.XmonArchitecture()
rule = rules.CompressLocalOperations(arch)
qubit = np.random.randint(10)
operations_in = tuple(circuit.Operation(gate, [qubit]) for gate in gates_in)
# check type and value for rule.accept(...)
is_accepted = rule.accept(operations_in)
self.assertIs(type(is_accepted), bool)
self.assertTrue(is_accepted)
# call rule.perform(...)
operations_out = tuple(rule.perform(operations_in))
# check types for operations_out
self.assertTrue(all(
type(operation) is circuit.Operation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for operation in operations_out
))
# check the qubits for operations_out
self.assertTrue(all(
operation.get_qubits() == (qubit,)
for operation in operations_out
))
# construct the expected output gates (note that for the computation of
# pauli_transform, the order for the factors needs to be reversed here)
pauli_transform = np.eye(3)
for gate in gates_in:
pauli_transform = np.dot(gate.get_pauli_transform(), pauli_transform)
gates_out_expected = arch.decompose_single_qubit_gate(pauli_transform)
# check the length of operations_out
self.assertLen(operations_out, len(gates_out_expected))
self.assertTrue(all(
type(operation.get_gate()) is type(gate)
for operation, gate in zip(operations_out, gates_out_expected)
))
self.assertTrue(all(
np.allclose(operation.get_gate().get_operator(), gate.get_operator())
for operation, gate in zip(operations_out, gates_out_expected)
))
@parameterized.parameters([
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.42)
],
[
circuit.RotZGate(0.42),
circuit.PhasedXGate(0.815, 0.4711)
],
[
circuit.PhasedXGate(0.815, 0.4711),
circuit.RotZGate(0.42),
]
])
def test_negative(self, *gates):
# preparation work
rule = rules.CompressLocalOperations(architecture.XmonArchitecture())
qubit = np.random.randint(10)
operations = tuple(circuit.Operation(gate, [qubit]) for gate in gates)
# check type and value for rule.accept(...)
is_accepted = rule.accept(operations)
self.assertIs(type(is_accepted), bool)
self.assertFalse(is_accepted)
# check that rule.perform(...) raises a RuleNotApplicableError
with self.assertRaises(rules.RuleNotApplicableError):
rule.perform(operations)
def test_transformations_from_scanner_with_compressable_groups(self):
# preparation work
rule = rules.CompressLocalOperations(architecture.XmonArchitecture())
scanner = rules.CircuitScanner(circuit.Circuit(4, [
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.42), [0]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.RotZGate(0.14), [3]),
circuit.Operation(circuit.PhasedXGate(0.37, 0.73), [2]),
circuit.Operation(circuit.RotZGate(0.15), [3]),
circuit.Operation(circuit.PhasedXGate(0.4711, 0.42), [0]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.RotZGate(0.654), [2]),
circuit.Operation(circuit.RotZGate(0.16), [3]),
circuit.Operation(circuit.RotZGate(0.1234), [0]),
circuit.Operation(circuit.PhasedXGate(0.137, 0.1248), [2]),
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertLen(transformations, 3)
self.assertTrue(all(
type(transformation) is transform.GroupTransformation # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for transformation in transformations
))
# sort the transformations to make their order canonical
transformations = sorted(
transformations,
key=lambda transformation: transformation.locations()
)
# check the locations to make sure that the correct operations are selected
self.assertTupleEqual(transformations[0].locations(), (1, 6))
self.assertTupleEqual(transformations[1].locations(), (3, 5, 9))
self.assertTupleEqual(transformations[2].locations(), (4, 8, 11))
def test_transformations_from_scanner_with_noncompressable_groups(self):
# preparation work
rule = rules.CompressLocalOperations(architecture.XmonArchitecture())
scanner = rules.CircuitScanner(circuit.Circuit(4, [
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.PhasedXGate(0.815, 0.4711), [0]),
circuit.Operation(circuit.ControlledZGate(), [1, 2]),
circuit.Operation(circuit.RotZGate(0.14), [3]),
circuit.Operation(circuit.PhasedXGate(0.37, 0.73), [2]),
circuit.Operation(circuit.PhasedXGate(0.137, 0.1248), [3]),
circuit.Operation(circuit.RotZGate(0.42), [0]),
circuit.Operation(circuit.ControlledZGate(), [0, 1]),
circuit.Operation(circuit.RotZGate(0.1234), [2]),
circuit.Operation(circuit.RotZGate(0.1234), [0]),
]))
# call the function to be tested
transformations = tuple(rule.transformations_from_scanner(scanner))
# check the length of transformations
self.assertEmpty(transformations)
class CircuitScannerTest(parameterized.TestCase):
def test_single_operations(self):
# preparation work: construct a circuit
circ = circuit.Circuit(5, [
_random_operation(0),
_random_operation(0, 1),
_random_operation(1),
_random_operation(1, 2),
_random_operation(2)
])
# construct the CircuitScanner
scanner = rules.CircuitScanner(circ)
# call the function to be tested
attention_circs = tuple(scanner.single_operations())
# check the length of attention_circs
self.assertLen(attention_circs, len(circ))
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=[circ[0]],
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[1:]
),
locations=[0]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=[circ[1]],
context=transform.TransformationContext(
before=circ[:1],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[2:]
),
locations=[1]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=[circ[2]],
context=transform.TransformationContext(
before=circ[:2],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[3:]
),
locations=[2]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=[circ[3]],
context=transform.TransformationContext(
before=circ[:3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[4:]
),
locations=[3]
)
))
# check attention_circs[4]
self.assertTrue(_cmp_attention_circs(
attention_circs[4],
transform.AttentionCircuit(
focus=[circ[4]],
context=transform.TransformationContext(
before=circ[:4],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circuit.Circuit(circ.get_num_qubits(), None)
),
locations=[4]
)
))
def test_operation_pairs(self):
# preparation work: construct a circuit
circ = circuit.Circuit(4, [
_random_operation(0, 1),
_random_operation(0),
_random_operation(1, 2),
_random_operation(1),
_random_operation(0, 1),
_random_operation(3),
_random_operation(0, 1)
])
# construct the CircuitScanner
scanner = rules.CircuitScanner(circ)
# call the function to be tested
attention_circs = tuple(scanner.operation_pairs())
# check the length of attention_circs
self.assertLen(attention_circs, 6)
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# sort the attention circuits to make their order canonical
attention_circs = sorted(
attention_circs,
key=lambda attention_circ: attention_circ.locations()
)
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=circ[0, 1].get_operation_sequence(),
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[2:]
),
locations=[0, 1]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=circ[0, 2].get_operation_sequence(),
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[1, 3:]
),
locations=[0, 2]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=circ[1, 4].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[0, 2, 3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[5:]
),
locations=[1, 4]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=circ[2, 3].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:2],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[4:]
),
locations=[2, 3]
)
))
# check attention_circs[4]
self.assertTrue(_cmp_attention_circs(
attention_circs[4],
transform.AttentionCircuit(
focus=circ[3, 4].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[5:]
),
locations=[3, 4]
)
))
# check attention_circs[5]
self.assertTrue(_cmp_attention_circs(
attention_circs[5],
transform.AttentionCircuit(
focus=circ[4, 6].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:4],
between=circ[5:6],
after=circ[7:]
),
locations=[4, 6]
)
))
def test_local_groups(self):
# preparation work: construct a circuit
circ = circuit.Circuit(4, [
_random_operation(0, 1),
_random_operation(0),
_random_operation(1, 2),
_random_operation(3),
_random_operation(2),
_random_operation(3),
_random_operation(0),
_random_operation(0, 1),
_random_operation(2),
_random_operation(3),
_random_operation(0),
_random_operation(2)
])
# construct the CircuitScanner
scanner = rules.CircuitScanner(circ)
# call the function to be tested
attention_circs = tuple(scanner.local_groups())
# check the length of attention_circs
self.assertLen(attention_circs, 4)
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# sort the attention circuits to make their order canonical
attention_circs = sorted(
attention_circs,
key=lambda attention_circ: attention_circ.locations()
)
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=circ[1, 6].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:1],
between=circ[2:6],
after=circ[7:]
),
locations=[1, 6]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=circ[3, 5, 9].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:3],
between=circ[4, 6:9],
after=circ[10:]
),
locations=[3, 5, 9]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=circ[4, 8, 11].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:4],
between=circ[5:8, 9:11],
after=circuit.Circuit(circ.get_num_qubits(), None)
),
locations=[4, 8, 11]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=[circ[10]],
context=transform.TransformationContext(
before=circ[:10],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[11:]
),
locations=[10]
)
))
def test_circ_type_error(self):
with self.assertRaisesRegex(
TypeError,
r'circ is not a Circuit \(found type: int\)'):
rules.CircuitScanner(42)
class ScanForSingleOperationsTest(parameterized.TestCase):
def test_successful(self):
# preparation work: construct a circuit
circ = circuit.Circuit(5, [
_random_operation(0),
_random_operation(0, 1),
_random_operation(1),
_random_operation(1, 2),
_random_operation(2)
])
# call the function to be tested
attention_circs = tuple(rules.scan_for_single_operations(circ))
# check the length of attention_circs
self.assertLen(attention_circs, len(circ))
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=[circ[0]],
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[1:]
),
locations=[0]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=[circ[1]],
context=transform.TransformationContext(
before=circ[:1],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[2:]
),
locations=[1]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=[circ[2]],
context=transform.TransformationContext(
before=circ[:2],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[3:]
),
locations=[2]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=[circ[3]],
context=transform.TransformationContext(
before=circ[:3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[4:]
),
locations=[3]
)
))
# check attention_circs[4]
self.assertTrue(_cmp_attention_circs(
attention_circs[4],
transform.AttentionCircuit(
focus=[circ[4]],
context=transform.TransformationContext(
before=circ[:4],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circuit.Circuit(circ.get_num_qubits(), None)
),
locations=[4]
)
))
def test_circ_type_error(self):
with self.assertRaisesRegex(
TypeError,
r'circ is not a Circuit \(found type: int\)'):
# next because function is lazy
next(rules.scan_for_single_operations(42))
class ScanForOperationPairsTest(parameterized.TestCase):
def test_successful(self):
# preparation work: construct a circuit
circ = circuit.Circuit(4, [
_random_operation(0, 1),
_random_operation(0),
_random_operation(1, 2),
_random_operation(1),
_random_operation(0, 1),
_random_operation(3),
_random_operation(0, 1)
])
# call the function to be tested
attention_circs = tuple(rules.scan_for_operation_pairs(circ))
# check the length of attention_circs
self.assertLen(attention_circs, 6)
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# sort the attention circuits to make their order canonical
attention_circs = sorted(
attention_circs,
key=lambda attention_circ: attention_circ.locations()
)
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=circ[0, 1].get_operation_sequence(),
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[2:]
),
locations=[0, 1]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=circ[0, 2].get_operation_sequence(),
context=transform.TransformationContext(
before=circuit.Circuit(circ.get_num_qubits(), None),
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[1, 3:]
),
locations=[0, 2]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=circ[1, 4].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[0, 2, 3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[5:]
),
locations=[1, 4]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=circ[2, 3].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:2],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[4:]
),
locations=[2, 3]
)
))
# check attention_circs[4]
self.assertTrue(_cmp_attention_circs(
attention_circs[4],
transform.AttentionCircuit(
focus=circ[3, 4].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:3],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[5:]
),
locations=[3, 4]
)
))
# check attention_circs[5]
self.assertTrue(_cmp_attention_circs(
attention_circs[5],
transform.AttentionCircuit(
focus=circ[4, 6].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:4],
between=circ[5:6],
after=circ[7:]
),
locations=[4, 6]
)
))
def test_circ_type_error(self):
with self.assertRaisesRegex(
TypeError,
r'circ is not a Circuit \(found type: int\)'):
next(rules.scan_for_operation_pairs(42)) # next because function is lazy
class ScanForLocalGroupsTest(parameterized.TestCase):
def test_successful(self):
# preparation work: construct a circuit
circ = circuit.Circuit(4, [
_random_operation(0, 1),
_random_operation(0),
_random_operation(1, 2),
_random_operation(3),
_random_operation(2),
_random_operation(3),
_random_operation(0),
_random_operation(0, 1),
_random_operation(2),
_random_operation(3),
_random_operation(0),
_random_operation(2)
])
# call the function to be tested
attention_circs = tuple(rules.scan_for_local_groups(circ))
# check the length of attention_circs
self.assertLen(attention_circs, 4)
# check the types for attention_circs
self.assertTrue(all(
type(attention_circ) is transform.AttentionCircuit # don't want possible subtypes, so pylint: disable=unidiomatic-typecheck
for attention_circ in attention_circs
))
# sort the attention circuits to make their order canonical
attention_circs = sorted(
attention_circs,
key=lambda attention_circ: attention_circ.locations()
)
# check attention_circs[0]
self.assertTrue(_cmp_attention_circs(
attention_circs[0],
transform.AttentionCircuit(
focus=circ[1, 6].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:1],
between=circ[2:6],
after=circ[7:]
),
locations=[1, 6]
)
))
# check attention_circs[1]
self.assertTrue(_cmp_attention_circs(
attention_circs[1],
transform.AttentionCircuit(
focus=circ[3, 5, 9].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:3],
between=circ[4, 6:9],
after=circ[10:]
),
locations=[3, 5, 9]
)
))
# check attention_circs[2]
self.assertTrue(_cmp_attention_circs(
attention_circs[2],
transform.AttentionCircuit(
focus=circ[4, 8, 11].get_operation_sequence(),
context=transform.TransformationContext(
before=circ[:4],
between=circ[5:8, 9:11],
after=circuit.Circuit(circ.get_num_qubits(), None)
),
locations=[4, 8, 11]
)
))
# check attention_circs[3]
self.assertTrue(_cmp_attention_circs(
attention_circs[3],
transform.AttentionCircuit(
focus=[circ[10]],
context=transform.TransformationContext(
before=circ[:10],
between=circuit.Circuit(circ.get_num_qubits(), None),
after=circ[11:]
),
locations=[10]
)
))
def test_circ_type_error(self):
with self.assertRaisesRegex(
TypeError,
r'circ is not a Circuit \(found type: int\)'):
next(rules.scan_for_local_groups(42)) # next because function is lazy
if __name__ == '__main__':
absltest.main()
| 33.963308 | 135 | 0.643743 | 6,951 | 62,017 | 5.573299 | 0.049345 | 0.065669 | 0.083712 | 0.006608 | 0.884306 | 0.849716 | 0.819721 | 0.796257 | 0.767682 | 0.759448 | 0 | 0.034923 | 0.244626 | 62,017 | 1,825 | 136 | 33.981918 | 0.792042 | 0.149169 | 0 | 0.726208 | 0 | 0 | 0.004931 | 0 | 0 | 0 | 0 | 0.000548 | 0.1347 | 1 | 0.029283 | false | 0 | 0.005857 | 0.001464 | 0.048316 | 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 |
fbfa49275dfd1e8c582b77a88d56b09f8ca27d82 | 5,123 | py | Python | drivers/tcu_pynq/stream_test.py | tensil-ai/tensil | 293de1ea42d567c2041e8733bab25f678f20433c | [
"Apache-2.0"
] | 134 | 2022-03-04T21:06:49.000Z | 2022-03-30T21:35:54.000Z | drivers/tcu_pynq/stream_test.py | tensil-ai/tensil | 293de1ea42d567c2041e8733bab25f678f20433c | [
"Apache-2.0"
] | 17 | 2022-03-04T19:33:16.000Z | 2022-03-28T03:14:09.000Z | drivers/tcu_pynq/stream_test.py | tensil-ai/tensil | 293de1ea42d567c2041e8733bab25f678f20433c | [
"Apache-2.0"
] | 5 | 2022-03-07T02:50:45.000Z | 2022-03-19T01:53:12.000Z | # SPDX-License-Identifier: Apache-2.0
# Copyright © 2019-2022 Tensil AI Company
import numpy as np
from tcu_pynq.stream import DoubleBufferedAdapter
import unittest
class MockSendChannel:
def __init__(self):
self.axi_data_width = 8
self.max_buffer_size = 8
self.dtype = np.uint8
self.transfer_requested = False
self.buffer = None
self.written = np.array([], dtype=self.dtype)
def make_buffer(self, size):
return np.zeros(size, dtype=self.dtype)
def transfer(self, buffer):
if self.transfer_requested:
raise Exception("transfer already in progress")
self.buffer = buffer
self.transfer_requested = True
def wait(self):
if self.transfer_requested:
self.written = np.concatenate((self.written, self.buffer))
self.transfer_requested = False
def copy(self, src, src_offset, dst, dst_offset, length):
dst[dst_offset : dst_offset + length] = src[src_offset : src_offset + length]
def free(self, buffer):
pass
class MockRecvChannel:
def __init__(self):
self.axi_data_width = 8
self.max_buffer_size = 8
self.dtype = np.uint8
self.transfer_requested = False
self.buffer = None
self.read = np.array([], dtype=self.dtype)
self.index = 0
def make_buffer(self, size):
return np.zeros(size, dtype=self.dtype)
def transfer(self, buffer):
if self.transfer_requested:
raise Exception("transfer already in progress")
self.buffer = buffer
self.transfer_requested = True
def wait(self):
if self.transfer_requested:
self.buffer[:] = self.read[self.index : self.index + len(self.buffer)]
self.index += len(self.buffer)
self.transfer_requested = False
def copy(self, src, src_offset, dst, dst_offset, length):
dst[dst_offset : dst_offset + length] = src[src_offset : src_offset + length]
def free(self, buffer):
pass
class DoubleBufferedAdapterWriteTest(unittest.TestCase):
def setUp(self):
self.channel = MockSendChannel()
self.adapter = DoubleBufferedAdapter(self.channel)
def test_small_write(self):
data = np.arange(self.channel.max_buffer_size, dtype=self.channel.dtype)
self.adapter.write(data)
np.testing.assert_array_equal(self.channel.written, data)
def test_remainder_write_buffer_plus1(self):
data = np.arange(self.channel.max_buffer_size + 1, dtype=self.channel.dtype)
self.adapter.write(data)
np.testing.assert_array_equal(self.channel.written, data)
def test_remainder_write_buffer_x2_plus1(self):
data = np.arange(self.channel.max_buffer_size * 2 + 1, dtype=self.channel.dtype)
self.adapter.write(data)
np.testing.assert_array_equal(self.channel.written, data)
def test_remainder_write_buffer_x5_plus1(self):
data = np.arange(self.channel.max_buffer_size * 5 + 1, dtype=self.channel.dtype)
self.adapter.write(data)
np.testing.assert_array_equal(self.channel.written, data)
def test_large_write(self):
data = np.arange(self.channel.max_buffer_size * 100, dtype=self.channel.dtype)
self.adapter.write(data)
np.testing.assert_array_equal(self.channel.written, data)
class DoubleBufferedAdapterReadTest(unittest.TestCase):
def setUp(self):
self.channel = MockRecvChannel()
self.adapter = DoubleBufferedAdapter(self.channel)
def test_small_read(self):
size = self.channel.max_buffer_size
self.channel.read = np.arange(size, dtype=self.channel.dtype)
data = np.zeros(size, dtype=self.channel.dtype)
self.adapter.read(data)
np.testing.assert_array_equal(self.channel.read, data)
def test_remainder_read_plus1(self):
size = self.channel.max_buffer_size + 1
self.channel.read = np.arange(size, dtype=self.channel.dtype)
data = np.zeros(size, dtype=self.channel.dtype)
self.adapter.read(data)
np.testing.assert_array_equal(self.channel.read, data)
def test_remainder_read_buffer_x2_plus1(self):
size = self.channel.max_buffer_size * 2 + 1
self.channel.read = np.arange(size, dtype=self.channel.dtype)
data = np.zeros(size, dtype=self.channel.dtype)
self.adapter.read(data)
np.testing.assert_array_equal(self.channel.read, data)
def test_remainder_read_buffer_x5_plus1(self):
size = self.channel.max_buffer_size * 5 + 1
self.channel.read = np.arange(size, dtype=self.channel.dtype)
data = np.zeros(size, dtype=self.channel.dtype)
self.adapter.read(data)
np.testing.assert_array_equal(self.channel.read, data)
def test_large_read(self):
size = self.channel.max_buffer_size * 100
self.channel.read = np.arange(size, dtype=self.channel.dtype)
data = np.zeros(size, dtype=self.channel.dtype)
self.adapter.read(data)
np.testing.assert_array_equal(self.channel.read, data)
| 36.333333 | 88 | 0.674605 | 677 | 5,123 | 4.935007 | 0.128508 | 0.144867 | 0.071835 | 0.094283 | 0.893146 | 0.880575 | 0.868602 | 0.844059 | 0.75636 | 0.75636 | 0 | 0.010772 | 0.220769 | 5,123 | 140 | 89 | 36.592857 | 0.825902 | 0.01464 | 0 | 0.678899 | 0 | 0 | 0.0111 | 0 | 0 | 0 | 0 | 0 | 0.091743 | 1 | 0.220183 | false | 0.018349 | 0.027523 | 0.018349 | 0.302752 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
223981f05de0e675e021553a183219fd137a9e82 | 17,541 | py | Python | tests/integration_tests/rules/test_toml.py | kissmikijr/hammurabi | 42c7d73a68d434a941b69ccc919a688193ef4990 | [
"Apache-2.0"
] | 12 | 2020-03-15T22:53:20.000Z | 2021-12-06T13:35:07.000Z | tests/integration_tests/rules/test_toml.py | kissmikijr/hammurabi | 42c7d73a68d434a941b69ccc919a688193ef4990 | [
"Apache-2.0"
] | 304 | 2020-01-14T08:55:29.000Z | 2022-03-17T08:00:58.000Z | tests/integration_tests/rules/test_toml.py | kissmikijr/hammurabi | 42c7d73a68d434a941b69ccc919a688193ef4990 | [
"Apache-2.0"
] | 2 | 2020-05-29T13:14:31.000Z | 2021-01-07T14:03:51.000Z | from pathlib import Path
import pytest
import toml
from hammurabi.rules.toml import (
TomlKeyExists,
TomlKeyNotExists,
TomlKeyRenamed,
TomlValueExists,
TomlValueNotExists,
)
from tests.fixtures import temporary_file
assert temporary_file
@pytest.mark.integration
def test_key_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("")
rule = TomlKeyExists(
name="Ensure key exists", path=expected_file, key="stack", value="python"
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\n'
expected_file.unlink()
@pytest.mark.integration
def test_key_nested_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("")
rule = TomlKeyExists(
name="Ensure key exists",
path=expected_file,
key="development.supported",
value=True,
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "[development]\nsupported = true\n"
expected_file.unlink()
@pytest.mark.integration
def test_key_nested_already_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text(
'apple = "banana"\n[dict]\nvalue = "exists"\n[dict.development]\nsupported = true'
)
rule = TomlKeyExists(
name="Ensure key exists",
path=expected_file,
key="dict.development.supported",
value=True,
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'apple = "banana"\n\n[dict]\nvalue = "exists"\n\n[dict.development]\nsupported = true\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_key_exists_with_root_dot(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("")
rule = TomlKeyExists(
name="Ensure key exists", path=expected_file, key=".stack", value="python"
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\n'
expected_file.unlink()
@pytest.mark.integration
def test_key_exists_keeping_comment(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('test = "apple" # test comment\n')
rule = TomlKeyExists(
name="Ensure key exists", path=expected_file, key="stack", value="python"
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text() == 'test = "apple" # test comment\nstack = "python"\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_key_not_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = []')
rule = TomlKeyNotExists(
name="Ensure key not exists", path=expected_file, key="stack"
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "dependencies = []\n"
expected_file.unlink()
@pytest.mark.integration
def test_key_not_exists_no_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("dependencies = []")
rule = TomlKeyNotExists(
name="Ensure key not exists", path=expected_file, key="stack"
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "dependencies = []"
expected_file.unlink()
@pytest.mark.integration
def test_key_not_exists_empty_file(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("")
rule = TomlKeyNotExists(
name="Ensure key not exists", path=expected_file, key="stack"
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == ""
expected_file.unlink()
@pytest.mark.integration
def test_key_renamed(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndepends_on = []')
rule = TomlKeyRenamed(
name="Ensure key renamed",
path=expected_file,
key="depends_on",
new_name="dependencies",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\ndependencies = []\n'
expected_file.unlink()
@pytest.mark.integration
def test_key_renamed_no_old_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = []')
rule = TomlKeyRenamed(
name="Ensure key renamed",
path=expected_file,
key="depends_on",
new_name="dependencies",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\ndependencies = []'
expected_file.unlink()
@pytest.mark.integration
def test_key_renamed_no_old_or_new_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n')
rule = TomlKeyRenamed(
name="Ensure key renamed",
path=expected_file,
key="depends_on",
new_name="dependencies",
)
rule.pre_task_hook()
with pytest.raises(LookupError):
rule.task()
assert expected_file.read_text() == 'stack = "python"\n'
expected_file.unlink()
@pytest.mark.integration
def test_key_renamed_has_old_and_new_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = []\ndepends_on = []')
rule = TomlKeyRenamed(
name="Ensure key renamed",
path=expected_file,
key="depends_on",
new_name="dependencies",
)
rule.pre_task_hook()
with pytest.raises(LookupError):
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\ndependencies = []\ndepends_on = []'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "scala"')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\n'
expected_file.unlink()
@pytest.mark.integration
def test_value_nested_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("[development]\napple = true\n")
rule = TomlValueExists(
name="Ensure local development is supported",
path=expected_file,
key="development.supported",
value=True,
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text() == "[development]\napple = true\nsupported = true\n"
)
expected_file.unlink()
@pytest.mark.integration
def test_value_nested_already_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("[development]\nsupported = true\n")
rule = TomlValueExists(
name="Ensure local development is supported",
path=expected_file,
key="development.supported",
value=True,
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "[development]\nsupported = true\n"
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_no_value(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "scala"')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="stack",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == ""
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_list(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = []')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value=["service1", "service2"],
)
rule.pre_task_hook()
rule.task()
# Because of the default flow style False, the result will be block-styled
assert (
expected_file.read_text()
== 'stack = "python"\ndependencies = [ "service1", "service2",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_list_single_item(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = []')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
# Because of the default flow style False, the result will be block-styled
assert (
expected_file.read_text() == 'stack = "python"\ndependencies = [ "service1",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_nested_list_single_item(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n[nested]\ndependencies = []')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="nested.dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
# Because of the default flow style False, the result will be block-styled
assert (
expected_file.read_text()
== 'stack = "python"\n\n[nested]\ndependencies = [ "service1",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_list_already_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = ["service3"]')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value=["service1", "service2"],
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\ndependencies = [ "service3", "service1", "service2",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_list_already_exists_single_item(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = ["service2"]')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\ndependencies = [ "service2", "service1",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_dict(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n\n[dependencies]')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value={"service1": True, "service2": True},
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\n\n[dependencies]\nservice1 = true\nservice2 = true\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_exists_dict_already_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n\n[dependencies]\nservice3 = true')
rule = TomlValueExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value={"service1": True},
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\n\n[dependencies]\nservice3 = true\nservice1 = true\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == ""
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_nested(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('[development]\nstack = "python"\n')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="development.stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "[development]\n"
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_not_changed(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "scala"')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "scala"'
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_nested_not_changed(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('[development]\nstack = "scala"\n')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="development.stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == '[development]\nstack = "scala"\n'
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_no_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text("dependencies = []")
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == "dependencies = []"
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_nested_no_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('[dependencies]\n\n[supported]\napple = "banana"\n')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies.supported.stack",
value="python",
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text() == '[dependencies]\n\n[supported]\napple = "banana"\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_list(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text(
'stack = "python"\ndependencies = [ "service1", "service2"]'
)
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
# Because of the default flow style False, the result will be block-styled
assert (
expected_file.read_text() == 'stack = "python"\ndependencies = [ "service2",]\n'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_list_no_item(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\ndependencies = [ "service3",]')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text() == 'stack = "python"\ndependencies = [ "service3",]'
)
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_dict(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n\n[dependencies]\nservice1 = true')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
assert expected_file.read_text() == 'stack = "python"\n\n[dependencies]\n'
expected_file.unlink()
@pytest.mark.integration
def test_value_not_exists_dict_no_key(temporary_file):
expected_file = Path(temporary_file.name)
expected_file.write_text('stack = "python"\n\n[dependencies]\nservice3 = true')
rule = TomlValueNotExists(
name="Ensure service descriptor has dependencies",
path=expected_file,
key="dependencies",
value="service1",
)
rule.pre_task_hook()
rule.task()
assert (
expected_file.read_text()
== 'stack = "python"\n\n[dependencies]\nservice3 = true'
)
expected_file.unlink()
| 25.986667 | 99 | 0.673451 | 2,021 | 17,541 | 5.585849 | 0.048986 | 0.175392 | 0.046505 | 0.070157 | 0.965099 | 0.952343 | 0.95004 | 0.947294 | 0.941359 | 0.940473 | 0 | 0.00273 | 0.206431 | 17,541 | 674 | 100 | 26.025223 | 0.808261 | 0.01659 | 0 | 0.718 | 0 | 0.004 | 0.231139 | 0.065004 | 0 | 0 | 0 | 0 | 0.068 | 1 | 0.066 | false | 0 | 0.01 | 0 | 0.076 | 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 |
22520731b0a8594e817e7d134895793dc24e26f4 | 5,494 | py | Python | splat/tests/test_empirical.py | brackham/splat | 5ee0da82f19017e900ee83af94609dbe9f8a0ea4 | [
"MIT"
] | null | null | null | splat/tests/test_empirical.py | brackham/splat | 5ee0da82f19017e900ee83af94609dbe9f8a0ea4 | [
"MIT"
] | null | null | null | splat/tests/test_empirical.py | brackham/splat | 5ee0da82f19017e900ee83af94609dbe9f8a0ea4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
# this is the test function set for splat empirical functions
# imports - internal
import copy
import glob
import os
# # imports - external
import numpy
from astropy import units as u # standard units
from astropy import constants as const # physical constants in SI units
from astropy import coordinates as coord # coordinate conversion
from astropy.io import fits
from numpy.testing.utils import assert_allclose
# splat functions and constants
from splat.initialize import *
from splat.utilities import *
import splat.core as splat
# things to test
# isNumber
#####################
# TESTING FUNCTIONS #
#####################
def test_typeToMag():
pass
def test_typeToColor():
pass
def test_typeToTeff():
t = spem.typeToTeff('M7')
assert len(t) == 2
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance(t[0].value,float)
assert isinstance(t[1].value,float)
t = spem.typeToTeff(17)
assert len(t) == 2
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance(t[0].value,float)
assert isinstance(t[1].value,float)
t = spem.typeToTeff(['M7','L4','T5'])
assert len(t) == 2
assert len(t[0]) == 3
assert len(t[1]) == 3
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance((t[0].value)[0],float)
assert isinstance((t[0].value)[1],float)
assert isinstance((t[0].value)[2],float)
assert isinstance((t[1].value)[0],float)
assert isinstance((t[1].value)[1],float)
assert isinstance((t[1].value)[2],float)
t = spem.typeToTeff([17,24,35])
assert len(t) == 2
assert len(t[0]) == 3
assert len(t[1]) == 3
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance((t[0].value)[0],float)
assert isinstance((t[0].value)[1],float)
assert isinstance((t[0].value)[2],float)
assert isinstance((t[1].value)[0],float)
assert isinstance((t[1].value)[1],float)
assert isinstance((t[1].value)[2],float)
t = spem.typeToTeff(17,uncertainty=0.5)
assert len(t) == 2
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance(t[0].value,float)
assert isinstance(t[1].value,float)
t = spem.typeToTeff([17,24,35],uncertainty=0.5)
assert len(t) == 2
assert len(t[0]) == 3
assert len(t[1]) == 3
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance((t[0].value)[0],float)
assert isinstance((t[0].value)[1],float)
assert isinstance((t[0].value)[2],float)
assert isinstance((t[1].value)[0],float)
assert isinstance((t[1].value)[1],float)
assert isinstance((t[1].value)[2],float)
t = spem.typeToTeff([17,24,35],uncertainty=[0.5,1.0,0.8])
assert len(t) == 2
assert len(t[0]) == 3
assert len(t[1]) == 3
assert isinstance(t[0],u.quantity.Quantity)
assert isinstance(t[1],u.quantity.Quantity)
assert isinstance((t[0].value)[0],float)
assert isinstance((t[0].value)[1],float)
assert isinstance((t[0].value)[2],float)
assert isinstance((t[1].value)[0],float)
assert isinstance((t[1].value)[1],float)
assert isinstance((t[1].value)[2],float)
t = spem.typeToTeff(1875,reverse=True)
assert len(t) == 2
assert isinstance(t[0],float)
assert isinstance(t[1],float)
t = spem.typeToTeff([1400,1875,2482],reverse=True)
assert len(t) == 2
assert isinstance(t[0],list)
assert isinstance(t[1],list)
assert isinstance(t[0][0],float)
assert isinstance(t[0][1],float)
assert isinstance(t[0][2],float)
assert isinstance(t[1][0],float)
assert isinstance(t[1][1],float)
assert isinstance(t[1][2],float)
t = spem.typeToTeff(1875,uncertainty=150.,reverse=True)
assert len(t) == 2
assert isinstance(t[0],float)
assert isinstance(t[1],float)
t = spem.typeToTeff([1400,1875,2482],uncertainty=100.,reverse=True)
assert len(t) == 2
assert isinstance(t[0],list)
assert isinstance(t[1],list)
assert isinstance(t[0][0],float)
assert isinstance(t[0][1],float)
assert isinstance(t[0][2],float)
assert isinstance(t[1][0],float)
assert isinstance(t[1][1],float)
assert isinstance(t[1][2],float)
t = spem.typeToTeff([1400,1875,2482],uncertainty=[100.,50.,150.],reverse=True)
assert len(t) == 2
assert isinstance(t[0],list)
assert isinstance(t[1],list)
assert isinstance(t[0][0],float)
assert isinstance(t[0][1],float)
assert isinstance(t[0][2],float)
assert isinstance(t[1][0],float)
assert isinstance(t[1][1],float)
assert isinstance(t[1][2],float)
t = spem.typeToTeff([1400,1875,2482],uncertainty=[100.,50.,150.],reverse=True,string=True)
assert len(t) == 2
assert isinstance(t[0],list)
assert isinstance(t[1],list)
assert isinstance(t[0][0],str)
assert isinstance(t[0][1],str)
assert isinstance(t[0][2],str)
assert isinstance(t[1][0],float)
assert isinstance(t[1][1],float)
assert isinstance(t[1][2],float)
def test_typeToLuminosity():
# typeToMag
pass
def test_typeToBC():
# typeToMag
pass
def test_estimateDistance():
# typeToMag
pass
def test_redden():
# typeToMag
pass
| 32.128655 | 94 | 0.655624 | 828 | 5,494 | 4.334541 | 0.108696 | 0.356645 | 0.378936 | 0.257453 | 0.794093 | 0.781833 | 0.779604 | 0.779604 | 0.775982 | 0.772081 | 0 | 0.05982 | 0.17237 | 5,494 | 170 | 95 | 32.317647 | 0.729492 | 0.054969 | 0 | 0.742857 | 0 | 0 | 0.001559 | 0 | 0 | 0 | 0 | 0 | 0.728571 | 1 | 0.05 | false | 0.042857 | 0.092857 | 0 | 0.142857 | 0.007143 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
2267729a8a977c842da1d999dc16159c38e08009 | 44 | py | Python | tests/test_pycounts_bl0701.py | ming0701/pycounts_bl0701 | af195a3dcc98df94917d7fe266374f1dd6aa7b0e | [
"MIT"
] | null | null | null | tests/test_pycounts_bl0701.py | ming0701/pycounts_bl0701 | af195a3dcc98df94917d7fe266374f1dd6aa7b0e | [
"MIT"
] | 1 | 2022-01-16T23:19:39.000Z | 2022-01-16T23:19:39.000Z | tests/test_pycounts_bl0701.py | ming0701/pycounts_bl0701 | af195a3dcc98df94917d7fe266374f1dd6aa7b0e | [
"MIT"
] | null | null | null | from pycounts_bl0701 import pycounts_bl0701
| 22 | 43 | 0.909091 | 6 | 44 | 6.333333 | 0.666667 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.090909 | 44 | 1 | 44 | 44 | 0.75 | 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 |
3f3b1a6900ab41eb6aef4f84868a1d2a15ebc385 | 63,471 | py | Python | swagger_client/api/accounts_api.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 2 | 2019-04-15T05:58:21.000Z | 2021-11-15T18:26:37.000Z | swagger_client/api/accounts_api.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 1 | 2021-06-18T09:46:25.000Z | 2021-06-18T20:12:41.000Z | swagger_client/api/accounts_api.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 2 | 2019-07-08T13:41:09.000Z | 2020-12-07T12:10:04.000Z | # coding: utf-8
"""
finAPI RESTful Services
finAPI RESTful Services # noqa: E501
OpenAPI spec version: v1.42.1
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 swagger_client.api_client import ApiClient
class AccountsApi(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 delete_account(self, id, **kwargs): # noqa: E501
"""Delete an account # noqa: E501
Delete a single bank account of the user that is authorized by the access_token, including its transactions and balance data. Must pass the account's identifier and the user's access_token.<br/><br/>Notes: <br/>- You cannot delete an account while the bank connection that it relates to is currently in the process of import, update, or transactions categorization. <br/>- When the last remaining account of a bank connection gets deleted, then the bank connection itself will get deleted as well! <br/>- All notification rules that are connected to the account will get adjusted so that they no longer have this account listed. Notification rules that are connected to just this account (and no other accounts) will get deleted altogether. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_account(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of the account to delete (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_account_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.delete_account_with_http_info(id, **kwargs) # noqa: E501
return data
def delete_account_with_http_info(self, id, **kwargs): # noqa: E501
"""Delete an account # noqa: E501
Delete a single bank account of the user that is authorized by the access_token, including its transactions and balance data. Must pass the account's identifier and the user's access_token.<br/><br/>Notes: <br/>- You cannot delete an account while the bank connection that it relates to is currently in the process of import, update, or transactions categorization. <br/>- When the last remaining account of a bank connection gets deleted, then the bank connection itself will get deleted as well! <br/>- All notification rules that are connected to the account will get adjusted so that they no longer have this account listed. Notification rules that are connected to just this account (and no other accounts) will get deleted altogether. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_account_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of the account to delete (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id'] # noqa: E501
all_params.append('async')
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_account" % 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 `delete_account`") # noqa: E501
if 'id' in params and not re.search('[\\d]+', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `delete_account`, must conform to the pattern `/[\\d]+/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/{id}', '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=params.get('async'),
_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_all_accounts(self, **kwargs): # noqa: E501
"""Delete all accounts # noqa: E501
Delete all accounts of the user that is authorized by the access_token, including all transactions and balance data. Must pass the user's access_token.<br/><br/>Notes: <br/>- Deleting all of the user's accounts also deletes all of his bank connections. <br/>- All notification rules that are connected to any specific accounts will get deleted as well. <br/>- If at least one of the user's bank connections in currently in the process of import, update, or transactions categorization, then this service will perform no action at all. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_all_accounts(async=True)
>>> result = thread.get()
:param async bool
:return: IdentifierList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_all_accounts_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.delete_all_accounts_with_http_info(**kwargs) # noqa: E501
return data
def delete_all_accounts_with_http_info(self, **kwargs): # noqa: E501
"""Delete all accounts # noqa: E501
Delete all accounts of the user that is authorized by the access_token, including all transactions and balance data. Must pass the user's access_token.<br/><br/>Notes: <br/>- Deleting all of the user's accounts also deletes all of his bank connections. <br/>- All notification rules that are connected to any specific accounts will get deleted as well. <br/>- If at least one of the user's bank connections in currently in the process of import, update, or transactions categorization, then this service will perform no action at all. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_all_accounts_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:return: IdentifierList
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('async')
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_all_accounts" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='IdentifierList', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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 edit_account(self, id, **kwargs): # noqa: E501
"""Edit an account # noqa: E501
Change the name and/or the type and/or the 'isNew' flag of a single bank account of the user that is authorized by the access_token. Must pass the account's identifier, the account's new name and/or type and/or 'isNew' flag, and the user's access_token. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.edit_account(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of the account to edit (required)
:param AccountParams body: New account name and/or type and/or 'isNew' flag
:return: Account
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.edit_account_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.edit_account_with_http_info(id, **kwargs) # noqa: E501
return data
def edit_account_with_http_info(self, id, **kwargs): # noqa: E501
"""Edit an account # noqa: E501
Change the name and/or the type and/or the 'isNew' flag of a single bank account of the user that is authorized by the access_token. Must pass the account's identifier, the account's new name and/or type and/or 'isNew' flag, and the user's access_token. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.edit_account_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of the account to edit (required)
:param AccountParams body: New account name and/or type and/or 'isNew' flag
:return: Account
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'body'] # noqa: E501
all_params.append('async')
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 edit_account" % 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 `edit_account`") # noqa: E501
if 'id' in params and not re.search('[\\d]+', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `edit_account`, must conform to the pattern `/[\\d]+/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/{id}', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Account', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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 execute_sepa_direct_debit(self, body, **kwargs): # noqa: E501
"""Execute SEPA Direct Debit # noqa: E501
Execute a SEPA direct debit order that has been previously submitted by the use of the /requestSepaDirectDebit service. Note that this service cannot be used for the demo account. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_sepa_direct_debit(body, async=True)
>>> result = thread.get()
:param async bool
:param ExecuteSepaDirectDebitParams body: Parameters for the execution of a SEPA direct debit order (required)
:return: BankResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.execute_sepa_direct_debit_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.execute_sepa_direct_debit_with_http_info(body, **kwargs) # noqa: E501
return data
def execute_sepa_direct_debit_with_http_info(self, body, **kwargs): # noqa: E501
"""Execute SEPA Direct Debit # noqa: E501
Execute a SEPA direct debit order that has been previously submitted by the use of the /requestSepaDirectDebit service. Note that this service cannot be used for the demo account. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_sepa_direct_debit_with_http_info(body, async=True)
>>> result = thread.get()
:param async bool
:param ExecuteSepaDirectDebitParams body: Parameters for the execution of a SEPA direct debit order (required)
:return: BankResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async')
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 execute_sepa_direct_debit" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `execute_sepa_direct_debit`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/executeSepaDirectDebit', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BankResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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 execute_sepa_money_transfer(self, body, **kwargs): # noqa: E501
"""Execute SEPA Money Transfer # noqa: E501
Execute a SEPA money transfer order that has been previously submitted by the use of the /requestSepaMoneyTransfer service. Note that this service cannot be used for the demo account. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_sepa_money_transfer(body, async=True)
>>> result = thread.get()
:param async bool
:param ExecuteSepaMoneyTransferParams body: Parameters for the execution of a SEPA money transfer order (required)
:return: BankResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.execute_sepa_money_transfer_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.execute_sepa_money_transfer_with_http_info(body, **kwargs) # noqa: E501
return data
def execute_sepa_money_transfer_with_http_info(self, body, **kwargs): # noqa: E501
"""Execute SEPA Money Transfer # noqa: E501
Execute a SEPA money transfer order that has been previously submitted by the use of the /requestSepaMoneyTransfer service. Note that this service cannot be used for the demo account. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.execute_sepa_money_transfer_with_http_info(body, async=True)
>>> result = thread.get()
:param async bool
:param ExecuteSepaMoneyTransferParams body: Parameters for the execution of a SEPA money transfer order (required)
:return: BankResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async')
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 execute_sepa_money_transfer" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `execute_sepa_money_transfer`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/executeSepaMoneyTransfer', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BankResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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_account(self, id, **kwargs): # noqa: E501
"""Get an account # noqa: E501
Get a single bank account of the user that is authorized by the access_token. Must pass the account's identifier and the user's access_token. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_account(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of requested account (required)
:return: Account
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_account_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_account_with_http_info(id, **kwargs) # noqa: E501
return data
def get_account_with_http_info(self, id, **kwargs): # noqa: E501
"""Get an account # noqa: E501
Get a single bank account of the user that is authorized by the access_token. Must pass the account's identifier and the user's access_token. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_account_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param int id: Identifier of requested account (required)
:return: Account
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id'] # noqa: E501
all_params.append('async')
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_account" % 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 `get_account`") # noqa: E501
if 'id' in params and not re.search('[\\d]+', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `get_account`, must conform to the pattern `/[\\d]+/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/{id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Account', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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_and_search_all_accounts(self, **kwargs): # noqa: E501
"""Get and search all accounts # noqa: E501
Get bank accounts of the user that is authorized by the access_token. Must pass the user's access_token. You can set optional search criteria to get only those bank accounts that you are interested in. If you do not specify any search criteria, then this service functions as a 'get all' service. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_and_search_all_accounts(async=True)
>>> result = thread.get()
:param async bool
:param list[int] ids: A comma-separated list of account identifiers. If specified, then only accounts whose identifier match any of the given identifiers will be regarded. The maximum number of identifiers is 1000.
:param str search: If specified, then only those accounts will be contained in the result whose 'accountName', 'iban', 'accountNumber' or 'subAccountNumber' contains the given search string (the matching works case-insensitive). If no accounts contain the search string in any of these fields, then the result will be an empty list. NOTE: If the given search string consists of several terms (separated by whitespace), then ALL of these terms must be contained in the searched fields in order for an account to get included into the result.
:param list[int] account_type_ids: A comma-separated list of account types. If specified, then only accounts that relate to the given types will be regarded. If not specified, then all accounts will be regarded.
:param list[int] bank_connection_ids: A comma-separated list of bank connection identifiers. If specified, then only accounts that relate to the given bank connections will be regarded. If not specified, then all accounts will be regarded.
:param str min_last_successful_update: Lower bound for a account's last successful update date, in the format 'YYYY-MM-DD' (e.g. '2016-01-01'). If specified, then only accounts whose 'lastSuccessfulUpdate' is equal to or later than the given date will be regarded.
:param str max_last_successful_update: Upper bound for a account's last successful update date, in the format 'YYYY-MM-DD' (e.g. '2016-01-01'). If specified, then only accounts whose 'lastSuccessfulUpdate' is equal to or earlier than the given date will be regarded.
:param float min_balance: If specified, then only accounts whose balance is equal to or greater than the given balance will be regarded. Can contain a positive or negative number with at most two decimal places. Examples: -300.12, or 90.95
:param float max_balance: If specified, then only accounts whose balance is equal to or less than the given balance will be regarded. Can contain a positive or negative number with at most two decimal places. Examples: -300.12, or 90.95
:return: AccountList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_and_search_all_accounts_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_and_search_all_accounts_with_http_info(**kwargs) # noqa: E501
return data
def get_and_search_all_accounts_with_http_info(self, **kwargs): # noqa: E501
"""Get and search all accounts # noqa: E501
Get bank accounts of the user that is authorized by the access_token. Must pass the user's access_token. You can set optional search criteria to get only those bank accounts that you are interested in. If you do not specify any search criteria, then this service functions as a 'get all' service. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_and_search_all_accounts_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param list[int] ids: A comma-separated list of account identifiers. If specified, then only accounts whose identifier match any of the given identifiers will be regarded. The maximum number of identifiers is 1000.
:param str search: If specified, then only those accounts will be contained in the result whose 'accountName', 'iban', 'accountNumber' or 'subAccountNumber' contains the given search string (the matching works case-insensitive). If no accounts contain the search string in any of these fields, then the result will be an empty list. NOTE: If the given search string consists of several terms (separated by whitespace), then ALL of these terms must be contained in the searched fields in order for an account to get included into the result.
:param list[int] account_type_ids: A comma-separated list of account types. If specified, then only accounts that relate to the given types will be regarded. If not specified, then all accounts will be regarded.
:param list[int] bank_connection_ids: A comma-separated list of bank connection identifiers. If specified, then only accounts that relate to the given bank connections will be regarded. If not specified, then all accounts will be regarded.
:param str min_last_successful_update: Lower bound for a account's last successful update date, in the format 'YYYY-MM-DD' (e.g. '2016-01-01'). If specified, then only accounts whose 'lastSuccessfulUpdate' is equal to or later than the given date will be regarded.
:param str max_last_successful_update: Upper bound for a account's last successful update date, in the format 'YYYY-MM-DD' (e.g. '2016-01-01'). If specified, then only accounts whose 'lastSuccessfulUpdate' is equal to or earlier than the given date will be regarded.
:param float min_balance: If specified, then only accounts whose balance is equal to or greater than the given balance will be regarded. Can contain a positive or negative number with at most two decimal places. Examples: -300.12, or 90.95
:param float max_balance: If specified, then only accounts whose balance is equal to or less than the given balance will be regarded. Can contain a positive or negative number with at most two decimal places. Examples: -300.12, or 90.95
:return: AccountList
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['ids', 'search', 'account_type_ids', 'bank_connection_ids', 'min_last_successful_update', 'max_last_successful_update', 'min_balance', 'max_balance'] # noqa: E501
all_params.append('async')
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_and_search_all_accounts" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'ids' in params:
query_params.append(('ids', params['ids'])) # noqa: E501
collection_formats['ids'] = 'multi' # noqa: E501
if 'search' in params:
query_params.append(('search', params['search'])) # noqa: E501
if 'account_type_ids' in params:
query_params.append(('accountTypeIds', params['account_type_ids'])) # noqa: E501
collection_formats['accountTypeIds'] = 'multi' # noqa: E501
if 'bank_connection_ids' in params:
query_params.append(('bankConnectionIds', params['bank_connection_ids'])) # noqa: E501
collection_formats['bankConnectionIds'] = 'multi' # noqa: E501
if 'min_last_successful_update' in params:
query_params.append(('minLastSuccessfulUpdate', params['min_last_successful_update'])) # noqa: E501
if 'max_last_successful_update' in params:
query_params.append(('maxLastSuccessfulUpdate', params['max_last_successful_update'])) # noqa: E501
if 'min_balance' in params:
query_params.append(('minBalance', params['min_balance'])) # noqa: E501
if 'max_balance' in params:
query_params.append(('maxBalance', params['max_balance'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AccountList', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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_daily_balances(self, **kwargs): # noqa: E501
"""Get daily balances # noqa: E501
Returns the daily balances for the given accounts and the given period. The balances are calculated by finAPI and are based on each account's latest balance. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_daily_balances(async=True)
>>> result = thread.get()
:param async bool
:param list[int] account_ids: A comma-separated list of (non-security) account identifiers. If no accounts are specified, all (non-security) accounts of the current user are regarded.
:param str start_date: A string in the format 'YYYY-MM-DD'. Note that the requested date range [startDate..endDate] may not exceed 365 days. If startDate is not specified, it defaults to the endDate minus one month.
:param str end_date: A string in the format 'YYYY-MM-DD'. Note that the requested date range [startDate..endDate] may not exceed 365 days. If endDate is not specified, it defaults to today's date.
:param bool with_projection: Whether finAPI should project the first and last actually existing balance into the past and future. When passing 'true', then the result will always contain a daily balance for every day of the entire requested date range, even for days before the first actually existing balance, resp. after the last actually existing balance. Those days will have the same balance as the day of the first actual balance, resp. last actual balance, i.e. the first/last balance will be infinitely projected into the past/the future. When passing 'false', then the result will contain daily balances only from the day on where the first actual balance exists for any of the given accounts, and only up to the day where the last actual balance exists for any of the given accounts. Note that when in this case there are no actual balances within the requested date range, then an empty array will be returned. Default value for this parameter is 'true'.
:param int page: Result page that you want to retrieve.
:param int per_page: Maximum number of records per page. Can be at most 500. NOTE: Due to its validation and visualization, the swagger frontend might show very low performance, or even crashes, when a service responds with a lot of data. It is recommended to use a HTTP client like Postman or DHC instead of our swagger frontend for service calls with large page sizes.
:param list[str] order: Determines the order of the results. You can order the results by 'date', 'balance', 'income' or 'spending'. The default order for this service is 'date,asc'. You can also order by multiple properties. In that case the order of the parameters passed is important. Example: '/accounts/dailyBalances?order=date,desc&order=balance,asc' will return daily balances ordered by 'date' (descending), where items with the same 'date' are ordered by 'balance' (ascending). The general format is: 'property[,asc|desc]', with 'asc' being the default value. Please note that ordering by multiple fields is not supported in our swagger frontend, but you can test this feature with any HTTP tool of your choice (e.g. postman or DHC).
:return: DailyBalanceList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_daily_balances_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_daily_balances_with_http_info(**kwargs) # noqa: E501
return data
def get_daily_balances_with_http_info(self, **kwargs): # noqa: E501
"""Get daily balances # noqa: E501
Returns the daily balances for the given accounts and the given period. The balances are calculated by finAPI and are based on each account's latest balance. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_daily_balances_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param list[int] account_ids: A comma-separated list of (non-security) account identifiers. If no accounts are specified, all (non-security) accounts of the current user are regarded.
:param str start_date: A string in the format 'YYYY-MM-DD'. Note that the requested date range [startDate..endDate] may not exceed 365 days. If startDate is not specified, it defaults to the endDate minus one month.
:param str end_date: A string in the format 'YYYY-MM-DD'. Note that the requested date range [startDate..endDate] may not exceed 365 days. If endDate is not specified, it defaults to today's date.
:param bool with_projection: Whether finAPI should project the first and last actually existing balance into the past and future. When passing 'true', then the result will always contain a daily balance for every day of the entire requested date range, even for days before the first actually existing balance, resp. after the last actually existing balance. Those days will have the same balance as the day of the first actual balance, resp. last actual balance, i.e. the first/last balance will be infinitely projected into the past/the future. When passing 'false', then the result will contain daily balances only from the day on where the first actual balance exists for any of the given accounts, and only up to the day where the last actual balance exists for any of the given accounts. Note that when in this case there are no actual balances within the requested date range, then an empty array will be returned. Default value for this parameter is 'true'.
:param int page: Result page that you want to retrieve.
:param int per_page: Maximum number of records per page. Can be at most 500. NOTE: Due to its validation and visualization, the swagger frontend might show very low performance, or even crashes, when a service responds with a lot of data. It is recommended to use a HTTP client like Postman or DHC instead of our swagger frontend for service calls with large page sizes.
:param list[str] order: Determines the order of the results. You can order the results by 'date', 'balance', 'income' or 'spending'. The default order for this service is 'date,asc'. You can also order by multiple properties. In that case the order of the parameters passed is important. Example: '/accounts/dailyBalances?order=date,desc&order=balance,asc' will return daily balances ordered by 'date' (descending), where items with the same 'date' are ordered by 'balance' (ascending). The general format is: 'property[,asc|desc]', with 'asc' being the default value. Please note that ordering by multiple fields is not supported in our swagger frontend, but you can test this feature with any HTTP tool of your choice (e.g. postman or DHC).
:return: DailyBalanceList
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['account_ids', 'start_date', 'end_date', 'with_projection', 'page', 'per_page', 'order'] # noqa: E501
all_params.append('async')
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_daily_balances" % key
)
params[key] = val
del params['kwargs']
if 'page' in params and params['page'] < 1: # noqa: E501
raise ValueError("Invalid value for parameter `page` when calling `get_daily_balances`, must be a value greater than or equal to `1`") # noqa: E501
if 'per_page' in params and params['per_page'] > 500: # noqa: E501
raise ValueError("Invalid value for parameter `per_page` when calling `get_daily_balances`, must be a value less than or equal to `500`") # noqa: E501
if 'per_page' in params and params['per_page'] < 1: # noqa: E501
raise ValueError("Invalid value for parameter `per_page` when calling `get_daily_balances`, must be a value greater than or equal to `1`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'account_ids' in params:
query_params.append(('accountIds', params['account_ids'])) # noqa: E501
collection_formats['accountIds'] = 'multi' # noqa: E501
if 'start_date' in params:
query_params.append(('startDate', params['start_date'])) # noqa: E501
if 'end_date' in params:
query_params.append(('endDate', params['end_date'])) # noqa: E501
if 'with_projection' in params:
query_params.append(('withProjection', params['with_projection'])) # noqa: E501
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
if 'per_page' in params:
query_params.append(('perPage', params['per_page'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
collection_formats['order'] = 'multi' # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/dailyBalances', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DailyBalanceList', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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_multiple_accounts(self, ids, **kwargs): # noqa: E501
"""Get multiple accounts # noqa: E501
Get a list of multiple bank accounts of the user that is authorized by the access_token. Must pass the accounts' identifiers and the user's access_token. Accounts whose identifiers do not exist or do not relate to the authorized user will not be contained in the result (If this applies to all of the given identifiers, then the result will be an empty list). WARNING: This service is deprecated and will be removed at some point. If you want to get multiple accounts, please instead use the service 'Get and search all accounts' and pass a comma-separated list of identifiers as a parameter 'ids'. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_multiple_accounts(ids, async=True)
>>> result = thread.get()
:param async bool
:param list[int] ids: Comma-separated list of identifiers of requested accounts (required)
:return: AccountList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_multiple_accounts_with_http_info(ids, **kwargs) # noqa: E501
else:
(data) = self.get_multiple_accounts_with_http_info(ids, **kwargs) # noqa: E501
return data
def get_multiple_accounts_with_http_info(self, ids, **kwargs): # noqa: E501
"""Get multiple accounts # noqa: E501
Get a list of multiple bank accounts of the user that is authorized by the access_token. Must pass the accounts' identifiers and the user's access_token. Accounts whose identifiers do not exist or do not relate to the authorized user will not be contained in the result (If this applies to all of the given identifiers, then the result will be an empty list). WARNING: This service is deprecated and will be removed at some point. If you want to get multiple accounts, please instead use the service 'Get and search all accounts' and pass a comma-separated list of identifiers as a parameter 'ids'. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_multiple_accounts_with_http_info(ids, async=True)
>>> result = thread.get()
:param async bool
:param list[int] ids: Comma-separated list of identifiers of requested accounts (required)
:return: AccountList
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['ids'] # noqa: E501
all_params.append('async')
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_multiple_accounts" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'ids' is set
if ('ids' not in params or
params['ids'] is None):
raise ValueError("Missing the required parameter `ids` when calling `get_multiple_accounts`") # noqa: E501
if 'ids' in params and not re.search('[\\d]+,[\\d,]+', params['ids']): # noqa: E501
raise ValueError("Invalid value for parameter `ids` when calling `get_multiple_accounts`, must conform to the pattern `/[\\d]+,[\\d,]+/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'ids' in params:
path_params['ids'] = params['ids'] # noqa: E501
collection_formats['ids'] = 'csv' # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/{ids}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AccountList', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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 request_sepa_direct_debit(self, body, **kwargs): # noqa: E501
"""Request SEPA Direct Debit # noqa: E501
Submit a SEPA direct debit order for one or multiple direct debits. Returns an instruction from the bank server that can be displayed to the user (e.g. \"Enter TAN\"), typically in the language of the bank's country. The order remains valid for execution for only a couple of minutes (the exact validity period depends on the bank). For executing the order, use the /executeSepaDirectDebit service after calling this service. Note that when the order is not executed within the validity period, the bank might take note of that and - if happening too often - ultimately lock the user's online banking access. If there already exists a previously submitted but not yet executed SEPA order for this account (either another direct debit order, or a money transfer order), then that order will be discarded and replaced with the new order that is being created with this service call.<br/><br/>Notes:<br/>• This service cannot be used for the demo account.<br/>• When using a two-step-procedure with flag 'implicitExecute' = true, then this service will immediately execute the direct debit. The response will not contain any challenge message and you won't be required to make a subsequent call to /executeSepaDirectDebit. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.request_sepa_direct_debit(body, async=True)
>>> result = thread.get()
:param async bool
:param RequestSepaDirectDebitParams body: Parameters for a SEPA direct debit request (required)
:return: DirectDebitOrderingResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.request_sepa_direct_debit_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.request_sepa_direct_debit_with_http_info(body, **kwargs) # noqa: E501
return data
def request_sepa_direct_debit_with_http_info(self, body, **kwargs): # noqa: E501
"""Request SEPA Direct Debit # noqa: E501
Submit a SEPA direct debit order for one or multiple direct debits. Returns an instruction from the bank server that can be displayed to the user (e.g. \"Enter TAN\"), typically in the language of the bank's country. The order remains valid for execution for only a couple of minutes (the exact validity period depends on the bank). For executing the order, use the /executeSepaDirectDebit service after calling this service. Note that when the order is not executed within the validity period, the bank might take note of that and - if happening too often - ultimately lock the user's online banking access. If there already exists a previously submitted but not yet executed SEPA order for this account (either another direct debit order, or a money transfer order), then that order will be discarded and replaced with the new order that is being created with this service call.<br/><br/>Notes:<br/>• This service cannot be used for the demo account.<br/>• When using a two-step-procedure with flag 'implicitExecute' = true, then this service will immediately execute the direct debit. The response will not contain any challenge message and you won't be required to make a subsequent call to /executeSepaDirectDebit. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.request_sepa_direct_debit_with_http_info(body, async=True)
>>> result = thread.get()
:param async bool
:param RequestSepaDirectDebitParams body: Parameters for a SEPA direct debit request (required)
:return: DirectDebitOrderingResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async')
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 request_sepa_direct_debit" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `request_sepa_direct_debit`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/requestSepaDirectDebit', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DirectDebitOrderingResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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 request_sepa_money_transfer(self, body, **kwargs): # noqa: E501
"""Request SEPA Money Transfer # noqa: E501
Submit a SEPA money transfer order for either a single or a collective money transfer. Returns an instruction from the bank server that can be displayed to the user (e.g. \"Enter TAN\"), typically in the language of the bank's country. The order remains valid for execution for only a couple of minutes (the exact validity period depends on the bank). For executing the order, use the /executeSepaMoneyTransfer service after calling this service. Note that when the order is not executed within the validity period, the bank might take note of that and - if happening too often - ultimately lock the user's online banking access. If there already exists a previously submitted but not yet executed SEPA order for this account (either another money transfer order, or a direct debit order), then that order will be discarded and replaced with the new order that is being created with this service call.<br/><br/>Notes:<br/>• This service cannot be used for the demo account.<br/>• Some banks may require a multi-step authentication, in which case the service will respond with HTTP code 510 and an error message containing a challenge for the user from the bank. You must display the challenge message to the user, and then retry the service call, passing the user's answer to the bank's challenge in the 'challengeResponse' field.<br/>• When using a two-step-procedure with flag 'implicitExecute' = true, then this service will immediately execute the money transfer. The response will not contain any challenge message and you won't be required to make a subsequent call to /executeSepaMoneyTransfer. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.request_sepa_money_transfer(body, async=True)
>>> result = thread.get()
:param async bool
:param RequestSepaMoneyTransferParams body: Parameters for a SEPA money transfer request (required)
:return: MoneyTransferOrderingResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.request_sepa_money_transfer_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.request_sepa_money_transfer_with_http_info(body, **kwargs) # noqa: E501
return data
def request_sepa_money_transfer_with_http_info(self, body, **kwargs): # noqa: E501
"""Request SEPA Money Transfer # noqa: E501
Submit a SEPA money transfer order for either a single or a collective money transfer. Returns an instruction from the bank server that can be displayed to the user (e.g. \"Enter TAN\"), typically in the language of the bank's country. The order remains valid for execution for only a couple of minutes (the exact validity period depends on the bank). For executing the order, use the /executeSepaMoneyTransfer service after calling this service. Note that when the order is not executed within the validity period, the bank might take note of that and - if happening too often - ultimately lock the user's online banking access. If there already exists a previously submitted but not yet executed SEPA order for this account (either another money transfer order, or a direct debit order), then that order will be discarded and replaced with the new order that is being created with this service call.<br/><br/>Notes:<br/>• This service cannot be used for the demo account.<br/>• Some banks may require a multi-step authentication, in which case the service will respond with HTTP code 510 and an error message containing a challenge for the user from the bank. You must display the challenge message to the user, and then retry the service call, passing the user's answer to the bank's challenge in the 'challengeResponse' field.<br/>• When using a two-step-procedure with flag 'implicitExecute' = true, then this service will immediately execute the money transfer. The response will not contain any challenge message and you won't be required to make a subsequent call to /executeSepaMoneyTransfer. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.request_sepa_money_transfer_with_http_info(body, async=True)
>>> result = thread.get()
:param async bool
:param RequestSepaMoneyTransferParams body: Parameters for a SEPA money transfer request (required)
:return: MoneyTransferOrderingResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async')
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 request_sepa_money_transfer" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `request_sepa_money_transfer`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# Authentication setting
auth_settings = ['finapi_auth'] # noqa: E501
return self.api_client.call_api(
'/api/v1/accounts/requestSepaMoneyTransfer', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='MoneyTransferOrderingResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_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)
| 57.911496 | 1,638 | 0.664603 | 8,382 | 63,471 | 4.895968 | 0.060964 | 0.032945 | 0.01501 | 0.019299 | 0.962206 | 0.956577 | 0.944807 | 0.938106 | 0.92792 | 0.925411 | 0 | 0.013555 | 0.258449 | 63,471 | 1,095 | 1,639 | 57.964384 | 0.858351 | 0.031983 | 0 | 0.743289 | 1 | 0.006711 | 0.204223 | 0.060813 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.006711 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
3f5b8a0bb9cf47caf1630dfd858857b35726ec89 | 3,042 | py | Python | products/migrations/0017_auto_20200114_1212.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | null | null | null | products/migrations/0017_auto_20200114_1212.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | 9 | 2020-01-10T14:10:02.000Z | 2022-03-12T00:08:19.000Z | products/migrations/0017_auto_20200114_1212.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.5 on 2020-01-14 03:12
from django.db import migrations, models
import products.models
class Migration(migrations.Migration):
dependencies = [
('products', '0016_auto_20200114_1037'),
]
operations = [
migrations.RemoveField(
model_name='template',
name='uppersole_left',
),
migrations.AddField(
model_name='template',
name='liner_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AddField(
model_name='template',
name='liner_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AddField(
model_name='template',
name='upper_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='midsole_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='midsole_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='outsole_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='outsole_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='shoelace_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='shoelace_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='tongue_left',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='tongue_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
migrations.AlterField(
model_name='template',
name='uppersole_right',
field=models.FileField(blank=True, null=True, unique=True, upload_to=products.models.generate_path),
),
]
| 38.506329 | 112 | 0.615056 | 316 | 3,042 | 5.753165 | 0.158228 | 0.10011 | 0.121562 | 0.150165 | 0.889439 | 0.867987 | 0.867987 | 0.841034 | 0.841034 | 0.841034 | 0 | 0.013951 | 0.26956 | 3,042 | 78 | 113 | 39 | 0.80423 | 0.014793 | 0 | 0.694444 | 1 | 0 | 0.098498 | 0.007679 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.027778 | 0 | 0.069444 | 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 |
58ab627753f28c2003bec4bb460152f53bccec79 | 1,672 | py | Python | conventions/migrations/0019_auto_20220418_1602.py | MTES-MCT/apilos | 6404b94b0f668e39c1dc12a6421aebd26ef1c98b | [
"MIT"
] | null | null | null | conventions/migrations/0019_auto_20220418_1602.py | MTES-MCT/apilos | 6404b94b0f668e39c1dc12a6421aebd26ef1c98b | [
"MIT"
] | 2 | 2021-12-15T05:10:43.000Z | 2021-12-15T05:11:00.000Z | conventions/migrations/0019_auto_20220418_1602.py | MTES-MCT/apilos | 6404b94b0f668e39c1dc12a6421aebd26ef1c98b | [
"MIT"
] | 1 | 2021-12-28T13:06:06.000Z | 2021-12-28T13:06:06.000Z | # Generated by Django 3.2.12 on 2022-04-18 14:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("conventions", "0018_convention_type1and2"),
]
operations = [
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option1",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option2",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option3",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option4",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option5",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option6",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option7",
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name="convention",
name="type2_lgts_concernes_option8",
field=models.BooleanField(default=True),
),
]
| 30.962963 | 53 | 0.593301 | 148 | 1,672 | 6.472973 | 0.290541 | 0.150313 | 0.192067 | 0.22547 | 0.776618 | 0.741127 | 0.741127 | 0.741127 | 0.741127 | 0.679541 | 0 | 0.032702 | 0.305024 | 1,672 | 53 | 54 | 31.54717 | 0.791738 | 0.027512 | 0 | 0.680851 | 1 | 0 | 0.20936 | 0.153325 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.021277 | 0 | 0.085106 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
58c8dd85d4aad92758100b5da53e1afef5484bee | 80,989 | py | Python | autogl/module/train/node_classification_trainer/node_classification_sampled_trainer.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/train/node_classification_trainer/node_classification_sampled_trainer.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/train/node_classification_trainer/node_classification_sampled_trainer.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | import os
import torch
import logging
import typing as _typing
import torch.nn.functional
import torch.utils.data
import autogl.data
from .. import register_trainer
from ..base import BaseNodeClassificationTrainer, EarlyStopping, Evaluation
from ..evaluation import get_feval, EvaluatorUtility, Logloss, MicroF1
from ..sampling.sampler.target_dependant_sampler import TargetDependantSampledData
from ..sampling.sampler.neighbor_sampler import NeighborSampler
from ..sampling.sampler.graphsaint_sampler import *
from ..sampling.sampler.layer_dependent_importance_sampler import (
LayerDependentImportanceSampler,
)
from ...model import BaseAutoModel
from ...model.base import ClassificationSupportedSequentialModel
LOGGER: logging.Logger = logging.getLogger("Node classification sampling trainer")
class _DeterministicNeighborSamplerStore:
def __init__(self):
self.__neighbor_sampler_mapping: _typing.List[
_typing.Tuple[torch.LongTensor, NeighborSampler]
] = []
@classmethod
def __is_target_node_indexes_equal(
cls, a: torch.LongTensor, b: torch.LongTensor
) -> bool:
if not a.dtype == b.dtype == torch.int64:
return False
if a.size() != b.size():
return False
return torch.where(a != b)[0].size(0) == 0
def __setitem__(
self, target_nodes: torch.Tensor, neighbor_sampler: NeighborSampler
):
target_nodes: _typing.Any = target_nodes.cpu()
if type(target_nodes) != torch.Tensor or target_nodes.dtype != torch.int64:
raise TypeError
if type(neighbor_sampler) != NeighborSampler:
raise TypeError
for i in range(len(self.__neighbor_sampler_mapping)):
if self.__is_target_node_indexes_equal(
target_nodes, self.__neighbor_sampler_mapping[i][0]
):
self.__neighbor_sampler_mapping[i] = (target_nodes, neighbor_sampler)
return
self.__neighbor_sampler_mapping.append((target_nodes, neighbor_sampler))
def __getitem__(
self, target_nodes: torch.Tensor
) -> _typing.Optional[NeighborSampler]:
target_nodes: _typing.Any = target_nodes.cpu()
if type(target_nodes) != torch.Tensor or target_nodes.dtype != torch.int64:
raise TypeError
for (
__current_target_nodes,
__neighbor_sampler,
) in self.__neighbor_sampler_mapping:
if self.__is_target_node_indexes_equal(
target_nodes, __current_target_nodes
):
return __neighbor_sampler
return None
@register_trainer("NodeClassificationGraphSAINTTrainer")
class NodeClassificationGraphSAINTTrainer(BaseNodeClassificationTrainer):
"""
The node classification trainer utilizing GraphSAINT technique.
Parameters
------------
model: ``BaseModel`` or ``str``
The name or class of model adopted
num_features: ``int``
number of features for each node provided by dataset
num_classes: ``int``
number of classes to classify
optimizer: ``Optimizer`` of ``str``
The (name of) optimizer used to train and predict.
lr: ``float``
The learning rate of link prediction task.
max_epoch: ``int``
The max number of epochs in training.
early_stopping_round: ``int``
The round of early stop.
weight_decay: ``float``
The weight decay argument for optimizer
device: ``torch.device`` or ``str``
The device where model will be running on.
init: ``bool``
If True(False), the model will (not) be initialized.
feval: ``str``.
The evaluation method adopted in this function.
"""
def __init__(
self,
model: _typing.Union[BaseAutoModel, str],
num_features: int,
num_classes: int,
optimizer: _typing.Union[_typing.Type[torch.optim.Optimizer], str, None] = ...,
lr: float = 1e-4,
max_epoch: int = 100,
early_stopping_round: int = 100,
weight_decay: float = 1e-4,
device: _typing.Optional[torch.device] = None,
init: bool = True,
feval: _typing.Union[
_typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = (MicroF1,),
loss: str = "nll_loss",
lr_scheduler_type: _typing.Optional[str] = None,
**kwargs,
):
if isinstance(optimizer, type) and issubclass(optimizer, torch.optim.Optimizer):
self._optimizer_class: _typing.Type[torch.optim.Optimizer] = optimizer
elif type(optimizer) == str:
if optimizer.lower() == "adam":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
elif optimizer.lower() == "adam" + "w":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.AdamW
elif optimizer.lower() == "sgd":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.SGD
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
self._learning_rate: float = lr if lr > 0 else 1e-4
self._lr_scheduler_type: _typing.Optional[str] = lr_scheduler_type
self._max_epoch: int = max_epoch if max_epoch > 0 else 1e2
self._weight_decay: float = weight_decay if weight_decay > 0 else 1e-4
self._early_stopping = EarlyStopping(
patience=early_stopping_round if early_stopping_round > 0 else 1e2,
verbose=False,
)
""" Assign an empty initial hyper parameter space """
self._hyper_parameter_space: _typing.Sequence[
_typing.Dict[str, _typing.Any]
] = []
self._valid_result: torch.Tensor = torch.zeros(0)
self._valid_result_prob: torch.Tensor = torch.zeros(0)
self._valid_score: _typing.Sequence[float] = ()
""" Set GraphSAINT hyper-parameters """
" Set sampler_type "
sampler_type: str = kwargs.get("sampler_type", "edge")
if type(sampler_type) != str:
raise TypeError
else:
sampler_type: str = sampler_type.strip().lower()
if sampler_type not in ("node", "edge", "rw"):
sampler_type: str = "edge" # default to edge sampler
self.__sampler_type: str = sampler_type
" Set num_graphs_per_epoch "
num_graphs_per_epoch: int = kwargs.get("num_graphs_per_epoch", 50)
if type(num_graphs_per_epoch) != int:
raise TypeError
elif not num_graphs_per_epoch > 0:
num_graphs_per_epoch = 50
self.__num_graphs_per_epoch: int = num_graphs_per_epoch
" Set sampled_budget "
sampled_budget: int = kwargs.get("sampled_budget", 1e4)
# todo: This is a version caused by current unreasonable initialization process
# todo: Refactor the framework for trainer to fix in future version
# if type(sampled_budget) != int:
# raise TypeError
# if not sampled_budget > 0:
# raise ValueError
self.__sampled_budget: int = sampled_budget
" Set walk_length "
walk_length: int = kwargs.get("walk_length", 2)
if type(walk_length) != int:
raise TypeError
if not walk_length > 0:
raise ValueError
self.__walk_length: int = walk_length
" Set sample_coverage_factor "
sample_coverage_factor: int = kwargs.get("sample_coverage_factor", 50)
if type(sample_coverage_factor) != int:
raise TypeError
elif not sample_coverage_factor > 0:
sample_coverage_factor = 50
self.__sample_coverage_factor: int = sample_coverage_factor
""" Set num_workers """
def _cpu_count() -> int:
__cpu_count: _typing.Optional[int] = os.cpu_count()
return __cpu_count if __cpu_count else 0
# self.__training_sampler_num_workers: int = kwargs.get(
# "training_sampler_num_workers", _cpu_count()
# )
# if not 0 <= self.__training_sampler_num_workers <= _cpu_count():
# self.__training_sampler_num_workers: int = _cpu_count()
# force to be 0 to be compactible with current pyg solution.
self.__training_sampler_num_workers: int = 0
super(NodeClassificationGraphSAINTTrainer, self).__init__(
model, None, num_features, num_classes, device, feval, loss
)
self.__is_initialized: bool = False
if init:
self.initialize()
def initialize(self):
if self.__is_initialized:
return self
self.model.initialize()
self.__is_initialized = True
return self
def to(self, device: torch.device):
self.device = device
if self.model is not None:
self.model.to(self.device)
def get_model(self):
return self.model
def __train_only(self, integral_data):
"""
The function of training on the given dataset and mask.
:param integral_data: data of a specific graph
:return: None
"""
optimizer: torch.optim.Optimizer = self._optimizer_class(
self.model.model.parameters(),
lr=self._learning_rate,
weight_decay=self._weight_decay,
)
if type(self._lr_scheduler_type) == str:
if self._lr_scheduler_type.lower() == "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.StepLR = (
torch.optim.lr_scheduler.StepLR(optimizer, step_size=100, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "multi" + "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.MultiStepLR = (
torch.optim.lr_scheduler.MultiStepLR(
optimizer, milestones=[30, 80], gamma=0.1
)
)
elif self._lr_scheduler_type.lower() == "exponential" + "lr":
lr_scheduler: torch.optim.lr_scheduler.ExponentialLR = (
torch.optim.lr_scheduler.ExponentialLR(optimizer, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "ReduceLROnPlateau".lower():
lr_scheduler: torch.optim.lr_scheduler.ReduceLROnPlateau = (
torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, "min")
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
setattr(
integral_data,
"edge_weight",
self.__compute_normalized_edge_weight(getattr(integral_data, "edge_index")),
)
" Generate Sampler "
if self.__sampler_type.lower() == "edge":
_sampler: torch_geometric.data.GraphSAINTEdgeSampler = (
GraphSAINTSamplerFactory.create_edge_sampler(
integral_data,
self.__num_graphs_per_epoch,
self.__sampled_budget,
self.__sample_coverage_factor,
num_workers=self.__training_sampler_num_workers,
)
)
elif self.__sampler_type.lower() == "node":
_sampler: torch_geometric.data.GraphSAINTNodeSampler = (
GraphSAINTSamplerFactory.create_node_sampler(
integral_data,
self.__num_graphs_per_epoch,
self.__sampled_budget,
self.__sample_coverage_factor,
num_workers=self.__training_sampler_num_workers,
)
)
elif self.__sampler_type.lower() == "rw":
_sampler: torch_geometric.data.GraphSAINTRandomWalkSampler = (
GraphSAINTSamplerFactory.create_random_walk_sampler(
integral_data,
self.__num_graphs_per_epoch,
self.__sampled_budget,
self.__walk_length,
self.__sample_coverage_factor,
num_workers=self.__training_sampler_num_workers,
)
)
else:
_sampler: torch_geometric.data.GraphSAINTRandomWalkSampler = (
GraphSAINTSamplerFactory.create_random_walk_sampler(
integral_data,
self.__num_graphs_per_epoch,
self.__sampled_budget,
self.__walk_length,
self.__sample_coverage_factor,
num_workers=self.__training_sampler_num_workers,
)
)
for current_epoch in range(self._max_epoch):
self.model.model.train()
optimizer.zero_grad()
""" epoch start """
for sampled_data in _sampler:
sampled_data = sampled_data.to(self.device)
setattr(
sampled_data,
"edge_weight",
getattr(sampled_data, "edge_norm")
* getattr(sampled_data, "edge_weight"),
)
optimizer.zero_grad()
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
prediction: torch.Tensor = self.model.model.cls_forward(
sampled_data
)
else:
prediction: torch.Tensor = self.model.model(sampled_data)
if not hasattr(torch.nn.functional, self.loss):
raise TypeError(f"PyTorch does not support loss type {self.loss}")
loss_function = getattr(torch.nn.functional, self.loss)
loss_value: torch.Tensor = loss_function(
prediction, getattr(sampled_data, "y"), reduction="none"
)
loss_value = (loss_value * getattr(sampled_data, "node_norm"))[
sampled_data.train_mask
].sum()
loss_value.backward()
optimizer.step()
lr_scheduler.step()
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
validation_results: _typing.Sequence[float] = self.evaluate(
(integral_data,), "val", [self.feval[0]]
)
if self.feval[0].is_higher_better():
validation_loss: float = -validation_results[0]
else:
validation_loss: float = validation_results[0]
self._early_stopping(validation_loss, self.model.model)
if self._early_stopping.early_stop:
LOGGER.debug("Early stopping at %d", current_epoch)
break
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
self._early_stopping.load_checkpoint(self.model.model)
def __predict_only(
self,
integral_data,
mask_or_target_nodes_indexes: _typing.Union[torch.BoolTensor, torch.LongTensor],
) -> torch.Tensor:
"""
The function of predicting on the given data.
:param integral_data: data of a specific graph
:param mask_or_target_nodes_indexes: ...
:return: the result of prediction on the given dataset
"""
import copy
integral_data = copy.copy(integral_data)
self.model.model.eval()
setattr(
integral_data,
"edge_weight",
self.__compute_normalized_edge_weight(getattr(integral_data, "edge_index")),
)
integral_data = integral_data.to(self.device)
with torch.no_grad():
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
prediction: torch.Tensor = self.model.model.cls_forward(integral_data)
else:
prediction: torch.Tensor = self.model.model(integral_data)
return prediction[mask_or_target_nodes_indexes]
def predict_proba(
self, dataset, mask: _typing.Optional[str] = None, in_log_format: bool = False
):
"""
The function of predicting the probability on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
in_log_format: ``bool``.
If True(False), the probability will (not) be log format.
Returns
-------
The prediction result.
"""
data = dataset[0].to(torch.device("cpu"))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.BoolTensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.BoolTensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.BoolTensor = data.val_mask
else:
_mask: torch.BoolTensor = data.test_mask
else:
_mask: torch.BoolTensor = data.test_mask
result = self.__predict_only(data, _mask)
return result if in_log_format else torch.exp(result)
def predict(self, dataset, mask: _typing.Optional[str] = None) -> torch.Tensor:
"""
The function of predicting on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
Returns
-------
The prediction result of ``predict_proba``.
"""
return self.predict_proba(dataset, mask, in_log_format=True).max(1)[1]
def evaluate(
self,
dataset,
mask: _typing.Optional[str] = None,
feval: _typing.Union[
None, _typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = None,
) -> _typing.Sequence[float]:
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
feval: ``str``.
The evaluation method adopted in this function.
Returns
-------
result: The evaluation result on the given dataset.
"""
data = dataset[0]
data = data.to(self.device)
if feval is None:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = self.feval
else:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = get_feval(list(feval))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.Tensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.Tensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.Tensor = data.val_mask
else:
_mask: torch.Tensor = data.test_mask
else:
_mask: torch.Tensor = data.test_mask
prediction_probability: torch.Tensor = self.predict_proba(dataset, mask)
y_ground_truth: torch.Tensor = data.y[_mask]
return [
f.evaluate(
prediction_probability.cpu().numpy(),
y_ground_truth.cpu().numpy(),
)
for f in _feval
]
@classmethod
def __compute_normalized_edge_weight(
cls,
edge_index: torch.LongTensor,
original_edge_weight: _typing.Optional[torch.Tensor] = ...,
) -> torch.Tensor:
if type(edge_index) != torch.Tensor:
raise TypeError
if original_edge_weight in (None, Ellipsis, ...):
original_edge_weight: torch.Tensor = torch.ones(edge_index.size(1))
elif type(original_edge_weight) != torch.Tensor:
raise TypeError
elif original_edge_weight.numel() != edge_index.size(1):
raise ValueError
elif original_edge_weight.size() != (edge_index.size(1),):
original_edge_weight = original_edge_weight.resize(edge_index.size(1))
__out_degree: torch.Tensor = torch_geometric.utils.degree(edge_index[0])
__in_degree: torch.Tensor = torch_geometric.utils.degree(edge_index[1])
temp_tensor: torch.Tensor = torch.stack(
[__out_degree[edge_index[0]], __in_degree[edge_index[1]]]
)
temp_tensor: torch.Tensor = torch.pow(temp_tensor, -0.5)
temp_tensor[torch.isinf(temp_tensor)] = 0.0
return original_edge_weight * temp_tensor[0] * temp_tensor[1]
def train(self, dataset, keep_valid_result: bool = True):
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
keep_valid_result: ``bool``
If True(False), save the validation result after training.
Returns
--------
None
"""
import gc
gc.collect()
data = dataset[0].to(torch.device("cpu"))
self.__train_only(data)
if keep_valid_result:
prediction: torch.Tensor = self.__predict_only(data, data.val_mask)
self._valid_result: torch.Tensor = prediction.max(1)[1]
self._valid_result_prob: torch.Tensor = prediction
self._valid_score: _typing.Sequence[float] = self.evaluate(dataset, "val")
def get_valid_predict(self) -> torch.Tensor:
return self._valid_result
def get_valid_predict_proba(self) -> torch.Tensor:
return self._valid_result_prob
def get_valid_score(
self, return_major: bool = True
) -> _typing.Union[
_typing.Tuple[float, bool],
_typing.Tuple[_typing.Sequence[float], _typing.Sequence[bool]],
]:
"""
The function of getting the valid score.
Parameters
----------
return_major: ``bool``.
If True, the return only consists of the major result.
If False, the return consists of the all results.
Returns
-------
result: The valid score.
"""
if return_major:
return self._valid_score[0], self.feval[0].is_higher_better()
else:
return self._valid_score, [f.is_higher_better() for f in self.feval]
def __repr__(self) -> str:
import yaml
__repr: dict = {
"trainer_name": self.__class__.__name__,
"learning_rate": self._learning_rate,
"model": repr(self.model),
"max_epoch": self._max_epoch,
"early_stopping_round": self._early_stopping.patience,
"sampler_type": self.__sampler_type,
"sampled_budget": self.__sampled_budget,
}
if self.__sampler_type == "rw":
__repr.update({"walk_length": self.__walk_length})
return yaml.dump(__repr)
def duplicate_from_hyper_parameter(
self,
hp: _typing.Dict[str, _typing.Any],
model: _typing.Optional[BaseAutoModel] = None,
) -> "NodeClassificationGraphSAINTTrainer":
"""
The function of duplicating a new instance from the given hyper-parameter.
Parameters
------------
hp: ``dict``.
The hyper-parameter settings for the new instance.
model: ``BaseModel``
The name or class of model adopted
Returns
--------
instance: ``NodeClassificationGraphSAINTTrainer``
A new instance of trainer.
"""
if model is None or not isinstance(model, BaseAutoModel):
model: BaseAutoModel = self.model
model = model.from_hyper_parameter(hp["encoder"])
return NodeClassificationGraphSAINTTrainer(
model,
self.num_features,
self.num_classes,
self._optimizer_class,
device=self.device,
init=True,
feval=self.feval,
loss=self.loss,
lr_scheduler_type=self._lr_scheduler_type,
**hp["trainer"],
)
@register_trainer("NodeClassificationLayerDependentImportanceSamplingTrainer")
class NodeClassificationLayerDependentImportanceSamplingTrainer(
BaseNodeClassificationTrainer
):
"""
The node classification trainer utilizing Layer dependent importance sampling technique.
Parameters
------------
model: ``BaseModel`` or ``str``
The name or class of model adopted
num_features: ``int``
number of features for each node provided by dataset
num_classes: ``int``
number of classes to classify
optimizer: ``Optimizer`` of ``str``
The (name of) optimizer used to train and predict.
lr: ``float``
The learning rate of link prediction task.
max_epoch: ``int``
The max number of epochs in training.
early_stopping_round: ``int``
The round of early stop.
weight_decay: ``float``
The weight decay argument for optimizer
device: ``torch.device`` or ``str``
The device where model will be running on.
init: ``bool``
If True(False), the model will (not) be initialized.
feval: ``str``.
The evaluation method adopted in this function.
"""
def __init__(
self,
model: _typing.Union[BaseAutoModel, str],
num_features: int,
num_classes: int,
optimizer: _typing.Union[_typing.Type[torch.optim.Optimizer], str, None] = ...,
lr: float = 1e-4,
max_epoch: int = 100,
early_stopping_round: int = 100,
weight_decay: float = 1e-4,
device: _typing.Optional[torch.device] = None,
init: bool = True,
feval: _typing.Union[
_typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = (MicroF1,),
loss: str = "nll_loss",
lr_scheduler_type: _typing.Optional[str] = None,
**kwargs,
) -> None:
if isinstance(optimizer, type) and issubclass(optimizer, torch.optim.Optimizer):
self._optimizer_class: _typing.Type[torch.optim.Optimizer] = optimizer
elif type(optimizer) == str:
if optimizer.lower() == "adam":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
elif optimizer.lower() == "adam" + "w":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.AdamW
elif optimizer.lower() == "sgd":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.SGD
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
self._learning_rate: float = lr if lr > 0 else 1e-4
self._lr_scheduler_type: _typing.Optional[str] = lr_scheduler_type
self._max_epoch: int = max_epoch if max_epoch > 0 else 1e2
self._weight_decay: float = weight_decay if weight_decay > 0 else 1e-4
self._early_stopping = EarlyStopping(
patience=early_stopping_round if early_stopping_round > 0 else 1e2,
verbose=False,
)
""" Assign an empty initial hyper parameter space """
self._hyper_parameter_space: _typing.Sequence[
_typing.Dict[str, _typing.Any]
] = []
self._valid_result: torch.Tensor = torch.zeros(0)
self._valid_result_prob: torch.Tensor = torch.zeros(0)
self._valid_score: _typing.Sequence[float] = ()
""" Set hyper parameters """
self.__sampled_node_sizes: _typing.Sequence[int] = kwargs.get(
"sampled_node_sizes"
)
self.__training_batch_size: int = kwargs.get("training_batch_size", 1024)
if not self.__training_batch_size > 0:
self.__training_batch_size: int = 1024
self.__predicting_batch_size: int = kwargs.get("predicting_batch_size", 1024)
if not self.__predicting_batch_size > 0:
self.__predicting_batch_size: int = 1024
cpu_count: int = os.cpu_count() if os.cpu_count() is not None else 0
self.__training_sampler_num_workers: int = kwargs.get(
"training_sampler_num_workers", cpu_count
)
if self.__training_sampler_num_workers > cpu_count:
self.__training_sampler_num_workers = cpu_count
self.__predicting_sampler_num_workers: int = kwargs.get(
"predicting_sampler_num_workers", cpu_count
)
if self.__predicting_sampler_num_workers > cpu_count:
self.__predicting_sampler_num_workers = cpu_count
super(NodeClassificationLayerDependentImportanceSamplingTrainer, self).__init__(
model, None, num_features, num_classes, device, feval, loss
)
self.__neighbor_sampler_store: _DeterministicNeighborSamplerStore = (
_DeterministicNeighborSamplerStore()
)
self.__is_initialized: bool = False
if init:
self.initialize()
def initialize(self):
if self.__is_initialized:
return self
self.model.initialize()
self.__is_initialized = True
return self
def to(self, device: torch.device):
self.device = device
if self.model is not None:
self.model.to(self.device)
def get_model(self):
return self.model
def __train_only(self, integral_data):
"""
The function of training on the given dataset and mask.
:param integral_data: data of a specific graph
:return: self
"""
optimizer: torch.optim.Optimizer = self._optimizer_class(
self.model.model.parameters(),
lr=self._learning_rate,
weight_decay=self._weight_decay,
)
if type(self._lr_scheduler_type) == str:
if self._lr_scheduler_type.lower() == "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.StepLR = (
torch.optim.lr_scheduler.StepLR(optimizer, step_size=100, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "multi" + "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.MultiStepLR = (
torch.optim.lr_scheduler.MultiStepLR(
optimizer, milestones=[30, 80], gamma=0.1
)
)
elif self._lr_scheduler_type.lower() == "exponential" + "lr":
lr_scheduler: torch.optim.lr_scheduler.ExponentialLR = (
torch.optim.lr_scheduler.ExponentialLR(optimizer, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "ReduceLROnPlateau".lower():
lr_scheduler: torch.optim.lr_scheduler.ReduceLROnPlateau = (
torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, "min")
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
__layer_dependent_importance_sampler: LayerDependentImportanceSampler = (
LayerDependentImportanceSampler(
integral_data.edge_index,
torch.where(integral_data.train_mask)[0].unique(),
self.__sampled_node_sizes,
batch_size=self.__training_batch_size,
num_workers=self.__training_sampler_num_workers,
)
)
for current_epoch in range(self._max_epoch):
self.model.model.train()
optimizer.zero_grad()
""" epoch start """
" sample graphs "
for sampled_data in __layer_dependent_importance_sampler:
optimizer.zero_grad()
sampled_data: TargetDependantSampledData = sampled_data
# 由于现在的Model设计是接受Data的,所以只能组装一个采样的Data作为参数
sampled_graph: autogl.data.Data = autogl.data.Data(
x=integral_data.x[sampled_data.all_sampled_nodes_indexes],
y=integral_data.y[sampled_data.all_sampled_nodes_indexes],
)
sampled_graph.to(self.device)
sampled_graph.edge_indexes: _typing.Sequence[torch.LongTensor] = [
current_layer.edge_index_for_sampled_graph.to(self.device)
for current_layer in sampled_data.sampled_edges_for_layers
]
sampled_graph.edge_weights: _typing.Sequence[torch.Tensor] = [
current_layer.edge_weight.to(self.device)
for current_layer in sampled_data.sampled_edges_for_layers
]
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
prediction: torch.Tensor = self.model.model.cls_forward(
sampled_graph
)
else:
prediction: torch.Tensor = self.model.model(sampled_graph)
if not hasattr(torch.nn.functional, self.loss):
raise TypeError(f"PyTorch does not support loss type {self.loss}")
loss_function = getattr(torch.nn.functional, self.loss)
loss_value: torch.Tensor = loss_function(
prediction[
sampled_data.target_nodes_indexes.indexes_in_sampled_graph
],
sampled_graph.y[
sampled_data.target_nodes_indexes.indexes_in_sampled_graph
],
)
loss_value.backward()
optimizer.step()
if self._lr_scheduler_type:
lr_scheduler.step()
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
validation_results: _typing.Sequence[float] = self.evaluate(
(integral_data,), "val", [self.feval[0]]
)
if self.feval[0].is_higher_better():
validation_loss: float = -validation_results[0]
else:
validation_loss: float = validation_results[0]
self._early_stopping(validation_loss, self.model.model)
if self._early_stopping.early_stop:
LOGGER.debug("Early stopping at %d", current_epoch)
break
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
self._early_stopping.load_checkpoint(self.model.model)
def __predict_only(
self,
integral_data,
mask_or_target_nodes_indexes: _typing.Union[torch.BoolTensor, torch.LongTensor],
) -> torch.Tensor:
"""
The function of predicting on the given data.
:param integral_data: data of a specific graph
:param mask_or_target_nodes_indexes: ...
:return: the result of prediction on the given dataset
"""
self.model.model.eval()
integral_data = integral_data.to(torch.device("cpu"))
mask_or_target_nodes_indexes = mask_or_target_nodes_indexes.to(
torch.device("cpu")
)
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
sequential_gnn_model: ClassificationSupportedSequentialModel = (
self.model.model
)
__num_layers: int = len(self.__sampled_node_sizes)
x: torch.Tensor = getattr(integral_data, "x")
for _current_layer_index in range(__num_layers - 1):
__next_x: _typing.Optional[torch.Tensor] = None
_optional_neighbor_sampler: _typing.Optional[
NeighborSampler
] = self.__neighbor_sampler_store[torch.arange(x.size(0))]
if (
_optional_neighbor_sampler is not None
and type(_optional_neighbor_sampler) == NeighborSampler
):
current_neighbor_sampler: NeighborSampler = (
_optional_neighbor_sampler
)
else:
current_neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
torch.arange(x.size(0)).unique(),
[-1],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
self.__neighbor_sampler_store[
torch.arange(x.size(0))
] = current_neighbor_sampler
for _target_dependant_sampled_data in current_neighbor_sampler:
_target_dependant_sampled_data: TargetDependantSampledData = (
_target_dependant_sampled_data
)
_sampled_graph: autogl.data.Data = autogl.data.Data(
x=x[_target_dependant_sampled_data.all_sampled_nodes_indexes],
edge_index=(
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_index_for_sampled_graph
),
)
_sampled_graph.edge_weight: torch.Tensor = (
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_weight
)
_sampled_graph: autogl.data.Data = _sampled_graph.to(self.device)
with torch.no_grad():
__sampled_graph_inferences: torch.Tensor = (
sequential_gnn_model.sequential_encoding_layers[
_current_layer_index
](_sampled_graph)
)
_sampled_target_nodes_inferences: torch.Tensor = __sampled_graph_inferences[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_sampled_graph
].cpu()
if __next_x is None:
__next_x: torch.Tensor = torch.zeros(
x.size(0), __sampled_graph_inferences.size(1)
)
__next_x[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_integral_graph
] = _sampled_target_nodes_inferences
x: torch.Tensor = __next_x
" The following procedures are for the top layer "
if mask_or_target_nodes_indexes.dtype == torch.bool:
target_nodes_indexes: _typing.Any = torch.where(
mask_or_target_nodes_indexes
)[0]
else:
target_nodes_indexes: _typing.Any = mask_or_target_nodes_indexes.long()
_optional_neighbor_sampler: _typing.Optional[
NeighborSampler
] = self.__neighbor_sampler_store[target_nodes_indexes]
if (
_optional_neighbor_sampler is not None
and type(_optional_neighbor_sampler) == NeighborSampler
):
current_neighbor_sampler: NeighborSampler = _optional_neighbor_sampler
else:
current_neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
target_nodes_indexes,
[-1],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
self.__neighbor_sampler_store[
target_nodes_indexes
] = current_neighbor_sampler
prediction_batch_cumulative_builder = (
EvaluatorUtility.PredictionBatchCumulativeBuilder()
)
for _target_dependant_sampled_data in current_neighbor_sampler:
_sampled_graph: autogl.data.Data = autogl.data.Data(
x[_target_dependant_sampled_data.all_sampled_nodes_indexes],
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_index_for_sampled_graph,
)
_sampled_graph.edge_weight: torch.Tensor = (
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_weight
)
_sampled_graph: autogl.data.Data = _sampled_graph.to(self.device)
with torch.no_grad():
prediction_batch_cumulative_builder.add_batch(
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_integral_graph.cpu().numpy(),
sequential_gnn_model.cls_decode(
sequential_gnn_model.sequential_encoding_layers[-1](
_sampled_graph
)
)[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_sampled_graph
]
.cpu()
.numpy(),
)
return torch.from_numpy(prediction_batch_cumulative_builder.compose()[1])
else:
if mask_or_target_nodes_indexes.dtype == torch.bool:
target_nodes_indexes: _typing.Any = torch.where(
mask_or_target_nodes_indexes
)[0]
else:
target_nodes_indexes: _typing.Any = mask_or_target_nodes_indexes.long()
neighbor_sampler: NeighborSampler = NeighborSampler(
torch_geometric.utils.add_remaining_self_loops(
integral_data.edge_index
)[0],
target_nodes_indexes,
[-1 for _ in self.__sampled_node_sizes],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
prediction_batch_cumulative_builder = (
EvaluatorUtility.PredictionBatchCumulativeBuilder()
)
self.model.model.eval()
for sampled_data in neighbor_sampler:
sampled_data: TargetDependantSampledData = sampled_data
sampled_graph: autogl.data.Data = autogl.data.Data(
integral_data.x[sampled_data.all_sampled_nodes_indexes],
integral_data.y[sampled_data.all_sampled_nodes_indexes],
)
sampled_graph.to(self.device)
sampled_graph.edge_indexes: _typing.Sequence[torch.LongTensor] = [
current_layer.edge_index_for_sampled_graph.to(self.device)
for current_layer in sampled_data.sampled_edges_for_layers
]
sampled_graph.edge_weights: _typing.Sequence[torch.FloatTensor] = [
current_layer.edge_weight.to(self.device)
for current_layer in sampled_data.sampled_edges_for_layers
]
with torch.no_grad():
prediction_batch_cumulative_builder.add_batch(
sampled_data.target_nodes_indexes.indexes_in_integral_graph.cpu().numpy(),
self.model.model(sampled_graph)[
sampled_data.target_nodes_indexes.indexes_in_sampled_graph
]
.cpu()
.numpy(),
)
return torch.from_numpy(prediction_batch_cumulative_builder.compose()[1])
def predict_proba(
self, dataset, mask: _typing.Optional[str] = None, in_log_format: bool = False
):
"""
The function of predicting the probability on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
in_log_format: ``bool``.
If True(False), the probability will (not) be log format.
Returns
-------
The prediction result.
"""
data = dataset[0].to(torch.device("cpu"))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.BoolTensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.BoolTensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.BoolTensor = data.val_mask
else:
_mask: torch.BoolTensor = data.test_mask
else:
_mask: torch.BoolTensor = data.test_mask
result = self.__predict_only(data, _mask)
return result if in_log_format else torch.exp(result)
def predict(self, dataset, mask: _typing.Optional[str] = None) -> torch.Tensor:
"""
The function of predicting on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
Returns
-------
The prediction result of ``predict_proba``.
"""
return self.predict_proba(dataset, mask, in_log_format=True).max(1)[1]
def evaluate(
self,
dataset,
mask: _typing.Optional[str] = None,
feval: _typing.Union[
None, _typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = None,
) -> _typing.Sequence[float]:
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
feval: ``str``.
The evaluation method adopted in this function.
Returns
-------
result: The evaluation result on the given dataset.
"""
data = dataset[0]
data = data.to(self.device)
if feval is None:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = self.feval
else:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = get_feval(list(feval))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.Tensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.Tensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.Tensor = data.val_mask
else:
_mask: torch.Tensor = data.test_mask
else:
_mask: torch.Tensor = data.test_mask
prediction_probability: torch.Tensor = self.predict_proba(dataset, mask)
y_ground_truth: torch.Tensor = data.y[_mask]
return [
f.evaluate(
prediction_probability.cpu().numpy(),
y_ground_truth.cpu().numpy(),
)
for f in _feval
]
def train(self, dataset, keep_valid_result: bool = True):
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
keep_valid_result: ``bool``
If True(False), save the validation result after training.
Returns
--------
None
"""
import gc
gc.collect()
data = dataset[0]
self.__train_only(data)
if keep_valid_result:
data = data.to(torch.device("cpu"))
prediction: torch.Tensor = self.__predict_only(data, data.val_mask)
self._valid_result: torch.Tensor = prediction.max(1)[1]
self._valid_result_prob: torch.Tensor = prediction
self._valid_score: _typing.Sequence[float] = self.evaluate(dataset, "val")
def get_valid_predict(self) -> torch.Tensor:
return self._valid_result
def get_valid_predict_proba(self) -> torch.Tensor:
return self._valid_result_prob
def get_valid_score(
self, return_major: bool = True
) -> _typing.Union[
_typing.Tuple[float, bool],
_typing.Tuple[_typing.Sequence[float], _typing.Sequence[bool]],
]:
"""
The function of getting the valid score.
Parameters
----------
return_major: ``bool``.
If True, the return only consists of the major result.
If False, the return consists of the all results.
Returns
-------
result: The valid score.
"""
if return_major:
return self._valid_score[0], self.feval[0].is_higher_better()
else:
return self._valid_score, [f.is_higher_better() for f in self.feval]
def __repr__(self) -> str:
import yaml
return yaml.dump(
{
"trainer_name": self.__class__.__name__,
"optimizer": self._optimizer_class,
"learning_rate": self._learning_rate,
"max_epoch": self._max_epoch,
"early_stopping_round": self._early_stopping.patience,
"sampling_sizes": self.__sampled_node_sizes,
"model": repr(self.model),
}
)
def duplicate_from_hyper_parameter(
self,
hp: _typing.Dict[str, _typing.Any],
model: _typing.Optional[BaseAutoModel] = None,
) -> "NodeClassificationLayerDependentImportanceSamplingTrainer":
"""
The function of duplicating a new instance from the given hyper-parameter.
Parameters
------------
hp: ``dict``.
The hyper-parameter settings for the new instance.
model: ``BaseModel``
The name or class of model adopted
Returns
--------
instance: ``NodeClassificationLayerDependentImportanceSamplingTrainer``
A new instance of trainer.
"""
if model is None or not isinstance(model, BaseAutoModel):
model: BaseAutoModel = self.model
model = model.from_hyper_parameter(hp["encoder"])
trainer_hp = hp["trainer"]
return NodeClassificationLayerDependentImportanceSamplingTrainer(
model,
self.num_features,
self.num_classes,
self._optimizer_class,
device=self.device,
init=True,
feval=self.feval,
loss=self.loss,
lr_scheduler_type=self._lr_scheduler_type,
**trainer_hp,
)
@register_trainer("NodeClassificationNeighborSamplingTrainer")
class NodeClassificationNeighborSamplingTrainer(BaseNodeClassificationTrainer):
"""
The node classification trainer utilizing Layer dependent importance sampling technique.
Parameters
------------
model: ``BaseModel`` or ``str``
The name or class of model adopted
num_features: ``int``
number of features for each node provided by dataset
num_classes: ``int``
number of classes to classify
optimizer: ``Optimizer`` of ``str``
The (name of) optimizer used to train and predict.
lr: ``float``
The learning rate of link prediction task.
max_epoch: ``int``
The max number of epochs in training.
early_stopping_round: ``int``
The round of early stop.
weight_decay: ``float``
The weight decay argument for optimizer
device: ``torch.device`` or ``str``
The device where model will be running on.
init: ``bool``
If True(False), the model will (not) be initialized.
feval: ``str``.
The evaluation method adopted in this function.
"""
def __init__(
self,
model: _typing.Union[BaseAutoModel, str],
num_features: int,
num_classes: int,
optimizer: _typing.Union[_typing.Type[torch.optim.Optimizer], str, None] = ...,
lr: float = 1e-4,
max_epoch: int = 100,
early_stopping_round: int = 100,
weight_decay: float = 1e-4,
device: _typing.Optional[torch.device] = None,
init: bool = True,
feval: _typing.Union[
_typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = (Logloss,),
loss: str = "nll_loss",
lr_scheduler_type: _typing.Optional[str] = None,
**kwargs,
):
if isinstance(optimizer, type) and issubclass(optimizer, torch.optim.Optimizer):
self._optimizer_class: _typing.Type[torch.optim.Optimizer] = optimizer
elif type(optimizer) == str:
if optimizer.lower() == "adam":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
elif optimizer.lower() == "adam" + "w":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.AdamW
elif optimizer.lower() == "sgd":
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.SGD
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
else:
self._optimizer_class: _typing.Type[
torch.optim.Optimizer
] = torch.optim.Adam
self._learning_rate: float = lr if lr > 0 else 1e-4
self._lr_scheduler_type: _typing.Optional[str] = lr_scheduler_type
self._max_epoch: int = max_epoch if max_epoch > 0 else 1e2
self._weight_decay: float = weight_decay if weight_decay > 0 else 1e-4
self._early_stopping = EarlyStopping(
patience=early_stopping_round if early_stopping_round > 0 else 1e2,
verbose=False,
)
""" Assign an empty initial hyper parameter space """
self._hyper_parameter_space: _typing.Sequence[
_typing.Dict[str, _typing.Any]
] = []
self._valid_result: torch.Tensor = torch.zeros(0)
self._valid_result_prob: torch.Tensor = torch.zeros(0)
self._valid_score: _typing.Sequence[float] = ()
""" Set hyper-parameter """
self.__sampling_sizes: _typing.Sequence[int] = kwargs.get("sampling_sizes")
self.__training_batch_size: int = kwargs.get("training_batch_size", 1024)
if not self.__training_batch_size > 0:
self.__training_batch_size: int = 1024
self.__predicting_batch_size: int = kwargs.get("predicting_batch_size", 1024)
if not self.__predicting_batch_size > 0:
self.__predicting_batch_size: int = 1024
cpu_count: int = os.cpu_count() if os.cpu_count() is not None else 0
self.__training_sampler_num_workers: int = kwargs.get(
"training_sampler_num_workers", cpu_count
)
if self.__training_sampler_num_workers > cpu_count:
self.__training_sampler_num_workers = cpu_count
self.__predicting_sampler_num_workers: int = kwargs.get(
"predicting_sampler_num_workers", cpu_count
)
if self.__predicting_sampler_num_workers > cpu_count:
self.__predicting_sampler_num_workers = cpu_count
super(NodeClassificationNeighborSamplingTrainer, self).__init__(
model, None, num_features, num_classes, device, feval, loss
)
self.__neighbor_sampler_store: _DeterministicNeighborSamplerStore = (
_DeterministicNeighborSamplerStore()
)
self.__is_initialized: bool = False
if init:
self.initialize()
def initialize(self):
if self.__is_initialized:
return self
self.model.initialize()
self.__is_initialized = True
return self
def to(self, device: torch.device):
self.device = device
if self.model is not None:
self.model.to(self.device)
def get_model(self):
return self.model
def __train_only(self, integral_data):
"""
The function of training on the given dataset and mask.
:param integral_data: data of the integral graph
:return: self
"""
optimizer: torch.optim.Optimizer = self._optimizer_class(
self.model.model.parameters(),
lr=self._learning_rate,
weight_decay=self._weight_decay,
)
if type(self._lr_scheduler_type) == str:
if self._lr_scheduler_type.lower() == "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.StepLR = (
torch.optim.lr_scheduler.StepLR(optimizer, step_size=100, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "multi" + "step" + "lr":
lr_scheduler: torch.optim.lr_scheduler.MultiStepLR = (
torch.optim.lr_scheduler.MultiStepLR(
optimizer, milestones=[30, 80], gamma=0.1
)
)
elif self._lr_scheduler_type.lower() == "exponential" + "lr":
lr_scheduler: torch.optim.lr_scheduler.ExponentialLR = (
torch.optim.lr_scheduler.ExponentialLR(optimizer, gamma=0.1)
)
elif self._lr_scheduler_type.lower() == "ReduceLROnPlateau".lower():
lr_scheduler: torch.optim.lr_scheduler.ReduceLROnPlateau = (
torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, "min")
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
else:
lr_scheduler: torch.optim.lr_scheduler.LambdaLR = (
torch.optim.lr_scheduler.LambdaLR(optimizer, lambda _: 1.0)
)
neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
torch.where(integral_data.train_mask)[0].unique(),
self.__sampling_sizes,
batch_size=self.__training_batch_size,
num_workers=self.__training_sampler_num_workers,
)
for current_epoch in range(self._max_epoch):
self.model.model.train()
optimizer.zero_grad()
""" epoch start """
" sample graphs "
for sampled_data in neighbor_sampler:
optimizer.zero_grad()
sampled_data: TargetDependantSampledData = sampled_data
sampled_graph: autogl.data.Data = autogl.data.Data(
x=integral_data.x[sampled_data.all_sampled_nodes_indexes],
y=integral_data.y[sampled_data.all_sampled_nodes_indexes],
)
sampled_graph.to(self.device)
sampled_graph.edge_indexes: _typing.Sequence[torch.LongTensor] = [
current_layer.edge_index_for_sampled_graph.to(self.device)
for current_layer in sampled_data.sampled_edges_for_layers
]
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
prediction: torch.Tensor = self.model.model.cls_forward(
sampled_graph
)
else:
prediction: torch.Tensor = self.model.model(sampled_graph)
if not hasattr(torch.nn.functional, self.loss):
raise TypeError(f"PyTorch does not support loss type {self.loss}")
loss_function = getattr(torch.nn.functional, self.loss)
loss_value: torch.Tensor = loss_function(
prediction[
sampled_data.target_nodes_indexes.indexes_in_sampled_graph
],
sampled_graph.y[
sampled_data.target_nodes_indexes.indexes_in_sampled_graph
],
)
loss_value.backward()
optimizer.step()
if self._lr_scheduler_type:
lr_scheduler.step()
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
validation_results: _typing.Sequence[float] = self.evaluate(
(integral_data,), "val", [self.feval[0]]
)
if self.feval[0].is_higher_better():
validation_loss: float = -validation_results[0]
else:
validation_loss: float = validation_results[0]
self._early_stopping(validation_loss, self.model.model)
if self._early_stopping.early_stop:
LOGGER.debug("Early stopping at %d", current_epoch)
break
if (
hasattr(integral_data, "val_mask")
and getattr(integral_data, "val_mask") is not None
and type(getattr(integral_data, "val_mask")) == torch.Tensor
):
self._early_stopping.load_checkpoint(self.model.model)
def __predict_only(
self,
integral_data,
mask_or_target_nodes_indexes: _typing.Union[torch.BoolTensor, torch.LongTensor],
) -> torch.Tensor:
"""
The function of predicting on the given data.
:param integral_data: data of a specific graph
:param mask_or_target_nodes_indexes: ...
:return: the result of prediction on the given dataset
"""
self.model.model.eval()
integral_data = integral_data.to(torch.device("cpu"))
mask_or_target_nodes_indexes = mask_or_target_nodes_indexes.to(
torch.device("cpu")
)
if isinstance(self.model.model, ClassificationSupportedSequentialModel):
sequential_gnn_model: ClassificationSupportedSequentialModel = (
self.model.model
)
__num_layers: int = len(self.__sampling_sizes)
x: torch.Tensor = getattr(integral_data, "x")
for _current_layer_index in range(__num_layers - 1):
__next_x: _typing.Optional[torch.Tensor] = None
_optional_neighbor_sampler: _typing.Optional[
NeighborSampler
] = self.__neighbor_sampler_store[torch.arange(x.size(0)).unique()]
if (
_optional_neighbor_sampler is not None
and type(_optional_neighbor_sampler) == NeighborSampler
):
current_neighbor_sampler: NeighborSampler = (
_optional_neighbor_sampler
)
else:
current_neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
torch.arange(x.size(0)).unique(),
[-1],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
__temp: _typing.Any = torch.arange(x.size(0))
self.__neighbor_sampler_store[__temp] = current_neighbor_sampler
for _target_dependant_sampled_data in current_neighbor_sampler:
_target_dependant_sampled_data: TargetDependantSampledData = (
_target_dependant_sampled_data
)
_sampled_graph: autogl.data.Data = autogl.data.Data(
x=x[_target_dependant_sampled_data.all_sampled_nodes_indexes],
edge_index=(
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_index_for_sampled_graph
),
)
_sampled_graph: autogl.data.Data = _sampled_graph.to(self.device)
with torch.no_grad():
__sampled_graph_inferences: torch.Tensor = (
sequential_gnn_model.sequential_encoding_layers[
_current_layer_index
](_sampled_graph)
)
_sampled_target_nodes_inferences: torch.Tensor = __sampled_graph_inferences[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_sampled_graph
].cpu()
if __next_x is None:
__next_x: torch.Tensor = torch.zeros(
x.size(0), __sampled_graph_inferences.size(1)
)
__next_x[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_integral_graph
] = _sampled_target_nodes_inferences
x: torch.Tensor = __next_x
# The following procedures are for the top layer
if mask_or_target_nodes_indexes.dtype == torch.bool:
target_nodes_indexes: _typing.Any = torch.where(
mask_or_target_nodes_indexes
)[0]
else:
target_nodes_indexes: _typing.Any = mask_or_target_nodes_indexes.long()
_optional_neighbor_sampler: _typing.Optional[
NeighborSampler
] = self.__neighbor_sampler_store[target_nodes_indexes]
if (
_optional_neighbor_sampler is not None
and type(_optional_neighbor_sampler) == NeighborSampler
):
current_neighbor_sampler: NeighborSampler = _optional_neighbor_sampler
else:
current_neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
target_nodes_indexes,
[-1],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
self.__neighbor_sampler_store[
target_nodes_indexes
] = current_neighbor_sampler
prediction_batch_cumulative_builder = (
EvaluatorUtility.PredictionBatchCumulativeBuilder()
)
for _target_dependant_sampled_data in current_neighbor_sampler:
_sampled_graph: autogl.data.Data = autogl.data.Data(
x[_target_dependant_sampled_data.all_sampled_nodes_indexes],
_target_dependant_sampled_data.sampled_edges_for_layers[
0
].edge_index_for_sampled_graph,
)
_sampled_graph: autogl.data.Data = _sampled_graph.to(self.device)
with torch.no_grad():
prediction_batch_cumulative_builder.add_batch(
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_integral_graph.cpu().numpy(),
sequential_gnn_model.cls_decode(
sequential_gnn_model.sequential_encoding_layers[-1](
_sampled_graph
)
)[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_sampled_graph
]
.cpu()
.numpy(),
)
return torch.from_numpy(prediction_batch_cumulative_builder.compose()[1])
else:
if mask_or_target_nodes_indexes.dtype == torch.bool:
target_nodes_indexes: _typing.Any = torch.where(
mask_or_target_nodes_indexes
)[0]
else:
target_nodes_indexes: _typing.Any = mask_or_target_nodes_indexes.long()
neighbor_sampler: NeighborSampler = NeighborSampler(
integral_data.edge_index,
target_nodes_indexes,
[-1 for _ in self.__sampling_sizes],
batch_size=self.__predicting_batch_size,
num_workers=self.__predicting_sampler_num_workers,
shuffle=False,
)
prediction_batch_cumulative_builder = (
EvaluatorUtility.PredictionBatchCumulativeBuilder()
)
self.model.model.eval()
for _target_dependant_sampled_data in neighbor_sampler:
_sampled_graph: autogl.data.Data = autogl.data.Data(
x=integral_data.x[
_target_dependant_sampled_data.all_sampled_nodes_indexes
]
)
_sampled_graph = _sampled_graph.to(self.device)
_sampled_graph.edge_indexes: _typing.Sequence[torch.LongTensor] = [
current_layer.edge_index_for_sampled_graph.to(self.device)
for current_layer in _target_dependant_sampled_data.sampled_edges_for_layers
]
with torch.no_grad():
prediction_batch_cumulative_builder.add_batch(
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_integral_graph.cpu().numpy(),
self.model.model(_sampled_graph)[
_target_dependant_sampled_data.target_nodes_indexes.indexes_in_sampled_graph
]
.cpu()
.numpy(),
)
return torch.from_numpy(prediction_batch_cumulative_builder.compose()[1])
def predict_proba(
self, dataset, mask: _typing.Optional[str] = None, in_log_format: bool = False
):
"""
The function of predicting the probability on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
in_log_format: ``bool``.
If True(False), the probability will (not) be log format.
Returns
-------
The prediction result.
"""
data = dataset[0].to(torch.device("cpu"))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.BoolTensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.BoolTensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.BoolTensor = data.val_mask
else:
_mask: torch.BoolTensor = data.test_mask
else:
_mask: torch.BoolTensor = data.test_mask
result = self.__predict_only(data, _mask)
return result if in_log_format else torch.exp(result)
def predict(self, dataset, mask: _typing.Optional[str] = None) -> torch.Tensor:
"""
The function of predicting on the given dataset.
Parameters
----------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
Returns
-------
The prediction result of ``predict_proba``.
"""
return self.predict_proba(dataset, mask, in_log_format=True).max(1)[1]
def evaluate(
self,
dataset,
mask: _typing.Optional[str] = None,
feval: _typing.Union[
None, _typing.Sequence[str], _typing.Sequence[_typing.Type[Evaluation]]
] = None,
) -> _typing.Sequence[float]:
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
mask: .
The `str` of ``train``, ``val``, or ``test``,
representing the identifier for specific dataset mask.
feval: ``str``.
The evaluation method adopted in this function.
Returns
-------
result: The evaluation result on the given dataset.
"""
data = dataset[0]
data = data.to(self.device)
if feval is None:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = self.feval
else:
_feval: _typing.Sequence[_typing.Type[Evaluation]] = get_feval(list(feval))
if mask is not None and type(mask) == str:
if mask.lower() == "train":
_mask: torch.Tensor = data.train_mask
elif mask.lower() == "test":
_mask: torch.Tensor = data.test_mask
elif mask.lower() == "val":
_mask: torch.Tensor = data.val_mask
else:
_mask: torch.Tensor = data.test_mask
else:
_mask: torch.Tensor = data.test_mask
prediction_probability: torch.Tensor = self.predict_proba(dataset, mask)
y_ground_truth: torch.Tensor = data.y[_mask]
eval_results = []
for f in _feval:
eval_results.append(
f.evaluate(
prediction_probability.cpu().numpy(),
y_ground_truth.cpu().numpy(),
)
)
return eval_results
def train(self, dataset, keep_valid_result: bool = True):
"""
The function of training on the given dataset and keeping valid result.
Parameters
------------
dataset:
The dataset containing conventional data of integral graph
adopted to train for node classification.
keep_valid_result: ``bool``
If True(False), save the validation result after training.
Returns
--------
None
"""
import gc
gc.collect()
data = dataset[0]
self.__train_only(data)
if keep_valid_result:
data = data.to(torch.device("cpu"))
prediction: torch.Tensor = self.__predict_only(data, data.val_mask)
self._valid_result: torch.Tensor = prediction.max(1)[1]
self._valid_result_prob: torch.Tensor = prediction
self._valid_score: _typing.Sequence[float] = self.evaluate(dataset, "val")
def get_valid_predict(self) -> torch.Tensor:
return self._valid_result
def get_valid_predict_proba(self) -> torch.Tensor:
return self._valid_result_prob
def get_valid_score(
self, return_major: bool = True
) -> _typing.Union[
_typing.Tuple[float, bool],
_typing.Tuple[_typing.Sequence[float], _typing.Sequence[bool]],
]:
"""
The function of getting the valid score.
Parameters
----------
return_major: ``bool``.
If True, the return only consists of the major result.
If False, the return consists of the all results.
Returns
-------
result: The valid score.
"""
if return_major:
return self._valid_score[0], self.feval[0].is_higher_better()
else:
return self._valid_score, [f.is_higher_better() for f in self.feval]
def __repr__(self) -> str:
import yaml
return yaml.dump(
{
"trainer_name": self.__class__.__name__,
"optimizer": self._optimizer_class,
"learning_rate": self._learning_rate,
"max_epoch": self._max_epoch,
"early_stopping_round": self._early_stopping.patience,
"sampling_sizes": self.__sampling_sizes,
"model": repr(self.model),
}
)
def duplicate_from_hyper_parameter(
self,
hp: _typing.Dict[str, _typing.Any],
model: _typing.Optional[BaseAutoModel] = None,
) -> "NodeClassificationNeighborSamplingTrainer":
"""
The function of duplicating a new instance from the given hyper-parameter.
Parameters
------------
hp: ``dict``.
The hyper-parameter settings for the new instance.
model: ``BaseModel``
The name or class of model adopted
Returns
--------
instance: ``NodeClassificationLayerDependentImportanceSamplingTrainer``
A new instance of trainer.
"""
if model is None or not isinstance(model, BaseAutoModel):
model: BaseAutoModel = self.model
model = model.from_hyper_parameter(hp["encoder"])
return NodeClassificationNeighborSamplingTrainer(
model,
self.num_features,
self.num_classes,
self._optimizer_class,
device=self.device,
init=True,
feval=self.feval,
loss=self.loss,
lr_scheduler_type=self._lr_scheduler_type,
**hp["trainer"],
)
| 40.965604 | 116 | 0.57756 | 8,230 | 80,989 | 5.356987 | 0.043864 | 0.023204 | 0.022455 | 0.017148 | 0.893781 | 0.880716 | 0.874569 | 0.872346 | 0.868853 | 0.860347 | 0 | 0.005269 | 0.336824 | 80,989 | 1,976 | 117 | 40.986336 | 0.815584 | 0.133253 | 0 | 0.776767 | 0 | 0 | 0.028343 | 0.006956 | 0.008397 | 0 | 0 | 0.000506 | 0 | 1 | 0.035689 | false | 0 | 0.022393 | 0.006298 | 0.095171 | 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 |
58d2181a75e9cfa214a6eb0cb08feb03b5a3b087 | 5,383 | py | Python | Cog1/Spam.py | Archers007/DesertedBot | d7115be23f35c69d07d8297ba1c29ba64079ab15 | [
"Unlicense"
] | 1 | 2020-10-16T03:06:13.000Z | 2020-10-16T03:06:13.000Z | Cog1/Spam.py | Archers007/DesertedBot | d7115be23f35c69d07d8297ba1c29ba64079ab15 | [
"Unlicense"
] | null | null | null | Cog1/Spam.py | Archers007/DesertedBot | d7115be23f35c69d07d8297ba1c29ba64079ab15 | [
"Unlicense"
] | null | null | null | import discord
import os
import random
from discord.ext import commands
from Main import UserSend
from Main import Message1
from Main import Message2
class Spam(commands.Cog):
def __inti__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Spam Cog is Running')
@commands.command(pass_context=True)
async def Spamdm(self, ctx, Amount, user: discord.User, *, args=None):
if args !=None:
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
await user.send(args)
@commands.command(pass_context=True)
async def Spam(self, ctx, *, args=None):
if args !=None:
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
await ctx.channel.send(args)
@commands.command()
async def Coolfont(self, ctx, args1=None, args2=None, args3=None):
if args1 !=None:
if args2 !=None:
if args3 !=None:
await ctx.channel.send('https://patorjk.com/software/taag/#p=display&h=1&v=1&f=Ogre&t={}%20{}%20{}'.format(args1, args2, args3))
else:
await ctx.channel.send('https://patorjk.com/software/taag/#p=display&h=1&v=1&f=Ogre&t={}%20{}'.format(args1, args2))
else:
await ctx.channel.send('https://patorjk.com/software/taag/#p=display&h=1&v=1&f=Ogre&t={}'.format(args1))
def setup(client):
client.add_cog(Spam(client))
def teardown(client):
print('Spam Cog is now not running') | 35.649007 | 148 | 0.546907 | 664 | 5,383 | 4.421687 | 0.096386 | 0.288828 | 0.46049 | 0.31846 | 0.826975 | 0.825613 | 0.813352 | 0.787466 | 0.787466 | 0.787466 | 0 | 0.007412 | 0.348319 | 5,383 | 151 | 149 | 35.649007 | 0.829533 | 0 | 0 | 0.805755 | 0 | 0.021583 | 0.046991 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.021583 | false | 0.014388 | 0.05036 | 0 | 0.079137 | 0.014388 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
58df6d7903e2f4be1402dd91b07069839523c93a | 126 | py | Python | Curso de Cisco/Actividades/Comparando cadenas.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Comparando cadenas.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Comparando cadenas.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | # Prueba los ejemplos aquí
print('alfa' == 'alfa')
print('alfa' != 'Alfa')
print('alfa' < 'alfabeto')
print('beta' > 'Beta') | 21 | 27 | 0.611111 | 17 | 126 | 4.588235 | 0.529412 | 0.346154 | 0.333333 | 0.461538 | 0.448718 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134921 | 126 | 6 | 28 | 21 | 0.706422 | 0.190476 | 0 | 0 | 0 | 0 | 0.36 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 7 |
4515d609e74386585dc80df2ebf1d78f8fd95415 | 4,108 | py | Python | src/peering/azext_peering/action.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2022-03-22T15:02:32.000Z | 2022-03-22T15:02:32.000Z | src/peering/azext_peering/action.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-02-10T22:04:59.000Z | 2021-02-10T22:04:59.000Z | src/peering/azext_peering/action.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2020-07-16T23:49:49.000Z | 2020-07-16T23:49:49.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import argparse
from knack.util import CLIError
# pylint: disable=protected-access
class PeeringAddDirectConnections(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(PeeringAddDirectConnections, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'bandwidthinmbps':
d['bandwidthInMbps'] = v
elif kl == 'sessionaddressprovider':
d['sessionAddressProvider'] = v
elif kl == 'useforpeeringservice':
d['useForPeeringService'] = v
elif kl == 'peeringdbfacilityid':
d['peeringDBFacilityId'] = v
elif kl == 'sessionprefixv4':
d.setdefault('bgpSession', {})['sessionPrefixV4'] = v
elif kl == 'sessionprefixv6':
d.setdefault('bgpSession', {})['sessionPrefixV6'] = v
elif kl == 'maxprefixesadvertisedv4':
d.setdefault('bgpSession', {})['maxPrefixesAdvertisedV4'] = v
elif kl == 'maxprefixesadvertisedv6':
d.setdefault('bgpSession', {})['maxPrefixesAdvertisedV6'] = v
elif kl == 'md5authenticationkey':
d.setdefault('bgpSession', {})['md5AuthenticationKey'] = v
elif kl == 'connectionidentifier':
d['connectionIdentifier'] = v
else:
raise CLIError('usage error: {} is invalid'.format(k))
return d
# pylint: disable=protected-access
class PeeringAddExchangeConnections(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(PeeringAddExchangeConnections, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'bandwidthinmbps':
d['bandwidthInMbps'] = v
elif kl == 'sessionaddressprovider':
d['sessionAddressProvider'] = v
elif kl == 'useforpeeringservice':
d['useForPeeringService'] = v
elif kl == 'peeringdbfacilityid':
d['peeringDBFacilityId'] = v
elif kl == 'sessionprefixv4':
d.setdefault('bgpSession', {})['sessionPrefixV4'] = v
elif kl == 'sessionprefixv6':
d.setdefault('bgpSession', {})['sessionPrefixV6'] = v
elif kl == 'maxprefixesadvertisedv4':
d.setdefault('bgpSession', {})['maxPrefixesAdvertisedV4'] = v
elif kl == 'maxprefixesadvertisedv6':
d.setdefault('bgpSession', {})['maxPrefixesAdvertisedV6'] = v
elif kl == 'md5authenticationkey':
d.setdefault('bgpSession', {})['md5AuthenticationKey'] = v
elif kl == 'connectionidentifier':
d['connectionIdentifier'] = v
else:
raise CLIError('usage error: {} is invalid'.format(k))
return d
| 46.681818 | 101 | 0.556962 | 345 | 4,108 | 6.53913 | 0.243478 | 0.039894 | 0.055851 | 0.04078 | 0.87766 | 0.848404 | 0.848404 | 0.848404 | 0.848404 | 0.848404 | 0 | 0.007473 | 0.28335 | 4,108 | 87 | 102 | 47.218391 | 0.758832 | 0.11149 | 0 | 0.918919 | 0 | 0 | 0.270255 | 0.074705 | 0 | 0 | 0 | 0 | 0 | 1 | 0.054054 | false | 0 | 0.027027 | 0 | 0.135135 | 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 |
18977c9b061f2b8485b67c7e33962d40ee5bad0b | 29,063 | py | Python | test/core/resampling/test_rectify.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | 97 | 2018-06-26T13:02:55.000Z | 2022-03-26T21:03:13.000Z | test/core/resampling/test_rectify.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | 524 | 2018-11-09T12:00:08.000Z | 2022-03-31T17:00:13.000Z | test/core/resampling/test_rectify.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | 15 | 2019-07-09T08:46:03.000Z | 2022-02-07T18:47:34.000Z | import unittest
from typing import Tuple
import numpy as np
# noinspection PyUnresolvedReferences
import xarray as xr
from test.sampledata import SourceDatasetMixin
from test.sampledata import create_s2plus_dataset
from xcube.core.gridmapping import CRS_WGS84
from xcube.core.gridmapping import GridMapping
from xcube.core.resampling import rectify_dataset
nan = np.nan
# noinspection PyMethodMayBeStatic
class RectifyDatasetTest(SourceDatasetMixin, unittest.TestCase):
def test_rectify_2x2_to_default(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(4, 4),
xy_min=(-1, 49),
xy_res=2,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
# target_ds = rectify_dataset(source_ds)
rad = target_ds.rad
# lon, lat, rad = self._assert_shape_and_dim(target_ds, (4, 4))
# np.testing.assert_almost_equal(lon.values,
# np.array([0., 2., 4., 6.],
# dtype=lon.dtype))
# np.testing.assert_almost_equal(lat.values,
# np.array([56., 54., 52., 50.],
# dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values,
np.array([
[nan, nan, nan, nan],
[nan, 1.0, 2.0, nan],
[3.0, 3.0, 2.0, nan],
[nan, 4.0, nan, nan]
],
dtype=rad.dtype))
def test_rectify_2x2_to_7x7(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(7, 7),
xy_min=(-0.5, 49.5),
xy_res=1.0,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (7, 7))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5., 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55., 54., 53., 52., 51., 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values,
np.array([
[nan, 1.0, nan, nan, nan, nan, nan],
[nan, 1.0, 1.0, nan, nan, nan, nan],
[nan, 1.0, 1.0, 1.0, 2.0, nan, nan],
[nan, 3.0, 3.0, 1.0, 2.0, 2.0, 2.0],
[3.0, 3.0, 3.0, 4.0, 2.0, nan, nan],
[nan, 3.0, 4.0, 4.0, nan, nan, nan],
[nan, nan, 4.0, nan, nan, nan, nan],
], dtype=rad.dtype))
def test_rectify_2x2_to_7x7_subset(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(7, 7),
xy_min=(1.5, 50.5),
xy_res=1.0,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (7, 7))
np.testing.assert_almost_equal(lon.values,
np.array([2.0, 3.0, 4.0, 5., 6., 7., 8.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([57., 56., 55., 54., 53., 52., 51.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values,
np.array([
[nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan],
[1.0, nan, nan, nan, nan, nan, nan],
[1.0, 1.0, 2.0, nan, nan, nan, nan],
[3.0, 1.0, 2.0, 2.0, 2.0, nan, nan],
[3.0, 4.0, 2.0, nan, nan, nan, nan],
[4.0, 4.0, nan, nan, nan, nan, nan],
], dtype=rad.dtype))
def test_rectify_2x2_to_13x13(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_j_axis_up(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
is_j_axis_up=True)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([50., 50.5, 51., 51.5, 52., 52.5, 53., 53.5, 54., 54.5, 55.,
55.5, 56.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype)[::-1])
def test_rectify_2x2_to_13x13_j_axis_up_dask_5x5(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=5,
is_j_axis_up=True)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13), chunks=((5, 5, 3), (5, 5, 3)))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([50., 50.5, 51., 51.5, 52., 52.5, 53., 53.5, 54., 54.5, 55.,
55.5, 56.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype)[::-1])
def test_rectify_2x2_to_13x13_dask_7x7(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=7)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13), chunks=((7, 6), (7, 6)))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_dask_5x5(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=5)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13), chunks=((5, 5, 3), (5, 5, 3)))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_dask_3x13(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=(3, 13))
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13), chunks=((13,), (3, 3, 3, 3, 1)))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_dask_13x3(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=(13, 3))
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13), chunks=((3, 3, 3, 3, 1), (13,)))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_antimeridian(self):
source_ds = self.new_2x2_dataset_with_irregular_coords_antimeridian()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(177.75, 49.75),
xy_res=0.5,
crs=CRS_WGS84)
self.assertEqual(True, target_gm.is_lon_360)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
self.assertIsNotNone(target_ds)
lon, lat, rad = self._assert_shape_and_dim(target_ds, (13, 13))
np.testing.assert_almost_equal(lon.values,
np.array([178., 178.5, 179., 179.5, 180., -179.5, -179., -178.5,
-178., -177.5, -177., -176.5, -176.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_output_ij_names(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm, output_ij_names=('source_i', 'source_j'))
lon, lat, rad, source_i, source_j = self._assert_shape_and_dim(target_ds, (13, 13),
var_names=('rad', 'source_i', 'source_j'))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
np.testing.assert_almost_equal(np.floor(source_i.values + 0.5), self.expected_i_13x13())
np.testing.assert_almost_equal(np.floor(source_j.values + 0.5), self.expected_j_13x13())
def test_rectify_2x2_to_13x13_output_ij_names_dask(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-0.25, 49.75),
xy_res=0.5,
crs=CRS_WGS84,
tile_size=5)
target_ds = rectify_dataset(source_ds, target_gm=target_gm, output_ij_names=('source_i', 'source_j'))
lon, lat, rad, source_i, source_j = self._assert_shape_and_dim(target_ds, (13, 13),
chunks=((5, 5, 3), (5, 5, 3)),
var_names=('rad', 'source_i', 'source_j'))
np.testing.assert_almost_equal(lon.values,
np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5., 5.5, 6.],
dtype=lon.dtype))
np.testing.assert_almost_equal(lat.values,
np.array([56., 55.5, 55., 54.5, 54., 53.5, 53., 52.5, 52., 51.5, 51.,
50.5, 50.],
dtype=lat.dtype))
# print('source_i:', np.floor(source_i.values + 0.5))
# print('source_j:', np.floor(source_j.values + 0.5))
np.testing.assert_almost_equal(np.floor(source_i.values + 0.5), self.expected_i_13x13())
np.testing.assert_almost_equal(np.floor(source_j.values + 0.5), self.expected_j_13x13())
np.testing.assert_almost_equal(rad.values, self.expected_rad_13x13(rad.dtype))
def test_rectify_2x2_to_13x13_none(self):
source_ds = self.new_2x2_dataset_with_irregular_coords()
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(10.0, 50.0),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
self.assertIsNone(target_ds)
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(-10.0, 50.0),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
self.assertIsNone(target_ds)
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(0.0, 58.0),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
self.assertIsNone(target_ds)
target_gm = GridMapping.regular(size=(13, 13),
xy_min=(0.0, 42.0),
xy_res=0.5,
crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds, target_gm=target_gm)
self.assertIsNone(target_ds)
def _assert_shape_and_dim(self, target_ds, size, chunks=None, var_names=('rad',)) -> Tuple[xr.DataArray, ...]:
w, h = size
self.assertIn('lon', target_ds)
lon = target_ds['lon']
self.assertEqual((w,), lon.shape)
self.assertEqual(('lon',), lon.dims)
self.assertIn('lat', target_ds)
lat = target_ds['lat']
self.assertEqual((h,), lat.shape)
self.assertEqual(('lat',), lat.dims)
# noinspection PyShadowingBuiltins
vars = []
for var_name in var_names:
self.assertIn(var_name, target_ds)
var = target_ds[var_name]
self.assertEqual((h, w), var.shape)
self.assertEqual(('lat', 'lon'), var.dims)
self.assertEqual(chunks, var.chunks)
vars.append(var)
return (lon, lat, *vars)
def test_compute_and_extract_source_pixels(self):
from xcube.core.resampling.rectify import _compute_ij_images_numpy_parallel
from xcube.core.resampling.rectify import _compute_var_image_numpy_parallel
self._assert_compute_and_extract_source_pixels(_compute_ij_images_numpy_parallel,
_compute_var_image_numpy_parallel, False)
from xcube.core.resampling.rectify import _compute_ij_images_numpy_sequential
from xcube.core.resampling.rectify import _compute_var_image_numpy_sequential
self._assert_compute_and_extract_source_pixels(_compute_ij_images_numpy_sequential,
_compute_var_image_numpy_sequential, False)
def test_compute_and_extract_source_pixels_j_axis_up(self):
from xcube.core.resampling.rectify import _compute_ij_images_numpy_parallel
from xcube.core.resampling.rectify import _compute_var_image_numpy_parallel
self._assert_compute_and_extract_source_pixels(_compute_ij_images_numpy_parallel,
_compute_var_image_numpy_parallel, True)
from xcube.core.resampling.rectify import _compute_ij_images_numpy_sequential
from xcube.core.resampling.rectify import _compute_var_image_numpy_sequential
self._assert_compute_and_extract_source_pixels(_compute_ij_images_numpy_sequential,
_compute_var_image_numpy_sequential, True)
def _assert_compute_and_extract_source_pixels(self,
compute_ij_images,
compute_var_image,
is_j_axis_up: bool):
source_ds = self.new_2x2_dataset_with_irregular_coords()
dst_src_ij = np.full((2, 13, 13), np.nan, dtype=np.float64)
dst_x_offset = -0.25
dst_y_offset = 49.75 if is_j_axis_up else 56.25
dst_x_scale = 0.5
dst_y_scale = 0.5 if is_j_axis_up else -0.5
compute_ij_images(source_ds.lon.values,
source_ds.lat.values,
0,
0,
dst_src_ij,
dst_x_offset,
dst_y_offset,
dst_x_scale,
dst_y_scale,
1e-5)
if not is_j_axis_up:
np.testing.assert_almost_equal(np.floor(dst_src_ij[0] + 0.5), self.expected_i_13x13())
np.testing.assert_almost_equal(np.floor(dst_src_ij[1] + 0.5), self.expected_j_13x13())
else:
np.testing.assert_almost_equal(np.floor(dst_src_ij[0] + 0.5), self.expected_i_13x13()[::-1])
np.testing.assert_almost_equal(np.floor(dst_src_ij[1] + 0.5), self.expected_j_13x13()[::-1])
target_rad = np.full((13, 13), np.nan, dtype=np.float64)
compute_var_image(source_ds.rad.values,
dst_src_ij,
target_rad)
if not is_j_axis_up:
np.testing.assert_almost_equal(target_rad, self.expected_rad_13x13(target_rad.dtype))
else:
np.testing.assert_almost_equal(target_rad, self.expected_rad_13x13(target_rad.dtype)[::-1])
def expected_i_13x13(self):
return np.array([
[nan, nan, 0.0, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, 0.0, 0.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, nan, nan, nan, nan, nan],
[nan, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, nan, nan, nan, nan],
[nan, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, nan, nan],
[nan, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[nan, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan],
[0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan],
[nan, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan],
[nan, nan, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, 1.0, nan, nan, nan, nan, nan, nan, nan, nan],
],
dtype=np.float64)
def expected_j_13x13(self):
return np.array([
[nan, nan, 0.0, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, 0.0, 0.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, nan, nan, nan, nan, nan],
[nan, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, nan, nan, nan, nan],
[nan, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, nan, nan],
[nan, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[nan, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, nan, nan],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, nan, nan, nan],
[nan, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan],
[nan, nan, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, 1.0, nan, nan, nan, nan, nan, nan, nan, nan],
],
dtype=np.float64)
def expected_rad_13x13(self, dtype):
return np.array([
[nan, nan, 1.0, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 1.0, 1.0, nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, nan, nan, nan, nan, nan],
[nan, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, nan, nan, nan, nan],
[nan, 3.0, 3.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, nan, nan],
[nan, 3.0, 3.0, 3.0, 3.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],
[nan, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 2.0, 2.0, 2.0, 2.0, nan, nan],
[3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 2.0, 2.0, 2.0, nan, nan, nan],
[nan, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 2.0, nan, nan, nan, nan],
[nan, nan, 3.0, 4.0, 4.0, 4.0, 4.0, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, 4.0, 4.0, 4.0, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, 4.0, nan, nan, nan, nan, nan, nan, nan, nan],
], dtype=dtype)
class RectifySentinel2DatasetTest(SourceDatasetMixin, unittest.TestCase):
def test_rectify_dataset(self):
source_ds = create_s2plus_dataset()
expected_data = np.array([
[nan, nan, nan, nan, nan, nan, nan, nan, nan],
[nan, 0.019001, 0.019001, 0.008999, 0.012001, 0.012001, 0.022999, nan, nan],
[nan, 0.021, 0.021, 0.009998, 0.009998, 0.008999, 0.022999, nan, nan],
[nan, 0.022999, 0.022999, 0.007999, 0.007999, 0.008999, 0.023998, nan, nan],
[nan, 0.022999, 0.022999, 0.007, 0.007, 0.009998, 0.021, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan, nan]
])
source_gm = GridMapping.from_dataset(source_ds, prefer_crs=CRS_WGS84)
target_ds = rectify_dataset(source_ds,
source_gm=source_gm,
tile_size=None)
self.assertEqual(None, target_ds.rrs_665.chunks)
print(repr(target_ds.rrs_665.values))
np.testing.assert_almost_equal(target_ds.rrs_665.values,
expected_data, decimal=3)
target_ds = rectify_dataset(source_ds,
source_gm=source_gm,
tile_size=5)
self.assertEqual(((5, 1), (5, 4)), target_ds.rrs_665.chunks)
np.testing.assert_almost_equal(target_ds.rrs_665.values,
expected_data, decimal=3)
target_ds = rectify_dataset(source_ds,
source_gm=source_gm,
tile_size=None,
is_j_axis_up=True)
self.assertEqual(None, target_ds.rrs_665.chunks)
np.testing.assert_almost_equal(target_ds.rrs_665.values,
expected_data[::-1], decimal=3)
target_ds = rectify_dataset(source_ds,
source_gm=source_gm,
tile_size=5,
is_j_axis_up=True)
self.assertEqual(((5, 1), (5, 4)), target_ds.rrs_665.chunks)
np.testing.assert_almost_equal(target_ds.rrs_665.values,
expected_data[::-1], decimal=3)
| 53.621771 | 114 | 0.470495 | 3,882 | 29,063 | 3.300618 | 0.043019 | 0.142824 | 0.172793 | 0.183564 | 0.874581 | 0.865917 | 0.84586 | 0.831733 | 0.820183 | 0.798486 | 0 | 0.116405 | 0.403503 | 29,063 | 541 | 115 | 53.720887 | 0.622693 | 0.021608 | 0 | 0.624146 | 0 | 0 | 0.003413 | 0 | 0 | 0 | 0 | 0 | 0.202733 | 1 | 0.050114 | false | 0 | 0.038724 | 0.006834 | 0.102506 | 0.002278 | 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 |
189db8d92a4519ca7c97022103b16d0310377020 | 7,996 | py | Python | fornecedor/backup.py | juancanuto/crud-stepes | 5b285aceb03ced7d44e542d612aef8aa7c9737c1 | [
"MIT"
] | null | null | null | fornecedor/backup.py | juancanuto/crud-stepes | 5b285aceb03ced7d44e542d612aef8aa7c9737c1 | [
"MIT"
] | null | null | null | fornecedor/backup.py | juancanuto/crud-stepes | 5b285aceb03ced7d44e542d612aef8aa7c9737c1 | [
"MIT"
] | null | null | null | '''class RepresentanteModelTest(TestCase):
# setup dos dados de teste para classe Fornecedor
@classmethod
def setUpTestData(self):
obj = Representative.objects.get(id=1)
self.representante = Representative.objects.create(cpf=10120230304, nome='Representante 1', contato='1112345678',
fornecedor=obj.razao_social)
# teste de nome de atributo
def test_cpf_label(self):
representante = Representative.objects.get(id=1)
field_label = representante._meta.get_field('cpf').verbose_name
self.assertEquals(field_label, 'cpf')
def test_nome_label(self):
representante = Representative.objects.get(id=1)
field_label = representante._meta.get_field('nome').verbose_name
self.assertEquals(field_label, 'nome')
def test_contato_label(self):
representante = Representative.objects.get(id=1)
field_label = representante._meta.get_field('contato').verbose_name
self.assertEquals(field_label, 'contato')
def test_fornecedor_label(self):
representante = Representative.objects.get(id=1)
field_label = representante._meta.get_field('fornecedor').verbose_name
self.assertEquals(field_label, 'fornecedor')
# Teste de rota
def test_get(self):
c = Client()
response = c.get('')
self.assertEqual(response.status_code, 200)
# Teste de valores
def test_cpf(self):
obj = Representative.objects.get(id=1)
field_value = obj.cpf
self.assertEquals(len(str(field_value)), 11)
def test_nome(self):
obj = Representative.objects.get(id=1)
field_value = obj.nome
self.assertEquals(field_value, 'Representante 1')
def test_contato(self):
obj = Representative.objects.get(id=1)
field_value = obj.contato
self.assertEquals(field_value, '1112345678')
def test_fornecedor(self):
obj = Representative.objects.get(id=1)
field_value = obj.fornecedor
self.assertEquals(field_value, 'Hospital')
class EstoqueModelTest(TestCase):
# setup dos dados de teste para classe Estoque
@classmethod
def setUpTestData(self):
self.estoque = Stock.objects.create(descricao='mascara', quantidade=100)
# teste de nome de atributo
def test_descricao_label(self):
estoque = Stock.objects.get(id=1)
field_label = estoque._meta.get_field('descricao').verbose_name
self.assertEquals(field_label, 'descricao')
def test_quantidade_label(self):
estoque = Stock.objects.get(id=1)
field_label = estoque._meta.get_field('quantidade').verbose_name
self.assertEquals(field_label, 'quantidade')
# Teste de rota
def test_get(self):
c = Client()
response = c.get('')
self.assertEqual(response.status_code, 200)
# Teste de valores
def test_descricao(self):
obj = Stock.objects.get(id=1)
field_value = obj.descricao
self.assertEqual(field_value, 'mascara')
def test_quantidade(self):
obj = Stock.objects.get(id=1)
field_value = obj.quantidade
self.assertEqual(len(str(field_value)), 999999)
class ProdutoModelTest(TestCase):
# configurando os dados para o teste da classe produtos
@classmethod
def setUpTestData(self):
obj = Product.objects.get(id=1)
self.produto = Product.objects.create(descricao='DescProduto', fornecedor=obj.razao_social)
# teste de nome de atributo
def test_descr_label(self):
produto = Product.objects.get(id=1)
field_label = produto._meta.get_field('descr').verbose_name
self.assertEquals(field_label, 'descr')
def test_fornecedor_label(self):
produto = Product.objects.get(id=1)
field_label = produto._meta.get_field('fornecedor').verbose_name
self.assertEquals(field_label, 'fornecedor')
# Teste de rota
def test_get(self):
c = Client()
response = c.get('')
self.assertEqual(response.status_code, 200)
# Teste de valores
def test_descr(self):
obj = Product.objects.get(id=1)
field_value = obj.descricao
self.assertEquals(field_value, 'DescProduto')
def test_fornecedor(self):
obj = Product.objects.get(id=1)
field_value = obj.fornecedor
self.assertEquals(field_value, '')'''
class RepresentativeModelTest(TestCase):
# setup dos dados de teste para classe Fornecedor
@classmethod
def setUpTestData(self):
obj = Provider.objects.get()
self.representante = Representative.objects.create(REP_ID=1,REP_CPF=10120230304, REP_NAME='Representante 1',
REP_CONTACT='1112345678',REP_CONTACT_CEL=10212121,
REP_CONTACT_EMAIL='teste@gmail.com',
REP_PROVIDER=obj.PRO_SOCIAL_REASON)
# teste de nome de atributo
def test_cpf_label(self):
representante = Representative.objects.get(REP_ID=1)
field_label = representante._meta.get_field('REP_CPF').verbose_name
self.assertEquals(field_label, 'cpf')
def test_nome_label(self):
representante = Representative.objects.get(REP_ID=1)
field_label = representante._meta.get_field('REP_NAME').verbose_name
self.assertEquals(field_label, 'nome')
def test_contato_label(self):
representante = Representative.objects.get(REP_ID=1)
field_label = representante._meta.get_field('REP_CONTACT').verbose_name
self.assertEquals(field_label, 'contato')
def test_fornecedor_label(self):
representante = Representative.objects.get(REP_ID=1)
field_label = representante._meta.get_field('REP_PROVIDER').verbose_name
self.assertEquals(field_label, 'fornecedor')
# Teste de rota
def test_get(self):
c = Client()
response = c.get('')
self.assertEqual(response.status_code, 200)
# Teste de valores
def test_cpf(self):
obj = Representative.objects.get(REP_ID=1)
field_value = obj.REP_CPF
self.assertEquals(len(str(field_value)), 11)
def test_nome(self):
obj = Representative.objects.get(REP_ID=1)
field_value = obj.REP_NAME
self.assertEquals(field_value, 'Representante 1')
def test_contato(self):
obj = Representative.objects.get(REP_ID=1)
field_value = obj.REP_CONTACT
self.assertEquals(field_value, '1112345678')
def test_fornecedor(self):
obj = Representative.objects.get(REP_ID=1)
field_value = obj.REP_PROVIDER
self.assertEquals(field_value, 'Hospital')
class StockModelTest(TestCase):
# setup dos dados de teste para classe Estoque
@classmethod
def setUpTestData(self):
self.estoque = Stock.objects.create(STK_ID=1,STK_TYPE='E', STK_PRODUCT='produto',STK_QUANTITY=100)
# teste de nome de atributo
def test_descricao_label(self):
estoque = Stock.objects.get(STK_ID=1)
field_label = estoque._meta.get_field('STK_TYPE').verbose_name
self.assertEquals(field_label, 'Tipo')
def test_quantidade_label(self):
estoque = Stock.objects.get(STK_ID=1)
field_label = estoque._meta.get_field('STK_QUANTITY').verbose_name
self.assertEquals(field_label, 'Quantidade')
# Teste de rota
def test_get(self):
c = Client()
response = c.get('')
self.assertEqual(response.status_code, 200)
# Teste de valores
def test_descricao(self):
obj = Stock.objects.get(STK_ID=1)
field_value = obj.STK_PRODUCT
self.assertEqual(field_value, 'mascara')
def test_quantidade(self):
obj = Stock.objects.get(STK_ID=1)
field_value = obj.quantidade
self.assertEqual(len(str(field_value)), 999999) | 35.856502 | 121 | 0.66083 | 957 | 7,996 | 5.322884 | 0.090909 | 0.045347 | 0.043973 | 0.045936 | 0.872399 | 0.842364 | 0.810365 | 0.799764 | 0.799764 | 0.788771 | 0 | 0.023439 | 0.236994 | 7,996 | 223 | 122 | 35.856502 | 0.811506 | 0.581291 | 0 | 0.352941 | 0 | 0 | 0.055156 | 0 | 0 | 0 | 0 | 0 | 0.205882 | 1 | 0.235294 | false | 0 | 0 | 0 | 0.264706 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
18a6c10ae89fb5978b8ea746a324218d8976a3fd | 15,860 | py | Python | tests/chem/magpie_python/vassal/analysis/test_VoronoiCellBasedAnalysis.py | crazysal/chemml | 300ed183c623fc8762ed2343e48c9e2ac5102c0f | [
"BSD-3-Clause"
] | 108 | 2018-03-23T20:06:03.000Z | 2022-01-06T19:32:46.000Z | tests/chem/magpie_python/vassal/analysis/test_VoronoiCellBasedAnalysis.py | crazysal/chemml | 300ed183c623fc8762ed2343e48c9e2ac5102c0f | [
"BSD-3-Clause"
] | 18 | 2019-08-09T21:16:14.000Z | 2022-02-14T21:52:06.000Z | tests/chem/magpie_python/vassal/analysis/test_VoronoiCellBasedAnalysis.py | crazysal/chemml | 300ed183c623fc8762ed2343e48c9e2ac5102c0f | [
"BSD-3-Clause"
] | 28 | 2018-04-28T17:07:33.000Z | 2022-02-28T07:22:56.000Z | import unittest
import numpy as np
import math
from chemml.chem.magpie_python.vassal.analysis.VoronoiCellBasedAnalysis import \
VoronoiCellBasedAnalysis
from chemml.chem.magpie_python.vassal.data.Atom import Atom
from chemml.chem.magpie_python.vassal.data.Cell import Cell
import numpy.testing as np_tst
class testVoronoiCellBasedAnalysis(unittest.TestCase):
def test_BCC(self):
# Structure of bcc.
structure = Cell()
atom = Atom([0, 0, 0], 0)
structure.add_atom(atom)
atom = Atom([0.5, 0.5, 0.5], 0)
structure.add_atom(atom)
# Prepare.
tool = VoronoiCellBasedAnalysis(radical=True)
tool.analyze_structure(structure)
# Check results.
n_eff = 11.95692194
np_tst.assert_array_almost_equal([n_eff, n_eff],
tool.get_effective_coordination_numbers())
self.assertAlmostEqual(14.0, tool.face_count_average(), delta=1e-2)
self.assertAlmostEqual(0.0, tool.face_count_variance(), delta=1e-2)
self.assertAlmostEqual(14.0, tool.face_count_minimum(), delta=1e-2)
self.assertAlmostEqual(14.0, tool.face_count_maximum(), delta=1e-2)
self.assertAlmostEqual(1, len(tool.get_unique_polyhedron_shapes()),
delta=1e-2)
self.assertAlmostEqual(0.0, tool.volume_variance(), delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_minimum(),
delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_maximum(),
delta=1e-2)
self.assertAlmostEqual(0.68, tool.max_packing_efficiency(),
delta=1e-2)
self.assertAlmostEqual(0, tool.mean_bcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(14.0 / 12.0, tool.mean_fcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(8.0 / 6.0, tool.mean_sc_dissimilarity(),
delta=1e-2)
bond_lengths = tool.bond_lengths()
self.assertEqual(2, len(bond_lengths))
self.assertEqual(14, len(bond_lengths[0]))
self.assertAlmostEqual(math.sqrt(3) / 2 , bond_lengths[0][0],
delta=1e-6)
self.assertAlmostEqual(1.0, bond_lengths[0][12], delta=1e-6)
mean_bond_lengths = tool.mean_bond_lengths()
var_bond_lengths = tool.bond_length_variance(mean_bond_lengths)
self.assertTrue(var_bond_lengths[0] > 0)
def test_B2(self):
# Structure of bcc.
structure = Cell()
atom = Atom([0, 0, 0], 0)
structure.add_atom(atom)
atom = Atom([0.5, 0.5, 0.5], 1)
structure.add_atom(atom)
# Prepare.
tool = VoronoiCellBasedAnalysis(radical=True)
tool.analyze_structure(structure)
# Check results.
n_eff = 11.95692194
np_tst.assert_array_almost_equal([n_eff, n_eff],
tool.get_effective_coordination_numbers())
self.assertAlmostEqual(14.0, tool.face_count_average(), delta=1e-2)
self.assertAlmostEqual(0.0, tool.face_count_variance(), delta=1e-2)
self.assertAlmostEqual(14.0, tool.face_count_minimum(), delta=1e-2)
self.assertAlmostEqual(14.0, tool.face_count_maximum(), delta=1e-2)
self.assertAlmostEqual(1, len(tool.get_unique_polyhedron_shapes()),
delta=1e-2)
self.assertAlmostEqual(0.0, tool.volume_variance(), delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_minimum(),
delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_maximum(),
delta=1e-2)
self.assertAlmostEqual(0.68, tool.max_packing_efficiency(),
delta=1e-2)
self.assertAlmostEqual(0, tool.mean_bcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(14.0 / 12.0, tool.mean_fcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(8.0 / 6.0, tool.mean_sc_dissimilarity(),
delta=1e-2)
bond_lengths = tool.bond_lengths()
self.assertEqual(2, len(bond_lengths))
self.assertEqual(14, len(bond_lengths[0]))
self.assertAlmostEqual(math.sqrt(3) / 2 , bond_lengths[0][0],
delta=1e-6)
self.assertAlmostEqual(1.0, bond_lengths[0][12], delta=1e-6)
mean_bond_lengths = tool.mean_bond_lengths()
var_bond_lengths = tool.bond_length_variance(mean_bond_lengths)
self.assertTrue(var_bond_lengths[0] > 0)
# Check ordering parameters (against values computed by hand).
np_tst.assert_array_almost_equal([0.142857, -0.142857],
tool.get_neighbor_ordering_parameters(
1, False)[0], decimal=2)
np_tst.assert_array_almost_equal([-0.04, 0.04],
tool.get_neighbor_ordering_parameters(
2, False)[0], decimal=2)
np_tst.assert_array_almost_equal([0.551982, -0.551982],
tool.get_neighbor_ordering_parameters(
1, True)[0], decimal=2)
np_tst.assert_array_almost_equal([-0.253856, 0.253856],
tool.get_neighbor_ordering_parameters(
2, True)[0], decimal=2)
self.assertAlmostEqual(0.142857,
tool.warren_cowley_ordering_magnitude(1,
False),
delta=1e-2)
self.assertAlmostEqual(0.04,
tool.warren_cowley_ordering_magnitude(2,
False),
delta=1e-2)
self.assertAlmostEqual(0.551982,
tool.warren_cowley_ordering_magnitude(1,
True),
delta=1e-2)
self.assertAlmostEqual(0.253856,
tool.warren_cowley_ordering_magnitude(2,
True),
delta=1e-2)
def test_B1(self):
# Structure of rocksalt.
structure = Cell()
basis = np.zeros((3, 3))
basis[0] = np.array([0, 0.5, 0.5])
basis[1] = np.array([0.5, 0, 0.5])
basis[2] = np.array([0.5, 0.5, 0])
structure.set_basis(basis=basis)
atom = Atom([0, 0, 0], 0)
structure.add_atom(atom)
atom = Atom([0.5, 0.5, 0.5], 1)
structure.add_atom(atom)
# Prepare.
tool = VoronoiCellBasedAnalysis(radical=True)
tool.analyze_structure(structure)
# Check results.
n_eff = 6
np_tst.assert_array_almost_equal([n_eff, n_eff],
tool.get_effective_coordination_numbers())
self.assertAlmostEqual(6.0, tool.face_count_average(), delta=1e-2)
self.assertAlmostEqual(0.0, tool.face_count_variance(), delta=1e-2)
self.assertAlmostEqual(6.0, tool.face_count_minimum(), delta=1e-2)
self.assertAlmostEqual(6.0, tool.face_count_maximum(), delta=1e-2)
self.assertAlmostEqual(1, len(tool.get_unique_polyhedron_shapes()),
delta=1e-2)
self.assertAlmostEqual(0.0, tool.volume_variance(), delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_minimum(),
delta=1e-2)
self.assertAlmostEqual(0.5, tool.volume_fraction_maximum(),
delta=1e-2)
np_tst.assert_array_almost_equal([1, -1],
tool.get_neighbor_ordering_parameters(
1, False)[0], decimal=2)
np_tst.assert_array_almost_equal([-1, 1],
tool.get_neighbor_ordering_parameters(
2, False)[0], decimal=2)
np_tst.assert_array_almost_equal([1, -1],
tool.get_neighbor_ordering_parameters(
3, False)[0], decimal=2)
np_tst.assert_array_almost_equal([-1, 1],
tool.get_neighbor_ordering_parameters(
2, True)[0], decimal=2)
np_tst.assert_array_almost_equal([1, -1],
tool.get_neighbor_ordering_parameters(
3, True)[0], decimal=2)
np_tst.assert_array_almost_equal([1, -1],
tool.get_neighbor_ordering_parameters(
3, True)[0], decimal=2)
self.assertAlmostEqual(1,
tool.warren_cowley_ordering_magnitude(1,
False),
delta=1e-2)
self.assertAlmostEqual(1,
tool.warren_cowley_ordering_magnitude(2,
False),
delta=1e-2)
self.assertAlmostEqual(1,
tool.warren_cowley_ordering_magnitude(1,
True),
delta=1e-2)
self.assertAlmostEqual(1,
tool.warren_cowley_ordering_magnitude(2,
True),
delta=1e-2)
bond_lengths = tool.bond_lengths()
self.assertEqual(2, len(bond_lengths))
self.assertEqual(6, len(bond_lengths[0]))
self.assertAlmostEqual(0.5 , bond_lengths[0][0], delta=1e-6)
mean_bond_lengths = tool.mean_bond_lengths()
self.assertEqual(2, len(mean_bond_lengths))
self.assertAlmostEqual(0.5, mean_bond_lengths[0], delta=1e-6)
var_bond_lengths = tool.bond_length_variance(mean_bond_lengths)
self.assertAlmostEqual(0, var_bond_lengths[0], delta=1e-6)
# Neighbor property attributes.
np_tst.assert_array_almost_equal([1, 1],
tool.neighbor_property_differences([
0, 1], 1))
np_tst.assert_array_almost_equal([0, 0],
tool.neighbor_property_differences([
0, 1], 2))
np_tst.assert_array_almost_equal([0, 0],
tool.neighbor_property_variances([
0, 1], 1))
np_tst.assert_array_almost_equal([0, 0],
tool.neighbor_property_variances([
0, 1], 2))
def test_L12(self):
# Structure of L12.
structure = Cell()
atom = Atom([0, 0, 0], 1)
structure.add_atom(atom)
atom = Atom([0.5, 0.5, 0], 0)
structure.add_atom(atom)
atom = Atom([0.5, 0, 0.5], 0)
structure.add_atom(atom)
atom = Atom([0, 0.5, 0.5], 0)
structure.add_atom(atom)
# Prepare.
tool = VoronoiCellBasedAnalysis(radical=True)
tool.analyze_structure(structure)
# Check results.
np_tst.assert_array_almost_equal([12, 12, 12, 12],
tool.get_effective_coordination_numbers())
self.assertAlmostEqual(12.0, tool.face_count_average(), delta=1e-2)
self.assertAlmostEqual(0.0, tool.face_count_variance(), delta=1e-2)
self.assertAlmostEqual(12.0, tool.face_count_minimum(), delta=1e-2)
self.assertAlmostEqual(12.0, tool.face_count_maximum(), delta=1e-2)
self.assertAlmostEqual(1, len(tool.get_unique_polyhedron_shapes()),
delta=1e-2)
self.assertAlmostEqual(0.0, tool.volume_variance(), delta=1e-2)
self.assertAlmostEqual(0.25, tool.volume_fraction_minimum(),
delta=1e-2)
self.assertAlmostEqual(0.25, tool.volume_fraction_maximum(),
delta=1e-2)
self.assertAlmostEqual(0.74, tool.max_packing_efficiency(),
delta=1e-2)
self.assertAlmostEqual(1, tool.mean_bcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(0, tool.mean_fcc_dissimilarity(),
delta=1e-2)
self.assertAlmostEqual(1, tool.mean_sc_dissimilarity(),
delta=1e-2)
bond_lengths = tool.bond_lengths()
self.assertEqual(4, len(bond_lengths))
self.assertEqual(12, len(bond_lengths[0]))
self.assertAlmostEqual(math.sqrt(2) / 2, bond_lengths[0][0],
delta=1e-6)
mean_bond_lengths = tool.mean_bond_lengths()
var_bond_lengths = tool.bond_length_variance(mean_bond_lengths)
self.assertAlmostEqual(0, var_bond_lengths[0], delta=1e-6)
# Neighbor analysis results.
neigh_diff = tool.neighbor_property_differences([-1, 1], 1)
np_tst.assert_array_almost_equal([2, 8.0 / 12.0, 2.0 / 3, 2.0 / 3],
neigh_diff, decimal=5)
neigh_diff = tool.neighbor_property_differences([-1, 1], 2)
np_tst.assert_array_almost_equal([192.0 / 132, 64.0 / 132.0, 64.0 /
132, 64.0/ 132], neigh_diff,
decimal=5)
neigh_var = tool.neighbor_property_variances([-1, 1], 1)
# Type 0 has 8 type 0 NNs and 4 type 1, mean = -1/3.
# Type 1 has 12 type 0 NNs, therefore variance = 0.
# variance = 8/12 * (-1 + 1/3)^2 + 4/12 + (1 + 1/3)^2.
a_var = 2.0 / 3.0 * (-1 + 1.0 / 3.0) ** 2 + 1.0 / 3.0 * (1 + 1.0 /
3.0) ** 2
np_tst.assert_array_almost_equal([0, a_var, a_var, a_var], neigh_var,
decimal=5)
neigh_var = tool.neighbor_property_variances([-1, 1], 2)
# Type 0 has 68 type 0 2nd NN and 16 type 1.
# Type 1 has 48 type 0 2nd NN and 36 type 1
type0_var = 0.734618916
type1_var = 0.79338843
np_tst.assert_array_almost_equal([type1_var, type0_var, type0_var,
type0_var], neigh_var, decimal=5)
def test_constructor(self):
# Create a Voronoi tessellation of a BCC crystal.
bcc = Cell()
atom = Atom([0, 0, 0], 0)
bcc.add_atom(atom)
atom = Atom([0.5, 0.5, 0.5], 0)
bcc.add_atom(atom)
# Prepare.
tool = VoronoiCellBasedAnalysis(radical=True)
tool.analyze_structure(bcc)
# Create a new instance based on a B2 crystal.
b2 = bcc.__copy__()
b2.get_atom(1).set_type(1)
tool2 = VoronoiCellBasedAnalysis(old_tessellation=tool,
new_structure=b2)
# Make sure it balks if I change the basis.
# with self.assertRaises(ValueError):
# b2.set_basis(lengths=[2, 1, 1], angles=[90, 90, 90])
| 50.509554 | 80 | 0.524842 | 1,775 | 15,860 | 4.467042 | 0.091831 | 0.161559 | 0.052466 | 0.069618 | 0.874385 | 0.849414 | 0.810695 | 0.785093 | 0.753941 | 0.734141 | 0 | 0.071119 | 0.374086 | 15,860 | 313 | 81 | 50.670927 | 0.727612 | 0.048298 | 0 | 0.715356 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.35206 | 1 | 0.018727 | false | 0 | 0.026217 | 0 | 0.048689 | 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 |
18bf5e1ce58ab77cd6b2fd254c6b2de43e9b8f72 | 22,455 | py | Python | skipole/skiadmin/skiadminpackages/editpages/inserts.py | bernie-skipole/skipole | b45d3291c593e7c03c053ab4f192f1ecc5c3e9b9 | [
"MIT"
] | null | null | null | skipole/skiadmin/skiadminpackages/editpages/inserts.py | bernie-skipole/skipole | b45d3291c593e7c03c053ab4f192f1ecc5c3e9b9 | [
"MIT"
] | null | null | null | skipole/skiadmin/skiadminpackages/editpages/inserts.py | bernie-skipole/skipole | b45d3291c593e7c03c053ab4f192f1ecc5c3e9b9 | [
"MIT"
] | null | null | null |
from ... import FailPage, ValidateError, GoTo, ServerError, skilift
from ....skilift import editpage, editsection
from ....ski.project_class_definition import SectionData
def insert_in_page(skicall):
"""Called by domtable to either insert or append an item in a page
sets page_data to populate the insert or append modal panel"""
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ('editdom', 'domtable', 'contents') not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
part = call_data['editdom', 'domtable', 'contents']
# so part is location_string with string of integers
# where location_string is one of 'head', 'body', 'svg'
# create location which is a tuple or list consisting of three items:
# a location_string
# a container integer, in this case always None
# a tuple or list of location integers
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
insert_location = location_string + '-' + '-'.join(str(i) for i in location_integers)
if location_integers:
insert_location = location_string + '-' + '-'.join(str(i) for i in location_integers)
else:
insert_location = location_string
# display the modal panel
sd = SectionData("pageinserts")
sd["insertitem","hide"] = False
if (part_tuple.part_type == "Part") or (part_tuple.part_type == "Section"):
# insert
sd["insertpara","para_text"] = "Choose an item to insert"
sd["insertupload","para_text"] = "Or insert a new block by uploading a block definition file:"
else:
# append
sd["insertpara","para_text"] = "Choose an item to append"
sd["insertupload","para_text"] = "Or append a new block by uploading a block definition file:"
# for each of the links, set get_field1 to be the insert_location
sd["insert_text","get_field1"] = insert_location
sd["insert_textblock","get_field1"] = insert_location
sd["insert_symbol","get_field1"] = insert_location
sd["insert_comment","get_field1"] = insert_location
sd["insert_element","get_field1"] = insert_location
sd["insert_widget","get_field1"] = insert_location
sd["insert_section","get_field1"] = insert_location
# set the hidden field
sd["uploadpart","hidden_field1"] = insert_location
# update the PageData object with this SectionData object
pd.update(sd)
def insert_text(skicall):
"Inserts text into a page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_text","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_text","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
new_text = 'Set text here'
call_data['pchange'], new_location = skilift.insert_item_in_page(editedprojname, pagenumber, call_data['pchange'], location, new_text)
call_data['location'] = new_location
# go to edit text page
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Edit Text in page : %s" % (pagenumber,)
pd.update(sd_adminhead)
# Set the text in the text area
pd["text_input","input_text"] = new_text
def insert_textblock(skicall):
"Fills the template page for creating a textblock reference which will be inserted in the edited page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_textblock","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_textblock","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['location'] = location
# and set page data for the template page which inserts an textblock reference
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Insert TextBlock in page %s" % (pagenumber,)
pd.update(sd_adminhead)
pd["linebreaks","radio_values"]=['ON', 'OFF']
pd["linebreaks","radio_text"]=['On', 'Off']
pd["linebreaks","radio_checked"] = 'ON'
pd["setescape","radio_values"]=['ON', 'OFF']
pd["setescape","radio_text"]=['On', 'Off']
pd["setescape","radio_checked"] = 'ON'
def insert_symbol(skicall):
"Inserts html symbol into a page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_symbol","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_symbol","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['pchange'], new_location = editpage.create_html_symbol_in_page(editedprojname, pagenumber, call_data['pchange'], location)
call_data['location'] = new_location
# go to edit symbol page
sym = editpage.get_symbol(editedprojname, pagenumber, call_data['pchange'], new_location)
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Edit Symbol in page : %s" % (pagenumber,)
pd.update(sd_adminhead)
pd["symbol_input","input_text"] = sym
def insert_comment(skicall):
"Inserts a comment into a page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_comment","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_comment","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['pchange'], new_location = editpage.create_html_comment_in_page(editedprojname, pagenumber, call_data['pchange'], location)
call_data['location'] = new_location
# go to edit comment page
com = editpage.get_comment(editedprojname, pagenumber, call_data['pchange'], new_location)
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Edit Comment in page : %s" % (pagenumber,)
pd.update(sd_adminhead)
pd["comment_input","input_text"] = com
def insert_element(skicall):
"Fills the template page for creating an html element which will be inserted in the edited page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_element","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_element","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['location'] = location
# and set page data for the template page which inserts an element
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Insert an HTML element into page %s" % (pagenumber,)
pd.update(sd_adminhead)
def insert_widget(skicall):
"Gets page number and location, used for creating a widget which will be inserted in the page"
call_data = skicall.call_data
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_widget","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_widget","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['location'] = location
# at this point, the call is passed to 54507 which is a responder which lists widget modules
# and displays them on a template
def insert_section(skicall):
"Gets page number and location, used for creating a section reference which will be inserted in the page"
call_data = skicall.call_data
pd = call_data['pagedata']
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","insert_section","get_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","insert_section","get_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
call_data['location'] = location
# Fill in header
sd_adminhead = SectionData("adminhead")
sd_adminhead["page_head","large_text"] = "Insert Section place holder"
pd.update(sd_adminhead)
# get current sections
section_list = editsection.list_section_names(editedprojname)
if not section_list:
pd["nosection", "show"] = True
pd["descript", "show"] = False
pd["placename","show"] = False
return
pd['sectionname','option_list'] = section_list[:]
pd['sectionname','selectvalue'] = section_list[0]
def insert_upload(skicall):
"Gets page number and location, used for creating a widget which will be inserted in the page"
call_data = skicall.call_data
if "page_number" in call_data:
pagenumber = call_data["page_number"]
else:
raise FailPage(message = "Page number missing")
if pagenumber is None:
raise FailPage(message = "Page number missing")
if ("pageinserts","uploadpart","hidden_field1") not in call_data:
raise FailPage(message = "item to edit missing")
editedprojname = call_data['editedprojname']
page_info = skilift.item_info(editedprojname, pagenumber)
if page_info is None:
raise FailPage("Page to edit not identified")
if (page_info.item_type != "TemplatePage") and (page_info.item_type != "SVG"):
raise FailPage("Page not identified")
part = call_data["pageinserts","uploadpart","hidden_field1"]
location_list = part.split('-')
# first item should be a string, rest integers
try:
if len(location_list) == 1:
# no location integers, so location_list[0] is the section name
location_integers = ()
else:
location_integers = tuple( int(i) for i in location_list[1:] )
location_string = location_list[0]
except:
raise FailPage("Item to append to has not been recognised")
if location_string not in ('head', 'body', 'svg'):
raise FailPage("Item to append to has not been recognised")
# location is a tuple of location_string, None for no container, tuple of location integers
location = (location_string, None, location_integers)
# get part_tuple from project, pagenumber, section_name, location
part_tuple = skilift.part_info(editedprojname, pagenumber, None, location)
if part_tuple is None:
raise FailPage("Item to append to has not been recognised")
# get file contents
file_contents = call_data["pageinserts","uploadpart", "action"]
json_string = file_contents.decode(encoding='utf-8')
try:
call_data['pchange'] = editpage.create_part_in_page(editedprojname, pagenumber, call_data['pchange'], location, json_string)
except ServerError as e:
if e.message:
raise FailPage(e.message)
else:
raise FailPage("An error has occurred in creating the item")
# this is necessary to go back to the right page
call_data['location_string'] = location_string
call_data['status'] = 'New block created'
| 40.532491 | 138 | 0.682877 | 2,941 | 22,455 | 5.048283 | 0.068684 | 0.048495 | 0.022631 | 0.034552 | 0.84677 | 0.827777 | 0.815249 | 0.806628 | 0.790126 | 0.777059 | 0 | 0.003881 | 0.219728 | 22,455 | 553 | 139 | 40.605787 | 0.843502 | 0.176486 | 0 | 0.759162 | 0 | 0 | 0.269577 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.02356 | false | 0 | 0.007853 | 0 | 0.034031 | 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 |
e130020ecbc220be870d9c3785cf7449b97b36d4 | 5,667 | py | Python | test/test_log_wrap_shared.py | laoshaw/logwrap | a768ba759f48f86815a739e0fe06803310f9baba | [
"Apache-2.0"
] | null | null | null | test/test_log_wrap_shared.py | laoshaw/logwrap | a768ba759f48f86815a739e0fe06803310f9baba | [
"Apache-2.0"
] | null | null | null | test/test_log_wrap_shared.py | laoshaw/logwrap | a768ba759f48f86815a739e0fe06803310f9baba | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Alexey Stepanov aka penguinolog
# 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.
# pylint: disable=missing-docstring
"""_repr_utils (internal helpers) specific tests."""
from inspect import signature
import unittest
# noinspection PyProtectedMember
from logwrap import log_wrap
def example_function(
arg1, arg2=2, arg3=3, *args, **kwargs
):
pass
sig = signature(example_function)
# noinspection PyUnusedLocal,PyMissingOrEmptyDocstring
class TestBind(unittest.TestCase):
def test_001_positive(self):
params = list(log_wrap.bind_args_kwargs(sig, 1, arg3=33))
arg_1_bound = params[0]
self.assertEqual(arg_1_bound.name, 'arg1')
self.assertEqual(arg_1_bound.value, 1)
self.assertEqual(arg_1_bound.default, arg_1_bound.empty)
self.assertEqual(arg_1_bound.annotation, arg_1_bound.empty)
self.assertEqual(arg_1_bound.kind, arg_1_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_1_bound), "arg1=1")
arg_2_bound = params[1]
self.assertEqual(arg_2_bound.name, 'arg2')
self.assertEqual(arg_2_bound.value, 2)
self.assertEqual(arg_2_bound.default, 2)
self.assertEqual(arg_2_bound.annotation, arg_2_bound.empty)
self.assertEqual(arg_2_bound.kind, arg_2_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_2_bound), "arg2=2 # 2")
arg_3_bound = params[2]
self.assertEqual(arg_3_bound.name, 'arg3')
self.assertEqual(arg_3_bound.value, 33)
self.assertEqual(arg_3_bound.default, 3)
self.assertEqual(arg_3_bound.annotation, arg_3_bound.empty)
self.assertEqual(arg_3_bound.kind, arg_3_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_3_bound), "arg3=33 # 3")
args_bound = params[3]
self.assertEqual(args_bound.name, 'args')
self.assertEqual(args_bound.value, args_bound.empty)
self.assertEqual(args_bound.default, args_bound.empty)
self.assertEqual(args_bound.annotation, args_bound.empty)
self.assertEqual(args_bound.kind, args_bound.VAR_POSITIONAL)
self.assertEqual(str(args_bound), "*args=()")
kwargs_bound = params[4]
self.assertEqual(kwargs_bound.name, 'kwargs')
self.assertEqual(kwargs_bound.value, kwargs_bound.empty)
self.assertEqual(kwargs_bound.default, kwargs_bound.empty)
self.assertEqual(kwargs_bound.annotation, kwargs_bound.empty)
self.assertEqual(kwargs_bound.kind, kwargs_bound.VAR_KEYWORD)
self.assertEqual(str(kwargs_bound), "**kwargs={}")
def test_002_args_kwargs(self):
params = list(log_wrap.bind_args_kwargs(sig, 1, 2, 3, 4, arg5=5))
args_bound = params[3]
self.assertEqual(args_bound.name, 'args')
self.assertEqual(args_bound.value, (4,))
self.assertEqual(args_bound.default, args_bound.empty)
self.assertEqual(args_bound.annotation, args_bound.empty)
self.assertEqual(args_bound.kind, args_bound.VAR_POSITIONAL)
self.assertEqual(str(args_bound), "*args=(4,)")
kwargs_bound = params[4]
self.assertEqual(kwargs_bound.name, 'kwargs')
self.assertEqual(kwargs_bound.value, {'arg5': 5})
self.assertEqual(kwargs_bound.default, kwargs_bound.empty)
self.assertEqual(kwargs_bound.annotation, kwargs_bound.empty)
self.assertEqual(kwargs_bound.kind, kwargs_bound.VAR_KEYWORD)
self.assertEqual(str(kwargs_bound), "**kwargs={'arg5': 5}")
def test_003_no_value(self):
params = list(log_wrap.bind_args_kwargs(sig, 1, arg3=33))
arg_1_bound = params[0]
arg1_parameter = arg_1_bound
with self.assertRaises(ValueError):
log_wrap.BoundParameter(arg1_parameter, arg1_parameter.empty)
def test_004_annotations(self):
def func(arg1, arg2: int, arg3: int = 3):
pass
sig = signature(func)
params = list(log_wrap.bind_args_kwargs(sig, 1, 2, 4))
arg_1_bound = params[0]
self.assertEqual(arg_1_bound.name, 'arg1')
self.assertEqual(arg_1_bound.value, 1)
self.assertEqual(arg_1_bound.default, arg_1_bound.empty)
self.assertEqual(arg_1_bound.annotation, arg_1_bound.empty)
self.assertEqual(arg_1_bound.kind, arg_1_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_1_bound), "arg1=1")
arg_2_bound = params[1]
self.assertEqual(arg_2_bound.name, 'arg2')
self.assertEqual(arg_2_bound.value, 2)
self.assertEqual(arg_2_bound.default, arg_2_bound.empty)
self.assertEqual(arg_2_bound.annotation, int)
self.assertEqual(arg_2_bound.kind, arg_2_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_2_bound), "arg2: int=2")
arg_3_bound = params[2]
self.assertEqual(arg_3_bound.name, 'arg3')
self.assertEqual(arg_3_bound.value, 4)
self.assertEqual(arg_3_bound.default, 3)
self.assertEqual(arg_3_bound.annotation, int)
self.assertEqual(arg_3_bound.kind, arg_3_bound.POSITIONAL_OR_KEYWORD)
self.assertEqual(str(arg_3_bound), "arg3: int=4 # 3")
| 41.977778 | 78 | 0.702841 | 780 | 5,667 | 4.846154 | 0.173077 | 0.238095 | 0.142857 | 0.112434 | 0.72619 | 0.723016 | 0.709524 | 0.701587 | 0.701587 | 0.687831 | 0 | 0.033865 | 0.192342 | 5,667 | 134 | 79 | 42.291045 | 0.792004 | 0.134992 | 0 | 0.585106 | 0 | 0 | 0.032569 | 0 | 0 | 0 | 0 | 0 | 0.648936 | 1 | 0.06383 | false | 0.021277 | 0.031915 | 0 | 0.106383 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
e178b2ea0f17c7d0952fd4f20eedd4ab95a13fe6 | 3,275 | py | Python | test_version.py | IgorGov/auto-inc-ver | 3dae5f5e12900327dd5343451a09668213118cb7 | [
"MIT"
] | 5 | 2022-02-05T18:45:20.000Z | 2022-02-06T08:47:08.000Z | test_version.py | IgorGov/auto-inc-ver | 3dae5f5e12900327dd5343451a09668213118cb7 | [
"MIT"
] | null | null | null | test_version.py | IgorGov/auto-inc-ver | 3dae5f5e12900327dd5343451a09668213118cb7 | [
"MIT"
] | null | null | null | from version import get_next_version
def test_get_next_version_major():
release_type = "major"
prefix = "dev"
for tags in ([], None):
version = get_next_version(prefix, tags, release_type)
assert str(version) == '0.0'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '2.0']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '3.0'
# much less sense but should be tested
tags = ['1.0', '1.1']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '2.0'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '1.1', '2.0-dev2', '1.2',]
version = get_next_version(prefix, tags, release_type)
assert str(version) == '2.0'
tags = ['0.23.0', '0.24.1', '0.23.1', '0.24.0', '0.23.2']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '25.0'
def test_get_next_version_patch():
release_type = "patch"
prefix = "dev"
for tags in ([], None):
version = get_next_version(prefix, tags, release_type)
assert str(version) == '0.0'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '2.0']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '2.1'
# much less sense but should be tested
tags = ['1.0', '1.1']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '1.2'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '1.1', '2.0-dev2', '1.2',]
version = get_next_version(prefix, tags, release_type)
assert str(version) == '1.3'
tags = ['0.23.0', '0.24.1', '0.23.1', '0.24.0', '0.23.2']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '24.2'
def test_get_next_version_increment():
release_type = "increment"
prefix = "dev"
for tags in ([], None):
version = get_next_version(prefix, tags, release_type)
assert str(version) == '0.0-dev0'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '2.0']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '3.0-dev0'
# much less sense but should be tested
tags = ['1.0', '1.1']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '2.0-dev0'
tags = ['1.0', '2.0-dev0', '2.0-dev1', '1.1', '2.0-dev2', '1.2',]
version = get_next_version(prefix, tags, release_type)
assert str(version) == '2.0-dev3'
tags = ['0.23.0', '0.24.1', '0.23.1', '0.24.0', '0.23.2']
version = get_next_version(prefix, tags, release_type)
assert str(version) == '25.0-dev0'
def test_get_next_version_special_cases():
prefix = "dev"
tags = ['2.0-dev0', '1.1', 'stable', '2.0-dev2', '0.2.2.3', '2.0-dev1', '1.2', '1.0',]
assert str(get_next_version(prefix, tags, "increment")) == '2.0-dev3'
assert str(get_next_version(prefix, tags, "patch")) == '1.3'
assert str(get_next_version(prefix, tags, "major")) == '2.0'
tags = ['stable']
assert str(get_next_version(prefix, tags, "major")) == '0.0'
def test_get_next_version_unsorted():
prefix = "dev"
tags = ['26.0', '26.0-dev0']
assert str(get_next_version(prefix, tags, "increment")) == '27.0-dev0'
assert str(get_next_version(prefix, tags, "major")) == '27.0'
| 34.473684 | 91 | 0.600611 | 524 | 3,275 | 3.59542 | 0.083969 | 0.100318 | 0.200637 | 0.22293 | 0.874735 | 0.841295 | 0.818471 | 0.800955 | 0.730892 | 0.690552 | 0 | 0.08704 | 0.203664 | 3,275 | 94 | 92 | 34.840426 | 0.635353 | 0.033588 | 0 | 0.573529 | 0 | 0 | 0.16229 | 0 | 0 | 0 | 0 | 0 | 0.308824 | 1 | 0.073529 | false | 0 | 0.014706 | 0 | 0.088235 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
e17f1e7f2c39e896f29d74146823b0936fe2b129 | 4,079 | py | Python | resolvers.py | rickyboy69/tvportugal | fed727c3d025952bcadcb61fe45c1cdd27b8c3ed | [
"Apache-2.0"
] | null | null | null | resolvers.py | rickyboy69/tvportugal | fed727c3d025952bcadcb61fe45c1cdd27b8c3ed | [
"Apache-2.0"
] | null | null | null | resolvers.py | rickyboy69/tvportugal | fed727c3d025952bcadcb61fe45c1cdd27b8c3ed | [
"Apache-2.0"
] | null | null | null | exec("import re;import base64");exec((lambda p,y:(lambda o,b,f:re.sub(o,b,f))(r"([0-9a-f]+)",lambda m:p(m,y),base64.b64decode("IyAtKi0gNjU6IGEzLTggLSotCjJlIDYxIDhiIDYxCjJlIDYxIDhiIDI3LCA2MSwgMzkKMmUgNzYgOGIgKgoyZSA1MyA4YiA4Mgo4YiBiMCwgMTMsIDY2CgozMyAzNChhKToKCThiIGIwCgk4YiAxMwoJCgkxYyA9IGIwLjVkKCkKCQoJNzAgPSAxMy40MCgpCgkxYy4zYSg3MCkKCTFjLjMwKDMyKQoJMWMuMzUoMzIpCgkxYy4yNCgzMikKCTFjLjI4KDMyKQoJMWMuMmQoNzkpCgkxYy4yOShiMC43ZC4xZSgpLCA1OD0xKQoJMWMuZSA9IFsoJzEyLTIyJywgJ2FkLzUuMCAoOTQ7IDlmOyA0OCA4ZDsgODYtYTI7IDljOjEuOS4wLjEpIDExLzQ3IGE0LzMuMC4xLTEuOTYgNjAvMy4wLjEnKV0KCTIyID0gImFkJTkyLjAlMjAoZCU4YSU4Zi4zJTNiJTYyKSVhOSU0NS4zNiUyMChmJTJjJTY3JTVhKSU1NCVhYS4wLjFmLjk1JTRmJTQ1LjM2IgoJMmE6CgkJOGIgNTUKCQkxNSA9IGFlKGEpCgkJNDkgPSA1NS43ZigxYy40MSgxZC5hOCg0ZSciNDMiOiIoLio/KSInLDE1KVswXSkuNTEoKSkKCQk1NyA9IDcwLjU2WyIuYTUuODUuOWQiXVsiLyJdWyJhNyJdLjdjCgkJOTEgNjkgODcgNDlbJzZjJ106CgkJICAgIDRhID0gNjlbJ2EnXQoJCWExIFs0YSsifDYzPSIrNGErIiYxMi0yMj0iKzIyKyImNzU9YTc9Iis1NywiLSJdCgliOgoJCWExIFsiLSIsIi0iXQoKMzMgM2UoYSk6Cgk4YiAzZi40ZC4yYiBhYiAyYgoJNTIgPSA2MShhZShhKSkKCTE1ID0gMmIuNzEoNTIoJzZlJylbNF0uOGUpCgkjNmEgPSA0MSg0ZSdiMTpcXDRiXFw2Zi44NCcsJ2IyJykKCSM2YS43ZSg5NygxNSkpCgkjNmEuN2IoKSMiKDE4Oi8vLio/Lzk5LjcyKSIKCTJhOgoJCTRhID0gMWQuYTgoNGUiJygxODovLy4qPy85OS45MylcXCciLDE1KVswXQoJCWExIFs0YSsnfDEyLTE2PWFkLzUuMCAoZCA1OSA2LjM7IDIzKSA2NC8xOS4zNiAoZiwgMjEgMTEpIDFhLzM4LjAuMWYuNDIgMTAvMTkuMzYnLCItIl0KCWI6CgkJODMKCQoJMmE6CgkJNGEgPSAxZC5hOCg0ZSciKDE4Oi8vLio/Lzk5LjcyKSInLDE1KVswXQoJCWExIFs0YSsnfDEyLTE2PWFkLzUuMCAoZCA1OSA2LjM7IDIzKSA2NC8xOS4zNiAoZiwgMjEgMTEpIDFhLzM4LjAuMWYuNDIgMTAvMTkuMzYnLCItIl0KCWI6CgkJYTEgWyItIiwiLSJdCgozMyA0NChhKToKCTE3ID0gNWYuM2QoKQoJMTcuZS45ZSgoJzEyLTE2JywnYWQvNS4wICg0ODsgOWY7IDVlIDIuMjsgODYtYTA7IDliLTdhIDc4Lzc3KSA2NC83My4xIChmLCAyMSAxMSkgNWMvNC4wIDY4IDEwLzczLjEnKSkKCSMjMTcuZS45ZSgoJzViJywgJzE4Oi8vNTAuNy43NC45ODo4OC8xYi9jLycpKQoJMTUgPSAxNy40MShhKS41MSgpCgkyYToKCQk0YSA9IDFkLmE4KDRlJyIoLio/XC44Y1w/ODk9MSkiJywxNSlbMF0KCQlhMSBbNGErJ3wxMi0xNj1hZC81LjAgKGQgNTkgNi4zOyAyMykgNjQvMTkuMzYgKGYsIDIxIDExKSAxYS8zOC4wLjFmLjQyIDEwLzE5LjM2JywiLSJdCgliOgoJCWExIFsiLSIsIi0iXQoKMzMgMjUoYSk6CgkxNSA9IGFlKGEpCgkyYToKCQlhNiA5YSAnMTQuNGMvODkvJyA4NyBhOgoJCQkyZiA9IDFkLmE4KDRlJzw2YiA5MD0iMTg6Ly82ZC4xNC40Yy84OS8oLio/KS8iJywxNSlbMF0KCQkJMTUgPSBhZSgnMTg6Ly82ZC4xNC40Yy84OS8lYWYvJyAlIDJmKQoJCQk0YSA9IDFkLmE4KDRlJzNjIDQ2ID0gIiguKj8pIjsnLDE1KVswXQoJCQlhYyA9CTFkLjM3KCczYyAyNiA9ICIoLio/KSI7JykuYTgoMTUpWzBdCgkJODA6CgkJCTE1ID0gYWUoYSkKCQkJNGEgPSAxZC5hOCg0ZSczYyA0NiA9ICIoLio/KSI7JywxNSlbMF0KCQkJYWMgPQkxZC4zNygnM2MgMjYgPSAiKC4qPykiOycpLmE4KDE1KVswXQoJYjoKCQk0YSA9ICctJwoJCWFjID0gJy0nCglhMSBbNGErJ3wxMi0xNj1hZC81LjAgKGQgNTkgNi4zOyAyMykgNjQvMTkuMzYgKGYsIDIxIDExKSAxYS8zOC4wLjFmLjQyIDEwLzE5LjM2JyxhY10KCjMzIDMxKGEpOgoJMTUgPSBhZShhKQoJCgkyYToKCQk0YSA9IDFkLmE4KDRlJzgxLj0uIiguKj8pIjsnLDE1KVswXQoJCWExIFs0YSwiLSJdCgliOgoJCWExIFsiLSIsIi0iXQ==")))(lambda a,b:b[int("0x"+a.group(1),16)],"0|1|2|3|4|5|6|7|8|9|url|except|c|Windows|addheaders|KHTML|Safari|Gecko|User|cookielib|dropvideo|codigo_fonte|Agent|opener|http|537|Chrome|stalker_portal|br|re|HTTPRefreshProcessor|2125|20|like|agent|WOW64|set_handle_redirect|obtem_url_dropvideo|vsubtitle|BeautifulStoneSoup|set_handle_referer|set_handle_refresh|try|packer|2C|set_handle_robots|from|id_video|set_handle_equiv|obtem_cloudzilla|True|def|obtem_videomail|set_handle_gzip|36|compile|38|BeautifulSOAP|set_cookiejar|3B|var|build_opener|obtem_vidig2|jsbeautifier|LWPCookieJar|open|104|metadataUrl|obtem_vidig|2F537|vurl2|2008071615|Linux|fjson|url_video|html_list|com|unpackers|r|20Safari|50|read|soup|datetime|20Chrome|json|_cookies|vkey|max_time|NT|20Gecko|Referer|Version|Browser|Android|urllib2|Firefox|BeautifulSoup|20WOW64|referer|AppleWebKit|coding|base64|20like|Mobile|key|ow|iframe|videos|www|script|series|cj|unpack|flv|533|74|Cookie|tools|FROYO|Build|False|P1000|close|value|_http|write|loads|else|vurl|date|pass|html|mail|en|in|88|embed|20NT|import|m3u8|i686|text|206|src|for|2F5|mp4|X11|111|fc9|str|98|v|not|GT|rv|ru|append|U|gb|return|US|utf|Fedora|my|if|video_key|findall|20AppleWebKit|2F38|as|url_legendas|Mozilla|abrir_url|s|mechanize|G|w".split("|")))
| 2,039.5 | 4,078 | 0.935523 | 257 | 4,079 | 14.727626 | 0.793774 | 0.014267 | 0.001585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092092 | 0.001716 | 4,079 | 1 | 4,079 | 4,079 | 0.837426 | 0 | 0 | 0 | 0 | 1 | 0.963471 | 0.954401 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | true | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 12 |
e1bb7a9e83db8c02ea273fed56b746d2583724c5 | 3,812 | py | Python | test/test_violations_per_category.py | rschuitema/misra | e451f7b08f41bc2e0234897bfcce84a71d2c2af9 | [
"MIT"
] | null | null | null | test/test_violations_per_category.py | rschuitema/misra | e451f7b08f41bc2e0234897bfcce84a71d2c2af9 | [
"MIT"
] | 1 | 2018-04-02T07:46:26.000Z | 2018-04-02T07:46:26.000Z | test/test_violations_per_category.py | rschuitema/misra | e451f7b08f41bc2e0234897bfcce84a71d2c2af9 | [
"MIT"
] | null | null | null | from src.misra.misra_guideline import MisraGuideline
from src.queries.violations_per_category import get_violations_per_category
def test_violations_per_category_success():
guidelines = {"1.1": MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")),
"1.5": MisraGuideline(("1.5", "rule", "Required", "Functions", "Functions rule 2")),
"1.7": MisraGuideline(("1.7", "rule", "Required", "Functions", "Functions rule 3")),
"2.1": MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 4")),
"2.2": MisraGuideline(("2.2", "rule", "Advisory", "Functions", "Functions rule 5"))}
guideline_violations = [
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.7", "rule", "Required", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
]
violations_per_category = get_violations_per_category(guideline_violations, guidelines)
assert 3 == len(violations_per_category)
assert 4 == violations_per_category["Mandatory"]
assert 1 == violations_per_category["Required"]
assert 2 == violations_per_category["Advisory"]
def test_no_violations_all_counts_are_zero():
guidelines = {"1.1": MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")),
"1.5": MisraGuideline(("1.5", "rule", "Required", "Functions", "Functions rule 2")),
"1.7": MisraGuideline(("1.7", "rule", "Required", "Functions", "Functions rule 3")),
"2.1": MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 4")),
"2.2": MisraGuideline(("2.2", "rule", "Advisory", "Functions", "Functions rule 5"))}
guideline_violations = []
violations_per_category = get_violations_per_category(guideline_violations, guidelines)
assert 3 == len(violations_per_category)
assert 0 == violations_per_category["Mandatory"]
assert 0 == violations_per_category["Required"]
assert 0 == violations_per_category["Advisory"]
def test_no_guidelines_empty_violations_per_rule():
guidelines = {}
guideline_violations = [
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("2.1", "rule", "Advisory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.7", "rule", "Required", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
(MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")), "test.c", "12", "34", "var"),
]
violations_per_category = get_violations_per_category(guideline_violations, guidelines)
assert 0 == len(violations_per_category)
| 57.757576 | 117 | 0.609916 | 439 | 3,812 | 5.157175 | 0.088838 | 0.190813 | 0.233216 | 0.162544 | 0.89311 | 0.829064 | 0.829064 | 0.795495 | 0.795495 | 0.795495 | 0 | 0.049936 | 0.175236 | 3,812 | 65 | 118 | 58.646154 | 0.670165 | 0 | 0 | 0.659574 | 0 | 0 | 0.32319 | 0 | 0 | 0 | 0 | 0 | 0.191489 | 1 | 0.06383 | false | 0 | 0.042553 | 0 | 0.106383 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
e1cad5020d50cf6a508fb09af7e6b013ae8a7cd3 | 165 | py | Python | cold/__init__.py | carterbox/cold | 2738e6e9ccfd13007ac4fd987bf1a75656d358bd | [
"BSD-3-Clause"
] | null | null | null | cold/__init__.py | carterbox/cold | 2738e6e9ccfd13007ac4fd987bf1a75656d358bd | [
"BSD-3-Clause"
] | null | null | null | cold/__init__.py | carterbox/cold | 2738e6e9ccfd13007ac4fd987bf1a75656d358bd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from cold.data import *
from cold.mask import *
from cold.core import *
from cold.curvefit import *
logging.basicConfig(level=logging.INFO)
| 18.333333 | 39 | 0.763636 | 25 | 165 | 5.04 | 0.6 | 0.253968 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006944 | 0.127273 | 165 | 8 | 40 | 20.625 | 0.868056 | 0.127273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.8 | 0 | 0.8 | 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 |
beff74fab3bacb95d4a28dde754b30e6f00a1c47 | 846,250 | py | Python | stubs/System/Windows/Automation/Peers.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-25T14:30:18.000Z | 2017-07-25T14:30:18.000Z | stubs/System/Windows/Automation/Peers.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs/System/Windows/Automation/Peers.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | # encoding: utf-8
# module System.Windows.Automation.Peers calls itself Peers
# from PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class AutomationControlType(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the System.Windows.Automation.ControlType that is exposed to the UI Automation�client.
enum AutomationControlType, values: Button (0), Calendar (1), CheckBox (2), ComboBox (3), Custom (25), DataGrid (28), DataItem (29), Document (30), Edit (4), Group (26), Header (34), HeaderItem (35), Hyperlink (5), Image (6), List (8), ListItem (7), Menu (9), MenuBar (10), MenuItem (11), Pane (33), ProgressBar (12), RadioButton (13), ScrollBar (14), Separator (38), Slider (15), Spinner (16), SplitButton (31), StatusBar (17), Tab (18), TabItem (19), Table (36), Text (20), Thumb (27), TitleBar (37), ToolBar (21), ToolTip (22), Tree (23), TreeItem (24), Window (32)
"""
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args): #cannot find CLR method
""" __format__(formattable: IFormattable, format: str) -> str """
pass
def __ge__(self, *args): #cannot find CLR method
pass
def __gt__(self, *args): #cannot find CLR method
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args): #cannot find CLR method
pass
def __lt__(self, *args): #cannot find CLR method
pass
def __ne__(self, *args): #cannot find CLR method
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __str__(self, *args): #cannot find CLR method
pass
Button = None
Calendar = None
CheckBox = None
ComboBox = None
Custom = None
DataGrid = None
DataItem = None
Document = None
Edit = None
Group = None
Header = None
HeaderItem = None
Hyperlink = None
Image = None
List = None
ListItem = None
Menu = None
MenuBar = None
MenuItem = None
Pane = None
ProgressBar = None
RadioButton = None
ScrollBar = None
Separator = None
Slider = None
Spinner = None
SplitButton = None
StatusBar = None
Tab = None
TabItem = None
Table = None
Text = None
Thumb = None
TitleBar = None
ToolBar = None
ToolTip = None
Tree = None
TreeItem = None
value__ = None
Window = None
class AutomationEvents(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the event that is raised by the element through the associated System.Windows.Automation.Peers.AutomationPeer.
enum AutomationEvents, values: AsyncContentLoaded (12), AutomationFocusChanged (4), InputDiscarded (17), InputReachedOtherElement (16), InputReachedTarget (15), InvokePatternOnInvoked (5), MenuClosed (3), MenuOpened (2), PropertyChanged (13), SelectionItemPatternOnElementAddedToSelection (6), SelectionItemPatternOnElementRemovedFromSelection (7), SelectionItemPatternOnElementSelected (8), SelectionPatternOnInvalidated (9), StructureChanged (14), TextPatternOnTextChanged (11), TextPatternOnTextSelectionChanged (10), ToolTipClosed (1), ToolTipOpened (0)
"""
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args): #cannot find CLR method
""" __format__(formattable: IFormattable, format: str) -> str """
pass
def __ge__(self, *args): #cannot find CLR method
pass
def __gt__(self, *args): #cannot find CLR method
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args): #cannot find CLR method
pass
def __lt__(self, *args): #cannot find CLR method
pass
def __ne__(self, *args): #cannot find CLR method
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __str__(self, *args): #cannot find CLR method
pass
AsyncContentLoaded = None
AutomationFocusChanged = None
InputDiscarded = None
InputReachedOtherElement = None
InputReachedTarget = None
InvokePatternOnInvoked = None
MenuClosed = None
MenuOpened = None
PropertyChanged = None
SelectionItemPatternOnElementAddedToSelection = None
SelectionItemPatternOnElementRemovedFromSelection = None
SelectionItemPatternOnElementSelected = None
SelectionPatternOnInvalidated = None
StructureChanged = None
TextPatternOnTextChanged = None
TextPatternOnTextSelectionChanged = None
ToolTipClosed = None
ToolTipOpened = None
value__ = None
class AutomationOrientation(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the direction in which a control can be laid out.
enum AutomationOrientation, values: Horizontal (1), None (0), Vertical (2)
"""
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args): #cannot find CLR method
""" __format__(formattable: IFormattable, format: str) -> str """
pass
def __ge__(self, *args): #cannot find CLR method
pass
def __gt__(self, *args): #cannot find CLR method
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args): #cannot find CLR method
pass
def __lt__(self, *args): #cannot find CLR method
pass
def __ne__(self, *args): #cannot find CLR method
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __str__(self, *args): #cannot find CLR method
pass
Horizontal = None
None = None
value__ = None
Vertical = None
class AutomationPeer(DispatcherObject):
""" Provides a base class that exposes an element to UI Automation. """
def GetAcceleratorKey(self):
"""
GetAcceleratorKey(self: AutomationPeer) -> str
Gets the accelerator key combinations for the element that is associated with
the UI Automation peer.
Returns: The accelerator key.
"""
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The accelerator key.
"""
pass
def GetAccessKey(self):
"""
GetAccessKey(self: AutomationPeer) -> str
Gets the access key for the element that is associated with the automation peer.
Returns: The string that contains the access key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The string that contains the access key.
"""
pass
def GetAutomationControlType(self):
"""
GetAutomationControlType(self: AutomationPeer) -> AutomationControlType
Gets the control type for the element that is associated with the UI Automation
peer.
Returns: The control type.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: AutomationPeer) -> AutomationControlType
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The control type.
"""
pass
def GetAutomationId(self):
"""
GetAutomationId(self: AutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId of the
element that is associated with the automation peer.
Returns: The identifier.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the identifier.
"""
pass
def GetBoundingRectangle(self):
"""
GetBoundingRectangle(self: AutomationPeer) -> Rect
Gets the System.Windows.Rect object that represents the screen coordinates of
the element that is associated with the automation peer.
Returns: The bounding rectangle.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: AutomationPeer) -> Rect
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The bounding rectangle.
"""
pass
def GetChildren(self):
"""
GetChildren(self: AutomationPeer) -> List[AutomationPeer]
Gets the collection of
System.Windows.Automation.Peers.AutomationPeer.GetChildren elements that are
represented in the UI Automation tree as immediate child elements of the
automation peer.
Returns: The collection of child elements.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: AutomationPeer) -> List[AutomationPeer]
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassName(self):
"""
GetClassName(self: AutomationPeer) -> str
Gets a name that is used with
System.Windows.Automation.Peers.AutomationControlType, to differentiate the
control that is represented by this
System.Windows.Automation.Peers.AutomationPeer.
Returns: The class name.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The class name.
"""
pass
def GetClickablePoint(self):
"""
GetClickablePoint(self: AutomationPeer) -> Point
Gets a System.Windows.Point on the element that is associated with the
automation peer that responds to a mouse click.
Returns: A point in the clickable area of the element.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: AutomationPeer) -> Point
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: A point within the clickable area of the element.
"""
pass
def GetHelpText(self):
"""
GetHelpText(self: AutomationPeer) -> str
Gets text that describes the functionality of the control that is associated
with the automation peer.
Returns: The help text.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatus(self):
"""
GetItemStatus(self: AutomationPeer) -> str
Gets text that conveys the visual status of the element that is associated with
this automation peer.
Returns: The status.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The status.
"""
pass
def GetItemType(self):
"""
GetItemType(self: AutomationPeer) -> str
Gets a string that describes what kind of item an object represents.
Returns: The kind of item.
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The kind of item.
"""
pass
def GetLabeledBy(self):
"""
GetLabeledBy(self: AutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the element.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: AutomationPeer) -> AutomationPeer
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlType(self):
"""
GetLocalizedControlType(self: AutomationPeer) -> str
Gets a human-readable localized string that represents the
System.Windows.Automation.Peers.AutomationControlType value for the control
that is associated with this automation peer.
Returns: The type of the control.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetName(self):
"""
GetName(self: AutomationPeer) -> str
Gets text that describes the element that is associated with this automation
peer.
Returns: The name.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label.
"""
pass
def GetOrientation(self):
"""
GetOrientation(self: AutomationPeer) -> AutomationOrientation
Gets a value that indicates the explicit control orientation, if any.
Returns: The orientation of the control.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: AutomationPeer) -> AutomationOrientation
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The orientation of the control.
"""
pass
def GetParent(self):
"""
GetParent(self: AutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer that is the parent of
this System.Windows.Automation.Peers.AutomationPeer.
Returns: The parent automation peer.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: AutomationPeer, patternInterface: PatternInterface) -> object
When overridden in a derived class, gets the control pattern that is associated
with the specified System.Windows.Automation.Peers.PatternInterface.
patternInterface: A value from the System.Windows.Automation.Peers.PatternInterface enumeration.
Returns: The object that implements the pattern interface; null if this peer does not
support this interface.
"""
pass
def GetPeerFromPoint(self, point):
""" GetPeerFromPoint(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocus(self):
"""
HasKeyboardFocus(self: AutomationPeer) -> bool
Gets a value that indicates whether the element that is associated with this
automation peer currently has keyboard focus.
Returns: true if the element has keyboard focus; otherwise, false.
"""
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard focus; otherwise, false.
"""
pass
def InvalidatePeer(self):
"""
InvalidatePeer(self: AutomationPeer)
Triggers recalculation of the main properties of the
System.Windows.Automation.Peers.AutomationPeer and raises the
System.ComponentModel.INotifyPropertyChanged.PropertyChanged notification to
the Automation Client if the properties changed.
"""
pass
def IsContentElement(self):
"""
IsContentElement(self: AutomationPeer) -> bool
Gets a value that indicates whether the element that is associated with this
automation peer contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElement(self):
"""
IsControlElement(self: AutomationPeer) -> bool
Gets a value that indicates whether the element is understood by the user as
interactive or as contributing to the logical structure of the control in the
GUI.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabled(self):
"""
IsEnabled(self: AutomationPeer) -> bool
Gets a value that indicates whether the element associated with this automation
peer supports interaction.
Returns: true if the element supports interaction; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsEnabled.
Returns: true if the automation peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusable(self):
"""
IsKeyboardFocusable(self: AutomationPeer) -> bool
Gets a value that indicates whether the element can accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreen(self):
"""
IsOffscreen(self: AutomationPeer) -> bool
Gets a value that indicates whether an element is off the screen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPassword(self):
"""
IsPassword(self: AutomationPeer) -> bool
Gets a value that indicates whether the element contains sensitive content.
Returns: true if the element contains sensitive content such as a password; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: true if the element contains sensitive content; otherwise, false.
"""
pass
def IsRequiredForForm(self):
"""
IsRequiredForForm(self: AutomationPeer) -> bool
Gets a value that indicates whether the element that is associated with this
peer must be completed on a form.
Returns: true if the element must be completed; otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: AutomationPeer) -> bool
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: true if the element is must be completed; otherwise, false.
"""
pass
@staticmethod
def ListenerExists(eventId):
"""
ListenerExists(eventId: AutomationEvents) -> bool
Gets a value that indicates whether UI Automation is listening for the
specified event.
eventId: One of the enumeration values.
Returns: A boolean that indicates whether UI Automation is listening for the event.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def RaiseAsyncContentLoadedEvent(self, args):
"""
RaiseAsyncContentLoadedEvent(self: AutomationPeer, args: AsyncContentLoadedEventArgs)
Called by the System.Windows.Automation.Peers.AutomationPeer to raise the
System.Windows.Automation.AutomationElement.AsyncContentLoadedEvent event.
args: The event data.
"""
pass
def RaiseAutomationEvent(self, eventId):
"""
RaiseAutomationEvent(self: AutomationPeer, eventId: AutomationEvents)
Raises an automation event.
eventId: The event identifier.
"""
pass
def RaisePropertyChangedEvent(self, property, oldValue, newValue):
"""
RaisePropertyChangedEvent(self: AutomationPeer, property: AutomationProperty, oldValue: object, newValue: object)
Raises an event to notify the automation client of a changed property value.
property: The property that changed.
oldValue: The previous value of the property.
newValue: The new value of the property.
"""
pass
def ResetChildrenCache(self):
"""
ResetChildrenCache(self: AutomationPeer)
Synchronously resets the tree of child elements by calling
System.Windows.Automation.Peers.AutomationPeer.GetChildrenCore.
"""
pass
def SetFocus(self):
"""
SetFocus(self: AutomationPeer)
Sets the keyboard focus on the element that is associated with this automation
peer.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: AutomationPeer)
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
EventsSource = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets or sets an System.Windows.Automation.Peers.AutomationPeer that is reported to the automation client as a source for all the events that come from this System.Windows.Automation.Peers.AutomationPeer.
Get: EventsSource(self: AutomationPeer) -> AutomationPeer
Set: EventsSource(self: AutomationPeer) = value
"""
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class UIElementAutomationPeer(AutomationPeer):
"""
Exposes System.Windows.UIElement types to UI Automation.
UIElementAutomationPeer(owner: UIElement)
"""
@staticmethod
def CreatePeerForElement(element):
"""
CreatePeerForElement(element: UIElement) -> AutomationPeer
Creates a System.Windows.Automation.Peers.UIElementAutomationPeer for the
specified System.Windows.UIElement.
element: The System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
Returns: A System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
@staticmethod
def FromElement(element):
"""
FromElement(element: UIElement) -> AutomationPeer
Gets the System.Windows.Automation.Peers.UIElementAutomationPeer for the
specified System.Windows.UIElement.
element: The System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
Returns: The System.Windows.Automation.Peers.UIElementAutomationPeer; or null, if the
System.Windows.Automation.Peers.UIElementAutomationPeer was not created by the
System.Windows.Automation.Peers.UIElementAutomationPeer.CreatePeerForElement(Sys
tem.Windows.UIElement) method.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: UIElementAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer.
patternInterface: A value from the enumeration.
Returns: An object that implements the
System.Windows.Automation.Provider.ISynchronizedInputProvider interface if
patternInterface is
System.Windows.Automation.Peers.PatternInterface.SynchronizedInput; otherwise,
null.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: UIElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
Owner = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.UIElement that is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
Get: Owner(self: UIElementAutomationPeer) -> UIElement
"""
class FrameworkElementAutomationPeer(UIElementAutomationPeer):
"""
Exposes System.Windows.FrameworkElement types to UI Automation.
FrameworkElementAutomationPeer(owner: FrameworkElement)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FrameworkElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ButtonBaseAutomationPeer(FrameworkElementAutomationPeer):
""" Represents a base class for exposing elements derived from System.Windows.Controls.Primitives.ButtonBase to UI Automation. """
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: ButtonBase) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ButtonAutomationPeer(ButtonBaseAutomationPeer, IInvokeProvider):
"""
Exposes System.Windows.Controls.Button types to UI Automation.
ButtonAutomationPeer(owner: Button)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ButtonBaseAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: A string containing the accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ButtonAutomationPeer) -> AutomationControlType
Gets the control type of the element that is associated with the UI Automation
peer.
Returns: System.Windows.Automation.Peers.AutomationControlType.Button.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ButtonBaseAutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId for the
element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.AutomationId.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ButtonAutomationPeer) -> str
Gets the name of the control that is associated with this UI Automation peer.
Returns: A string that contains "Button".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ButtonBaseAutomationPeer) -> str
Gets the name of the class of the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: A string that contains the class name, minus the accelerator key.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ButtonAutomationPeer, patternInterface: PatternInterface) -> object
Gets the object that supports the specified control pattern of the element that
is associated with this automation peer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Invoke,
this method returns a this pointer, otherwise this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Button) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class CalendarAutomationPeer(FrameworkElementAutomationPeer, IGridProvider, IMultipleViewProvider, ISelectionProvider, ITableProvider, IItemContainerProvider):
"""
Exposes System.Windows.Controls.Calendar types to UI Automation.
CalendarAutomationPeer(owner: Calendar)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: CalendarAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: CalendarAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: CalendarAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: CalendarAutomationPeer, patternInterface: PatternInterface) -> object
Gets the object that supports the specified control pattern of the element that
is associated with this automation peer.
patternInterface: An enumeration value that specifies the control pattern.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Grid,
System.Windows.Automation.Peers.PatternInterface.Table,
System.Windows.Automation.Peers.PatternInterface.MultipleView, or
System.Windows.Automation.Peers.PatternInterface.Selection, this method returns
a this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
""" SetFocusCore(self: CalendarAutomationPeer) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Calendar) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class CalendarButtonAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.CalendarButton types to UI Automation.
CalendarButtonAutomationPeer(owner: Button)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Button) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ToggleButtonAutomationPeer(ButtonBaseAutomationPeer, IToggleProvider):
"""
Exposes System.Windows.Controls.Primitives.ToggleButton types to UI Automation.
ToggleButtonAutomationPeer(owner: ToggleButton)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ButtonBaseAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: A string containing the accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ToggleButtonAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Primitives.ToggleButton
that is associated with this
System.Windows.Automation.Peers.ToggleButtonAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The control type for the System.Windows.Controls.Primitives.ToggleButton that
is associated with this
System.Windows.Automation.Peers.ToggleButtonAutomationPeer.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ButtonBaseAutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId for the
element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.AutomationId.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ToggleButtonAutomationPeer) -> str
Gets the name of the System.Windows.Controls.Primitives.ToggleButton that is
associated with this
System.Windows.Automation.Peers.ToggleButtonAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "Button".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ButtonBaseAutomationPeer) -> str
Gets the name of the class of the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: A string that contains the class name, minus the accelerator key.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ToggleButtonAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the
System.Windows.Controls.Primitives.ToggleButton that is associated with this
System.Windows.Automation.Peers.ToggleButtonAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Toggle,
this method returns the current instance of the
System.Windows.Automation.Peers.ToggleButtonAutomationPeer, otherwise null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ToggleButton) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class CheckBoxAutomationPeer(ToggleButtonAutomationPeer, IToggleProvider):
"""
Exposes System.Windows.Controls.CheckBox types to UI Automation.
CheckBoxAutomationPeer(owner: CheckBox)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ButtonBaseAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: A string containing the accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: CheckBoxAutomationPeer) -> AutomationControlType
Gets the System.Windows.Automation.Peers.AutomationControlType for the element
associated with this System.Windows.Automation.Peers.CheckBoxAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.CheckBox.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ButtonBaseAutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId for the
element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.AutomationId.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: CheckBoxAutomationPeer) -> str
Gets the name of the element associated with this
System.Windows.Automation.Peers.CheckBoxAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "CheckBox".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ButtonBaseAutomationPeer) -> str
Gets the name of the class of the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: A string that contains the class name, minus the accelerator key.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: CheckBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ItemsControlAutomationPeer(FrameworkElementAutomationPeer, IItemContainerProvider):
""" Exposes System.Windows.Controls.ItemsControl types to UI Automation. """
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer
When overridden in a derived class, creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer for a data item in the
System.Windows.Controls.ItemsControl.Items collection of this
System.Windows.Controls.ItemsControl.
item: The data item that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The new System.Windows.Automation.Peers.ItemAutomationPeer created.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: UIElementAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Custom enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemsControlAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.ItemsControl that is associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: UIElementAutomationPeer) -> str
Gets the name of the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: An System.String.Empty string.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ItemsControlAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.ItemsControl that is
associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer.
patternInterface: One of the enumeration values.
Returns: The System.Windows.Automation.Peers.ScrollViewerAutomationPeer that is
associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: ItemsControl) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class SelectorAutomationPeer(ItemsControlAutomationPeer, IItemContainerProvider, ISelectionProvider):
""" Exposes System.Windows.Controls.Primitives.Selector types to UI Automation. """
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer
When overridden in a derived class, creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer for a data item in the
System.Windows.Controls.ItemsControl.Items collection of this
System.Windows.Controls.ItemsControl.
item: The data item that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The new System.Windows.Automation.Peers.ItemAutomationPeer created.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: SelectorAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Primitives.Selector that
is associated with this System.Windows.Automation.Peers.SelectorAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.List enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemsControlAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.ItemsControl that is associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: UIElementAutomationPeer) -> str
Gets the name of the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: An System.String.Empty string.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: SelectorAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.Primitives.Selector
that is associated with this
System.Windows.Automation.Peers.SelectorAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.Selection, this method returns
a pointer to the current instance; otherwise null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: Selector) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class ComboBoxAutomationPeer(SelectorAutomationPeer, IItemContainerProvider, ISelectionProvider, IValueProvider, IExpandCollapseProvider):
"""
Exposes System.Windows.Controls.ComboBox types to UI Automation.
ComboBoxAutomationPeer(owner: ComboBox)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: ComboBoxAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer class.
item: The System.Windows.Controls.ComboBoxItem that is associated with this
System.Windows.Automation.Peers.ComboBoxAutomationPeer.
Returns: A new instance of the System.Windows.Automation.Peers.ItemAutomationPeer class.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ComboBoxAutomationPeer) -> AutomationControlType
Gets the control type for this
System.Windows.Automation.Peers.ComboBoxAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.ComboBox enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ComboBoxAutomationPeer) -> List[AutomationPeer]
Gets a collection of child elements. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ComboBoxAutomationPeer) -> str
Gets the name of the class that defines the type that is associated with this
System.Windows.Automation.Peers.ComboBoxAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ComboBox".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, pattern):
"""
GetPattern(self: ComboBoxAutomationPeer, pattern: PatternInterface) -> object
Gets the control pattern for this
System.Windows.Automation.Peers.ComboBoxAutomationPeer.
pattern: One of the enumeration values.
Returns: If pattern is System.Windows.Automation.Peers.PatternInterface.Value or
System.Windows.Automation.Peers.PatternInterface.ExpandCollapse, this method
returns a reference to the current instance of the
System.Windows.Automation.Peers.ComboBoxAutomationPeer; otherwise, this method
calls the base implementation on
System.Windows.Automation.Peers.SelectorAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ComboBoxAutomationPeer)
Sets the keyboard input focus on the System.Windows.Controls.ComboBox control
that is associated with this
System.Windows.Automation.Peers.ComboBoxAutomationPeer object. This method is
called by System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ComboBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class ContentElementAutomationPeer(AutomationPeer):
"""
Exposes System.Windows.ContentElement types to UI Automation.
ContentElementAutomationPeer(owner: ContentElement)
"""
@staticmethod
def CreatePeerForElement(element):
"""
CreatePeerForElement(element: ContentElement) -> AutomationPeer
Creates a System.Windows.Automation.Peers.ContentElementAutomationPeer for the
specified System.Windows.ContentElement.
element: The System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer.
Returns: The System.Windows.Automation.Peers.ContentElementAutomationPeer for the
specified System.Windows.ContentElement.
"""
pass
@staticmethod
def FromElement(element):
"""
FromElement(element: ContentElement) -> AutomationPeer
Gets the System.Windows.Automation.Peers.ContentElementAutomationPeer for the
specified System.Windows.ContentElement.
element: The System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer.
Returns: The System.Windows.Automation.Peers.ContentElementAutomationPeer for the
specified System.Windows.ContentElement, or null if the
System.Windows.Automation.Peers.ContentElementAutomationPeer has not been
created by the
System.Windows.Automation.Peers.ContentElementAutomationPeer.CreatePeerForElemen
t(System.Windows.ContentElement) method.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ContentElementAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer.
patternInterface: One of the enumeration values.
Returns: An object that implements the
System.Windows.Automation.Provider.ISynchronizedInputProvider interface if
patternInterface is
System.Windows.Automation.Peers.PatternInterface.SynchronizedInput; otherwise,
null.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ContentElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
Owner = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.ContentElement that is associated with this System.Windows.Automation.Peers.ContentElementAutomationPeer.
Get: Owner(self: ContentElementAutomationPeer) -> ContentElement
"""
class FrameworkContentElementAutomationPeer(ContentElementAutomationPeer):
"""
Exposes System.Windows.FrameworkContentElement types to UI Automation.
FrameworkContentElementAutomationPeer(owner: FrameworkContentElement)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FrameworkContentElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ContentTextAutomationPeer(FrameworkContentElementAutomationPeer):
""" Represents a base class for exposing System.Windows.Automation.TextPattern types to UI Automation. """
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: FrameworkContentElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ContextMenuAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.ContextMenu types to UI Automation.
ContextMenuAutomationPeer(owner: ContextMenu)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ContextMenu) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridAutomationPeer(ItemsControlAutomationPeer, IItemContainerProvider, IGridProvider, ISelectionProvider, ITableProvider):
"""
Exposes System.Windows.Controls.DataGrid types to UI Automation.
DataGridAutomationPeer(owner: DataGrid)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
""" CreateItemAutomationPeer(self: DataGridAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DataGridAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DataGridAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DataGridAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DataGridAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Grid,
System.Windows.Automation.Peers.PatternInterface.Selection, or
System.Windows.Automation.Peers.PatternInterface.Table, this method returns a
this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGrid) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class DataGridCellAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.DataGridCell types to UI Automation.
DataGridCellAutomationPeer(owner: DataGridCell)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridCell) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridCellItemAutomationPeer(AutomationPeer, IGridItemProvider, ITableItemProvider, IInvokeProvider, IScrollItemProvider, ISelectionItemProvider, IValueProvider, IVirtualizedItemProvider):
"""
Exposes System.Windows.Controls.DataGridCell types to UI Automation.
DataGridCellItemAutomationPeer(item: object, dataGridColumn: DataGridColumn)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
""" GetAcceleratorKeyCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
""" GetAccessKeyCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DataGridCellItemAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
""" GetAutomationIdCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
""" GetBoundingRectangleCore(self: DataGridCellItemAutomationPeer) -> Rect """
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DataGridCellItemAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
""" GetClickablePointCore(self: DataGridCellItemAutomationPeer) -> Point """
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
""" GetHelpTextCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
""" GetItemStatusCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
""" GetItemTypeCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
""" GetLabeledByCore(self: DataGridCellItemAutomationPeer) -> AutomationPeer """
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
""" GetNameCore(self: DataGridCellItemAutomationPeer) -> str """
pass
def GetOrientationCore(self, *args): #cannot find CLR method
""" GetOrientationCore(self: DataGridCellItemAutomationPeer) -> AutomationOrientation """
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DataGridCellItemAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: An enumeration that specifies the control pattern.
Returns: The current System.Windows.Automation.Peers.DataGridCellItemAutomationPeer
object, if patternInterface is a supported value; otherwise, null. For more
information, see Remarks.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
""" HasKeyboardFocusCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
""" IsControlElementCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsEnabledCore(self, *args): #cannot find CLR method
""" IsEnabledCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
""" IsKeyboardFocusableCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
""" IsOffscreenCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsPasswordCore(self, *args): #cannot find CLR method
""" IsPasswordCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
""" IsRequiredForFormCore(self: DataGridCellItemAutomationPeer) -> bool """
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
""" SetFocusCore(self: DataGridCellItemAutomationPeer) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, item, dataGridColumn):
""" __new__(cls: type, item: object, dataGridColumn: DataGridColumn) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridColumnHeaderAutomationPeer(ButtonBaseAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.DataGridColumnHeader types to UI Automation.
DataGridColumnHeaderAutomationPeer(owner: DataGridColumnHeader)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridColumnHeader) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ItemAutomationPeer(AutomationPeer, IVirtualizedItemProvider):
""" Exposes a data item in an System.Windows.Controls.ItemsControl.Items collection to UI Automation. """
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: AutomationPeer) -> AutomationControlType
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The control type.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The class name.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ItemAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: An enumeration value that specifies the control pattern.
Returns: An object that supports the control pattern if patternInterface is a supported
value; otherwise, null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, item: object, itemsControlAutomationPeer: ItemsControlAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
Item = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the data item in the System.Windows.Controls.ItemsControl.Items collection that is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Get: Item(self: ItemAutomationPeer) -> object
"""
ItemsControlAutomationPeer = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.Automation.Peers.ItemsControlAutomationPeer that is associated with the System.Windows.Controls.ItemsControl that holds the System.Windows.Controls.ItemsControl.Items collection.
Get: ItemsControlAutomationPeer(self: ItemAutomationPeer) -> ItemsControlAutomationPeer
"""
class DataGridColumnHeaderItemAutomationPeer(ItemAutomationPeer, IVirtualizedItemProvider, IInvokeProvider, IScrollItemProvider, ITransformProvider):
"""
Exposes the System.Windows.Controls.DataGridColumn.Header of a System.Windows.Controls.DataGridColumn that is in a System.Windows.Controls.DataGrid to UI Automation.
DataGridColumnHeaderItemAutomationPeer(item: object, column: DataGridColumn, peer: DataGridColumnHeadersPresenterAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: DataGridColumnHeaderItemAutomationPeer) -> AutomationControlType
Gets the control type for the header that is associated with this
System.Windows.Automation.Peers.DataGridColumnHeaderItemAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.HeaderItem
enumeration value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: DataGridColumnHeaderItemAutomationPeer) -> str
Gets a name that differentiates the header that is represented by this
System.Windows.Automation.Peers.DataGridColumnHeaderItemAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The type name of the System.Windows.Controls.DataGridColumn.Header property
that is associated with this
System.Windows.Automation.Peers.DataGridColumnHeaderItemAutomationPeer.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DataGridColumnHeaderItemAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: An enumeration value that specifies the control pattern.
Returns: The current
System.Windows.Automation.Peers.DataGridColumnHeaderItemAutomationPeer object,
if patternInterface is a supported value; otherwise, null. For more
information, see Remarks.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: DataGridColumnHeaderItemAutomationPeer) -> bool
Gets a value that indicates whether the element that is associated with this
automation peer contains data that is presented to the user.
Returns: false in all cases.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, item, column, peer):
""" __new__(cls: type, item: object, column: DataGridColumn, peer: DataGridColumnHeadersPresenterAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridColumnHeadersPresenterAutomationPeer(ItemsControlAutomationPeer, IItemContainerProvider):
"""
Exposes System.Windows.Controls.Primitives.DataGridColumnHeadersPresenter types to UI Automation.
DataGridColumnHeadersPresenterAutomationPeer(owner: DataGridColumnHeadersPresenter)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
""" CreateItemAutomationPeer(self: DataGridColumnHeadersPresenterAutomationPeer, column: object) -> ItemAutomationPeer """
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DataGridColumnHeadersPresenterAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DataGridColumnHeadersPresenterAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DataGridColumnHeadersPresenterAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: DataGridColumnHeadersPresenterAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridColumnHeadersPresenter) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class DataGridDetailsPresenterAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.DataGridDetailsPresenter types to UI Automation.
DataGridDetailsPresenterAutomationPeer(owner: DataGridDetailsPresenter)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridDetailsPresenter) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridItemAutomationPeer(ItemAutomationPeer, IVirtualizedItemProvider, IInvokeProvider, IScrollItemProvider, ISelectionItemProvider, ISelectionProvider, IItemContainerProvider):
"""
Exposes System.Windows.Controls.DataGridRow types to UI Automation. The System.Windows.Controls.DataGridRow may or may not actually exist in memory.
DataGridItemAutomationPeer(item: object, dataGridPeer: DataGridAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DataGridItemAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DataGridItemAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DataGridItemAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DataGridItemAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: An enumeration value that specifies the control pattern.
Returns: The current System.Windows.Automation.Peers.DataGridCellItemAutomationPeer
object, if patternInterface is a supported value; otherwise, null. For more
information, see Remarks.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: DataGridItemAutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, item, dataGridPeer):
""" __new__(cls: type, item: object, dataGridPeer: DataGridAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridRowAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.DataGridRow types to UI Automation.
DataGridRowAutomationPeer(owner: DataGridRow)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridRow) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DataGridRowHeaderAutomationPeer(ButtonBaseAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.DataGridRowHeader types to UI Automation.
DataGridRowHeaderAutomationPeer(owner: DataGridRowHeader)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DataGridRowHeader) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DatePickerAutomationPeer(FrameworkElementAutomationPeer, IExpandCollapseProvider, IValueProvider):
"""
Exposes System.Windows.Controls.DatePicker types to UI Automation.
DatePickerAutomationPeer(owner: DatePicker)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DatePickerAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DatePickerAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DatePickerAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
""" GetLocalizedControlTypeCore(self: DatePickerAutomationPeer) -> str """
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DatePickerAutomationPeer, patternInterface: PatternInterface) -> object
Returns the object that supports the specified control pattern of the element
that is associated with this automation peer.
patternInterface: An enumeration value that specifies the control pattern.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.ExpandCollapse or
System.Windows.Automation.Peers.PatternInterface.Value, this method returns a
this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
""" SetFocusCore(self: DatePickerAutomationPeer) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DatePicker) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DateTimeAutomationPeer(AutomationPeer, IGridItemProvider, ISelectionItemProvider, ITableItemProvider, IInvokeProvider, IVirtualizedItemProvider):
""" Exposes System.Windows.Controls.Primitives.CalendarDayButton and System.Windows.Controls.Primitives.CalendarButton types to UI Automation. """
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
""" GetAcceleratorKeyCore(self: DateTimeAutomationPeer) -> str """
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
""" GetAccessKeyCore(self: DateTimeAutomationPeer) -> str """
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
""" GetAutomationControlTypeCore(self: DateTimeAutomationPeer) -> AutomationControlType """
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
""" GetAutomationIdCore(self: DateTimeAutomationPeer) -> str """
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
""" GetBoundingRectangleCore(self: DateTimeAutomationPeer) -> Rect """
pass
def GetChildrenCore(self, *args): #cannot find CLR method
""" GetChildrenCore(self: DateTimeAutomationPeer) -> List[AutomationPeer] """
pass
def GetClassNameCore(self, *args): #cannot find CLR method
""" GetClassNameCore(self: DateTimeAutomationPeer) -> str """
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
""" GetClickablePointCore(self: DateTimeAutomationPeer) -> Point """
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
""" GetHelpTextCore(self: DateTimeAutomationPeer) -> str """
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
""" GetItemStatusCore(self: DateTimeAutomationPeer) -> str """
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
""" GetItemTypeCore(self: DateTimeAutomationPeer) -> str """
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
""" GetLabeledByCore(self: DateTimeAutomationPeer) -> AutomationPeer """
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
""" GetLocalizedControlTypeCore(self: DateTimeAutomationPeer) -> str """
pass
def GetNameCore(self, *args): #cannot find CLR method
""" GetNameCore(self: DateTimeAutomationPeer) -> str """
pass
def GetOrientationCore(self, *args): #cannot find CLR method
""" GetOrientationCore(self: DateTimeAutomationPeer) -> AutomationOrientation """
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: DateTimeAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern implementation for this
System.Windows.Automation.Peers.DateTimeAutomationPeer.
patternInterface: The type of pattern implemented by the element to retrieve.
Returns: The object that implements the pattern interface, or null if the specified
pattern interface is not implemented by this peer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
""" HasKeyboardFocusCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
""" IsControlElementCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsEnabledCore(self, *args): #cannot find CLR method
""" IsEnabledCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
""" IsKeyboardFocusableCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
""" IsOffscreenCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsPasswordCore(self, *args): #cannot find CLR method
""" IsPasswordCore(self: DateTimeAutomationPeer) -> bool """
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
""" IsRequiredForFormCore(self: DateTimeAutomationPeer) -> bool """
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
""" SetFocusCore(self: DateTimeAutomationPeer) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DocumentAutomationPeer(ContentTextAutomationPeer):
"""
Exposes System.Windows.Automation.ControlType.Document�control types to UI Automation.
DocumentAutomationPeer(owner: FrameworkContentElement)
"""
def GetPattern(self, patternInterface):
"""
GetPattern(self: DocumentAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.FrameworkContentElement that is
associated with this System.Windows.Automation.Peers.DocumentAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Text,
this method returns an System.Windows.Automation.Provider.ITextProvider.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FrameworkContentElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DocumentPageViewAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.DocumentPageView types to UI Automation.
DocumentPageViewAutomationPeer(owner: DocumentPageView)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DocumentPageView) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DocumentViewerBaseAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.DocumentViewerBase types to UI Automation.
DocumentViewerBaseAutomationPeer(owner: DocumentViewerBase)
"""
def GetPattern(self, patternInterface):
"""
GetPattern(self: DocumentViewerBaseAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the
System.Windows.Controls.Primitives.DocumentViewerBase that is associated with
this System.Windows.Automation.Peers.DocumentViewerBaseAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Text,
this method returns an System.Windows.Automation.Provider.ITextProvider
reference.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DocumentViewerBase) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class DocumentViewerAutomationPeer(DocumentViewerBaseAutomationPeer):
"""
Exposes System.Windows.Controls.DocumentViewer types to UI Automation.
DocumentViewerAutomationPeer(owner: DocumentViewer)
"""
def GetPattern(self, patternInterface):
"""
GetPattern(self: DocumentViewerAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.DocumentViewer that is
associated with this
System.Windows.Automation.Peers.DocumentViewerAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.ScrollItem, this method
returns the System.Windows.Automation.Peers.ScrollViewerAutomationPeer for this
System.Windows.Automation.Peers.DocumentViewerAutomationPeer. This method also
sets System.Windows.Automation.Peers.DocumentViewerAutomationPeer as the
System.Windows.Automation.Peers.AutomationPeer.EventsSource.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: DocumentViewer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ExpanderAutomationPeer(FrameworkElementAutomationPeer, IExpandCollapseProvider):
"""
Exposes System.Windows.Controls.Expander types to UI Automation.
ExpanderAutomationPeer(owner: Expander)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ExpanderAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Expander that is
associated with this System.Windows.Automation.Peers.ExpanderAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.Group.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ExpanderAutomationPeer) -> str
Gets the name of the System.Windows.Controls.Expander that is associated with
this System.Windows.Automation.Peers.ExpanderAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "Expander".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, pattern):
"""
GetPattern(self: ExpanderAutomationPeer, pattern: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.Expander that is
associated with this System.Windows.Automation.Peers.ExpanderAutomationPeer.
pattern: One of the enumeration values.
Returns: If pattern is System.Windows.Automation.Peers.PatternInterface.ExpandCollapse,
this method returns a reference to the current instance of the
System.Windows.Automation.Peers.ExpanderAutomationPeer, otherwise this method
calls the base implementation on
System.Windows.Automation.Peers.UIElementAutomationPeer which returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Expander) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class FixedPageAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Documents.FixedPage types to UI Automation.
FixedPageAutomationPeer(owner: FixedPage)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FixedPage) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class FlowDocumentPageViewerAutomationPeer(DocumentViewerBaseAutomationPeer):
"""
Exposes System.Windows.Controls.FlowDocumentPageViewer types to UI Automation.
FlowDocumentPageViewerAutomationPeer(owner: FlowDocumentPageViewer)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FlowDocumentPageViewer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class FlowDocumentReaderAutomationPeer(FrameworkElementAutomationPeer, IMultipleViewProvider):
"""
Exposes System.Windows.Controls.FlowDocumentReader types to UI Automation.
FlowDocumentReaderAutomationPeer(owner: FlowDocumentReader)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: UIElementAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Custom enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: FlowDocumentReaderAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.FlowDocumentReader that is associated with this
System.Windows.Automation.Peers.FlowDocumentReaderAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: FlowDocumentReaderAutomationPeer) -> str
Gets the name of the System.Windows.Controls.FlowDocumentReader that is
associated with this
System.Windows.Automation.Peers.FlowDocumentReaderAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The name of the System.Windows.Controls.FlowDocumentReader that is associated
with this System.Windows.Automation.Peers.FlowDocumentReaderAutomationPeer.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: FlowDocumentReaderAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.FlowDocumentReader
that is associated with this
System.Windows.Automation.Peers.FlowDocumentReaderAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.MultipleView, this method
returns a this pointer. Otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FlowDocumentReader) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class FlowDocumentScrollViewerAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.FlowDocumentScrollViewer types to UI Automation.
FlowDocumentScrollViewerAutomationPeer(owner: FlowDocumentScrollViewer)
"""
def GetPattern(self, patternInterface):
"""
GetPattern(self: FlowDocumentScrollViewerAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the
System.Windows.Controls.FlowDocumentScrollViewer that is associated with this
System.Windows.Automation.Peers.FlowDocumentScrollViewerAutomationPeer.
patternInterface: One of the enumeration values.
Returns: An object that supports the control pattern if patternInterface is a supported
value; otherwise, null.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: FlowDocumentScrollViewer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class FrameAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Frame types to UI Automation.
FrameAutomationPeer(owner: Frame)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Frame) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GenericRootAutomationPeer(UIElementAutomationPeer):
"""
Exposes System.Windows.Interop.HwndSource types to UI Automation.
GenericRootAutomationPeer(owner: UIElement)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: UIElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ThumbAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.Thumb types to UI Automation.
ThumbAutomationPeer(owner: Thumb)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Thumb) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GridSplitterAutomationPeer(ThumbAutomationPeer, ITransformProvider):
"""
Exposes System.Windows.Controls.GridSplitter types to UI Automation.
GridSplitterAutomationPeer(owner: GridSplitter)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ThumbAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Primitives.Thumb that is
associated with this System.Windows.Automation.Peers.ThumbAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.Thumb
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: GridSplitterAutomationPeer) -> str
Gets the name of the System.Windows.Controls.GridSplitter that is associated
with this System.Windows.Automation.Peers.GridSplitterAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "GridSplitter".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: GridSplitterAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the
System.Windows.Automation.Peers.GridSplitterAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.Transform, this method returns
a this pointer; otherwise this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: ThumbAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: GridSplitter) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class IViewAutomationPeer:
""" Allows a customized view of a System.Windows.Controls.ListView that derives from System.Windows.Controls.ViewBase to implement automation peer features that are specific to the custom view. """
def CreateItemAutomationPeer(self, item):
"""
CreateItemAutomationPeer(self: IViewAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer class.
item: The System.Windows.Controls.ListViewItem that is associated with the
System.Windows.Controls.ListView that is used by this
System.Windows.Automation.Peers.IViewAutomationPeer.
Returns: The new System.Windows.Automation.Peers.ItemAutomationPeer instance.
"""
pass
def GetAutomationControlType(self):
"""
GetAutomationControlType(self: IViewAutomationPeer) -> AutomationControlType
Gets the control type for the element that is associated with this
System.Windows.Automation.Peers.IViewAutomationPeer.
Returns: A value in the System.Windows.Automation.Peers.AutomationControlType
enumeration.
"""
pass
def GetChildren(self, children):
""" GetChildren(self: IViewAutomationPeer, children: List[AutomationPeer]) -> List[AutomationPeer] """
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: IViewAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern that is associated with the specified patternInterface.
patternInterface: A value in the enumeration.
Returns: Return the object that implements the control pattern. If this method returns
null, the return value from
System.Windows.Automation.Peers.IViewAutomationPeer.GetPattern(System.Windows.Au
tomation.Peers.PatternInterface) is used.
"""
pass
def ItemsChanged(self, e):
"""
ItemsChanged(self: IViewAutomationPeer, e: NotifyCollectionChangedEventArgs)
Called by System.Windows.Controls.ListView when the collection of items changes.
e: A System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains
the event data.
"""
pass
def ViewDetached(self):
"""
ViewDetached(self: IViewAutomationPeer)
Called when the custom view is no longer applied to the
System.Windows.Controls.ListView.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
class GridViewAutomationPeer(object, IViewAutomationPeer, ITableProvider, IGridProvider):
"""
Exposes System.Windows.Controls.GridView types to UI Automation.
GridViewAutomationPeer(owner: GridView, listview: ListView)
"""
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner, listview):
""" __new__(cls: type, owner: GridView, listview: ListView) """
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
class GridViewCellAutomationPeer(FrameworkElementAutomationPeer, ITableItemProvider, IGridItemProvider):
""" Exposes the cells in a System.Windows.Controls.GridView to UI Automation. """
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: GridViewCellAutomationPeer) -> AutomationControlType
Gets the control type for the element that is associated with this
System.Windows.Automation.Peers.GridViewCellAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: If this System.Windows.Automation.Peers.GridViewCellAutomationPeer is
associated with a System.Windows.Controls.TextBlock element, this method
returns System.Windows.Automation.Peers.AutomationControlType.Text; otherwise,
this method returns
System.Windows.Automation.Peers.AutomationControlType.Custom.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: GridViewCellAutomationPeer) -> str
Gets the name of the element that is associated with this
System.Windows.Automation.Peers.GridViewCellAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The name of the element.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: GridViewCellAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the element that is associated with this
System.Windows.Automation.Peers.GridViewCellAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.GridItem or
System.Windows.Automation.Peers.PatternInterface.TableItem, this method returns
the current System.Windows.Automation.Peers.GridViewCellAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: GridViewCellAutomationPeer) -> bool
Gets or sets a value that indicates whether the element that is associated with
this System.Windows.Automation.Peers.GridViewCellAutomationPeer is understood
by the end user as interactive or the user might understand the element as
contributing to the logical structure of the control in the GUI. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: If this System.Windows.Automation.Peers.GridViewCellAutomationPeer is
associated with a System.Windows.Controls.TextBlock element, this method
returns true; otherwise, this method returns a list of child elements.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GridViewColumnHeaderAutomationPeer(FrameworkElementAutomationPeer, IInvokeProvider, ITransformProvider):
"""
Exposes System.Windows.Controls.GridViewColumnHeader types to UI Automation.
GridViewColumnHeaderAutomationPeer(owner: GridViewColumnHeader)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: GridViewColumnHeaderAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.GridViewColumnHeader that
is associated with this
System.Windows.Automation.Peers.GridViewColumnHeaderAutomationPeer. This method
is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.HeaderItem
enumeration value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: GridViewColumnHeaderAutomationPeer) -> str
Gets the name of the System.Windows.Controls.GridViewColumnHeader that is
associated with this
System.Windows.Automation.Peers.GridViewColumnHeaderAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "GridViewColumnHeader".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: GridViewColumnHeaderAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.GridViewColumnHeader
that is associated with this
System.Windows.Automation.Peers.GridViewColumnHeaderAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.Transform or
System.Windows.Automation.Peers.PatternInterface.Invoke, this method returns a
this pointer; otherwise this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: GridViewColumnHeaderAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: GridViewColumnHeader) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GridViewHeaderRowPresenterAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.GridViewHeaderRowPresenter types to UI Automation.
GridViewHeaderRowPresenterAutomationPeer(owner: GridViewHeaderRowPresenter)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: GridViewHeaderRowPresenter) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class SelectorItemAutomationPeer(ItemAutomationPeer, IVirtualizedItemProvider, ISelectionItemProvider):
""" Exposes the items in the System.Windows.Controls.ItemsControl.Items collection of a System.Windows.Controls.Primitives.Selector to UI Automation. """
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: AutomationPeer) -> AutomationControlType
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The control type.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The class name.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: SelectorItemAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern that is associated with the specified
System.Windows.Automation.Peers.PatternInterface.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.Selection, this method returns
the current instance of this
System.Windows.Automation.Peers.SelectorItemAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: object, selectorAutomationPeer: SelectorAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ListBoxItemAutomationPeer(SelectorItemAutomationPeer, IVirtualizedItemProvider, ISelectionItemProvider, IScrollItemProvider):
"""
Exposes the items in the System.Windows.Controls.ItemsControl.Items collection of a System.Windows.Controls.ListBox to UI Automation.
ListBoxItemAutomationPeer(owner: object, selectorAutomationPeer: SelectorAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ListBoxItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.ListBoxItem that is
associated with this System.Windows.Automation.Peers.ListBoxItemAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.ListItem enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ListBoxItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ListBoxItem that is associated
with this System.Windows.Automation.Peers.ListBoxItemAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ListBoxItem".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ListBoxItemAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.ListBoxItem that is
associated with this System.Windows.Automation.Peers.ListBoxItemAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.ScrollItem, this method
returns the current instance of this
System.Windows.Automation.Peers.ListBoxItemAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner, selectorAutomationPeer):
""" __new__(cls: type, owner: object, selectorAutomationPeer: SelectorAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GridViewItemAutomationPeer(ListBoxItemAutomationPeer, IVirtualizedItemProvider, ISelectionItemProvider, IScrollItemProvider):
"""
Exposes the data items in the collection of System.Windows.Controls.ItemsControl.Items in System.Windows.Controls.GridView types to UI Automation.
GridViewItemAutomationPeer(owner: object, listviewAP: ListViewAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: GridViewItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.GridViewItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.DataItem.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: GridViewItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.GridViewItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: GridViewItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ItemsControl.Items collection that
is associated with this
System.Windows.Automation.Peers.GridViewItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ListViewItem".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner, listviewAP):
""" __new__(cls: type, owner: object, listviewAP: ListViewAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GroupBoxAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.GroupBox types to UI Automation.
GroupBoxAutomationPeer(owner: GroupBox)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: GroupBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class GroupItemAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.GroupItem types to UI Automation.
GroupItemAutomationPeer(owner: GroupItem)
"""
def GetPattern(self, patternInterface):
""" GetPattern(self: GroupItemAutomationPeer, patternInterface: PatternInterface) -> object """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: GroupItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class HostedWindowWrapper(object):
"""
Exposes System.Windows.Interop.HwndHost types to UI Automation.
HostedWindowWrapper(hwnd: IntPtr)
"""
@staticmethod # known case of __new__
def __new__(self, hwnd):
""" __new__(cls: type, hwnd: IntPtr) """
pass
class TextElementAutomationPeer(ContentTextAutomationPeer):
"""
Exposes System.Windows.Documents.TextElement types to UI Automation.
TextElementAutomationPeer(owner: TextElement)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TextElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class HyperlinkAutomationPeer(TextElementAutomationPeer, IInvokeProvider):
"""
Exposes System.Windows.Documents.Hyperlink types to UI Automation.
HyperlinkAutomationPeer(owner: Hyperlink)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ContentElementAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: System.String.Empty.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ContentElementAutomationPeer) -> str
Gets the access key for the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for this System.Windows.ContentElement.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: HyperlinkAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Documents.Hyperlink that is
associated with this System.Windows.Automation.Peers.HyperlinkAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Hyperlink enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that uniquely identifies the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The System.Windows.Automation.AutomationIdentifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: TextElementAutomationPeer) -> Rect
Gets the System.Windows.Rect representing the bounding rectangle of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element, or
System.Windows.Rect.Empty if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TextElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: null.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: HyperlinkAutomationPeer) -> str
Gets the name of the System.Windows.Documents.Hyperlink that is associated with
this System.Windows.Automation.Peers.HyperlinkAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "Hyperlink".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: TextElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The string describing the functionality of the element.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ContentElementAutomationPeer) -> str
Gets a string that conveys the visual status of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: A string containing the status.
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ContentElementAutomationPeer) -> str
Gets a human-readable string that contains the type of the item that the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer represents. Called
by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the item type.
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: FrameworkContentElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.LabelAutomationPeer for the
System.Windows.Controls.Label that is targeted to the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.FrameworkContentElementAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: HyperlinkAutomationPeer) -> str
Gets the text label of the System.Windows.Documents.Hyperlink that is
associated with this System.Windows.Automation.Peers.HyperlinkAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ContentElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is laid out in a
specific direction. Called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: System.Windows.Automation.Peers.AutomationOrientation.None.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: HyperlinkAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Documents.Hyperlink that is
associated with this System.Windows.Automation.Peers.HyperlinkAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Invoke,
this method returns a this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer currently has
keyboard input focus. Called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is an element that
contains data that is presented to the user. Called by
System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: HyperlinkAutomationPeer) -> bool
Gets or sets a value that indicates whether the
System.Windows.Documents.Hyperlink that is associated with this
System.Windows.Automation.Peers.HyperlinkAutomationPeer is understood by the
end user as interactive the user might understand the
System.Windows.Documents.Hyperlink as contributing to the logical structure of
the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether this automation peer can receive and send
events to the associated element. Called by
System.Windows.Automation.Peers.AutomationPeer.IsEnabled.
Returns: true if the automation peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer can accept
keyboard focus. Called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: TextElementAutomationPeer) -> bool
Gets a value that indicates whether System.Windows.Documents.TextElement that
is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer is off of the screen.
Called by System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer contains protected
content. Called by System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is required to be
filled out on a form. Called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ContentElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Hyperlink) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ImageAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Image types to UI Automation.
ImageAutomationPeer(owner: Image)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Image) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class InkCanvasAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.InkCanvas types to UI Automation.
InkCanvasAutomationPeer(owner: InkCanvas)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: InkCanvas) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class InkPresenterAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.InkPresenter types to UI Automation.
InkPresenterAutomationPeer(owner: InkPresenter)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: InkPresenter) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class LabelAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Label types to UI Automation.
LabelAutomationPeer(owner: Label)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Label) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ListBoxAutomationPeer(SelectorAutomationPeer, IItemContainerProvider, ISelectionProvider):
"""
Exposes System.Windows.Controls.ListBox types to UI Automation.
ListBoxAutomationPeer(owner: ListBox)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: ListBoxAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer class.
item: The System.Windows.Controls.ListBoxItem that is associated with this
System.Windows.Automation.Peers.ListBoxAutomationPeer.
Returns: A new instance of the System.Windows.Automation.Peers.ItemAutomationPeer class.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: SelectorAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Primitives.Selector that
is associated with this System.Windows.Automation.Peers.SelectorAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.List enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemsControlAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.ItemsControl that is associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ListBoxAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ListBox that is associated with
this System.Windows.Automation.Peers.ListBoxAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ListBox".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ListBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class ListBoxItemWrapperAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes the System.Windows.UIElement sub-tree for the data items in a System.Windows.Controls.ListBox to UI Automation.
ListBoxItemWrapperAutomationPeer(owner: ListBoxItem)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ListBoxItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ListViewAutomationPeer(ListBoxAutomationPeer, IItemContainerProvider, ISelectionProvider):
"""
Exposes System.Windows.Controls.ListView types to UI Automation.
ListViewAutomationPeer(owner: ListView)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: ListViewAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.ItemAutomationPeer class.
item: The System.Windows.Controls.ListViewItem that is associated with this
System.Windows.Automation.Peers.ListViewAutomationPeer.
Returns: The System.Windows.Automation.Peers.ItemAutomationPeer instance that is
associated with this System.Windows.Automation.Peers.ListViewAutomationPeer.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ListViewAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.ListView that is
associated with this System.Windows.Automation.Peers.ListViewAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.List enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ListViewAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.Controls.ListView
that is associated with this
System.Windows.Automation.Peers.ListViewAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ListViewAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ListView that is associated with
this System.Windows.Automation.Peers.ListViewAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ListView".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ListViewAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.ListView that is
associated with this System.Windows.Automation.Peers.ListViewAutomationPeer.
patternInterface: A value in the enumeration.
Returns: An System.Windows.Automation.Peers.AutomationPeer for the view that this
System.Windows.Controls.ListView is using. Default
System.Windows.Controls.ListView implementation uses the
System.Windows.Controls.GridView, and this method returns
System.Windows.Automation.Peers.GridViewAutomationPeer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ListView) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
ViewAutomationPeer = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.Automation.Peers.IViewAutomationPeer for this System.Windows.Automation.Peers.ListViewAutomationPeer.
"""
class MediaElementAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.MediaElement types to UI Automation.
MediaElementAutomationPeer(owner: MediaElement)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: MediaElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class MenuAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Menu types to UI Automation.
MenuAutomationPeer(owner: Menu)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Menu) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class MenuItemAutomationPeer(FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider, IToggleProvider):
"""
Exposes System.Windows.Controls.MenuItem types to UI Automation.
MenuItemAutomationPeer(owner: MenuItem)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: MenuItemAutomationPeer) -> str
Gets the access key for the System.Windows.Controls.MenuItem that is associated
with this System.Windows.Automation.Peers.MenuItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.Controls.MenuItem.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: MenuItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.MenuItem that is
associated with this System.Windows.Automation.Peers.MenuItemAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.MenuItem
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: MenuItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.Controls.MenuItem
that is associated with this
System.Windows.Automation.Peers.MenuItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: MenuItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.MenuItem that is associated with
this System.Windows.Automation.Peers.MenuItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "MenuItem".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: MenuItemAutomationPeer) -> str
Gets the text label of the System.Windows.Controls.MenuItem that is associated
with this System.Windows.Automation.Peers.MenuItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: MenuItemAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.MenuItem that is
associated with this System.Windows.Automation.Peers.MenuItemAutomationPeer.
patternInterface: One of the enumeration values.
Returns: An object that supports the control pattern if patternInterface is a supported
value; otherwise, null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: MenuItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class WindowAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Window types to UI Automation.
WindowAutomationPeer(owner: Window)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Window) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class NavigationWindowAutomationPeer(WindowAutomationPeer):
"""
Exposes System.Windows.Navigation.NavigationWindow types to UI Automation.
NavigationWindowAutomationPeer(owner: NavigationWindow)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: NavigationWindow) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TextAutomationPeer(FrameworkElementAutomationPeer):
""" Exposes System.Windows.Automation.TextPattern types to UI Automation. """
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
""" __new__(cls: type, owner: FrameworkElement) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class PasswordBoxAutomationPeer(TextAutomationPeer, IValueProvider):
"""
Exposes System.Windows.Controls.PasswordBox types to UI Automation.
PasswordBoxAutomationPeer(owner: PasswordBox)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: PasswordBoxAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.PasswordBox that is
associated with this System.Windows.Automation.Peers.PasswordBoxAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Edit enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: PasswordBoxAutomationPeer) -> str
Gets the name of the System.Windows.Controls.PasswordBox that is associated
with this System.Windows.Automation.Peers.PasswordBoxAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "PasswordBox".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: TextAutomationPeer) -> str
Gets the text label of the element that is associated with this
System.Windows.Automation.Peers.TextAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The value of System.Windows.Automation.AutomationProperties.Name or
System.Windows.Automation.AutomationProperties.LabeledBy if either is set;
otherwise this method returns an empty string.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: PasswordBoxAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.PasswordBox that is
associated with this System.Windows.Automation.Peers.PasswordBoxAutomationPeer.
patternInterface: A value in the enumeration.
Returns: The System.Windows.Automation.Peers.PatternInterface.Value enumeration value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: PasswordBoxAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.Controls.PasswordBox
that is associated with this
System.Windows.Automation.Peers.PasswordBoxAutomationPeer contains protected
content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: true.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: PasswordBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class PatternInterface(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies the control pattern that System.Windows.Automation.Peers.AutomationPeer.GetPattern(System.Windows.Automation.Peers.PatternInterface) returns.
enum PatternInterface, values: Dock (12), ExpandCollapse (6), Grid (7), GridItem (8), Invoke (0), ItemContainer (18), MultipleView (9), RangeValue (3), Scroll (4), ScrollItem (5), Selection (1), SelectionItem (11), SynchronizedInput (20), Table (13), TableItem (14), Text (17), Toggle (15), Transform (16), Value (2), VirtualizedItem (19), Window (10)
"""
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args): #cannot find CLR method
""" __format__(formattable: IFormattable, format: str) -> str """
pass
def __ge__(self, *args): #cannot find CLR method
pass
def __gt__(self, *args): #cannot find CLR method
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args): #cannot find CLR method
pass
def __lt__(self, *args): #cannot find CLR method
pass
def __ne__(self, *args): #cannot find CLR method
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __str__(self, *args): #cannot find CLR method
pass
Dock = None
ExpandCollapse = None
Grid = None
GridItem = None
Invoke = None
ItemContainer = None
MultipleView = None
RangeValue = None
Scroll = None
ScrollItem = None
Selection = None
SelectionItem = None
SynchronizedInput = None
Table = None
TableItem = None
Text = None
Toggle = None
Transform = None
Value = None
value__ = None
VirtualizedItem = None
Window = None
class RangeBaseAutomationPeer(FrameworkElementAutomationPeer, IRangeValueProvider):
"""
Exposes System.Windows.Controls.Primitives.RangeBase types to UI Automation.
RangeBaseAutomationPeer(owner: RangeBase)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: UIElementAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Custom enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: UIElementAutomationPeer) -> str
Gets the name of the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: An System.String.Empty string.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: RangeBaseAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.Primitives.RangeBase
that is associated with this
System.Windows.Automation.Peers.RangeBaseAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.RangeValue, this method
returns a this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: RangeBase) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ProgressBarAutomationPeer(RangeBaseAutomationPeer, IRangeValueProvider):
"""
Exposes System.Windows.Controls.ProgressBar types to UI Automation.
ProgressBarAutomationPeer(owner: ProgressBar)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ProgressBarAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.ProgressBar that is
associated with this System.Windows.Automation.Peers.ProgressBarAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.ProgressBar
enumeration value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ProgressBarAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ProgressBar that is associated
with this System.Windows.Automation.Peers.ProgressBarAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ProgressBar".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ProgressBarAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.ProgressBar that is
associated with this System.Windows.Automation.Peers.ProgressBarAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.RangeValue and
System.Windows.Controls.ProgressBar.IsIndeterminate is true, this method
returns the current instance of the
System.Windows.Automation.Peers.ProgressBarAutomationPeer; otherwise, this
method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ProgressBar) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class RadioButtonAutomationPeer(ToggleButtonAutomationPeer, IToggleProvider, ISelectionItemProvider):
"""
Exposes System.Windows.Controls.RadioButton types to UI Automation.
RadioButtonAutomationPeer(owner: RadioButton)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ButtonBaseAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: A string containing the accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: RadioButtonAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.RadioButton that is
associated with this System.Windows.Automation.Peers.RadioButtonAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType..
Returns: A System.Windows.Automation.Peers.AutomationControlType.RadioButton.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ButtonBaseAutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId for the
element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.AutomationId.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: RadioButtonAutomationPeer) -> str
Gets the name of the System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "RadioButton".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ButtonBaseAutomationPeer) -> str
Gets the name of the class of the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: A string that contains the class name, minus the accelerator key.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: RadioButtonAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.RadioButton that is
associated with this System.Windows.Automation.Peers.RadioButtonAutomationPeer.
patternInterface: A value in the enumeration.
Returns: An object that supports the control pattern if patternInterface is a supported
value; otherwise, null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: RadioButton) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class RepeatButtonAutomationPeer(ButtonBaseAutomationPeer, IInvokeProvider):
"""
Exposes System.Windows.Controls.Primitives.RepeatButton types to UI Automation.
RepeatButtonAutomationPeer(owner: RepeatButton)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ButtonBaseAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: A string containing the accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: RepeatButtonAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Primitives.RepeatButton
that is associated with this
System.Windows.Automation.Peers.RepeatButtonAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Button enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ButtonBaseAutomationPeer) -> str
Gets the System.Windows.Automation.AutomationProperties.AutomationId for the
element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.AutomationId.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: RepeatButtonAutomationPeer) -> str
Gets the name of the System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "RepeatButton".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ButtonBaseAutomationPeer) -> str
Gets the name of the class of the element associated with this
System.Windows.Automation.Peers.ButtonBaseAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: A string that contains the class name, minus the accelerator key.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: RepeatButtonAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Invoke,
this method returns a reference to the current instance of the
System.Windows.Automation.Peers.RepeatButtonAutomationPeer; otherwise, null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: RepeatButton) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class RichTextBoxAutomationPeer(TextAutomationPeer):
"""
Exposes System.Windows.Controls.RichTextBox types to UI Automation.
RichTextBoxAutomationPeer(owner: RichTextBox)
"""
def GetPattern(self, patternInterface):
"""
GetPattern(self: RichTextBoxAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.RichTextBox that is
associated with this System.Windows.Automation.Peers.RichTextBoxAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Text,
this method returns an System.Windows.Automation.Provider.ITextProvider
reference. If patternInterface is
System.Windows.Automation.Peers.PatternInterface.Scroll, this method returns a
new System.Windows.Automation.Peers.ScrollViewerAutomationPeer.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: RichTextBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ScrollBarAutomationPeer(RangeBaseAutomationPeer, IRangeValueProvider):
"""
Exposes System.Windows.Controls.Primitives.ScrollBar types to UI Automation.
ScrollBarAutomationPeer(owner: ScrollBar)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ScrollBarAutomationPeer) -> AutomationControlType
Gets the name of the System.Windows.Controls.Primitives.ScrollBar that is
associated with this System.Windows.Automation.Peers.ScrollBarAutomationPeer.
Called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: System.Windows.Automation.Peers.AutomationControlType.ScrollBar.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ScrollBarAutomationPeer) -> str
Gets the name of the System.Windows.Controls.Primitives.ScrollBar that is
associated with this System.Windows.Automation.Peers.ScrollBarAutomationPeer.
Called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains the word "ScrollBar".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ScrollBarAutomationPeer) -> Point
Called by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: A System.Windows.Point that has values of System.Double.NaN, System.Double.NaN;
the only clickable points in a System.Windows.Controls.Primitives.ScrollBar are
the child elements.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ScrollBarAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the
System.Windows.Controls.Primitives.ScrollBar that is associated with this
System.Windows.Automation.Peers.ScrollBarAutomationPeer is laid out in a
specific direction. Called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: System.Windows.Automation.Peers.AutomationOrientation.Horizontal or
System.Windows.Automation.Peers.AutomationOrientation.Vertical, depending on
the orientation of the System.Windows.Controls.Primitives.ScrollBar.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
""" IsContentElementCore(self: ScrollBarAutomationPeer) -> bool """
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ScrollBar) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ScrollViewerAutomationPeer(FrameworkElementAutomationPeer, IScrollProvider):
"""
Exposes System.Windows.Controls.ScrollViewer types to UI Automation.
ScrollViewerAutomationPeer(owner: ScrollViewer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: ScrollViewerAutomationPeer) -> AutomationControlType
Gets the name of the System.Windows.Controls.ScrollViewer that is associated
with this System.Windows.Automation.Peers.ScrollViewerAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Pane enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: ScrollViewerAutomationPeer) -> str
Gets the name of the System.Windows.Controls.ScrollViewer that is associated
with this System.Windows.Automation.Peers.ScrollViewerAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "ScrollViewer".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: ScrollViewerAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.ScrollViewer that is
associated with this
System.Windows.Automation.Peers.ScrollViewerAutomationPeer.
patternInterface: A value in the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Scroll,
this method returns a this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ScrollViewerAutomationPeer) -> bool
Gets or sets a value that indicates whether the
System.Windows.Controls.ScrollViewer that is associated with this
System.Windows.Automation.Peers.ScrollViewerAutomationPeer is understood by the
end user as interactive or as contributing to the logical structure of the
control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: If the System.Windows.FrameworkElement.TemplatedParent is null, this method
returns true; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ScrollViewer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class SeparatorAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Separator types to UI Automation.
SeparatorAutomationPeer(owner: Separator)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Separator) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class SliderAutomationPeer(RangeBaseAutomationPeer, IRangeValueProvider):
"""
Exposes System.Windows.Controls.Slider types to UI Automation.
SliderAutomationPeer(owner: Slider)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: SliderAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.Slider that is associated
with this System.Windows.Automation.Peers.SliderAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.Slider
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: SliderAutomationPeer) -> str
Gets the name of the System.Windows.Controls.Slider that is associated with
this System.Windows.Automation.Peers.SliderAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "Slider".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: SliderAutomationPeer) -> Point
Called by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: A System.Windows.Point containing System.Double.NaN, System.Double.NaN; the
only clickable points in a System.Windows.Controls.TabControl are the child
System.Windows.Controls.TabItem elements.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Slider) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class StatusBarAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.StatusBar types to UI Automation.
StatusBarAutomationPeer(owner: StatusBar)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: StatusBar) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class StatusBarItemAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Primitives.StatusBarItem types to UI Automation.
StatusBarItemAutomationPeer(owner: StatusBarItem)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: StatusBarItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TabControlAutomationPeer(SelectorAutomationPeer, IItemContainerProvider, ISelectionProvider):
"""
Exposes System.Windows.Controls.TabControl types to UI Automation.
TabControlAutomationPeer(owner: TabControl)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: TabControlAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new System.Windows.Automation.Peers.TabItemAutomationPeer.
item: The System.Windows.Controls.TabItem that is associated with the new
System.Windows.Automation.Peers.TabItemAutomationPeer.
Returns: A new System.Windows.Automation.Peers.TabItemAutomationPeer.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TabControlAutomationPeer) -> AutomationControlType
Gets the collection of child elements for the System.Windows.Controls.TabItem
that is associated with the new
System.Windows.Automation.Peers.TabItemAutomationPeer. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Tab enumeration value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemsControlAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.ItemsControl that is associated with this
System.Windows.Automation.Peers.ItemsControlAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TabControlAutomationPeer) -> str
Gets the name of the System.Windows.Controls.TabItem that is associated with
the new System.Windows.Automation.Peers.TabItemAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TabControl".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: TabControlAutomationPeer) -> Point
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: A System.Windows.Point containing System.Double.NaN, System.Double.NaN; the
only clickable points in a System.Windows.Controls.TabControl are the child
System.Windows.Controls.TabItem elements.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TabControl) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class TabItemAutomationPeer(SelectorItemAutomationPeer, IVirtualizedItemProvider, ISelectionItemProvider):
"""
Exposes System.Windows.Controls.TabItem types to UI Automation.
TabItemAutomationPeer(owner: object, tabControlAutomationPeer: TabControlAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TabItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.TabItem that is
associated with this System.Windows.Automation.Peers.TabItemAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.TabItem
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TabItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.Controls.TabItem
that is associated with this
System.Windows.Automation.Peers.TabItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TabItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.TabItem that is associated with
this System.Windows.Automation.Peers.TabItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TabItem".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: TabItemAutomationPeer) -> str
Gets the text label of the System.Windows.Controls.TabItem that is associated
with this System.Windows.Automation.Peers.TabItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label. If set, this method returns the value of
the System.Windows.Automation.AutomationProperties.Name property; otherwise
this method will return the value of the
System.Windows.Controls.HeaderedContentControl.Header property.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner, tabControlAutomationPeer):
""" __new__(cls: type, owner: object, tabControlAutomationPeer: TabControlAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TabItemWrapperAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes the System.Windows.UIElement subtree for the data items in a System.Windows.Controls.TabControl to UI Automation.
TabItemWrapperAutomationPeer(owner: TabItem)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TabItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TableAutomationPeer(TextElementAutomationPeer, IGridProvider):
"""
Exposes System.Windows.Documents.Table types to UI Automation.
TableAutomationPeer(owner: Table)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ContentElementAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: System.String.Empty.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ContentElementAutomationPeer) -> str
Gets the access key for the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for this System.Windows.ContentElement.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TableAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Documents.Table that is associated
with this System.Windows.Automation.Peers.TableAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Table enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that uniquely identifies the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The System.Windows.Automation.AutomationIdentifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: TextElementAutomationPeer) -> Rect
Gets the System.Windows.Rect representing the bounding rectangle of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element, or
System.Windows.Rect.Empty if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TextElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: null.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TableAutomationPeer) -> str
Gets the name of the System.Windows.Documents.Table that is associated with
this System.Windows.Automation.Peers.TableAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "Table".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: TextElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The string describing the functionality of the element.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ContentElementAutomationPeer) -> str
Gets a string that conveys the visual status of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: A string containing the status.
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ContentElementAutomationPeer) -> str
Gets a human-readable string that contains the type of the item that the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer represents. Called
by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the item type.
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: FrameworkContentElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.LabelAutomationPeer for the
System.Windows.Controls.Label that is targeted to the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.FrameworkContentElementAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ContentElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ContentElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is laid out in a
specific direction. Called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: System.Windows.Automation.Peers.AutomationOrientation.None.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TableAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Documents.Table that is
associated with this System.Windows.Automation.Peers.TableAutomationPeer.
patternInterface: A value from the enumeration.
Returns: If patternInterface is System.Windows.Automation.Peers.PatternInterface.Grid,
this method returns a this pointer; otherwise, this method returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer currently has
keyboard input focus. Called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is an element that
contains data that is presented to the user. Called by
System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: TableAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.Documents.Table
that is associated with this
System.Windows.Automation.Peers.TableAutomationPeer is understood by the end
user as interactive or as contributing to the logical structure of the control
in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether this automation peer can receive and send
events to the associated element. Called by
System.Windows.Automation.Peers.AutomationPeer.IsEnabled.
Returns: true if the automation peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer can accept
keyboard focus. Called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: TextElementAutomationPeer) -> bool
Gets a value that indicates whether System.Windows.Documents.TextElement that
is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer is off of the screen.
Called by System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer contains protected
content. Called by System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is required to be
filled out on a form. Called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ContentElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Table) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TableCellAutomationPeer(TextElementAutomationPeer, IGridItemProvider):
"""
Exposes System.Windows.Documents.TableCell types to UI Automation.
TableCellAutomationPeer(owner: TableCell)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ContentElementAutomationPeer) -> str
Gets the accelerator key for the element associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: System.String.Empty.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ContentElementAutomationPeer) -> str
Gets the access key for the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for this System.Windows.ContentElement.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TableCellAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Documents.TableCell that is
associated with this System.Windows.Automation.Peers.TableCellAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.Custom enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that uniquely identifies the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The System.Windows.Automation.AutomationIdentifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: TextElementAutomationPeer) -> Rect
Gets the System.Windows.Rect representing the bounding rectangle of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element, or
System.Windows.Rect.Empty if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TextElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: null.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TableCellAutomationPeer) -> str
Gets the name of the System.Windows.Documents.TableCell that is associated with
this System.Windows.Automation.Peers.TableCellAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TableCell".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: TextElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.Documents.TextElement that is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkContentElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The string describing the functionality of the element.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ContentElementAutomationPeer) -> str
Gets a string that conveys the visual status of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: A string containing the status.
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ContentElementAutomationPeer) -> str
Gets a human-readable string that contains the type of the item that the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer represents. Called
by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the item type.
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: FrameworkContentElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.LabelAutomationPeer for the
System.Windows.Controls.Label that is targeted to the
System.Windows.FrameworkContentElement that is associated with this
System.Windows.Automation.Peers.FrameworkContentElementAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: TableCellAutomationPeer) -> str
Gets the localized version of the control type for the
System.Windows.Documents.TableCell that is associated with this
System.Windows.Automation.Peers.TableCellAutomationPeer.
Returns: A string that contains "cell".
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ContentElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The string that contains the label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ContentElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is laid out in a
specific direction. Called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: System.Windows.Automation.Peers.AutomationOrientation.None.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TableCellAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Documents.TableCell that is
associated with this System.Windows.Automation.Peers.TableCellAutomationPeer.
patternInterface: A value from the enumeration.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.GridItem, this method returns
the current instance of the
System.Windows.Automation.Peers.TableCellAutomationPeer; otherwise, this method
returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer currently has
keyboard input focus. Called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is an element that
contains data that is presented to the user. Called by
System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: TableCellAutomationPeer) -> bool
Gets or sets a value that indicates whether the
System.Windows.Documents.TableCell that is associated with this
System.Windows.Automation.Peers.TableCellAutomationPeer is understood by the
end user as interactive or as contributing to the logical structure of the
control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether this automation peer can receive and send
events to the associated element. Called by
System.Windows.Automation.Peers.AutomationPeer.IsEnabled.
Returns: true if the automation peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer can accept
keyboard focus. Called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: TextElementAutomationPeer) -> bool
Gets a value that indicates whether System.Windows.Documents.TextElement that
is associated with this
System.Windows.Automation.Peers.TextElementAutomationPeer is off of the screen.
Called by System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer contains protected
content. Called by System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ContentElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer is required to be
filled out on a form. Called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ContentElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TableCell) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TextBlockAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.TextBlock types to UI Automation.
TextBlockAutomationPeer(owner: TextBlock)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TextBlock) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TextBoxAutomationPeer(TextAutomationPeer, IValueProvider):
"""
Exposes System.Windows.Controls.TextBox types to UI Automation.
TextBoxAutomationPeer(owner: TextBox)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TextBoxAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.TextBox that is
associated with this System.Windows.Automation.Peers.TextBoxAutomationPeer.
Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.Edit
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: UIElementAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A list of child System.Windows.Automation.Peers.AutomationPeer elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TextBoxAutomationPeer) -> str
Gets the name of the System.Windows.Controls.TextBox that is associated with
this System.Windows.Automation.Peers.TextBoxAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TextBox".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: TextAutomationPeer) -> str
Gets the text label of the element that is associated with this
System.Windows.Automation.Peers.TextAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The value of System.Windows.Automation.AutomationProperties.Name or
System.Windows.Automation.AutomationProperties.LabeledBy if either is set;
otherwise this method returns an empty string.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TextBoxAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.TextBox that is
associated with this System.Windows.Automation.Peers.TextBoxAutomationPeer.
patternInterface: A value from the enumeration.
Returns: An object that supports the control pattern if patternInterface is a supported
value; otherwise, null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TextBox) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ToolBarAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.ToolBar types to UI Automation.
ToolBarAutomationPeer(owner: ToolBar)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ToolBar) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class ToolTipAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.ToolTip types to UI Automation.
ToolTipAutomationPeer(owner: ToolTip)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: ToolTip) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class TreeViewAutomationPeer(ItemsControlAutomationPeer, IItemContainerProvider, ISelectionProvider):
"""
Exposes System.Windows.Controls.TreeView types to UI Automation.
TreeViewAutomationPeer(owner: TreeView)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: TreeViewAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer for a data item
in the System.Windows.Controls.ItemsControl.Items collection of this
System.Windows.Controls.TreeView.
item: The data item that is associated with the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer.
Returns: A new instance of the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer for item.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: ItemsControlAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TreeViewAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.Tree.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TreeViewAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.ContentElement that
is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: A collection of System.Windows.Automation.Peers.TreeViewItemAutomationPeer
elements, or null if the System.Windows.Controls.TreeView that is associated
with this System.Windows.Automation.Peers.TreeViewAutomationPeer is empty.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TreeViewAutomationPeer) -> str
Gets the name of the System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TreeView".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TreeViewAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.ContentElement that is
associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer.
patternInterface: One of the enumeration values.
Returns: The current instance of the
System.Windows.Automation.Peers.TreeViewItemAutomationPeer, or null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TreeView) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class TreeViewDataItemAutomationPeer(ItemAutomationPeer, IVirtualizedItemProvider, ISelectionItemProvider, IScrollItemProvider, IExpandCollapseProvider):
"""
Exposes System.Windows.Controls.TreeViewItem types containing data items to UI Automation.
TreeViewDataItemAutomationPeer(item: object, itemsControlAutomationPeer: ItemsControlAutomationPeer, parentDataItemAutomationPeer: TreeViewDataItemAutomationPeer)
"""
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: ItemAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that corresponds to
the data item in the System.Windows.Controls.ItemsControl.Items collection that
is associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The accelerator key.
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: ItemAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The access key.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TreeViewDataItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.TreeViewItem that is
associated with this
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: System.Windows.Automation.Peers.AutomationControlType.TreeItem in all cases.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: ItemAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: A string that contains the UI Automation�identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: ItemAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
specified System.Windows.UIElement.
Returns: The bounding rectangle.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: ItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the System.Windows.UIElement that
corresponds to the data item in the System.Windows.Controls.ItemsControl.Items
collection that is associated with this
System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TreeViewDataItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.TreeViewItem that is associated
with this System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer.
Called by System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string containing the value TreeViewItem.
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: ItemAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
specified System.Windows.UIElement.
Returns: The point that represents the clickable space that is on the specified
System.Windows.UIElement.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: ItemAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.UIElement that corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: ItemAutomationPeer) -> str
Gets a string that conveys the visual status of the specified
System.Windows.UIElement.
Returns: The status. Examples include "Busy" or "Online".
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: ItemAutomationPeer) -> str
Gets a human-readable string that contains the type of item that the specified
System.Windows.UIElement represents.
Returns: The item type. An example includes "Mail Message" or "Contact".
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: ItemAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the
System.Windows.Controls.Label that is targeted to the specified
System.Windows.UIElement.
Returns: The System.Windows.Automation.Peers.LabelAutomationPeer for the element that is
targeted by the System.Windows.Controls.Label.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: ItemAutomationPeer) -> str
Gets the text label of the System.Windows.UIElement that corresponds to the
data item in the System.Windows.Controls.ItemsControl.Items collection that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer.
Returns: The text label.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: ItemAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the specified System.Windows.UIElement is
laid out in a particular direction.
Returns: The direction of the specified System.Windows.UIElement. Optionally, the method
returns System.Windows.Automation.Peers.AutomationOrientation.None if the
System.Windows.UIElement is not laid out in a particular direction.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TreeViewDataItemAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the element that is associated with this
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer.
patternInterface: The type of pattern implemented by the element to retrieve.
Returns: The object that implements the pattern interface, or null if the specified
pattern interface is not implemented by this peer.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
currently has keyboard input focus.
Returns: true if the specified System.Windows.UIElement has keyboard input focus;
otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains data that is presented to the user.
Returns: true if the element is a content element; otherwise, false.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.ItemAutomationPeer is
understood by the end user as interactive.
Returns: true if the element is a control; otherwise, false.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
receive and send events.
Returns: true if the UI Automation�peer can receive and send events; otherwise, false.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement can
accept keyboard focus.
Returns: true if the element can accept keyboard focus; otherwise, false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
off the screen.
Returns: true if the specified System.Windows.UIElement is not on the screen; otherwise,
false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement
contains protected content.
Returns: true if the specified System.Windows.UIElement contains protected content;
otherwise, false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: ItemAutomationPeer) -> bool
Gets a value that indicates whether the specified System.Windows.UIElement is
required to be completed on a form.
Returns: true if the specified System.Windows.UIElement is required to be completed;
otherwise, false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: ItemAutomationPeer)
Sets the keyboard input focus on the specified System.Windows.UIElement. The
System.Windows.UIElement corresponds to the data item in the
System.Windows.Controls.ItemsControl.Items collection that is associated with
this System.Windows.Automation.Peers.ItemAutomationPeer.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, item, itemsControlAutomationPeer, parentDataItemAutomationPeer):
""" __new__(cls: type, item: object, itemsControlAutomationPeer: ItemsControlAutomationPeer, parentDataItemAutomationPeer: TreeViewDataItemAutomationPeer) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
ParentDataItemAutomationPeer = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer that is the parent to this automation peer.
Get: ParentDataItemAutomationPeer(self: TreeViewDataItemAutomationPeer) -> TreeViewDataItemAutomationPeer
"""
class TreeViewItemAutomationPeer(ItemsControlAutomationPeer, IItemContainerProvider, IExpandCollapseProvider, ISelectionItemProvider, IScrollItemProvider):
"""
Exposes System.Windows.Controls.TreeViewItem types to UI Automation.
TreeViewItemAutomationPeer(owner: TreeViewItem)
"""
def CreateItemAutomationPeer(self, *args): #cannot find CLR method
"""
CreateItemAutomationPeer(self: TreeViewItemAutomationPeer, item: object) -> ItemAutomationPeer
Creates a new instance of the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer for a data item
in the System.Windows.Controls.ItemsControl.Items collection of this
System.Windows.Controls.TreeView.
item: The data item that is associated with the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer.
Returns: A new instance of the
System.Windows.Automation.Peers.TreeViewDataItemAutomationPeer for item.
"""
pass
def FindOrCreateItemAutomationPeer(self, *args): #cannot find CLR method
""" FindOrCreateItemAutomationPeer(self: TreeViewItemAutomationPeer, item: object) -> ItemAutomationPeer """
pass
def GetAcceleratorKeyCore(self, *args): #cannot find CLR method
"""
GetAcceleratorKeyCore(self: UIElementAutomationPeer) -> str
Gets the accelerator key for the System.Windows.UIElement that is associated
with this System.Windows.Automation.Peers.UIElementAutomationPeer. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass
def GetAccessKeyCore(self, *args): #cannot find CLR method
"""
GetAccessKeyCore(self: UIElementAutomationPeer) -> str
Gets the access key for the System.Windows.UIElement that is associated with
this System.Windows.Automation.Peers.UIElementAutomationPeer.This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetAccessKey.
Returns: The access key for the System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetAutomationControlTypeCore(self, *args): #cannot find CLR method
"""
GetAutomationControlTypeCore(self: TreeViewItemAutomationPeer) -> AutomationControlType
Gets the control type for the System.Windows.Controls.TreeViewItem that is
associated with this
System.Windows.Automation.Peers.TreeViewItemAutomationPeer. This method is
called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType.
Returns: The System.Windows.Automation.Peers.AutomationControlType.TreeItem enumeration
value.
"""
pass
def GetAutomationIdCore(self, *args): #cannot find CLR method
"""
GetAutomationIdCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that uniquely identifies the System.Windows.FrameworkElement
that is associated with this
System.Windows.Automation.Peers.FrameworkElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetAutomationId.
Returns: The automation identifier for the element associated with the
System.Windows.Automation.Peers.FrameworkElementAutomationPeer, or
System.String.Empty if there isn't an automation identifier.
"""
pass
def GetBoundingRectangleCore(self, *args): #cannot find CLR method
"""
GetBoundingRectangleCore(self: UIElementAutomationPeer) -> Rect
Gets the System.Windows.Rect that represents the bounding rectangle of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetBoundingRectangle.
Returns: The System.Windows.Rect that contains the coordinates of the element.
Optionally, if the element is not both a System.Windows.Interop.HwndSource and
a System.Windows.PresentationSource, this method returns
System.Windows.Rect.Empty.
"""
pass
def GetChildrenCore(self, *args): #cannot find CLR method
"""
GetChildrenCore(self: TreeViewItemAutomationPeer) -> List[AutomationPeer]
Gets the collection of child elements of the
System.Windows.Controls.TreeViewItem that is associated with this
System.Windows.Automation.Peers.TreeViewItemAutomationPeer. This method is
called by System.Windows.Automation.Peers.AutomationPeer.GetChildren.
Returns: The collection of child elements.
"""
pass
def GetClassNameCore(self, *args): #cannot find CLR method
"""
GetClassNameCore(self: TreeViewItemAutomationPeer) -> str
Gets the name of the System.Windows.Controls.TreeViewItem that is associated
with this System.Windows.Automation.Peers.TreeViewItemAutomationPeer. This
method is called by
System.Windows.Automation.Peers.AutomationPeer.GetClassName.
Returns: A string that contains "TreeViewItem".
"""
pass
def GetClickablePointCore(self, *args): #cannot find CLR method
"""
GetClickablePointCore(self: UIElementAutomationPeer) -> Point
Gets a System.Windows.Point that represents the clickable space that is on the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetClickablePoint.
Returns: The System.Windows.Point on the element that allows a click. The point values
are (System.Double.NaN, System.Double.NaN) if the element is not both a
System.Windows.Interop.HwndSource and a System.Windows.PresentationSource.
"""
pass
def GetHelpTextCore(self, *args): #cannot find CLR method
"""
GetHelpTextCore(self: FrameworkElementAutomationPeer) -> str
Gets the string that describes the functionality of the
System.Windows.ContentElement that is associated with this
System.Windows.Automation.Peers.ContentElementAutomationPeer. Called by
System.Windows.Automation.Peers.AutomationPeer.GetHelpText.
Returns: The help text, usually from the System.Windows.Controls.ToolTip, or
System.String.Empty if there is no help text.
"""
pass
def GetHostRawElementProviderCore(self, *args): #cannot find CLR method
"""
GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper
Tells UI Automation where in the UI Automation tree to place the hwnd being
hosted by a Windows Presentation Foundation (WPF) element.
Returns: This method returns the hosted hwnd to UI Automation for controls that host
hwnd objects.
"""
pass
def GetItemStatusCore(self, *args): #cannot find CLR method
"""
GetItemStatusCore(self: UIElementAutomationPeer) -> str
Gets a string that communicates the visual status of the
System.Windows.UIElement that is associated with this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetItemStatus.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemStatus that is returned by
System.Windows.Automation.AutomationProperties.GetItemStatus(System.Windows.Depe
ndencyObject).
"""
pass
def GetItemTypeCore(self, *args): #cannot find CLR method
"""
GetItemTypeCore(self: UIElementAutomationPeer) -> str
Gets a human-readable string that contains the item type that the
System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer represents. This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetItemType.
Returns: The string that contains the
System.Windows.Automation.AutomationProperties.ItemType that is returned by
System.Windows.Automation.AutomationProperties.GetItemType(System.Windows.Depend
encyObject).
"""
pass
def GetLabeledByCore(self, *args): #cannot find CLR method
"""
GetLabeledByCore(self: UIElementAutomationPeer) -> AutomationPeer
Gets the System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer. This method is called
by System.Windows.Automation.Peers.AutomationPeer.GetLabeledBy.
Returns: The System.Windows.Automation.Peers.AutomationPeer for the element that is
targeted to the System.Windows.UIElement for this
System.Windows.Automation.Peers.UIElementAutomationPeer.
"""
pass
def GetLocalizedControlTypeCore(self, *args): #cannot find CLR method
"""
GetLocalizedControlTypeCore(self: AutomationPeer) -> str
When overridden in a derived class, is called by
System.Windows.Automation.Peers.AutomationPeer.GetLocalizedControlType.
Returns: The type of the control.
"""
pass
def GetNameCore(self, *args): #cannot find CLR method
"""
GetNameCore(self: FrameworkElementAutomationPeer) -> str
Gets the text label of the System.Windows.ContentElement that is associated
with this System.Windows.Automation.Peers.ContentElementAutomationPeer. Called
by System.Windows.Automation.Peers.AutomationPeer.GetName.
Returns: The text label of the element that is associated with this automation peer.
"""
pass
def GetOrientationCore(self, *args): #cannot find CLR method
"""
GetOrientationCore(self: UIElementAutomationPeer) -> AutomationOrientation
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
laid out in a specific direction. This method is called by
System.Windows.Automation.Peers.AutomationPeer.GetOrientation.
Returns: The System.Windows.Automation.Peers.AutomationOrientation.None enumeration
value.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: TreeViewItemAutomationPeer, patternInterface: PatternInterface) -> object
Gets the control pattern for the System.Windows.Controls.TreeViewItem that is
associated with this
System.Windows.Automation.Peers.TreeViewItemAutomationPeer.
patternInterface: One of the enumeration values.
Returns: If patternInterface is
System.Windows.Automation.Peers.PatternInterface.ScrollItem,
System.Windows.Automation.Peers.PatternInterface.SelectionItem, or
System.Windows.Automation.Peers.PatternInterface.ExpandCollapse, this method
returns the current instance of the
System.Windows.Automation.Peers.TreeViewItemAutomationPeer; otherwise, it
returns null.
"""
pass
def GetPeerFromPointCore(self, *args): #cannot find CLR method
""" GetPeerFromPointCore(self: AutomationPeer, point: Point) -> AutomationPeer """
pass
def HasKeyboardFocusCore(self, *args): #cannot find CLR method
"""
HasKeyboardFocusCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
currently has keyboard input focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.HasKeyboardFocus.
Returns: true if the element has keyboard input focus; otherwise, false.
"""
pass
def IsContentElementCore(self, *args): #cannot find CLR method
"""
IsContentElementCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
an element that contains data that is presented to the user. This method is
called by System.Windows.Automation.Peers.AutomationPeer.IsContentElement.
Returns: true.
"""
pass
def IsControlElementCore(self, *args): #cannot find CLR method
"""
IsControlElementCore(self: UIElementAutomationPeer) -> bool
Gets or sets a value that indicates whether the System.Windows.UIElement that
is associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
is understood by the end user as interactive. Optionally, the user might
understand the System.Windows.UIElement as contributing to the logical
structure of the control in the GUI. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsControlElement.
Returns: true.
"""
pass
def IsEnabledCore(self, *args): #cannot find CLR method
"""
IsEnabledCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: A boolean that contains the value of System.Windows.UIElement.IsEnabled.
"""
pass
def IsKeyboardFocusableCore(self, *args): #cannot find CLR method
"""
IsKeyboardFocusableCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
can accept keyboard focus. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsKeyboardFocusable.
Returns: true if the element is focusable by the keyboard; otherwise false.
"""
pass
def IsOffscreenCore(self, *args): #cannot find CLR method
"""
IsOffscreenCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
off the screen. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsOffscreen.
Returns: true if the element is not on the screen; otherwise, false.
"""
pass
def IsPasswordCore(self, *args): #cannot find CLR method
"""
IsPasswordCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer
contains protected content. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsPassword.
Returns: false.
"""
pass
def IsRequiredForFormCore(self, *args): #cannot find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that is returned by
System.Windows.Automation.AutomationProperties.GetIsRequiredForForm(System.Windo
ws.DependencyObject), if it's set; otherwise false.
"""
pass
def PeerFromProvider(self, *args): #cannot find CLR method
"""
PeerFromProvider(self: AutomationPeer, provider: IRawElementProviderSimple) -> AutomationPeer
Gets an System.Windows.Automation.Peers.AutomationPeer for the specified
System.Windows.Automation.Provider.IRawElementProviderSimple proxy.
provider: The class that implements
System.Windows.Automation.Provider.IRawElementProviderSimple.
Returns: The System.Windows.Automation.Peers.AutomationPeer.
"""
pass
def ProviderFromPeer(self, *args): #cannot find CLR method
"""
ProviderFromPeer(self: AutomationPeer, peer: AutomationPeer) -> IRawElementProviderSimple
Gets the System.Windows.Automation.Provider.IRawElementProviderSimple for the
specified System.Windows.Automation.Peers.AutomationPeer.
peer: The automation peer.
Returns: The proxy.
"""
pass
def SetFocusCore(self, *args): #cannot find CLR method
"""
SetFocusCore(self: UIElementAutomationPeer)
Sets the keyboard input focus on the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer.
This method is called by
System.Windows.Automation.Peers.AutomationPeer.SetFocus.
"""
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: TreeViewItem) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
IsVirtualized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class UIElement3DAutomationPeer(AutomationPeer):
"""
Exposes System.Windows.UIElement3D types to UI Automation.
UIElement3DAutomationPeer(owner: UIElement3D)
"""
@staticmethod
def CreatePeerForElement(element):
"""
CreatePeerForElement(element: UIElement3D) -> AutomationPeer
Creates a System.Windows.Automation.Peers.UIElement3DAutomationPeer for the
specified System.Windows.UIElement3D.
element: The System.Windows.UIElement3D that is associated with this
System.Windows.Automation.Peers.UIElement3DAutomationPeer.
Returns: A System.Windows.Automation.Peers.UIElement3DAutomationPeer for the specified
System.Windows.UIElement3D.
"""
pass
@staticmethod
def FromElement(element):
"""
FromElement(element: UIElement3D) -> AutomationPeer
Returns the System.Windows.Automation.Peers.UIElement3DAutomationPeer for the
specified System.Windows.UIElement3D.
element: The System.Windows.UIElement3D that is associated with this
System.Windows.Automation.Peers.UIElement3DAutomationPeer.
Returns: The System.Windows.Automation.Peers.UIElement3DAutomationPeer, or null if the
System.Windows.Automation.Peers.UIElement3DAutomationPeer was not created by
the
System.Windows.Automation.Peers.UIElement3DAutomationPeer.CreatePeerForElement(S
ystem.Windows.UIElement3D) method.
"""
pass
def GetPattern(self, patternInterface):
"""
GetPattern(self: UIElement3DAutomationPeer, patternInterface: PatternInterface) -> object
Returns the control pattern for the System.Windows.UIElement3D that is
associated with this System.Windows.Automation.Peers.UIElement3DAutomationPeer.
patternInterface: One of the enumeration values.
Returns: An object that implements the
System.Windows.Automation.Provider.ISynchronizedInputProvider interface if
patternInterface is
System.Windows.Automation.Peers.PatternInterface.SynchronizedInput; otherwise,
null.
"""
pass
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: UIElement3D) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
Owner = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets the System.Windows.UIElement3D that is associated with this System.Windows.Automation.Peers.UIElement3DAutomationPeer.
Get: Owner(self: UIElement3DAutomationPeer) -> UIElement3D
"""
class UserControlAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.UserControl types to UI Automation.
UserControlAutomationPeer(owner: UserControl)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: UserControl) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
class Viewport3DAutomationPeer(FrameworkElementAutomationPeer):
"""
Exposes System.Windows.Controls.Viewport3D types to UI Automation.
Viewport3DAutomationPeer(owner: Viewport3D)
"""
@staticmethod # known case of __new__
def __new__(self, owner):
""" __new__(cls: type, owner: Viewport3D) """
pass
IsHwndHost = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Gets a value that indicates whether the element that is associated with this System.Windows.Automation.Peers.AutomationPeer hosts hwnds in Windows Presentation Foundation (WPF).
"""
| 44.951131 | 573 | 0.637107 | 79,474 | 846,250 | 6.74301 | 0.009475 | 0.107101 | 0.114336 | 0.120278 | 0.952688 | 0.94272 | 0.933595 | 0.929398 | 0.926181 | 0.922352 | 0.000021 | 0.000333 | 0.300186 | 846,250 | 18,825 | 574 | 44.953519 | 0.90453 | 0.038805 | 0 | 0.934402 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.456268 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 9 |
83370dce832698d56fe63cb6d4e03d107f527cf0 | 56,436 | py | Python | platform/core/tests/test_configs/test_options.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/tests/test_configs/test_options.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/tests/test_configs/test_options.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | # pylint:disable=too-many-lines
# pylint:disable=too-many-statements
import pytest
from rest_framework import status
import conf
from constants.urls import API_V1
from db.models.clusters import Cluster
from db.models.config_options import ConfigOption
from options.registry import (
affinities,
auth_azure,
auth_bitbucket,
auth_github,
auth_gitlab,
env_vars,
integrations,
k8s,
k8s_config_maps,
k8s_secrets,
node_selectors,
notebooks,
service_accounts,
tensorboards,
tolerations
)
from tests.base.views import BaseViewTest
@pytest.mark.configs_mark
class TestOptionsSaveLoad(BaseViewTest):
model_class = ConfigOption
HAS_AUTH = True
ADMIN_USER = True
DISABLE_EXECUTOR = False
def setUp(self):
super().setUp()
self.owner = self.get_owner()
self.url = self.get_url()
self.queryset = self.model_class.objects.filter(owner=self.owner)
def get_owner(self):
return Cluster.get_or_create_owner(Cluster.load())
def get_url(self):
return '/{}/options/'.format(API_V1)
def test_node_selectors(self):
data = {'foo': 'bar'}
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
node_selectors.NODE_SELECTORS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
node_selectors.NODE_SELECTORS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
node_selectors.NODE_SELECTORS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
node_selectors.NODE_SELECTORS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
node_selectors.NODE_SELECTORS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
node_selectors.NODE_SELECTORS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(node_selectors.NODE_SELECTORS_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] == data
def test_affinities(self):
data = {'podAffinity': {'preferredDuringSchedulingIgnoredDuringExecution:': []}}
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
affinities.AFFINITIES_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
affinities.AFFINITIES_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
affinities.AFFINITIES_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
affinities.AFFINITIES_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
affinities.AFFINITIES_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
affinities.AFFINITIES_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(affinities.AFFINITIES_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] == data
def test_tolerations(self):
data = [{'key': "key", 'operator': "Equal", 'value': "value", 'effect': "NoSchedule"}]
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
tolerations.TOLERATIONS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
tolerations.TOLERATIONS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
tolerations.TOLERATIONS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
tolerations.TOLERATIONS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
tolerations.TOLERATIONS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tolerations.TOLERATIONS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tolerations.TOLERATIONS_TENSORBOARDS, to_dict=True)
assert resp.data[0]['value'] == data
def test_service_accounts(self):
data = 'service-foo'
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
service_accounts.SERVICE_ACCOUNTS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
service_accounts.SERVICE_ACCOUNTS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
service_accounts.SERVICE_ACCOUNTS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
service_accounts.SERVICE_ACCOUNTS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
service_accounts.SERVICE_ACCOUNTS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
service_accounts.SERVICE_ACCOUNTS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(service_accounts.SERVICE_ACCOUNTS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] == data
def test_config_maps(self):
data = ['config1', 'config2']
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
k8s_config_maps.K8S_CONFIG_MAPS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_config_maps.K8S_CONFIG_MAPS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_config_maps.K8S_CONFIG_MAPS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_config_maps.K8S_CONFIG_MAPS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_config_maps.K8S_CONFIG_MAPS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_config_maps.K8S_CONFIG_MAPS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_config_maps.K8S_CONFIG_MAPS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] == data
def test_secrets(self):
data = ['secret1', 'secret2']
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
k8s_secrets.K8S_SECRETS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_secrets.K8S_SECRETS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_secrets.K8S_SECRETS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_secrets.K8S_SECRETS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
k8s_secrets.K8S_SECRETS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s_secrets.K8S_SECRETS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s_secrets.K8S_SECRETS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] == data
def test_env_vars(self):
data = [['key1', 'value1'], ['key2', 'value2']]
# Build
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
env_vars.ENV_VARS_BUILD_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_BUILD_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_BUILD_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Job
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_JOBS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
env_vars.ENV_VARS_JOBS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_JOBS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_JOBS, to_dict=True)
assert resp.data[0]['value'] == data
# Experiment
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
env_vars.ENV_VARS_EXPERIMENTS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_EXPERIMENTS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_EXPERIMENTS, to_dict=True)
assert resp.data[0]['value'] == data
# Notebook
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
env_vars.ENV_VARS_NOTEBOOKS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_NOTEBOOKS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_NOTEBOOKS, to_dict=True)
assert resp.data[0]['value'] == data
# Tensorboard
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] is None
# Update node selectors
resp = self.auth_client.post(self.url, data={
env_vars.ENV_VARS_TENSORBOARDS: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
env_vars.ENV_VARS_TENSORBOARDS))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(env_vars.ENV_VARS_TENSORBOARDS,
to_dict=True)
assert resp.data[0]['value'] == data
def test_auth_github(self):
# enabled
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_ENABLED, to_dict=True)
assert resp.data[0]['value'] is False
resp = self.auth_client.post(self.url, data={
auth_github.AUTH_GITHUB_ENABLED: True
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_ENABLED, to_dict=True)
assert resp.data[0]['value'] is True
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 0
resp = self.auth_client.post(self.url, data={
auth_github.AUTH_GITHUB_VERIFICATION_SCHEDULE: 2
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 2
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_github.AUTH_GITHUB_CLIENT_ID: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client secret
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_github.AUTH_GITHUB_CLIENT_SECRET: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_github.AUTH_GITHUB_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_github.AUTH_GITHUB_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
def test_auth_bitbucket(self):
# enabled
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_ENABLED, to_dict=True)
assert resp.data[0]['value'] is False
resp = self.auth_client.post(self.url, data={
auth_bitbucket.AUTH_BITBUCKET_ENABLED: True
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_ENABLED, to_dict=True)
assert resp.data[0]['value'] is True
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_VERIFICATION_SCHEDULE,
to_dict=True)
assert resp.data[0]['value'] == 0
resp = self.auth_client.post(self.url, data={
auth_bitbucket.AUTH_BITBUCKET_VERIFICATION_SCHEDULE: 2
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_VERIFICATION_SCHEDULE,
to_dict=True)
assert resp.data[0]['value'] == 2
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_bitbucket.AUTH_BITBUCKET_CLIENT_ID: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client secret
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_bitbucket.AUTH_BITBUCKET_CLIENT_SECRET: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_bitbucket.AUTH_BITBUCKET_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_bitbucket.AUTH_BITBUCKET_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
def test_auth_gitlab(self):
# enabled
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_ENABLED, to_dict=True)
assert resp.data[0]['value'] is False
resp = self.auth_client.post(self.url, data={
auth_gitlab.AUTH_GITLAB_ENABLED: True
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_ENABLED, to_dict=True)
assert resp.data[0]['value'] is True
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 0
resp = self.auth_client.post(self.url, data={
auth_gitlab.AUTH_GITLAB_VERIFICATION_SCHEDULE: 2
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 2
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_gitlab.AUTH_GITLAB_CLIENT_ID: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client secret
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_gitlab.AUTH_GITLAB_CLIENT_SECRET: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client url
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_URL))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_URL, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_gitlab.AUTH_GITLAB_URL: 'https://gitlab.com'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_gitlab.AUTH_GITLAB_URL))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_gitlab.AUTH_GITLAB_URL, to_dict=True)
assert resp.data[0]['value'] == 'https://gitlab.com'
def test_auth_azure(self):
# enabled
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_ENABLED, to_dict=True)
assert resp.data[0]['value'] is False
resp = self.auth_client.post(self.url, data={
auth_azure.AUTH_AZURE_ENABLED: True
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_ENABLED))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_ENABLED, to_dict=True)
assert resp.data[0]['value'] is True
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 0
resp = self.auth_client.post(self.url, data={
auth_azure.AUTH_AZURE_VERIFICATION_SCHEDULE: 2
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_VERIFICATION_SCHEDULE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_VERIFICATION_SCHEDULE, to_dict=True)
assert resp.data[0]['value'] == 2
# client id
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_azure.AUTH_AZURE_CLIENT_ID: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_CLIENT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_CLIENT_ID, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client secret
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_azure.AUTH_AZURE_CLIENT_SECRET: 'foobar'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_CLIENT_SECRET))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_CLIENT_SECRET, to_dict=True)
assert resp.data[0]['value'] == 'foobar'
# client url
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_TENANT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_TENANT_ID, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
auth_azure.AUTH_AZURE_TENANT_ID: 'some_value'
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
auth_azure.AUTH_AZURE_TENANT_ID))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(auth_azure.AUTH_AZURE_TENANT_ID, to_dict=True)
assert resp.data[0]['value'] == 'some_value'
def test_integrations(self):
data = [
{'url': 'https://hooks.com/services/sdfdfdsfsdf/sdflsdklfj'},
{'url': ' https://hooks.com/services/sdlkfjsdlk/lkjsdlkfjdklsjf2'}
]
# Discord
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_DISCORD))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_DISCORD, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_DISCORD: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_DISCORD))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_DISCORD, to_dict=True)
assert resp.data[0]['value'] == data
# Hipchat
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_HIPCHAT))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_HIPCHAT, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_HIPCHAT: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_HIPCHAT))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_HIPCHAT, to_dict=True)
assert resp.data[0]['value'] == data
# Mattermost
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_MATTERMOST))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_MATTERMOST, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_MATTERMOST: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_MATTERMOST))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_MATTERMOST, to_dict=True)
assert resp.data[0]['value'] == data
# Pagerduty
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_PAGER_DUTY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_PAGER_DUTY, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_PAGER_DUTY: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_PAGER_DUTY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_PAGER_DUTY, to_dict=True)
assert resp.data[0]['value'] == data
# Slack
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_SLACK))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_SLACK, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_SLACK: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_SLACK))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_SLACK, to_dict=True)
assert resp.data[0]['value'] == data
# Generic
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_GENERIC))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_GENERIC, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
integrations.INTEGRATIONS_WEBHOOKS_GENERIC: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
integrations.INTEGRATIONS_WEBHOOKS_GENERIC))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(integrations.INTEGRATIONS_WEBHOOKS_GENERIC, to_dict=True)
assert resp.data[0]['value'] == data
def test_k8s(self):
# GPU
data = 'something.com/gpu'
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_GPU_RESOURCE_KEY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_GPU_RESOURCE_KEY, to_dict=True)
assert resp.data[0]['value'] == 'nvidia.com/gpu'
resp = self.auth_client.post(self.url, data={
k8s.K8S_GPU_RESOURCE_KEY: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_GPU_RESOURCE_KEY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_GPU_RESOURCE_KEY, to_dict=True)
assert resp.data[0]['value'] == data
# TPU tf version
data = '1.14'
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_TPU_TF_VERSION))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_TPU_TF_VERSION, to_dict=True)
assert resp.data[0]['value'] == '1.12'
resp = self.auth_client.post(self.url, data={
k8s.K8S_TPU_TF_VERSION: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_TPU_TF_VERSION))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_TPU_TF_VERSION, to_dict=True)
assert resp.data[0]['value'] == data
# TPU tf version
data = 'cloud-tpus.google.com/preemptible-v2'
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_TPU_RESOURCE_KEY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_TPU_RESOURCE_KEY, to_dict=True)
assert resp.data[0]['value'] == 'cloud-tpus.google.com/v2'
resp = self.auth_client.post(self.url, data={
k8s.K8S_TPU_RESOURCE_KEY: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
k8s.K8S_TPU_RESOURCE_KEY))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(k8s.K8S_TPU_RESOURCE_KEY, to_dict=True)
assert resp.data[0]['value'] == data
def test_notebooks(self):
# Backend
data = 'lab'
resp = self.auth_client.get(self.url + '?keys={}'.format(
notebooks.NOTEBOOKS_BACKEND))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(notebooks.NOTEBOOKS_BACKEND, to_dict=True)
assert resp.data[0]['value'] == 'notebook'
resp = self.auth_client.post(self.url, data={
notebooks.NOTEBOOKS_BACKEND: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
notebooks.NOTEBOOKS_BACKEND))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(notebooks.NOTEBOOKS_BACKEND, to_dict=True)
assert resp.data[0]['value'] == data
# Docker image
data = 'someimage:tag-12'
resp = self.auth_client.get(self.url + '?keys={}'.format(
notebooks.NOTEBOOKS_DOCKER_IMAGE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(notebooks.NOTEBOOKS_DOCKER_IMAGE, to_dict=True)
assert resp.data[0]['value'] is None
resp = self.auth_client.post(self.url, data={
notebooks.NOTEBOOKS_DOCKER_IMAGE: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
notebooks.NOTEBOOKS_DOCKER_IMAGE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(notebooks.NOTEBOOKS_DOCKER_IMAGE, to_dict=True)
assert resp.data[0]['value'] == data
def test_tensorboards(self):
# Docker image
data = 'someimage:tag-12'
resp = self.auth_client.get(self.url + '?keys={}'.format(
tensorboards.TENSORBOARDS_DOCKER_IMAGE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tensorboards.TENSORBOARDS_DOCKER_IMAGE, to_dict=True)
assert resp.data[0]['value'] == 'tensorflow/tensorflow:1.11.0-py3'
resp = self.auth_client.post(self.url, data={
tensorboards.TENSORBOARDS_DOCKER_IMAGE: data
})
assert resp.status_code == status.HTTP_200_OK
resp = self.auth_client.get(self.url + '?keys={}'.format(
tensorboards.TENSORBOARDS_DOCKER_IMAGE))
assert resp.status_code == status.HTTP_200_OK
assert resp.data[0] == conf.get(tensorboards.TENSORBOARDS_DOCKER_IMAGE, to_dict=True)
assert resp.data[0]['value'] == data
| 45.77129 | 100 | 0.645368 | 7,416 | 56,436 | 4.649407 | 0.022384 | 0.131961 | 0.105568 | 0.113109 | 0.957019 | 0.954524 | 0.953944 | 0.953944 | 0.952987 | 0.952291 | 0 | 0.02363 | 0.235896 | 56,436 | 1,232 | 101 | 45.808442 | 0.775943 | 0.022734 | 0 | 0.857719 | 0 | 0 | 0.041902 | 0.002543 | 0 | 0 | 0 | 0 | 0.459132 | 1 | 0.018163 | false | 0 | 0.008073 | 0.002018 | 0.0333 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
835994e9172d7998927ed117a5e7c3095f674203 | 16,979 | py | Python | Testing/WhipItUp.py | Adam-Gibbs/PAC-project | c157e45879cd7e3f992dec76dfd45c797c3fd9df | [
"MIT"
] | 1 | 2019-01-07T11:19:57.000Z | 2019-01-07T11:19:57.000Z | Testing/WhipItUp.py | Adam-Gibbs/PAC-project | c157e45879cd7e3f992dec76dfd45c797c3fd9df | [
"MIT"
] | 18 | 2019-03-10T18:22:29.000Z | 2019-03-11T22:15:44.000Z | Testing/WhipItUp.py | Adam-Gibbs/PAC-project | c157e45879cd7e3f992dec76dfd45c797c3fd9df | [
"MIT"
] | null | null | null | text = "True,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,True,False,False,S/False,False,False,True,E/False,True,False,False,E/True,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,True,False,False,S/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,P/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,True,False,True,U/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,U/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/False,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,False,False,S/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,False,False,E/False,False,False,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,False,False,S/False,False,False,True,E/False,True,False,False,E/False,False,True,True,S/True,False,True,False,S/True,False,True,False,S/True,True,False,False,S/False,False,False,True,E/False,True,False,False,E/True,False,False,True,S/True,False,True,False,S/True,False,True,False,S/False,True,True,False,S/False,False,False,True,E/False,True,False,False,E/False,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,True,False,S/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,E/False,False,False,True,E/False,True,False,False,E/False,True,False,True,E/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,E/False,False,True,True,E/False,True,True,False,E/False,True,False,True,E/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/True,False,False,True,E/True,False,True,False,E/True,False,True,False,E/False,False,True,False,E/True,False,False,False,E/True,False,False,False,E/False,False,True,False,E/True,False,True,False,E/True,False,True,False,E/True,True,False,False,E/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,True,True,E/False,True,True,False,E/False,True,False,True,E/True,False,False,True,E/True,False,True,False,E/True,True,True,False,E/False,False,False,True,E/False,True,False,False,E/True,False,True,True,E/True,False,True,False,E/True,True,False,False,E/False,True,False,True,E/False,False,True,True,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,False,False,True,S/True,False,False,False,E/True,False,False,False,E/False,True,False,False,E/False,True,False,True,E/True,False,False,True,G/True,False,False,False,G/False,False,False,False,G/False,False,False,False,G/True,False,False,False,G/True,True,False,False,G/False,True,False,True,E/False,False,False,True,E/True,False,False,False,E/True,False,False,False,E/False,True,False,False,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,False,False,True,S/False,False,True,False,E/False,False,True,False,E/False,True,False,False,E/False,True,False,True,E/False,False,True,True,G/False,False,True,False,G/False,False,False,False,G/False,False,False,False,G/False,False,True,False,G/False,True,True,False,G/False,True,False,True,E/False,False,False,True,E/False,False,True,False,E/False,False,True,False,E/False,True,False,False,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,True,False,False,E/False,True,False,True,E/False,False,True,True,E/True,False,True,False,E/True,True,True,False,E/False,False,False,True,E/False,True,False,False,E/True,False,True,True,E/True,False,True,False,E/False,True,True,False,E/False,True,False,True,E/True,False,False,True,E/True,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,False,True,True,E/True,False,True,False,E/True,False,True,False,E/True,False,False,False,E/False,False,True,False,E/False,False,True,False,E/True,False,False,False,E/True,False,True,False,E/True,False,True,False,E/False,True,True,False,E/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,E/True,False,False,True,E/True,True,False,False,E/False,True,False,True,E/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,E/False,False,False,True,E/False,True,False,False,E/False,True,False,True,E/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/True,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,False,False,S/False,False,False,True,E/False,True,False,False,E/True,False,False,True,S/True,False,True,False,S/True,False,True,False,S/False,True,True,False,S/False,False,False,True,E/False,True,False,False,E/False,False,True,True,S/True,False,True,False,S/True,False,True,False,S/True,True,False,False,S/False,False,False,True,E/False,True,False,False,E/False,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,True,False,False,S/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/False,False,False,False,E/False,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,False,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,False,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,False,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,False,False,S/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/True,False,False,True,E/True,False,False,False,E/True,False,False,False,E/True,True,False,False,E/False,True,False,True,S/False,True,False,True,U/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,S/False,False,False,True,E/False,False,False,False,E/False,False,False,False,E/False,True,False,False,E/False,True,False,True,U/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,False,True,E/False,True,False,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,E/False,False,True,False,E/False,False,True,False,E/False,True,True,False,E/False,True,False,True,S/False,False,True,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,True,False,S/False,False,False,True,E/False,True,False,False,E/False,False,True,True,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/True,False,True,False,S/False,True,True,False,S"
group = text.split("/")
ngroup = list()
dave = list()
for item in group:
if len(dave) < 26:
dave.append(item)
else:
f2 = "/".join(dave)
ngroup.append(f2*2)
dave.clear()
final = "/".join(ngroup)
with open("file.txt", "w") as output:
output.write(final)
| 998.764706 | 16,680 | 0.792744 | 3,422 | 16,979 | 3.933372 | 0.009936 | 0.572808 | 0.367756 | 0.197325 | 0.986776 | 0.985884 | 0.984027 | 0.981798 | 0.981798 | 0.981798 | 0 | 0.000296 | 0.00483 | 16,979 | 16 | 16,681 | 1,061.1875 | 0.796295 | 0 | 0 | 0 | 0 | 0.071429 | 0.982567 | 0.98186 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 |
3620a61eba069a60258c65ecdbf2fa6cae39042b | 142 | py | Python | repositories/admin.py | MaryCaroline/repositoriesfeed | 164621c1008a29c966f5435ad2b01ca126011b46 | [
"MIT"
] | null | null | null | repositories/admin.py | MaryCaroline/repositoriesfeed | 164621c1008a29c966f5435ad2b01ca126011b46 | [
"MIT"
] | 2 | 2020-06-05T20:20:55.000Z | 2021-06-10T21:17:47.000Z | repositories/admin.py | MaryCaroline/repositoriesfeed | 164621c1008a29c966f5435ad2b01ca126011b46 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Commit, Repository
admin.site.register(Repository)
admin.site.register(Commit)
| 17.75 | 39 | 0.774648 | 18 | 142 | 6.111111 | 0.555556 | 0.272727 | 0.345455 | 0.490909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147887 | 142 | 7 | 40 | 20.285714 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
3645d0ed00bf8cd68a331b245d6b09145e75bc95 | 2,826 | py | Python | src/config.py | francismontalbo/attention-is-all-you-need-paper | 21ba3e48917da0c6808126d183bece6a9969cfd2 | [
"MIT"
] | 167 | 2021-12-02T16:25:34.000Z | 2022-03-31T02:02:17.000Z | src/config.py | francismontalbo/attention-is-all-you-need-paper | 21ba3e48917da0c6808126d183bece6a9969cfd2 | [
"MIT"
] | null | null | null | src/config.py | francismontalbo/attention-is-all-you-need-paper | 21ba3e48917da0c6808126d183bece6a9969cfd2 | [
"MIT"
] | 35 | 2021-12-02T16:45:28.000Z | 2022-03-28T07:54:17.000Z | unofficial_single_gpu_config=dict(
# RUN CONFIG:
RUN_NAME='unofficial_single_gpu_run',
RUN_DESCRIPTION='Default run on GPU, 10GB of VRAM needed for this.',
RUNS_FOLDER_PTH='../runs',
# DATA CONFIG:
DATASET_SIZE=300000,
TEST_PROPORTION=0.001,
MAX_SEQ_LEN=40,
VOCAB_SIZE=60000,
TOKENIZER_TYPE='wordlevel', # 'wordlevel' or 'bpe
# TRAINING CONFIG:
BATCH_SIZE=48,
GRAD_ACCUMULATION_STEPS=2048//48,
WORKER_COUNT=10,
EPOCHS=100,
# OPTIMIZER CONFIG:
BETAS=(0.9, 0.98),
EPS=1e-9,
# SCHEDULER CONFIG:
N_WARMUP_STEPS=4000,
# MODEL CONFIG:
D_MODEL=512,
N_BLOCKS=6,
N_HEADS=8,
D_FF=2048,
DROPOUT_PROBA=0.1,
# OTHER:
MODEL_SAVE_EPOCH_CNT=10,
DEVICE='gpu',
LABEL_SMOOTHING=0.1,
)
unofficial_overfit_single_gpu_config=dict(
# RUN CONFIG:
RUN_NAME='unofficial_overfit_gpu_run',
RUN_DESCRIPTION="""
This run is for testing can the model overfit a single example.
This is useful when debugging.
For better results change the scheduler in train.py.
""",
RUNS_FOLDER_PTH='../runs',
# DATA CONFIG:
DATASET_SIZE=2,
TEST_PROPORTION=0.5,
MAX_SEQ_LEN=100,
VOCAB_SIZE=100,
TOKENIZER_TYPE='wordlevel', # 'wordlevel' or 'bpe
# TRAINING CONFIG:
BATCH_SIZE=1,
GRAD_ACCUMULATION_STEPS=1,
WORKER_COUNT=10,
EPOCHS=1000,
# OPTIMIZER CONFIG:
BETAS=(0.9, 0.98),
EPS=1e-9,
# SCHEDULER CONFIG:
N_WARMUP_STEPS=4000,
D_MODEL=512,
N_BLOCKS=6,
N_HEADS=8,
D_FF=2048,
DROPOUT_PROBA=0.1,
# OTHER:
MODEL_SAVE_EPOCH_CNT=1000,
DEVICE='gpu',
LABEL_SMOOTHING=0.1,
)
unofficial_overfit_cpu_config=dict(
# RUN CONFIG:
RUN_NAME='unofficial_overfit_cpu_run',
RUN_DESCRIPTION="""
This run is for testing can the model overfit a single example.
It is useful when debugging.
For better results change the scheduler in train.py.
""",
RUNS_FOLDER_PTH='../runs',
# DATA CONFIG:
DATASET_SIZE=2,
TEST_PROPORTION=0.5,
MAX_SEQ_LEN=100,
VOCAB_SIZE=100,
TOKENIZER_TYPE='wordlevel', # 'wordlevel' or 'bpe
# TRAINING CONFIG:
BATCH_SIZE=1,
GRAD_ACCUMULATION_STEPS=1,
WORKER_COUNT=10,
EPOCHS=1000,
# OPTIMIZER CONFIG:
BETAS=(0.9, 0.98),
EPS=1e-9,
# SCHEDULER CONFIG:
N_WARMUP_STEPS=4000,
# MODEL CONFIG:
D_MODEL=512,
N_BLOCKS=6,
N_HEADS=8,
D_FF=2048,
DROPOUT_PROBA=0.1,
# OTHER:
MODEL_SAVE_EPOCH_CNT=1000,
DEVICE='cpu',
LABEL_SMOOTHING=0.1,
)
configs={
'unofficial_single_gpu_config': unofficial_single_gpu_config,
'unofficial_overfit_single_gpu_config': unofficial_overfit_single_gpu_config,
'unofficial_overfit_cpu_config': unofficial_overfit_cpu_config,
} | 25.459459 | 81 | 0.662774 | 392 | 2,826 | 4.487245 | 0.255102 | 0.077317 | 0.051165 | 0.05685 | 0.876634 | 0.836839 | 0.836839 | 0.836839 | 0.742467 | 0.691302 | 0 | 0.068109 | 0.231069 | 2,826 | 111 | 82 | 25.459459 | 0.741371 | 0.121019 | 0 | 0.704545 | 0 | 0 | 0.256806 | 0.069078 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
368fe3f15ca9bdf692bc2e254f52f291bddf21aa | 4,616 | py | Python | dateparser/data/numeral_translation_data/is.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 8 | 2019-11-15T21:00:15.000Z | 2021-12-21T22:09:42.000Z | dateparser/data/numeral_translation_data/is.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 9 | 2020-06-05T21:28:57.000Z | 2022-02-12T12:30:39.000Z | dateparser/data/numeral_translation_data/is.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 21 | 2019-03-11T04:25:23.000Z | 2022-02-03T08:54:33.000Z | # -*- coding: utf-8 -*-
info = {
"%spellout-cardinal-feminine": {
"0": "núll;",
"1": "ein;",
"2": "tvær;",
"3": "þrjár;",
"4": "fjórar;",
"(5, 19)": "=%spellout-cardinal-masculine=;",
"(20, 29)": "tuttugu[ og >>];",
"(30, 39)": "þrjátíu[ og >>];",
"(40, 49)": "fjörutíu[ og >>];",
"(50, 59)": "fimmtíu[ og >>];",
"(60, 69)": "sextíu[ og >>];",
"(70, 79)": "sjötíu[ og >>];",
"(80, 89)": "áttatíu[ og >>];",
"(90, 99)": "níutíu[ og >>];",
"(100, 999)": "<%spellout-cardinal-neuter<hundrað[ og >>];",
"(1000, 999999)": "<%spellout-cardinal-neuter< þúsund[ og >>];",
"(1000000, 1999999)": "ein millión[ og >>];",
"(2000000, 999999999)": "<%spellout-cardinal-feminine< milliónur[ og >>];",
"(1000000000, 1999999999)": "ein milliarð[ og >>];",
"(2000000000, 999999999999)": "<%spellout-cardinal-feminine< milliarður[ og >>];",
"(1000000000000, 1999999999999)": "ein billión[ og >>];",
"(2000000000000, 999999999999999)": "<%spellout-cardinal-feminine< billiónur[ og >>];",
"(1000000000000000, 1999999999999999)": "ein billiarð[ og >>];",
"(2000000000000000, 999999999999999999)": "<%spellout-cardinal-feminine< billiarður[ og >>];",
"(1000000000000000000, 'inf')": "=#,##0.#=;"
},
"%spellout-cardinal-masculine": {
"0": "núll;",
"1": "einn;",
"2": "tveir;",
"3": "þrír;",
"4": "fjórir;",
"5": "fimm;",
"6": "sex;",
"7": "sjó;",
"8": "átta;",
"9": "níu;",
"10": "tíu;",
"11": "ellefu;",
"12": "tólf;",
"13": "þrettán;",
"14": "fjórtán;",
"15": "fimmtán;",
"16": "sextán;",
"17": "sautján;",
"18": "átján;",
"19": "nítján;",
"(20, 29)": "tuttugu[ og >>];",
"(30, 39)": "þrjátíu[ og >>];",
"(40, 49)": "fjörutíu[ og >>];",
"(50, 59)": "fimmtíu[ og >>];",
"(60, 69)": "sextíu[ og >>];",
"(70, 79)": "sjötíu[ og >>];",
"(80, 89)": "áttatíu[ og >>];",
"(90, 99)": "níutíu[ og >>];",
"(100, 999)": "<%spellout-cardinal-neuter<hundrað[ og >>];",
"(1000, 999999)": "<%spellout-cardinal-neuter< þúsund[ og >>];",
"(1000000, 1999999)": "ein millión[ og >>];",
"(2000000, 999999999)": "<%spellout-cardinal-feminine< milliónur[ og >>];",
"(1000000000, 1999999999)": "ein milliarð[ og >>];",
"(2000000000, 999999999999)": "<%spellout-cardinal-feminine< milliarður[ og >>];",
"(1000000000000, 1999999999999)": "ein billión[ og >>];",
"(2000000000000, 999999999999999)": "<%spellout-cardinal-feminine< billiónur[ og >>];",
"(1000000000000000, 1999999999999999)": "ein billiarð[ og >>];",
"(2000000000000000, 999999999999999999)": "<%spellout-cardinal-feminine< billiarður[ og >>];",
"(1000000000000000000, 'inf')": "=#,##0=;"
},
"%spellout-cardinal-neuter": {
"0": "núll;",
"1": "eitt;",
"2": "tvö;",
"3": "þrjú;",
"4": "fjögur;",
"(5, 19)": "=%spellout-cardinal-masculine=;",
"(20, 29)": "tuttugu[ og >>];",
"(30, 39)": "þrjátíu[ og >>];",
"(40, 49)": "fjörutíu[ og >>];",
"(50, 59)": "fimmtíu[ og >>];",
"(60, 69)": "sextíu[ og >>];",
"(70, 79)": "sjötíu[ og >>];",
"(80, 89)": "áttatíu[ og >>];",
"(90, 99)": "níutíu[ og >>];",
"(100, 999)": "<%spellout-cardinal-neuter<hundrað[ og >>];",
"(1000, 999999)": "<%spellout-cardinal-neuter< þúsund[ og >>];",
"(1000000, 1999999)": "ein millión[ og >>];",
"(2000000, 999999999)": "<%spellout-cardinal-feminine< milliónur[ og >>];",
"(1000000000, 1999999999)": "ein milliarð[ og >>];",
"(2000000000, 999999999999)": "<%spellout-cardinal-feminine< milliarður[ og >>];",
"(1000000000000, 1999999999999)": "ein billión[ og >>];",
"(2000000000000, 999999999999999)": "<%spellout-cardinal-feminine< billiónur[ og >>];",
"(1000000000000000, 1999999999999999)": "ein billiarð[ og >>];",
"(2000000000000000, 999999999999999999)": "<%spellout-cardinal-feminine< billiarður[ og >>];",
"(1000000000000000000, 'inf')": "=#,##0=;"
},
"%spellout-numbering": {
"(0, 'inf')": "=%spellout-cardinal-masculine=;"
},
"%spellout-numbering-year": {
"(0, 9999)": "=%spellout-numbering=;",
"(10000, 'inf')": "=%spellout-numbering=;"
}
} | 43.961905 | 102 | 0.475303 | 395 | 4,616 | 5.562025 | 0.298734 | 0.174784 | 0.142012 | 0.017751 | 0.845244 | 0.845244 | 0.845244 | 0.845244 | 0.845244 | 0.845244 | 0 | 0.243888 | 0.255633 | 4,616 | 105 | 103 | 43.961905 | 0.394645 | 0.004549 | 0 | 0.586538 | 0 | 0 | 0.659774 | 0.183065 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
36a551bf37c944af122c8c54580d6565ac4a6194 | 52 | py | Python | pycollector/ap_hw_ids.py | yiannisy/behop-misc | 75290bafaa1acc312a0d9eea06ddeb1d94cf48da | [
"MIT"
] | null | null | null | pycollector/ap_hw_ids.py | yiannisy/behop-misc | 75290bafaa1acc312a0d9eea06ddeb1d94cf48da | [
"MIT"
] | null | null | null | pycollector/ap_hw_ids.py | yiannisy/behop-misc | 75290bafaa1acc312a0d9eea06ddeb1d94cf48da | [
"MIT"
] | null | null | null |
def ap_hw_ids():
return [\
'0024015fa272'\
]
| 8.666667 | 17 | 0.576923 | 6 | 52 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25641 | 0.25 | 52 | 5 | 18 | 10.4 | 0.461538 | 0 | 0 | 0 | 0 | 0 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0 | 0.25 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 7 |
36f040082d335f2bbf540f49d5bbfe76b75e3f46 | 5,039 | py | Python | dm_page/migrations/0068_auto_20210916_1251.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0068_auto_20210916_1251.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0068_auto_20210916_1251.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-09-16 12:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dm_page', '0067_auto_20210916_1103'),
]
operations = [
migrations.DeleteModel(
name='Image',
),
migrations.AddField(
model_name='paramètre',
name='donation_type_10',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation_type10', to='dm_page.donationtype', verbose_name='Type de don'),
),
migrations.AddField(
model_name='paramètre',
name='donation_type_6',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation_type6', to='dm_page.donationtype', verbose_name='Type de don'),
),
migrations.AddField(
model_name='paramètre',
name='donation_type_7',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation_type7', to='dm_page.donationtype', verbose_name='Type de don'),
),
migrations.AddField(
model_name='paramètre',
name='donation_type_8',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation_type8', to='dm_page.donationtype', verbose_name='Type de don'),
),
migrations.AddField(
model_name='paramètre',
name='donation_type_9',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation_type9', to='dm_page.donationtype', verbose_name='Type de don'),
),
migrations.AddField(
model_name='paramètre',
name='institut_image',
field=models.FileField(blank=True, null=True, upload_to=''),
),
migrations.AddField(
model_name='paramètre',
name='institut_post_code',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='institut_street_name',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='institut_title',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='institut_town',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='object_description',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='paramètre',
name='object_title',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='organisation_10',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organisation10', to='dm_page.organisation', verbose_name='Organisation'),
),
migrations.AddField(
model_name='paramètre',
name='organisation_6',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organisation6', to='dm_page.organisation', verbose_name='Organisation'),
),
migrations.AddField(
model_name='paramètre',
name='organisation_7',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organisation7', to='dm_page.organisation', verbose_name='Organisation'),
),
migrations.AddField(
model_name='paramètre',
name='organisation_8',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organisation8', to='dm_page.organisation', verbose_name='Organisation'),
),
migrations.AddField(
model_name='paramètre',
name='organisation_9',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organisation9', to='dm_page.organisation', verbose_name='Organisation'),
),
migrations.AddField(
model_name='paramètre',
name='president',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='paramètre',
name='president_signature',
field=models.FileField(blank=True, null=True, upload_to=''),
),
]
| 44.59292 | 192 | 0.628101 | 547 | 5,039 | 5.583181 | 0.14808 | 0.111984 | 0.143091 | 0.167976 | 0.87721 | 0.87721 | 0.87721 | 0.84905 | 0.832024 | 0.782908 | 0 | 0.019251 | 0.24747 | 5,039 | 112 | 193 | 44.991071 | 0.786129 | 0.00893 | 0 | 0.622642 | 1 | 0 | 0.188702 | 0.004607 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.018868 | 0 | 0.04717 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
3d36022a1d5b6342bc23fa08c8b6f3447762e282 | 1,114 | py | Python | tests/dataset/dataset_test.py | tanakafwd/shinra_2019 | 9bf60e776fa96b030e1bee40300326001104e11c | [
"MIT"
] | null | null | null | tests/dataset/dataset_test.py | tanakafwd/shinra_2019 | 9bf60e776fa96b030e1bee40300326001104e11c | [
"MIT"
] | 4 | 2021-03-31T19:33:45.000Z | 2021-11-12T01:00:59.000Z | tests/dataset/dataset_test.py | tanakafwd/shinra_2019 | 9bf60e776fa96b030e1bee40300326001104e11c | [
"MIT"
] | null | null | null | import shinra.dataset.dataset as d
def test_get_page_id_from_file_path():
assert d.get_page_id_from_file_path('12345.html') == 12345
assert d.get_page_id_from_file_path('12345.txt') == 12345
assert d.get_page_id_from_file_path('12345.json.gz') == 12345
assert d.get_page_id_from_file_path('/tmp/12345.html') == 12345
assert d.get_page_id_from_file_path('/tmp/12345.txt') == 12345
assert d.get_page_id_from_file_path('/tmp/12345.json.gz') == 12345
def test_get_category_from_dir_path():
assert d.get_category_from_dir_path('') is None
assert d.get_category_from_dir_path('/tmp/Airport') == 'Airport'
assert d.get_category_from_dir_path('/tmp/Unknown') is None
assert d.get_category_from_dir_path('/tmp/Airport/HTML') == 'Airport'
assert d.get_category_from_dir_path('/tmp/Unknown/HTML') is None
assert d.get_category_from_dir_path('tmp/Airport') == 'Airport'
assert d.get_category_from_dir_path('tmp/Unknown') is None
assert d.get_category_from_dir_path('tmp/Airport/HTML') == 'Airport'
assert d.get_category_from_dir_path('tmp/Unknown/HTML') is None
| 48.434783 | 73 | 0.754937 | 189 | 1,114 | 4.042328 | 0.137566 | 0.137435 | 0.196335 | 0.235602 | 0.921466 | 0.89267 | 0.865183 | 0.827225 | 0.827225 | 0.790576 | 0 | 0.0611 | 0.118492 | 1,114 | 22 | 74 | 50.636364 | 0.716904 | 0 | 0 | 0 | 0 | 0 | 0.196589 | 0 | 0 | 0 | 0 | 0 | 0.833333 | 1 | 0.111111 | true | 0 | 0.055556 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
3d45846b028134b3f7d35f7d18592389e8b5db6b | 40,987 | py | Python | fgapiserver_ugr_apis.py | tzok/fgAPIServer | fb8ca2cd7638b962451e24014075f61f41509721 | [
"Apache-2.0"
] | null | null | null | fgapiserver_ugr_apis.py | tzok/fgAPIServer | fb8ca2cd7638b962451e24014075f61f41509721 | [
"Apache-2.0"
] | 1 | 2020-11-29T10:00:51.000Z | 2020-11-29T10:27:06.000Z | fgapiserver_ugr_apis.py | tzok/fgAPIServer | fb8ca2cd7638b962451e24014075f61f41509721 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015:
# Istituto Nazionale di Fisica Nucleare (INFN), Italy
# Consorzio COMETA (COMETA), Italy
#
# See http://www.infn.it and and http://www.consorzio-cometa.it for details on
# the copyright holders.
#
# 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 flask import request
from flask import Response
from flask import Blueprint
from flask_login import login_required, current_user
from fgapiserver_config import FGApiServerConfig
from fgapiserver_auth import authorize_user
from fgapiserver_tools import check_api_ver,\
get_fgapiserver_db
import os
import sys
import json
import logging
"""
FutureGateway APIServer User, Group and Roles APIs
"""
__author__ = 'Riccardo Bruno'
__copyright__ = '2019'
__license__ = 'Apache'
__version__ = 'v0.0.10.1'
__maintainer__ = 'Riccardo Bruno'
__email__ = 'riccardo.bruno@ct.infn.it'
__status__ = 'devel'
__update__ = '2019-10-18 15:19:14'
# setup path
fgapirundir = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
# fgapiserver configuration file
fgapiserver_config_file = fgapirundir + 'fgapiserver.conf'
# Load configuration
fg_config = FGApiServerConfig(fgapiserver_config_file)
# Logging
logging.config.fileConfig(fg_config['fgapisrv_logcfg'])
# Define Blueprint for user groups and roles APIs
ugr_apis = Blueprint('ugr_apis', __name__, template_folder='templates')
# Get the database object
fgapisrv_db = get_fgapiserver_db()
@ugr_apis.route('/<apiver>/users', methods=['GET', 'POST'])
@login_required
def users(apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('users(%s): %s' % (request.method,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_view")
if auth_state is True:
user_record = fgapisrv_db.users_retrieve()
status = 200
response = {"users": user_record}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_change")
if auth_state is True:
params = request.get_json()
logging.debug("params: '%s'" % params)
new_users = []
if params is not None:
user_records = params.get('users', [])
for user_data in user_records:
user_record = fgapisrv_db.user_create(user_data)
if user_record is not None:
new_users.append(user_record)
if new_users is not []:
status = 201
response = {"users": new_users}
else:
status = 400
response = {
'message': 'Unable to create user(s) \'%s\''
% user_records
}
else:
status = 400
response = {
'message': 'Missing userdata'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg
}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/users/<user>', methods=['GET', 'POST'])
@login_required
def users_user(user, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('users(%s)/%s: %s' % (request.method,
user,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_view")
if auth_state is True:
if fgapisrv_db.user_exists(user):
user_record = fgapisrv_db.user_retrieve(user)
status = 200
response = user_record
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_change")
if auth_state is True:
if fgapisrv_db.user_exists(user):
user_record = fgapisrv_db.user_retrieve(user)
status = 200
response = user_record
else:
params = request.get_json()
logging.debug("params: '%s'" % params)
if params is not None:
user_data = {
'first_name': params.get('first_name', ''),
'last_name': params.get('last_name', ''),
'name': user,
'institute': params.get('institute', ''),
'mail': params.get('mail', ''),
}
user_record = fgapisrv_db.user_create(user_data)
if user_record is not None:
status = 201
response = user_record
else:
status = 400
response = {
'message': 'Unable to create user \'%s\''
% user
}
else:
status = 400
response = {
'message': 'Missing userdata'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/users/<user>/groups',
methods=['GET', 'POST', 'DELETE'])
@login_required
def user_groups(user, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('user_groups(%s)/%s: %s' % (request.method,
user,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_groups_view")
if auth_state is True:
if fgapisrv_db.user_exists(user):
group_list = fgapisrv_db.user_groups_retrieve(user)
status = 200
response = {'groups': group_list}
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_groups_change")
if auth_state is True:
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
params = request.get_json()
logging.debug("params: '%s'" % params)
if params is not None:
group_list = params.get('groups', [])
inserted_groups =\
fgapisrv_db.add_user_groups(user, group_list)
if inserted_groups is not None:
status = 201
response = {'groups': inserted_groups}
else:
status = 400
response = {
'message':
('Unable to assign groups %s '
'to user \'%s\'') %
(group_list, user)
}
else:
status = 400
response = {
'message': 'Missing groups'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'DELETE':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_groups_change")
if auth_state is True:
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
params = request.get_json()
logging.debug("params: '%s'" % params)
if params is not None:
group_list = params.get('groups', [])
deleted_groups =\
fgapisrv_db.delete_user_groups(user, group_list)
if deleted_groups is not None:
status = 200
response = {'groups': deleted_groups}
else:
status = 400
response = {
'message':
('Unable to delete groups %s'
' to user \'%s\'') %
(group_list, user)
}
else:
status = 400
response = {
'message': 'Missing groups'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/users/<user>/tasks', methods=['GET', ])
@login_required
def user_tasks(user, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('user_tasks(%s)/%s: %s' % (request.method,
user,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
application = request.values.get('application')
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_tasks_view")
if auth_state is True:
if fgapisrv_db.user_exists(user):
tasks_list = []
user_task_ids =\
fgapisrv_db.user_tasks_retrieve(user, application)
for task_id in user_task_ids:
task_record = fgapisrv_db.get_task_record(task_id)
tasks_list += [task_record, ]
status = 200
response = {'tasks': tasks_list}
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route(
'/<apiver>/users/<user>/tasks/<task_id>', methods=['GET', ])
@login_required
def user_tasks_id(user, task_id, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('user_tasks(%s)/%s: %s' % (request.method,
user,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "users_tasks_view")
if auth_state is True:
if fgapisrv_db.user_exists(user):
response = fgapisrv_db.get_task_record(task_id)
status = 200
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/users/<user>/data',
methods=['GET', 'POST', 'DELETE', 'PATCH'])
@login_required
def users_user_data(user, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('user_data(%s)/%s: %s' % (request.method,
user,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
if fgapisrv_db.user_exists(user):
data = fgapisrv_db.user_data(user)
status = 200
response = {'data': data}
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
elif request.method == 'POST':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = request.get_json()
logging.debug("data: '%s'" % data)
if data is not None:
data_entries = data.get('data', [])
inserted_data =\
fgapisrv_db.add_user_data(user, data_entries)
if inserted_data is not None:
status = 201
response = {'data': inserted_data}
else:
status = 400
response = {
'message':
('Unable to add data %s '
'to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
elif request.method == 'DELETE':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = request.get_json()
logging.debug("data: '%s'" % data)
if data is not None:
data_entries = data.get('data', [])
deleted_data =\
fgapisrv_db.delete_user_data(user, data_entries)
if deleted_data is not None:
status = 201
response = {'data': deleted_data}
else:
status = 400
response = {
'message':
('Unable to delete data %s'
' to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
elif request.method == 'PATCH':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = request.get_json()
logging.debug("data: '%s'" % data)
if data is not None:
data_entries = data.get('data', [])
modified_data =\
fgapisrv_db.modify_user_data(user, data_entries)
if modified_data is not None:
status = 201
response = {'data': modified_data}
else:
status = 400
response = {
'message':
('Unable to modify data %s'
' to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/users/<user>/data/<data_name>',
methods=['GET', 'POST', 'DELETE', 'PATCH'])
@login_required
def users_user_data_name(user, data_name, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('user_data_name(%s, %s)/%s: %s'
% (request.method,
user,
data_name,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user)
if request.method == 'GET':
if fgapisrv_db.user_exists(user):
data = fgapisrv_db.user_data_name(user, data_name)
status = 200
response = data
else:
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
elif request.method == 'POST':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = request.get_json()
data['data_name'] = data_name
if data is not None:
data_entries = [data, ]
inserted_data =\
fgapisrv_db.add_user_data(user, data_entries)
if inserted_data is not None:
status = 201
response = inserted_data[0]
else:
status = 400
response = {
'message':
('Unable to add data %s '
'to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
elif request.method == 'DELETE':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = {'data_name': data_name}
if data is not None:
data_entries = [data, ]
deleted_data =\
fgapisrv_db.delete_user_data(user, data_entries)
if deleted_data is not None:
status = 201
response = deleted_data[0]
else:
status = 400
response = {
'message':
('Unable to delete data %s'
' to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
elif request.method == 'PATCH':
if not fgapisrv_db.user_exists(user):
status = 404
response = {
'message': 'User \'%s\' does not exists' % user
}
else:
data = request.get_json()
data['data_name'] = data_name
logging.debug("data: '%s'" % data)
if data is not None:
data_entries = [data, ]
modified_data =\
fgapisrv_db.modify_user_data(user, data_entries)
if modified_data is not None:
status = 201
response = modified_data[0]
else:
status = 400
response = {
'message':
('Unable to modify data %s'
' to user \'%s\'') %
(data_entries, user)
}
else:
status = 400
response = {
'message': 'Missing data'
}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/groups', methods=['GET', 'POST'])
@login_required
def groups(apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('groups(%s): %s' % (request.method,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_view")
if auth_state is True:
group_list = fgapisrv_db.groups_retrieve()
status = 200
response = {'groups': group_list}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_change")
if auth_state is True:
params = request.get_json()
if params is not None:
logging.debug("params: '%s'" % params)
group_name = params.get('name', '')
new_group = fgapisrv_db.group_add(group_name)
if new_group is not None:
status = 201
response = new_group
else:
status = 400
response = {
'message':
'Unable to create group: \'%s\'' % group_name
}
else:
status = 400
response = {
'message': 'Missing group'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/groups/<group>', methods=['GET', 'POST'])
@login_required
def groups_group(group, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('groups_group(%s)/%s: %s' % (request.method,
group,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_view")
if auth_state is True:
group_info = fgapisrv_db.group_retrieve(group)
if group_info is not None:
status = 200
response = group_info
else:
status = 404
response = {
'message': 'No groups found with name or id: %s'
% group}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
status = 404
response = {"message": "Not yet implemented"}
else:
status = 404
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/groups/<group>/apps', methods=['GET', 'POST'])
@login_required
def groups_group_apps(group, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('groups_group_apps(%s)/%s: %s' % (request.method,
group,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_apps_view")
if auth_state is True:
group_apps_info = fgapisrv_db.group_apps_retrieve(group)
if group_apps_info is not None:
status = 200
response = group_apps_info
else:
status = 404
response = {
'message':
('No applications found for group having name '
'or id: %s' % group)}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_apps_change")
if auth_state is True:
params = request.get_json()
if params is not None:
logging.debug("params: '%s'" % params)
app_ids = params.get('applications', [])
new_ids = fgapisrv_db.group_apps_add(group, app_ids)
if new_ids is not []:
status = 201
response = {'applications': new_ids}
else:
status = 400
response = {
'message':
('Unable to associate applications \'%s\' '
'to the group: \'%s\'' % (app_ids,
group))
}
else:
status = 400
response = {
'message': 'Missing group'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/groups/<group>/roles', methods=['GET', 'POST'])
@login_required
def groups_group_roles(group, apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('groups_group_roles(%s)/%s: %s' % (request.method,
group,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_roles_view")
if auth_state is True:
group_roles_info = fgapisrv_db.group_roles_retrieve(group)
if group_roles_info is not None:
status = 200
response = group_roles_info
else:
status = 404
response = {
'message': ('No roles found for group having name or '
'id: %s' % group)}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
elif request.method == 'POST':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "groups_roles_change")
if auth_state is True:
params = request.get_json()
if params is not None:
logging.debug("params: '%s'" % params)
role_ids = params.get('roles', [])
new_roles = fgapisrv_db.group_roles_add(group, role_ids)
if new_roles is not []:
status = 201
response = {'roles': new_roles}
else:
status = 400
response = {
'message':
('Unable to add roles: \'%s\' '
'to the group: \'%s\'' % (role_ids,
group))
}
else:
status = 400
response = {
'message': 'Missing group'
}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
@ugr_apis.route('/<apiver>/roles', methods=['GET', ])
@login_required
def roles(apiver=fg_config['fgapiver']):
global fgapisrv_db
logging.debug('groups(%s): %s' % (request.method,
request.values.to_dict()))
api_support, state, message = check_api_ver(apiver)
if not api_support:
status = 400
response = {"message": message}
else:
user_name = current_user.get_name()
user_id = current_user.get_id()
logging.debug("user_name: '%s'" % user_name)
logging.debug("user_id: '%s'" % user_id)
user = request.values.get('user', user_name)
if request.method == 'GET':
auth_state, auth_msg = \
authorize_user(current_user, None, user, "roles_view")
if auth_state is True:
role_list = fgapisrv_db.roles_retrieve()
status = 200
response = {'roles': role_list}
else:
status = 402
response = {
"message": "Not authorized to perform this request:\n%s" %
auth_msg}
else:
status = 400
response = {"message": "Unhandled method: '%s'" % request.method}
logging.debug('message: %s' % response.get('message', 'success'))
js = json.dumps(response, indent=fg_config['fgjson_indent'])
resp = Response(js, status=status, mimetype='application/json')
resp.headers['Content-type'] = 'application/json'
return resp
| 40.946054 | 79 | 0.467587 | 3,864 | 40,987 | 4.770704 | 0.0603 | 0.069166 | 0.045188 | 0.063795 | 0.844418 | 0.834111 | 0.821797 | 0.793913 | 0.767929 | 0.765759 | 0 | 0.015775 | 0.430844 | 40,987 | 1,000 | 80 | 40.987 | 0.774434 | 0.021665 | 0 | 0.786868 | 0 | 0 | 0.140651 | 0.008547 | 0 | 0 | 0 | 0 | 0 | 1 | 0.012917 | false | 0 | 0.011841 | 0 | 0.037675 | 0.002153 | 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 |
1801e2096465adab5cc0ab2dd480011457375211 | 12,902 | py | Python | tests/test_x_forwarded.py | stj/aiohttp-remotes | 7aa1a24c4dcde2e5be9f7df8b8d9d2d7c61177da | [
"MIT"
] | 79 | 2017-12-18T13:15:11.000Z | 2022-02-24T13:06:20.000Z | tests/test_x_forwarded.py | stj/aiohttp-remotes | 7aa1a24c4dcde2e5be9f7df8b8d9d2d7c61177da | [
"MIT"
] | 271 | 2017-12-18T15:57:38.000Z | 2022-03-25T03:20:15.000Z | tests/test_x_forwarded.py | stj/aiohttp-remotes | 7aa1a24c4dcde2e5be9f7df8b8d9d2d7c61177da | [
"MIT"
] | 16 | 2017-12-29T14:51:14.000Z | 2022-03-11T19:54:41.000Z | from typing import Awaitable, Callable
import pytest
from aiohttp import web
from aiohttp.test_utils import TestClient
from aiohttp_remotes import (
XForwardedFiltered,
XForwardedRelaxed,
XForwardedStrict,
setup as _setup,
)
_Client = Callable[[web.Application], Awaitable[TestClient]]
async def test_x_forwarded_relaxed_ok(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedRelaxed())
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10",
"X-Forwarded-Proto": "https",
"X-Forwarded-Host": "example.com",
},
)
assert resp.status == 200
async def test_x_forwarded_relaxed_no_forwards(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
url = cl.make_url("/")
assert url.host is not None
assert url.port is not None
host = url.host + ":" + str(url.port)
assert request.host == host
assert request.scheme == "http"
assert not request.secure
assert request.remote == "127.0.0.1"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedRelaxed())
cl = await aiohttp_client(app)
resp = await cl.get("/")
assert resp.status == 200
async def test_x_forwarded_relaxed_multiple_for(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedRelaxed())
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers=[
("X-Forwarded-For", "10.10.10.10"),
("X-Forwarded-For", "20.20.20.20"),
("X-Forwarded-Proto", "https"),
("X-Forwarded-Host", "example.com"),
],
)
assert resp.status == 400
async def test_x_forwarded_relaxed_multiple_proto(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedRelaxed())
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers=[
("X-Forwarded-For", "10.10.10.10"),
("X-Forwarded-Proto", "http"),
("X-Forwarded-Proto", "https"),
("X-Forwarded-Host", "example.com"),
],
)
assert resp.status == 400
async def test_x_forwarded_relaxed_multiple_host(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedRelaxed())
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers=[
("X-Forwarded-For", "10.10.10.10"),
("X-Forwarded-Proto", "http"),
("X-Forwarded-Host", "example.org"),
("X-Forwarded-Host", "example.com"),
],
)
assert resp.status == 400
async def test_x_forwarded_filtered_ok(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered(["11.0.0.0/8"]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10, 11.11.11.11",
"X-Forwarded-Proto": "https, http",
"X-Forwarded-Host": "example.com",
},
)
assert resp.status == 200
def test_x_forwarded_filtered_invalid_config() -> None:
for invalid in ("127.0.0.1", "10.0.0.0/8", 42):
with pytest.raises(TypeError):
XForwardedFiltered(invalid) # type: ignore
async def test_x_forwarded_filtered_no_forwards(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
url = cl.make_url("/")
assert url.host is not None
assert url.port is not None
host = url.host + ":" + str(url.port)
assert request.host == host
assert request.scheme == "http"
assert not request.secure
assert request.remote == "127.0.0.1"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered(["127.0.0.1"]))
cl = await aiohttp_client(app)
resp = await cl.get("/")
assert resp.status == 200
async def test_x_forwarded_filtered_all_filtered(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered({"10.0.0.0/8"}))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10, 10.0.0.1",
"X-Forwarded-Proto": "https, http",
"X-Forwarded-Host": "example.com",
},
)
assert resp.status == 200
async def test_x_forwarded_filtered_one_proto(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered({"11.11.11.11"}))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10, 11.11.11.11",
"X-Forwarded-Proto": "https",
"X-Forwarded-Host": "example.com",
},
)
assert resp.status == 200
async def test_x_forwarded_filtered_no_proto_or_host(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
url = cl.make_url("/")
assert url.host is not None
assert url.port is not None
host = url.host + ":" + str(url.port)
assert request.host == host
assert request.scheme == "http"
assert not request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered({"11.11.11.11"}))
cl = await aiohttp_client(app)
resp = await cl.get("/", headers={"X-Forwarded-For": "10.10.10.10, 11.11.11.11"})
assert resp.status == 200
async def test_x_forwarded_filtered_too_many_headers(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedFiltered({"10.0.0.0/8"}))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers=[
("X-Forwarded-For", "10.10.10.10"),
("X-Forwarded-Proto", "https"),
("X-Forwarded-Proto", "http"),
("X-Forwarded-Host", "example.com"),
],
)
assert resp.status == 400
async def test_x_forwarded_strict_ok(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10",
"X-Forwarded-Proto": "https",
"X-Forwarded-Host": "example.com",
},
)
assert resp.status == 200
async def test_x_forwarded_strict_no_proto(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "http"
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={"X-Forwarded-For": "10.10.10.10", "X-Forwarded-Host": "example.com"},
)
assert resp.status == 200
async def test_x_forwarded_strict_no_host(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host.startswith("127.0.0.1:")
assert request.scheme == "https"
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/", headers={"X-Forwarded-For": "10.10.10.10", "X-Forwarded-Proto": "https"}
)
assert resp.status == 200
async def test_x_forwarded_strict_too_many_headers(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.host == "example.com"
assert request.scheme == "https"
assert request.secure
assert request.remote == "10.10.10.10"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers=[
("X-Forwarded-For", "10.10.10.10"),
("X-Forwarded-Proto", "https"),
("X-Forwarded-Proto", "http"),
("X-Forwarded-Host", "example.com"),
],
)
assert resp.status == 400
async def test_x_forwarded_strict_too_many_protos(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get(
"/",
headers={
"X-Forwarded-For": "10.10.10.10",
"X-Forwarded-Proto": "https, http, https",
},
)
assert resp.status == 400
async def test_x_forwarded_strict_too_many_for(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["127.0.0.1"]]))
cl = await aiohttp_client(app)
resp = await cl.get("/", headers={"X-Forwarded-For": "10.10.10.10, 11.11.11.11"})
assert resp.status == 400
async def test_x_forwarded_strict_untrusted_ip(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["20.20.20.20"]]))
cl = await aiohttp_client(app)
resp = await cl.get("/", headers={"X-Forwarded-For": "10.10.10.10"})
assert resp.status == 400
async def test_x_forwarded_strict_whitelist(aiohttp_client: _Client) -> None:
async def handler(request: web.Request) -> web.Response:
assert request.remote == "127.0.0.1"
return web.Response()
app = web.Application()
app.router.add_get("/", handler)
await _setup(app, XForwardedStrict([["20.20.20.20"]], white_paths=["/"]))
cl = await aiohttp_client(app)
resp = await cl.get("/", headers={"X-Forwarded-For": "10.10.10.10"})
assert resp.status == 200
| 31.778325 | 86 | 0.608665 | 1,622 | 12,902 | 4.715166 | 0.05672 | 0.042887 | 0.043149 | 0.029289 | 0.943515 | 0.938415 | 0.930439 | 0.925209 | 0.923771 | 0.923771 | 0 | 0.045817 | 0.242133 | 12,902 | 405 | 87 | 31.85679 | 0.736347 | 0.00093 | 0 | 0.806647 | 0 | 0 | 0.131673 | 0 | 0 | 0 | 0 | 0 | 0.217523 | 1 | 0.003021 | false | 0 | 0.015106 | 0 | 0.075529 | 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 |
18787ba0af8174619a19319d105b4cfaba0394ea | 6,243 | py | Python | tests/Metrics/test_fbeta.py | earlbabson/torchflare | 15db06d313a53a3ec4640869335ba87730562b28 | [
"Apache-2.0"
] | 1 | 2021-04-28T19:57:57.000Z | 2021-04-28T19:57:57.000Z | tests/Metrics/test_fbeta.py | earlbabson/torchflare | 15db06d313a53a3ec4640869335ba87730562b28 | [
"Apache-2.0"
] | null | null | null | tests/Metrics/test_fbeta.py | earlbabson/torchflare | 15db06d313a53a3ec4640869335ba87730562b28 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
import warnings
import pytest
import torch
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.metrics import f1_score, fbeta_score
from torchflare.metrics.fbeta_meter import F1Score, FBeta, _BaseInputHandler
torch.manual_seed(42)
def test_binary_inputs():
def _test(num_classes, threshold, multilabel, average):
fbeta = FBeta(beta=2.0, num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
f1 = F1Score(num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
outputs = torch.randn(100, 1)
targets = torch.randint(0, 2, size=(100,))
bs = _BaseInputHandler(num_classes=num_classes, average=average, threshold=0.5, multilabel=multilabel,)
np_outputs, np_targets = bs._compute(outputs=outputs, targets=targets)
fbeta.accumulate(outputs=outputs, targets=targets)
f1.accumulate(outputs=outputs, targets=targets)
fbeta_val = fbeta.compute()
f1_val = f1.compute()
assert fbeta.case_type == "binary"
assert f1.case_type == "binary"
fbeta_skm = fbeta_score(np_targets.numpy(), np_outputs.numpy(), average="binary", beta=2.0)
f1_skm = f1_score(np_targets.numpy(), np_outputs.numpy(), average="binary")
assert fbeta_skm == pytest.approx(fbeta_val.item())
assert f1_skm == pytest.approx(f1_val.item())
bs = 16
iters = targets.shape[0] // bs + 1
fbeta.reset()
f1.reset()
for i in range(iters):
idx = i * bs
fbeta.accumulate(outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs])
f1.accumulate(
outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs],
)
f1_m = f1.compute()
fbeta_m = fbeta.compute()
assert f1_skm == pytest.approx(f1_m.item())
assert fbeta_skm == pytest.approx(fbeta_m.item())
for _ in range(10):
_test(num_classes=2, threshold=0.5, multilabel=False, average="macro")
_test(num_classes=2, threshold=0.5, multilabel=False, average="micro")
def test_multiclass_inputs():
def _test(num_classes, threshold, multilabel, average):
fbeta = FBeta(beta=2.0, num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
f1 = F1Score(num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
outputs = torch.randn(100, 4)
targets = torch.randint(0, 4, size=(100,))
bs = _BaseInputHandler(num_classes=num_classes, average=average, threshold=0.5, multilabel=multilabel,)
np_outputs, np_targets = bs._compute(outputs=outputs, targets=targets)
fbeta.accumulate(outputs=outputs, targets=targets)
f1.accumulate(outputs=outputs, targets=targets)
fbeta_val = fbeta.compute()
f1_val = f1.compute()
assert fbeta.case_type == "multiclass"
assert f1.case_type == "multiclass"
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=UndefinedMetricWarning)
fbeta_skm = fbeta_score(np_targets.numpy(), np_outputs.numpy(), average=average, beta=2.0)
f1_skm = f1_score(np_targets.numpy(), np_outputs.numpy(), average=average)
assert fbeta_skm == pytest.approx(fbeta_val.item())
assert f1_skm == pytest.approx(f1_val.item())
bs = 16
iters = targets.shape[0] // bs + 1
fbeta.reset()
f1.reset()
for i in range(iters):
idx = i * bs
fbeta.accumulate(outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs])
f1.accumulate(
outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs],
)
f1_m = f1.compute()
fbeta_m = fbeta.compute()
assert f1_skm == pytest.approx(f1_m.item())
assert fbeta_skm == pytest.approx(fbeta_m.item())
for _ in range(10):
_test(num_classes=4, threshold=0.5, multilabel=False, average="macro")
_test(num_classes=4, threshold=0.5, multilabel=False, average="micro")
def test_multilabel_inputs():
def _test(num_classes, threshold, multilabel, average):
fbeta = FBeta(beta=2.0, num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
f1 = F1Score(num_classes=num_classes, threshold=threshold, multilabel=multilabel, average=average,)
outputs = torch.randn(10, 4)
targets = torch.randint(0, 2, size=(10, 4))
bs = _BaseInputHandler(num_classes=num_classes, average=average, threshold=0.5, multilabel=multilabel,)
np_outputs, np_targets = bs._compute(outputs=outputs, targets=targets)
fbeta.accumulate(outputs=outputs, targets=targets)
f1.accumulate(outputs=outputs, targets=targets)
fbeta_val = fbeta.compute()
f1_val = f1.compute()
assert fbeta.case_type == "multilabel"
assert f1.case_type == "multilabel"
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=UndefinedMetricWarning)
fbeta_skm = fbeta_score(np_targets.numpy(), np_outputs.numpy(), average=average, beta=2.0)
f1_skm = f1_score(np_targets.numpy(), np_outputs.numpy(), average=average)
assert fbeta_skm == pytest.approx(fbeta_val.item())
assert f1_skm == pytest.approx(f1_val.item())
bs = 16
iters = targets.shape[0] // bs + 1
fbeta.reset()
f1.reset()
for i in range(iters):
idx = i * bs
fbeta.accumulate(outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs])
f1.accumulate(
outputs=outputs[idx : idx + bs], targets=targets[idx : idx + bs],
)
f1_m = f1.compute()
fbeta_m = fbeta.compute()
assert f1_skm == pytest.approx(f1_m.item())
assert fbeta_skm == pytest.approx(fbeta_m.item())
for _ in range(10):
_test(num_classes=4, threshold=0.5, multilabel=True, average="macro")
_test(num_classes=4, threshold=0.5, multilabel=True, average="micro")
| 34.114754 | 118 | 0.644722 | 773 | 6,243 | 5.03881 | 0.097025 | 0.06932 | 0.073941 | 0.046213 | 0.906547 | 0.900899 | 0.889089 | 0.889089 | 0.889089 | 0.879846 | 0 | 0.027789 | 0.233381 | 6,243 | 182 | 119 | 34.302198 | 0.786043 | 0.001922 | 0 | 0.715517 | 0 | 0 | 0.017017 | 0 | 0 | 0 | 0 | 0 | 0.155172 | 1 | 0.051724 | false | 0 | 0.051724 | 0 | 0.103448 | 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 |
43f94fa76d67ecc513b398ca3add2726316f5f98 | 369 | py | Python | pychess/Utils/lutils/validator.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | pychess/Utils/lutils/validator.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | 40 | 2019-05-04T04:46:31.000Z | 2022-02-26T10:37:51.000Z | pychess/Utils/lutils/validator.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | from pychess.Utils.lutils.lmovegen import genAllMoves
################################################################################
# Validate move #
################################################################################
def validateMove(board, move):
return move in genAllMoves(board)
| 36.9 | 80 | 0.300813 | 18 | 369 | 6.166667 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.235772 | 369 | 9 | 81 | 41 | 0.393617 | 0.03523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 7 |
a1162ddcaf990a7b67c792f2295e066d7d4cee27 | 178,878 | py | Python | nova/tests/unit/objects/test_instance.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_instance.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_instance.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright 2013 IBM Corp.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
name|'import'
name|'datetime'
newline|'\n'
nl|'\n'
name|'import'
name|'mock'
newline|'\n'
name|'from'
name|'mox3'
name|'import'
name|'mox'
newline|'\n'
name|'import'
name|'netaddr'
newline|'\n'
name|'from'
name|'oslo_db'
name|'import'
name|'exception'
name|'as'
name|'db_exc'
newline|'\n'
name|'from'
name|'oslo_serialization'
name|'import'
name|'jsonutils'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'timeutils'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'cells'
name|'import'
name|'rpcapi'
name|'as'
name|'cells_rpcapi'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'compute'
name|'import'
name|'flavors'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'context'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'db'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'network'
name|'import'
name|'model'
name|'as'
name|'network_model'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'notifications'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'objects'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'base'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'fields'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'instance'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'instance_info_cache'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'pci_device'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'objects'
name|'import'
name|'security_group'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'test'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
name|'import'
name|'fake_instance'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_instance_fault'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_instance_info_cache'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_instance_numa_topology'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_instance_pci_requests'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_migration_context'
name|'as'
name|'test_mig_ctxt'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_objects'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_security_group'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_vcpu_model'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
name|'import'
name|'uuidsentinel'
name|'as'
name|'uuids'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'utils'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|_TestInstanceObject
name|'class'
name|'_TestInstanceObject'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
indent|' '
op|'@'
name|'property'
newline|'\n'
DECL|member|fake_instance
name|'def'
name|'fake_instance'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'db_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'2'
op|','
nl|'\n'
name|'access_ip_v4'
op|'='
string|"'1.2.3.4'"
op|','
nl|'\n'
name|'access_ip_v6'
op|'='
string|"'::1'"
op|')'
newline|'\n'
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|'='
name|'uuids'
op|'.'
name|'db_instance'
newline|'\n'
name|'db_inst'
op|'['
string|"'cell_name'"
op|']'
op|'='
string|"'api!child'"
newline|'\n'
name|'db_inst'
op|'['
string|"'terminated_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'deleted_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'created_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'updated_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'launched_at'"
op|']'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'1955'
op|','
number|'11'
op|','
number|'12'
op|','
nl|'\n'
number|'22'
op|','
number|'4'
op|','
number|'0'
op|')'
newline|'\n'
name|'db_inst'
op|'['
string|"'deleted'"
op|']'
op|'='
name|'False'
newline|'\n'
name|'db_inst'
op|'['
string|"'security_groups'"
op|']'
op|'='
op|'['
op|']'
newline|'\n'
name|'db_inst'
op|'['
string|"'pci_devices'"
op|']'
op|'='
op|'['
op|']'
newline|'\n'
name|'db_inst'
op|'['
string|"'user_id'"
op|']'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
newline|'\n'
name|'db_inst'
op|'['
string|"'project_id'"
op|']'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
newline|'\n'
name|'db_inst'
op|'['
string|"'tags'"
op|']'
op|'='
op|'['
op|']'
newline|'\n'
nl|'\n'
name|'db_inst'
op|'['
string|"'info_cache'"
op|']'
op|'='
name|'dict'
op|'('
name|'test_instance_info_cache'
op|'.'
name|'fake_info_cache'
op|','
nl|'\n'
name|'instance_uuid'
op|'='
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'db_inst'
op|'['
string|"'system_metadata'"
op|']'
op|'='
op|'{'
nl|'\n'
string|"'image_name'"
op|':'
string|"'os2-warp'"
op|','
nl|'\n'
string|"'image_min_ram'"
op|':'
number|'100'
op|','
nl|'\n'
string|"'image_hw_disk_bus'"
op|':'
string|"'ide'"
op|','
nl|'\n'
string|"'image_hw_vif_model'"
op|':'
string|"'ne2k_pci'"
op|','
nl|'\n'
op|'}'
newline|'\n'
name|'return'
name|'db_inst'
newline|'\n'
nl|'\n'
DECL|member|test_datetime_deserialization
dedent|''
name|'def'
name|'test_datetime_deserialization'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'red_letter_date'
op|'='
name|'timeutils'
op|'.'
name|'parse_isotime'
op|'('
nl|'\n'
name|'utils'
op|'.'
name|'isotime'
op|'('
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'1955'
op|','
number|'11'
op|','
number|'5'
op|')'
op|')'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'launched_at'
op|'='
name|'red_letter_date'
op|')'
newline|'\n'
name|'primitive'
op|'='
name|'inst'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
newline|'\n'
name|'expected'
op|'='
op|'{'
string|"'nova_object.name'"
op|':'
string|"'Instance'"
op|','
nl|'\n'
string|"'nova_object.namespace'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'nova_object.version'"
op|':'
name|'inst'
op|'.'
name|'VERSION'
op|','
nl|'\n'
string|"'nova_object.data'"
op|':'
nl|'\n'
op|'{'
string|"'uuid'"
op|':'
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
string|"'launched_at'"
op|':'
string|"'1955-11-05T00:00:00Z'"
op|'}'
op|','
nl|'\n'
string|"'nova_object.changes'"
op|':'
op|'['
string|"'launched_at'"
op|','
string|"'uuid'"
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertJsonEqual'
op|'('
name|'primitive'
op|','
name|'expected'
op|')'
newline|'\n'
name|'inst2'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'obj_from_primitive'
op|'('
name|'primitive'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst2'
op|'.'
name|'launched_at'
op|','
name|'datetime'
op|'.'
name|'datetime'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'red_letter_date'
op|','
name|'inst2'
op|'.'
name|'launched_at'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_ip_deserialization
dedent|''
name|'def'
name|'test_ip_deserialization'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
name|'access_ip_v4'
op|'='
string|"'1.2.3.4'"
op|','
nl|'\n'
name|'access_ip_v6'
op|'='
string|"'::1'"
op|')'
newline|'\n'
name|'primitive'
op|'='
name|'inst'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
newline|'\n'
name|'expected'
op|'='
op|'{'
string|"'nova_object.name'"
op|':'
string|"'Instance'"
op|','
nl|'\n'
string|"'nova_object.namespace'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'nova_object.version'"
op|':'
name|'inst'
op|'.'
name|'VERSION'
op|','
nl|'\n'
string|"'nova_object.data'"
op|':'
nl|'\n'
op|'{'
string|"'uuid'"
op|':'
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
string|"'access_ip_v4'"
op|':'
string|"'1.2.3.4'"
op|','
nl|'\n'
string|"'access_ip_v6'"
op|':'
string|"'::1'"
op|'}'
op|','
nl|'\n'
string|"'nova_object.changes'"
op|':'
op|'['
string|"'uuid'"
op|','
string|"'access_ip_v6'"
op|','
nl|'\n'
string|"'access_ip_v4'"
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertJsonEqual'
op|'('
name|'primitive'
op|','
name|'expected'
op|')'
newline|'\n'
name|'inst2'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'obj_from_primitive'
op|'('
name|'primitive'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst2'
op|'.'
name|'access_ip_v4'
op|','
name|'netaddr'
op|'.'
name|'IPAddress'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst2'
op|'.'
name|'access_ip_v6'
op|','
name|'netaddr'
op|'.'
name|'IPAddress'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'netaddr'
op|'.'
name|'IPAddress'
op|'('
string|"'1.2.3.4'"
op|')'
op|','
name|'inst2'
op|'.'
name|'access_ip_v4'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'netaddr'
op|'.'
name|'IPAddress'
op|'('
string|"'::1'"
op|')'
op|','
name|'inst2'
op|'.'
name|'access_ip_v6'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_without_expected
dedent|''
name|'def'
name|'test_get_without_expected'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'uuid'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'uuid'"
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
op|']'
op|')'
newline|'\n'
name|'for'
name|'attr'
name|'in'
name|'instance'
op|'.'
name|'INSTANCE_OPTIONAL_ATTRS'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
name|'attr'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_with_expected
dedent|''
dedent|''
name|'def'
name|'test_get_with_expected'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_fault_get_by_instance_uuids'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
nl|'\n'
name|'db'
op|','
string|"'instance_extra_get_by_instance_uuid'"
op|')'
newline|'\n'
nl|'\n'
name|'exp_cols'
op|'='
name|'instance'
op|'.'
name|'INSTANCE_OPTIONAL_ATTRS'
op|'['
op|':'
op|']'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'fault'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'numa_topology'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'pci_requests'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'vcpu_model'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'ec2_ids'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'migration_context'"
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'remove'
op|'('
string|"'keypairs'"
op|')'
newline|'\n'
name|'exp_cols'
op|'='
name|'list'
op|'('
name|'filter'
op|'('
name|'lambda'
name|'x'
op|':'
string|"'flavor'"
name|'not'
name|'in'
name|'x'
op|','
name|'exp_cols'
op|')'
op|')'
newline|'\n'
name|'exp_cols'
op|'.'
name|'extend'
op|'('
op|'['
string|"'extra'"
op|','
string|"'extra.numa_topology'"
op|','
string|"'extra.pci_requests'"
op|','
nl|'\n'
string|"'extra.flavor'"
op|','
string|"'extra.vcpu_model'"
op|','
nl|'\n'
string|"'extra.migration_context'"
op|','
string|"'extra.keypairs'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'fake_topology'
op|'='
op|'('
name|'test_instance_numa_topology'
op|'.'
nl|'\n'
name|'fake_db_topology'
op|'['
string|"'numa_topology'"
op|']'
op|')'
newline|'\n'
name|'fake_requests'
op|'='
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
name|'test_instance_pci_requests'
op|'.'
nl|'\n'
name|'fake_pci_requests'
op|')'
newline|'\n'
name|'fake_flavor'
op|'='
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
nl|'\n'
op|'{'
string|"'cur'"
op|':'
name|'objects'
op|'.'
name|'Flavor'
op|'('
op|')'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
op|','
nl|'\n'
string|"'old'"
op|':'
name|'None'
op|','
string|"'new'"
op|':'
name|'None'
op|'}'
op|')'
newline|'\n'
name|'fake_vcpu_model'
op|'='
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
nl|'\n'
name|'test_vcpu_model'
op|'.'
name|'fake_vcpumodel'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
op|')'
newline|'\n'
name|'fake_mig_context'
op|'='
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
nl|'\n'
name|'test_mig_ctxt'
op|'.'
name|'fake_migration_context_obj'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
op|')'
newline|'\n'
name|'fake_keypairlist'
op|'='
name|'objects'
op|'.'
name|'KeyPairList'
op|'('
name|'objects'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'KeyPair'
op|'('
name|'name'
op|'='
string|"'foo'"
op|')'
op|']'
op|')'
newline|'\n'
name|'fake_keypairs'
op|'='
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
nl|'\n'
name|'fake_keypairlist'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
op|')'
newline|'\n'
name|'fake_service'
op|'='
op|'{'
string|"'created_at'"
op|':'
name|'None'
op|','
string|"'updated_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted_at'"
op|':'
name|'None'
op|','
string|"'deleted'"
op|':'
name|'False'
op|','
string|"'id'"
op|':'
number|'123'
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'fake-host'"
op|','
string|"'binary'"
op|':'
string|"'nova-fake'"
op|','
nl|'\n'
string|"'topic'"
op|':'
string|"'fake-service-topic'"
op|','
string|"'report_count'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
string|"'disabled'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|','
string|"'last_seen_up'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'version'"
op|':'
number|'1'
op|','
nl|'\n'
op|'}'
newline|'\n'
name|'fake_instance'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
nl|'\n'
name|'services'
op|'='
op|'['
name|'fake_service'
op|']'
op|','
nl|'\n'
name|'extra'
op|'='
op|'{'
nl|'\n'
string|"'numa_topology'"
op|':'
name|'fake_topology'
op|','
nl|'\n'
string|"'pci_requests'"
op|':'
name|'fake_requests'
op|','
nl|'\n'
string|"'flavor'"
op|':'
name|'fake_flavor'
op|','
nl|'\n'
string|"'vcpu_model'"
op|':'
name|'fake_vcpu_model'
op|','
nl|'\n'
string|"'migration_context'"
op|':'
name|'fake_mig_context'
op|','
nl|'\n'
string|"'keypairs'"
op|':'
name|'fake_keypairs'
op|','
nl|'\n'
op|'}'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
string|"'uuid'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
name|'exp_cols'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_faults'
op|'='
name|'test_instance_fault'
op|'.'
name|'fake_faults'
newline|'\n'
name|'db'
op|'.'
name|'instance_fault_get_by_instance_uuids'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'['
name|'fake_instance'
op|'['
string|"'uuid'"
op|']'
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_faults'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
string|"'uuid'"
op|','
nl|'\n'
name|'expected_attrs'
op|'='
name|'instance'
op|'.'
name|'INSTANCE_OPTIONAL_ATTRS'
op|')'
newline|'\n'
name|'for'
name|'attr'
name|'in'
name|'instance'
op|'.'
name|'INSTANCE_OPTIONAL_ATTRS'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
name|'attr'
op|')'
op|')'
newline|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'123'
op|','
name|'inst'
op|'.'
name|'services'
op|'['
number|'0'
op|']'
op|'.'
name|'id'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo'"
op|','
name|'inst'
op|'.'
name|'keypairs'
op|'['
number|'0'
op|']'
op|'.'
name|'name'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_lazy_load_services_on_deleted_instance
dedent|''
name|'def'
name|'test_lazy_load_services_on_deleted_instance'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
comment|'# We should avoid trying to hit the database to reload the instance'
nl|'\n'
comment|'# and just set the services attribute to an empty list.'
nl|'\n'
indent|' '
name|'instance'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'deleted'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'instance'
op|'.'
name|'services'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_by_id
dedent|''
name|'def'
name|'test_get_by_id'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'instid'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_id'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'instid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load
dedent|''
name|'def'
name|'test_load'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'self'
op|'.'
name|'fake_instance'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_inst2'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
nl|'\n'
name|'metadata'
op|'='
op|'['
op|'{'
string|"'key'"
op|':'
string|"'foo'"
op|','
string|"'value'"
op|':'
string|"'bar'"
op|'}'
op|']'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'metadata'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst2'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'hasattr'
op|'('
name|'inst'
op|','
string|"'_obj_metadata'"
op|')'
op|')'
newline|'\n'
name|'meta'
op|'='
name|'inst'
op|'.'
name|'metadata'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'meta'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'hasattr'
op|'('
name|'inst'
op|','
string|"'_obj_metadata'"
op|')'
op|')'
newline|'\n'
comment|"# Make sure we don't run load again"
nl|'\n'
name|'meta2'
op|'='
name|'inst'
op|'.'
name|'metadata'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'meta2'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_invalid
dedent|''
name|'def'
name|'test_load_invalid'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'exception'
op|'.'
name|'ObjectActionError'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'obj_load_attr'
op|','
string|"'foo'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_and_load_keypairs_from_extra
dedent|''
name|'def'
name|'test_create_and_load_keypairs_from_extra'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'keypairs'
op|'='
name|'objects'
op|'.'
name|'KeyPairList'
op|'('
name|'objects'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'KeyPair'
op|'('
name|'name'
op|'='
string|"'foo'"
op|')'
op|']'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'keypairs'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo'"
op|','
name|'inst'
op|'.'
name|'keypairs'
op|'['
number|'0'
op|']'
op|'.'
name|'name'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_lazy_load_keypairs_from_extra
dedent|''
name|'def'
name|'test_lazy_load_keypairs_from_extra'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'keypairs'
op|'='
name|'objects'
op|'.'
name|'KeyPairList'
op|'('
name|'objects'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'KeyPair'
op|'('
name|'name'
op|'='
string|"'foo'"
op|')'
op|']'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'keypairs'"
op|','
name|'inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo'"
op|','
name|'inst'
op|'.'
name|'keypairs'
op|'['
number|'0'
op|']'
op|'.'
name|'name'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'keypairs'"
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.KeyPair.get_by_name'"
op|')'
newline|'\n'
DECL|member|test_lazy_load_keypairs_from_legacy
name|'def'
name|'test_lazy_load_keypairs_from_legacy'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'objects'
op|'.'
name|'KeyPair'
op|'('
name|'name'
op|'='
string|"'foo'"
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'key_name'
op|'='
string|"'foo'"
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'keypairs'"
op|','
name|'inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo'"
op|','
name|'inst'
op|'.'
name|'keypairs'
op|'['
number|'0'
op|']'
op|'.'
name|'name'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIn'
op|'('
string|"'keypairs'"
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'key_name'
op|','
nl|'\n'
name|'localonly'
op|'='
name|'True'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_remote
dedent|''
name|'def'
name|'test_get_remote'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
comment|"# isotime doesn't have microseconds and is always UTC"
nl|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'fake_instance'
op|'='
name|'self'
op|'.'
name|'fake_instance'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_instance'
op|'['
string|"'id'"
op|']'
op|','
name|'inst'
op|'.'
name|'id'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_instance'
op|'['
string|"'launched_at'"
op|']'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'launched_at'
op|'.'
name|'replace'
op|'('
name|'tzinfo'
op|'='
name|'None'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_instance'
op|'['
string|"'access_ip_v4'"
op|']'
op|','
nl|'\n'
name|'str'
op|'('
name|'inst'
op|'.'
name|'access_ip_v4'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_instance'
op|'['
string|"'access_ip_v6'"
op|']'
op|','
nl|'\n'
name|'str'
op|'('
name|'inst'
op|'.'
name|'access_ip_v6'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_refresh
dedent|''
name|'def'
name|'test_refresh'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'self'
op|'.'
name|'fake_instance'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
nl|'\n'
name|'host'
op|'='
string|"'orig-host'"
op|')'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
nl|'\n'
name|'host'
op|'='
string|"'new-host'"
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'instance_info_cache'
op|'.'
name|'InstanceInfoCache'
op|','
nl|'\n'
string|"'refresh'"
op|')'
newline|'\n'
name|'instance_info_cache'
op|'.'
name|'InstanceInfoCache'
op|'.'
name|'refresh'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'orig-host'"
op|','
name|'inst'
op|'.'
name|'host'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'refresh'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'new-host'"
op|','
name|'inst'
op|'.'
name|'host'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|'['
op|']'
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_refresh_does_not_recurse
dedent|''
name|'def'
name|'test_refresh_does_not_recurse'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'metadata'
op|'='
op|'{'
op|'}'
op|')'
newline|'\n'
name|'inst_copy'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
op|')'
newline|'\n'
name|'inst_copy'
op|'.'
name|'uuid'
op|'='
name|'inst'
op|'.'
name|'uuid'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|','
string|"'get_by_uuid'"
op|')'
newline|'\n'
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'inst'
op|'.'
name|'uuid'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'metadata'"
op|']'
op|','
nl|'\n'
name|'use_slave'
op|'='
name|'False'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'inst_copy'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'exception'
op|'.'
name|'OrphanedObjectError'
op|','
name|'inst'
op|'.'
name|'refresh'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_save_test_helper
dedent|''
name|'def'
name|'_save_test_helper'
op|'('
name|'self'
op|','
name|'cell_type'
op|','
name|'save_kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Common code for testing save() for cells/non-cells."""'
newline|'\n'
name|'if'
name|'cell_type'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'enable'
op|'='
name|'True'
op|','
name|'cell_type'
op|'='
name|'cell_type'
op|','
name|'group'
op|'='
string|"'cells'"
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'enable'
op|'='
name|'False'
op|','
name|'group'
op|'='
string|"'cells'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'old_ref'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'host'
op|'='
string|"'oldhost'"
op|','
name|'user_data'
op|'='
string|"'old'"
op|','
nl|'\n'
name|'vm_state'
op|'='
string|"'old'"
op|','
name|'task_state'
op|'='
string|"'old'"
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'old_ref'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
nl|'\n'
name|'expected_updates'
op|'='
name|'dict'
op|'('
name|'vm_state'
op|'='
string|"'meow'"
op|','
name|'task_state'
op|'='
string|"'wuff'"
op|','
nl|'\n'
name|'user_data'
op|'='
string|"'new'"
op|')'
newline|'\n'
nl|'\n'
name|'new_ref'
op|'='
name|'dict'
op|'('
name|'old_ref'
op|','
name|'host'
op|'='
string|"'newhost'"
op|','
op|'**'
name|'expected_updates'
op|')'
newline|'\n'
name|'exp_vm_state'
op|'='
name|'save_kwargs'
op|'.'
name|'get'
op|'('
string|"'expected_vm_state'"
op|')'
newline|'\n'
name|'exp_task_state'
op|'='
name|'save_kwargs'
op|'.'
name|'get'
op|'('
string|"'expected_task_state'"
op|')'
newline|'\n'
name|'admin_reset'
op|'='
name|'save_kwargs'
op|'.'
name|'get'
op|'('
string|"'admin_state_reset'"
op|','
name|'False'
op|')'
newline|'\n'
name|'if'
name|'exp_vm_state'
op|':'
newline|'\n'
indent|' '
name|'expected_updates'
op|'['
string|"'expected_vm_state'"
op|']'
op|'='
name|'exp_vm_state'
newline|'\n'
dedent|''
name|'if'
name|'exp_task_state'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'exp_task_state'
op|'=='
string|"'image_snapshot'"
name|'and'
nl|'\n'
string|"'instance_version'"
name|'in'
name|'save_kwargs'
name|'and'
nl|'\n'
name|'save_kwargs'
op|'['
string|"'instance_version'"
op|']'
op|'=='
string|"'1.9'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'expected_updates'
op|'['
string|"'expected_task_state'"
op|']'
op|'='
op|'['
nl|'\n'
string|"'image_snapshot'"
op|','
string|"'image_snapshot_pending'"
op|']'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'expected_updates'
op|'['
string|"'expected_task_state'"
op|']'
op|'='
name|'exp_task_state'
newline|'\n'
dedent|''
dedent|''
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_update_and_get_original'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_info_cache_update'"
op|')'
newline|'\n'
name|'cells_api_mock'
op|'='
name|'self'
op|'.'
name|'mox'
op|'.'
name|'CreateMock'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'cells_api_mock'
op|','
nl|'\n'
string|"'instance_update_at_top'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'cells_api_mock'
op|','
nl|'\n'
string|"'instance_update_from_api'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'cells_rpcapi'
op|','
string|"'CellsAPI'"
op|','
nl|'\n'
name|'use_mock_anything'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'notifications'
op|','
string|"'send_update'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'old_ref'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_update_and_get_original'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
name|'expected_updates'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
string|"'security_groups'"
op|','
nl|'\n'
string|"'system_metadata'"
op|','
string|"'extra'"
op|','
string|"'extra.flavor'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
op|'('
name|'old_ref'
op|','
name|'new_ref'
op|')'
op|')'
newline|'\n'
name|'if'
name|'cell_type'
op|'=='
string|"'api'"
op|':'
newline|'\n'
indent|' '
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|'('
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'cells_api_mock'
op|')'
newline|'\n'
name|'cells_api_mock'
op|'.'
name|'instance_update_from_api'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'mox'
op|'.'
name|'IsA'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|')'
op|','
nl|'\n'
name|'exp_vm_state'
op|','
name|'exp_task_state'
op|','
name|'admin_reset'
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'cell_type'
op|'=='
string|"'compute'"
op|':'
newline|'\n'
indent|' '
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|'('
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'cells_api_mock'
op|')'
newline|'\n'
name|'cells_api_mock'
op|'.'
name|'instance_update_at_top'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'mox'
op|'.'
name|'IsA'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|')'
op|')'
newline|'\n'
dedent|''
name|'notifications'
op|'.'
name|'send_update'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'mox'
op|'.'
name|'IgnoreArg'
op|'('
op|')'
op|','
nl|'\n'
name|'mox'
op|'.'
name|'IgnoreArg'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'old_ref'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
name|'if'
string|"'instance_version'"
name|'in'
name|'save_kwargs'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'VERSION'
op|'='
name|'save_kwargs'
op|'.'
name|'pop'
op|'('
string|"'instance_version'"
op|')'
newline|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'old'"
op|','
name|'inst'
op|'.'
name|'task_state'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'old'"
op|','
name|'inst'
op|'.'
name|'vm_state'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'old'"
op|','
name|'inst'
op|'.'
name|'user_data'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'vm_state'
op|'='
string|"'meow'"
newline|'\n'
name|'inst'
op|'.'
name|'task_state'
op|'='
string|"'wuff'"
newline|'\n'
name|'inst'
op|'.'
name|'user_data'
op|'='
string|"'new'"
newline|'\n'
name|'save_kwargs'
op|'.'
name|'pop'
op|'('
string|"'context'"
op|','
name|'None'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|'**'
name|'save_kwargs'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'newhost'"
op|','
name|'inst'
op|'.'
name|'host'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'meow'"
op|','
name|'inst'
op|'.'
name|'vm_state'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'wuff'"
op|','
name|'inst'
op|'.'
name|'task_state'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'new'"
op|','
name|'inst'
op|'.'
name|'user_data'
op|')'
newline|'\n'
comment|'# NOTE(danms): Ignore flavor migrations for the moment'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|'['
op|']'
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|'-'
name|'set'
op|'('
op|'['
string|"'flavor'"
op|']'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save
dedent|''
name|'def'
name|'test_save'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
name|'None'
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_in_api_cell
dedent|''
name|'def'
name|'test_save_in_api_cell'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
string|"'api'"
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_in_compute_cell
dedent|''
name|'def'
name|'test_save_in_compute_cell'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
string|"'compute'"
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_exp_vm_state
dedent|''
name|'def'
name|'test_save_exp_vm_state'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
name|'None'
op|','
op|'{'
string|"'expected_vm_state'"
op|':'
op|'['
string|"'meow'"
op|']'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_exp_task_state
dedent|''
name|'def'
name|'test_save_exp_task_state'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
name|'None'
op|','
op|'{'
string|"'expected_task_state'"
op|':'
op|'['
string|"'meow'"
op|']'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_exp_vm_state_api_cell
dedent|''
name|'def'
name|'test_save_exp_vm_state_api_cell'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
string|"'api'"
op|','
op|'{'
string|"'expected_vm_state'"
op|':'
op|'['
string|"'meow'"
op|']'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_exp_task_state_api_cell
dedent|''
name|'def'
name|'test_save_exp_task_state_api_cell'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
string|"'api'"
op|','
op|'{'
string|"'expected_task_state'"
op|':'
op|'['
string|"'meow'"
op|']'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_exp_task_state_api_cell_admin_reset
dedent|''
name|'def'
name|'test_save_exp_task_state_api_cell_admin_reset'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_save_test_helper'
op|'('
string|"'api'"
op|','
op|'{'
string|"'admin_state_reset'"
op|':'
name|'True'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_rename_sends_notification
dedent|''
name|'def'
name|'test_save_rename_sends_notification'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
comment|"# Tests that simply changing the 'display_name' on the instance"
nl|'\n'
comment|'# will send a notification.'
nl|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'enable'
op|'='
name|'False'
op|','
name|'group'
op|'='
string|"'cells'"
op|')'
newline|'\n'
name|'old_ref'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'display_name'
op|'='
string|"'hello'"
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'old_ref'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'expected_updates'
op|'='
name|'dict'
op|'('
name|'display_name'
op|'='
string|"'goodbye'"
op|')'
newline|'\n'
name|'new_ref'
op|'='
name|'dict'
op|'('
name|'old_ref'
op|','
op|'**'
name|'expected_updates'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_update_and_get_original'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'notifications'
op|','
string|"'send_update'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'old_ref'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_update_and_get_original'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
name|'expected_updates'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
string|"'security_groups'"
op|','
nl|'\n'
string|"'system_metadata'"
op|','
string|"'extra'"
op|','
string|"'extra.flavor'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
op|'('
name|'old_ref'
op|','
name|'new_ref'
op|')'
op|')'
newline|'\n'
name|'notifications'
op|'.'
name|'send_update'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'mox'
op|'.'
name|'IgnoreArg'
op|'('
op|')'
op|','
nl|'\n'
name|'mox'
op|'.'
name|'IgnoreArg'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'old_ref'
op|'['
string|"'uuid'"
op|']'
op|','
nl|'\n'
name|'use_slave'
op|'='
name|'False'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'hello'"
op|','
name|'inst'
op|'.'
name|'display_name'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'display_name'
op|'='
string|"'goodbye'"
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'goodbye'"
op|','
name|'inst'
op|'.'
name|'display_name'
op|')'
newline|'\n'
comment|'# NOTE(danms): Ignore flavor migrations for the moment'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|'['
op|']'
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|'-'
name|'set'
op|'('
op|'['
string|"'flavor'"
op|']'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_related_object_if_none
dedent|''
name|'def'
name|'test_save_related_object_if_none'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|','
string|"'_save_pci_requests'"
nl|'\n'
op|')'
name|'as'
name|'save_mock'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'_from_db_object'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'pci_requests'
op|'='
name|'None'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'save_mock'
op|'.'
name|'called'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_update_and_get_original'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'instance'
op|'.'
name|'Instance'
op|','
string|"'_from_db_object'"
op|')'
newline|'\n'
DECL|member|test_save_does_not_refresh_pci_devices
name|'def'
name|'test_save_does_not_refresh_pci_devices'
op|'('
name|'self'
op|','
name|'mock_fdo'
op|','
name|'mock_update'
op|')'
op|':'
newline|'\n'
comment|"# NOTE(danms): This tests that we don't update the pci_devices"
nl|'\n'
comment|'# field from the contents of the database. This is not because we'
nl|'\n'
comment|"# don't necessarily want to, but because the way pci_devices is"
nl|'\n'
comment|'# currently implemented it causes versioning issues. When that is'
nl|'\n'
comment|'# resolved, this test should go away.'
nl|'\n'
indent|' '
name|'mock_update'
op|'.'
name|'return_value'
op|'='
name|'None'
op|','
name|'None'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
number|'123'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'test_instance_not_refresh'
newline|'\n'
name|'inst'
op|'.'
name|'pci_devices'
op|'='
name|'pci_device'
op|'.'
name|'PciDeviceList'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'pci_devices'"
op|','
nl|'\n'
name|'mock_fdo'
op|'.'
name|'call_args_list'
op|'['
number|'0'
op|']'
op|'['
number|'1'
op|']'
op|'['
string|"'expected_attrs'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_extra_update_by_uuid'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_update_and_get_original'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'instance'
op|'.'
name|'Instance'
op|','
string|"'_from_db_object'"
op|')'
newline|'\n'
DECL|member|test_save_updates_numa_topology
name|'def'
name|'test_save_updates_numa_topology'
op|'('
name|'self'
op|','
name|'mock_fdo'
op|','
name|'mock_update'
op|','
nl|'\n'
name|'mock_extra_update'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_obj_numa_topology'
op|'='
name|'objects'
op|'.'
name|'InstanceNUMATopology'
op|'('
name|'cells'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'InstanceNUMACell'
op|'('
name|'id'
op|'='
number|'0'
op|','
name|'cpuset'
op|'='
name|'set'
op|'('
op|'['
number|'0'
op|']'
op|')'
op|','
name|'memory'
op|'='
number|'128'
op|')'
op|','
nl|'\n'
name|'objects'
op|'.'
name|'InstanceNUMACell'
op|'('
name|'id'
op|'='
number|'1'
op|','
name|'cpuset'
op|'='
name|'set'
op|'('
op|'['
number|'1'
op|']'
op|')'
op|','
name|'memory'
op|'='
number|'128'
op|')'
op|']'
op|')'
newline|'\n'
name|'fake_obj_numa_topology'
op|'.'
name|'instance_uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
newline|'\n'
name|'jsonified'
op|'='
name|'fake_obj_numa_topology'
op|'.'
name|'_to_json'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'mock_update'
op|'.'
name|'return_value'
op|'='
name|'None'
op|','
name|'None'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
nl|'\n'
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
number|'123'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'numa_topology'
op|'='
name|'fake_obj_numa_topology'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
nl|'\n'
comment|'# NOTE(sdague): the json representation of nova object for'
nl|'\n'
comment|"# NUMA isn't stable from a string comparison"
nl|'\n'
comment|'# perspective. There are sets which get converted to lists,'
nl|'\n'
comment|'# and based on platform differences may show up in different'
nl|'\n'
comment|"# orders. So we can't have mock do the comparison. Instead"
nl|'\n'
comment|'# manually compare the final parameter using our json equality'
nl|'\n'
comment|'# operator which does the right thing here.'
nl|'\n'
name|'mock_extra_update'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
name|'mock'
op|'.'
name|'ANY'
op|')'
newline|'\n'
name|'called_arg'
op|'='
name|'mock_extra_update'
op|'.'
name|'call_args_list'
op|'['
number|'0'
op|']'
op|'['
number|'0'
op|']'
op|'['
number|'2'
op|']'
op|'['
string|"'numa_topology'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'assertJsonEqual'
op|'('
name|'called_arg'
op|','
name|'jsonified'
op|')'
newline|'\n'
nl|'\n'
name|'mock_extra_update'
op|'.'
name|'reset_mock'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'numa_topology'
op|'='
name|'None'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'mock_extra_update'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
op|'{'
string|"'numa_topology'"
op|':'
name|'None'
op|'}'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_extra_update_by_uuid'"
op|')'
newline|'\n'
DECL|member|test_save_vcpu_model
name|'def'
name|'test_save_vcpu_model'
op|'('
name|'self'
op|','
name|'mock_update'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_instance_obj'
op|'('
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'vcpu_model'
op|'='
name|'test_vcpu_model'
op|'.'
name|'fake_vcpumodel'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'mock_update'
op|'.'
name|'called'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'1'
op|','
name|'mock_update'
op|'.'
name|'call_count'
op|')'
newline|'\n'
name|'actual_args'
op|'='
name|'mock_update'
op|'.'
name|'call_args'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'0'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'inst'
op|'.'
name|'uuid'
op|','
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'1'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
string|"'vcpu_model'"
op|']'
op|','
name|'list'
op|'('
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'2'
op|']'
op|'.'
name|'keys'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertJsonEqual'
op|'('
name|'jsonutils'
op|'.'
name|'dumps'
op|'('
nl|'\n'
name|'test_vcpu_model'
op|'.'
name|'fake_vcpumodel'
op|'.'
name|'obj_to_primitive'
op|'('
op|')'
op|')'
op|','
nl|'\n'
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'2'
op|']'
op|'['
string|"'vcpu_model'"
op|']'
op|')'
newline|'\n'
name|'mock_update'
op|'.'
name|'reset_mock'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'vcpu_model'
op|'='
name|'None'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'mock_update'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
op|'{'
string|"'vcpu_model'"
op|':'
name|'None'
op|'}'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_extra_update_by_uuid'"
op|')'
newline|'\n'
DECL|member|test_save_migration_context_model
name|'def'
name|'test_save_migration_context_model'
op|'('
name|'self'
op|','
name|'mock_update'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_instance_obj'
op|'('
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'='
name|'test_mig_ctxt'
op|'.'
name|'get_fake_migration_context_obj'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'mock_update'
op|'.'
name|'called'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'1'
op|','
name|'mock_update'
op|'.'
name|'call_count'
op|')'
newline|'\n'
name|'actual_args'
op|'='
name|'mock_update'
op|'.'
name|'call_args'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'0'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'inst'
op|'.'
name|'uuid'
op|','
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'1'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
string|"'migration_context'"
op|']'
op|','
name|'list'
op|'('
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'2'
op|']'
op|'.'
name|'keys'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
nl|'\n'
name|'objects'
op|'.'
name|'MigrationContext'
op|'.'
name|'obj_from_db_obj'
op|'('
nl|'\n'
name|'actual_args'
op|'['
number|'0'
op|']'
op|'['
number|'2'
op|']'
op|'['
string|"'migration_context'"
op|']'
op|')'
op|','
nl|'\n'
name|'objects'
op|'.'
name|'MigrationContext'
op|')'
newline|'\n'
name|'mock_update'
op|'.'
name|'reset_mock'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'='
name|'None'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'mock_update'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
op|'{'
string|"'migration_context'"
op|':'
name|'None'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_flavor_skips_unchanged_flavors
dedent|''
name|'def'
name|'test_save_flavor_skips_unchanged_flavors'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'flavor'
op|'='
name|'objects'
op|'.'
name|'Flavor'
op|'('
op|')'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_extra_update_by_uuid'"
op|')'
name|'as'
name|'mock_upd'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'mock_upd'
op|'.'
name|'called'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'notifications'
op|','
string|"'send_update'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|','
string|"'instance_update_from_api'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|','
string|"'instance_update_at_top'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_update_and_get_original'"
op|')'
newline|'\n'
DECL|member|_test_skip_cells_sync_helper
name|'def'
name|'_test_skip_cells_sync_helper'
op|'('
name|'self'
op|','
name|'mock_db_update'
op|','
name|'mock_update_at_top'
op|','
nl|'\n'
name|'mock_update_from_api'
op|','
name|'mock_notif_update'
op|','
name|'cell_type'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'enable'
op|'='
name|'True'
op|','
name|'cell_type'
op|'='
name|'cell_type'
op|','
name|'group'
op|'='
string|"'cells'"
op|')'
newline|'\n'
name|'inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_instance_obj'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'cell_name'
op|'='
string|"'fake'"
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'vm_state'
op|'='
string|"'foo'"
newline|'\n'
name|'inst'
op|'.'
name|'task_state'
op|'='
string|"'bar'"
newline|'\n'
name|'inst'
op|'.'
name|'cell_name'
op|'='
string|"'foo!bar@baz'"
newline|'\n'
nl|'\n'
name|'old_ref'
op|'='
name|'dict'
op|'('
name|'base'
op|'.'
name|'obj_to_primitive'
op|'('
name|'inst'
op|')'
op|','
name|'vm_state'
op|'='
string|"'old'"
op|','
nl|'\n'
name|'task_state'
op|'='
string|"'old'"
op|')'
newline|'\n'
name|'new_ref'
op|'='
name|'dict'
op|'('
name|'old_ref'
op|','
name|'vm_state'
op|'='
string|"'foo'"
op|','
name|'task_state'
op|'='
string|"'bar'"
op|')'
newline|'\n'
name|'newer_ref'
op|'='
name|'dict'
op|'('
name|'new_ref'
op|','
name|'vm_state'
op|'='
string|"'bar'"
op|','
name|'task_state'
op|'='
string|"'foo'"
op|')'
newline|'\n'
name|'mock_db_update'
op|'.'
name|'side_effect'
op|'='
op|'['
op|'('
name|'old_ref'
op|','
name|'new_ref'
op|')'
op|','
op|'('
name|'new_ref'
op|','
name|'newer_ref'
op|')'
op|']'
newline|'\n'
nl|'\n'
name|'with'
name|'inst'
op|'.'
name|'skip_cells_sync'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'mock_update_at_top'
op|'.'
name|'assert_has_calls'
op|'('
op|'['
op|']'
op|')'
newline|'\n'
name|'mock_update_from_api'
op|'.'
name|'assert_has_calls'
op|'('
op|'['
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'mock_notif_update'
op|'.'
name|'called'
op|')'
newline|'\n'
nl|'\n'
name|'inst'
op|'.'
name|'vm_state'
op|'='
string|"'bar'"
newline|'\n'
name|'inst'
op|'.'
name|'task_state'
op|'='
string|"'foo'"
newline|'\n'
nl|'\n'
DECL|function|fake_update_from_api
name|'def'
name|'fake_update_from_api'
op|'('
name|'context'
op|','
name|'instance'
op|','
name|'expected_vm_state'
op|','
nl|'\n'
name|'expected_task_state'
op|','
name|'admin_state_reset'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo!bar@baz'"
op|','
name|'instance'
op|'.'
name|'cell_name'
op|')'
newline|'\n'
nl|'\n'
comment|'# This is re-mocked so that cell_name can be checked above. Since'
nl|'\n'
comment|'# instance objects have no equality testing assert_called_once_with'
nl|'\n'
comment|"# doesn't work."
nl|'\n'
dedent|''
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|','
nl|'\n'
string|"'instance_update_from_api'"
op|','
nl|'\n'
name|'side_effect'
op|'='
name|'fake_update_from_api'
op|')'
name|'as'
name|'fake_update_from_api'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo!bar@baz'"
op|','
name|'inst'
op|'.'
name|'cell_name'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'mock_notif_update'
op|'.'
name|'called'
op|')'
newline|'\n'
name|'if'
name|'cell_type'
op|'=='
string|"'compute'"
op|':'
newline|'\n'
indent|' '
name|'mock_update_at_top'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'mock'
op|'.'
name|'ANY'
op|')'
newline|'\n'
comment|"# Compare primitives since we can't check instance object equality"
nl|'\n'
name|'expected_inst_p'
op|'='
name|'base'
op|'.'
name|'obj_to_primitive'
op|'('
name|'inst'
op|')'
newline|'\n'
name|'actual_inst'
op|'='
name|'mock_update_at_top'
op|'.'
name|'call_args'
op|'['
number|'0'
op|']'
op|'['
number|'1'
op|']'
newline|'\n'
name|'actual_inst_p'
op|'='
name|'base'
op|'.'
name|'obj_to_primitive'
op|'('
name|'actual_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'expected_inst_p'
op|','
name|'actual_inst_p'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'fake_update_from_api'
op|'.'
name|'called'
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'cell_type'
op|'=='
string|"'api'"
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'mock_update_at_top'
op|'.'
name|'called'
op|')'
newline|'\n'
name|'fake_update_from_api'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'mock'
op|'.'
name|'ANY'
op|','
name|'None'
op|','
name|'None'
op|','
name|'False'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'expected_calls'
op|'='
op|'['
nl|'\n'
name|'mock'
op|'.'
name|'call'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
nl|'\n'
op|'{'
string|"'vm_state'"
op|':'
string|"'foo'"
op|','
string|"'task_state'"
op|':'
string|"'bar'"
op|','
nl|'\n'
string|"'cell_name'"
op|':'
string|"'foo!bar@baz'"
op|'}'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'system_metadata'"
op|','
string|"'extra'"
op|','
nl|'\n'
string|"'extra.flavor'"
op|']'
op|')'
op|','
nl|'\n'
name|'mock'
op|'.'
name|'call'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
nl|'\n'
op|'{'
string|"'vm_state'"
op|':'
string|"'bar'"
op|','
string|"'task_state'"
op|':'
string|"'foo'"
op|'}'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'system_metadata'"
op|']'
op|')'
op|']'
newline|'\n'
name|'mock_db_update'
op|'.'
name|'assert_has_calls'
op|'('
name|'expected_calls'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_skip_cells_api
dedent|''
name|'def'
name|'test_skip_cells_api'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_skip_cells_sync_helper'
op|'('
name|'cell_type'
op|'='
string|"'api'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_skip_cells_compute
dedent|''
name|'def'
name|'test_skip_cells_compute'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_skip_cells_sync_helper'
op|'('
name|'cell_type'
op|'='
string|"'compute'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_deleted
dedent|''
name|'def'
name|'test_get_deleted'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'id'
op|'='
number|'123'
op|','
name|'deleted'
op|'='
number|'123'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
comment|"# NOTE(danms): Make sure it's actually a bool"
nl|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'inst'
op|'.'
name|'deleted'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_not_cleaned
dedent|''
name|'def'
name|'test_get_not_cleaned'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'id'
op|'='
number|'123'
op|','
name|'cleaned'
op|'='
name|'None'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
comment|"# NOTE(mikal): Make sure it's actually a bool"
nl|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'inst'
op|'.'
name|'cleaned'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_cleaned
dedent|''
name|'def'
name|'test_get_cleaned'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'id'
op|'='
number|'123'
op|','
name|'cleaned'
op|'='
number|'1'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
comment|"# NOTE(mikal): Make sure it's actually a bool"
nl|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'inst'
op|'.'
name|'cleaned'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_info_cache
dedent|''
name|'def'
name|'test_with_info_cache'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'nwinfo1'
op|'='
name|'network_model'
op|'.'
name|'NetworkInfo'
op|'.'
name|'hydrate'
op|'('
op|'['
op|'{'
string|"'address'"
op|':'
string|"'foo'"
op|'}'
op|']'
op|')'
newline|'\n'
name|'nwinfo2'
op|'='
name|'network_model'
op|'.'
name|'NetworkInfo'
op|'.'
name|'hydrate'
op|'('
op|'['
op|'{'
string|"'address'"
op|':'
string|"'bar'"
op|'}'
op|']'
op|')'
newline|'\n'
name|'nwinfo1_json'
op|'='
name|'nwinfo1'
op|'.'
name|'json'
op|'('
op|')'
newline|'\n'
name|'nwinfo2_json'
op|'='
name|'nwinfo2'
op|'.'
name|'json'
op|'('
op|')'
newline|'\n'
name|'fake_info_cache'
op|'='
name|'test_instance_info_cache'
op|'.'
name|'fake_info_cache'
newline|'\n'
name|'fake_inst'
op|'['
string|"'info_cache'"
op|']'
op|'='
name|'dict'
op|'('
nl|'\n'
name|'fake_info_cache'
op|','
nl|'\n'
name|'network_info'
op|'='
name|'nwinfo1_json'
op|','
nl|'\n'
name|'instance_uuid'
op|'='
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_update_and_get_original'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_info_cache_update'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_info_cache_update'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
op|'{'
string|"'network_info'"
op|':'
name|'nwinfo2_json'
op|'}'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_info_cache'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'nwinfo1'
op|','
name|'inst'
op|'.'
name|'info_cache'
op|'.'
name|'network_info'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_uuid'
op|','
name|'inst'
op|'.'
name|'info_cache'
op|'.'
name|'instance_uuid'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'info_cache'
op|'.'
name|'network_info'
op|'='
name|'nwinfo2'
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_info_cache_none
dedent|''
name|'def'
name|'test_with_info_cache_none'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'info_cache'
op|'='
name|'None'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
op|'['
string|"'info_cache'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'inst'
op|'.'
name|'info_cache'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_security_groups
dedent|''
name|'def'
name|'test_with_security_groups'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'fake_inst'
op|'['
string|"'security_groups'"
op|']'
op|'='
op|'['
nl|'\n'
op|'{'
string|"'id'"
op|':'
number|'1'
op|','
string|"'name'"
op|':'
string|"'secgroup1'"
op|','
string|"'description'"
op|':'
string|"'fake-desc'"
op|','
nl|'\n'
string|"'user_id'"
op|':'
string|"'fake-user'"
op|','
string|"'project_id'"
op|':'
string|"'fake_project'"
op|','
nl|'\n'
string|"'created_at'"
op|':'
name|'None'
op|','
string|"'updated_at'"
op|':'
name|'None'
op|','
string|"'deleted_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted'"
op|':'
name|'False'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'id'"
op|':'
number|'2'
op|','
string|"'name'"
op|':'
string|"'secgroup2'"
op|','
string|"'description'"
op|':'
string|"'fake-desc'"
op|','
nl|'\n'
string|"'user_id'"
op|':'
string|"'fake-user'"
op|','
string|"'project_id'"
op|':'
string|"'fake_project'"
op|','
nl|'\n'
string|"'created_at'"
op|':'
name|'None'
op|','
string|"'updated_at'"
op|':'
name|'None'
op|','
string|"'deleted_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted'"
op|':'
name|'False'
op|'}'
op|','
nl|'\n'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_update_and_get_original'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'security_group_update'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'security_group_update'
op|'('
name|'self'
op|'.'
name|'context'
op|','
number|'1'
op|','
op|'{'
string|"'description'"
op|':'
string|"'changed'"
op|'}'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|'['
string|"'security_groups'"
op|']'
op|'['
number|'0'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'len'
op|'('
name|'inst'
op|'.'
name|'security_groups'
op|')'
op|')'
newline|'\n'
name|'for'
name|'index'
op|','
name|'group'
name|'in'
name|'enumerate'
op|'('
name|'fake_inst'
op|'['
string|"'security_groups'"
op|']'
op|')'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'key'
name|'in'
name|'group'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'group'
op|'['
name|'key'
op|']'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'security_groups'
op|'['
name|'index'
op|']'
op|'['
name|'key'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst'
op|'.'
name|'security_groups'
op|'['
name|'index'
op|']'
op|','
nl|'\n'
name|'security_group'
op|'.'
name|'SecurityGroup'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|')'
op|','
name|'inst'
op|'.'
name|'security_groups'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'security_groups'
op|'['
number|'0'
op|']'
op|'.'
name|'description'
op|'='
string|"'changed'"
newline|'\n'
name|'inst'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|')'
op|','
name|'inst'
op|'.'
name|'security_groups'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_empty_security_groups
dedent|''
name|'def'
name|'test_with_empty_security_groups'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'security_groups'
op|'='
op|'['
op|']'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'info_cache'"
op|','
nl|'\n'
string|"'security_groups'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'inst'
op|'.'
name|'security_groups'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_empty_pci_devices
dedent|''
name|'def'
name|'test_with_empty_pci_devices'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|','
name|'pci_devices'
op|'='
op|'['
op|']'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'pci_devices'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
op|'['
string|"'pci_devices'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'inst'
op|'.'
name|'pci_devices'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_pci_devices
dedent|''
name|'def'
name|'test_with_pci_devices'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'fake_inst'
op|'['
string|"'pci_devices'"
op|']'
op|'='
op|'['
nl|'\n'
op|'{'
string|"'created_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'compute_node_id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'address'"
op|':'
string|"'a1'"
op|','
nl|'\n'
string|"'vendor_id'"
op|':'
string|"'v1'"
op|','
nl|'\n'
string|"'numa_node'"
op|':'
number|'0'
op|','
nl|'\n'
string|"'product_id'"
op|':'
string|"'p1'"
op|','
nl|'\n'
string|"'dev_type'"
op|':'
name|'fields'
op|'.'
name|'PciDeviceType'
op|'.'
name|'STANDARD'
op|','
nl|'\n'
string|"'status'"
op|':'
name|'fields'
op|'.'
name|'PciDeviceStatus'
op|'.'
name|'ALLOCATED'
op|','
nl|'\n'
string|"'dev_id'"
op|':'
string|"'i'"
op|','
nl|'\n'
string|"'label'"
op|':'
string|"'l'"
op|','
nl|'\n'
string|"'instance_uuid'"
op|':'
name|'fake_uuid'
op|','
nl|'\n'
string|"'request_id'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'parent_addr'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'extra_info'"
op|':'
string|"'{}'"
op|'}'
op|','
nl|'\n'
op|'{'
nl|'\n'
string|"'created_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'deleted'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'compute_node_id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'address'"
op|':'
string|"'a'"
op|','
nl|'\n'
string|"'vendor_id'"
op|':'
string|"'v'"
op|','
nl|'\n'
string|"'numa_node'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'product_id'"
op|':'
string|"'p'"
op|','
nl|'\n'
string|"'dev_type'"
op|':'
name|'fields'
op|'.'
name|'PciDeviceType'
op|'.'
name|'STANDARD'
op|','
nl|'\n'
string|"'status'"
op|':'
name|'fields'
op|'.'
name|'PciDeviceStatus'
op|'.'
name|'ALLOCATED'
op|','
nl|'\n'
string|"'dev_id'"
op|':'
string|"'i'"
op|','
nl|'\n'
string|"'label'"
op|':'
string|"'l'"
op|','
nl|'\n'
string|"'instance_uuid'"
op|':'
name|'fake_uuid'
op|','
nl|'\n'
string|"'request_id'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'parent_addr'"
op|':'
string|"'a1'"
op|','
nl|'\n'
string|"'extra_info'"
op|':'
string|"'{}'"
op|'}'
op|','
nl|'\n'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'pci_devices'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
op|'['
string|"'pci_devices'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'len'
op|'('
name|'inst'
op|'.'
name|'pci_devices'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_uuid'
op|','
name|'inst'
op|'.'
name|'pci_devices'
op|'['
number|'0'
op|']'
op|'.'
name|'instance_uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_uuid'
op|','
name|'inst'
op|'.'
name|'pci_devices'
op|'['
number|'1'
op|']'
op|'.'
name|'instance_uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_fault
dedent|''
name|'def'
name|'test_with_fault'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'fake_faults'
op|'='
op|'['
name|'dict'
op|'('
name|'x'
op|','
name|'instance_uuid'
op|'='
name|'fake_uuid'
op|')'
nl|'\n'
name|'for'
name|'x'
name|'in'
name|'test_instance_fault'
op|'.'
name|'fake_faults'
op|'['
string|"'fake-uuid'"
op|']'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_by_uuid'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_fault_get_by_instance_uuids'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_fault_get_by_instance_uuids'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'['
name|'fake_uuid'
op|']'
op|')'
op|'.'
name|'AndReturn'
op|'('
op|'{'
name|'fake_uuid'
op|':'
name|'fake_faults'
op|'}'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'fault'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_faults'
op|'['
number|'0'
op|']'
op|','
name|'dict'
op|'('
name|'inst'
op|'.'
name|'fault'
op|'.'
name|'items'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.EC2Ids.get_by_instance'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_get_by_uuid'"
op|')'
newline|'\n'
DECL|member|test_with_ec2_ids
name|'def'
name|'test_with_ec2_ids'
op|'('
name|'self'
op|','
name|'mock_get'
op|','
name|'mock_ec2'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'fake_uuid'
op|'='
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'fake_inst'
newline|'\n'
name|'fake_ec2_ids'
op|'='
name|'objects'
op|'.'
name|'EC2Ids'
op|'('
name|'instance_id'
op|'='
string|"'fake-inst'"
op|','
nl|'\n'
name|'ami_id'
op|'='
string|"'fake-ami'"
op|')'
newline|'\n'
name|'mock_ec2'
op|'.'
name|'return_value'
op|'='
name|'fake_ec2_ids'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'fake_uuid'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'ec2_ids'"
op|']'
op|')'
newline|'\n'
name|'mock_ec2'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'mock'
op|'.'
name|'ANY'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_ec2_ids'
op|'.'
name|'instance_id'
op|','
name|'inst'
op|'.'
name|'ec2_ids'
op|'.'
name|'instance_id'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_get_by_uuid'"
op|')'
newline|'\n'
DECL|member|test_with_image_meta
name|'def'
name|'test_with_image_meta'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'dict'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'fake_inst'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'fake_inst'
op|'['
string|"'uuid'"
op|']'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'image_meta'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'image_meta'
op|'='
name|'inst'
op|'.'
name|'image_meta'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'image_meta'
op|','
name|'objects'
op|'.'
name|'ImageMeta'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'100'
op|','
name|'image_meta'
op|'.'
name|'min_ram'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'ide'"
op|','
name|'image_meta'
op|'.'
name|'properties'
op|'.'
name|'hw_disk_bus'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'ne2k_pci'"
op|','
name|'image_meta'
op|'.'
name|'properties'
op|'.'
name|'hw_vif_model'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_iteritems_with_extra_attrs
dedent|''
name|'def'
name|'test_iteritems_with_extra_attrs'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'stubs'
op|'.'
name|'Set'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|','
string|"'name'"
op|','
string|"'foo'"
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'sorted'
op|'('
op|'{'
string|"'uuid'"
op|':'
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
string|"'name'"
op|':'
string|"'foo'"
op|','
nl|'\n'
op|'}'
op|'.'
name|'items'
op|'('
op|')'
op|')'
op|','
name|'sorted'
op|'('
name|'inst'
op|'.'
name|'items'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_test_metadata_change_tracking
dedent|''
name|'def'
name|'_test_metadata_change_tracking'
op|'('
name|'self'
op|','
name|'which'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'setattr'
op|'('
name|'inst'
op|','
name|'which'
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
name|'getattr'
op|'('
name|'inst'
op|','
name|'which'
op|')'
op|'['
string|"'foo'"
op|']'
op|'='
string|"'bar'"
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|'['
name|'which'
op|']'
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_skip_scheduled_at
dedent|''
name|'def'
name|'test_create_skip_scheduled_at'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_create'"
op|')'
newline|'\n'
name|'vals'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'foo-host'"
op|','
nl|'\n'
string|"'memory_mb'"
op|':'
number|'128'
op|','
nl|'\n'
string|"'system_metadata'"
op|':'
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
nl|'\n'
string|"'extra'"
op|':'
op|'{'
nl|'\n'
string|"'vcpu_model'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'numa_topology'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'pci_requests'"
op|':'
name|'None'
op|','
nl|'\n'
op|'}'
op|'}'
newline|'\n'
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|'**'
name|'vals'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'vals'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'host'
op|'='
string|"'foo-host'"
op|','
name|'memory_mb'
op|'='
number|'128'
op|','
nl|'\n'
name|'scheduled_at'
op|'='
name|'None'
op|','
nl|'\n'
name|'system_metadata'
op|'='
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo-host'"
op|','
name|'inst'
op|'.'
name|'host'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_metadata_change_tracking
dedent|''
name|'def'
name|'test_metadata_change_tracking'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_metadata_change_tracking'
op|'('
string|"'metadata'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_system_metadata_change_tracking
dedent|''
name|'def'
name|'test_system_metadata_change_tracking'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_metadata_change_tracking'
op|'('
string|"'system_metadata'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_stubbed
dedent|''
name|'def'
name|'test_create_stubbed'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_create'"
op|')'
newline|'\n'
name|'vals'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'foo-host'"
op|','
nl|'\n'
string|"'memory_mb'"
op|':'
number|'128'
op|','
nl|'\n'
string|"'system_metadata'"
op|':'
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
nl|'\n'
string|"'extra'"
op|':'
op|'{'
nl|'\n'
string|"'vcpu_model'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'numa_topology'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'pci_requests'"
op|':'
name|'None'
op|','
nl|'\n'
op|'}'
op|'}'
newline|'\n'
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|'**'
name|'vals'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'vals'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'host'
op|'='
string|"'foo-host'"
op|','
name|'memory_mb'
op|'='
number|'128'
op|','
nl|'\n'
name|'system_metadata'
op|'='
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create
dedent|''
name|'def'
name|'test_create'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_create'"
op|')'
newline|'\n'
name|'extras'
op|'='
op|'{'
string|"'vcpu_model'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'numa_topology'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'pci_requests'"
op|':'
name|'None'
op|'}'
newline|'\n'
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'extra'"
op|':'
name|'extras'
op|'}'
op|')'
op|'.'
name|'AndReturn'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'fake_instance'
op|'['
string|"'id'"
op|']'
op|','
name|'inst'
op|'.'
name|'id'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'inst'
op|'.'
name|'ec2_ids'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_with_values
dedent|''
name|'def'
name|'test_create_with_values'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst1'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'host'
op|'='
string|"'foo-host'"
op|')'
newline|'\n'
name|'inst1'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo-host'"
op|','
name|'inst1'
op|'.'
name|'host'
op|')'
newline|'\n'
name|'inst2'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst1'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo-host'"
op|','
name|'inst2'
op|'.'
name|'host'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_with_extras
dedent|''
name|'def'
name|'test_create_with_extras'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'self'
op|'.'
name|'fake_instance'
op|'['
string|"'uuid'"
op|']'
op|','
nl|'\n'
name|'numa_topology'
op|'='
name|'test_instance_numa_topology'
op|'.'
name|'fake_obj_numa_topology'
op|','
nl|'\n'
name|'pci_requests'
op|'='
name|'objects'
op|'.'
name|'InstancePCIRequests'
op|'('
nl|'\n'
name|'requests'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'InstancePCIRequest'
op|'('
name|'count'
op|'='
number|'123'
op|','
nl|'\n'
name|'spec'
op|'='
op|'['
op|']'
op|')'
op|']'
op|')'
op|','
nl|'\n'
name|'vcpu_model'
op|'='
name|'test_vcpu_model'
op|'.'
name|'fake_vcpumodel'
op|','
nl|'\n'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'inst'
op|'.'
name|'numa_topology'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'inst'
op|'.'
name|'pci_requests'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'1'
op|','
name|'len'
op|'('
name|'inst'
op|'.'
name|'pci_requests'
op|'.'
name|'requests'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'inst'
op|'.'
name|'vcpu_model'
op|')'
newline|'\n'
name|'got_numa_topo'
op|'='
name|'objects'
op|'.'
name|'InstanceNUMATopology'
op|'.'
name|'get_by_instance_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'inst'
op|'.'
name|'numa_topology'
op|'.'
name|'instance_uuid'
op|','
nl|'\n'
name|'got_numa_topo'
op|'.'
name|'instance_uuid'
op|')'
newline|'\n'
name|'got_pci_requests'
op|'='
name|'objects'
op|'.'
name|'InstancePCIRequests'
op|'.'
name|'get_by_instance_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'123'
op|','
name|'got_pci_requests'
op|'.'
name|'requests'
op|'['
number|'0'
op|']'
op|'.'
name|'count'
op|')'
newline|'\n'
name|'vcpu_model'
op|'='
name|'objects'
op|'.'
name|'VirtCPUModel'
op|'.'
name|'get_by_instance_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'fake-model'"
op|','
name|'vcpu_model'
op|'.'
name|'model'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_recreate_fails
dedent|''
name|'def'
name|'test_recreate_fails'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'host'
op|'='
string|"'foo-host'"
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'exception'
op|'.'
name|'ObjectActionError'
op|','
name|'inst'
op|'.'
name|'create'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_create_with_special_things
dedent|''
name|'def'
name|'test_create_with_special_things'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_create'"
op|')'
newline|'\n'
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
op|'{'
string|"'host'"
op|':'
string|"'foo-host'"
op|','
nl|'\n'
string|"'security_groups'"
op|':'
op|'['
string|"'foo'"
op|','
string|"'bar'"
op|']'
op|','
nl|'\n'
string|"'info_cache'"
op|':'
op|'{'
string|"'network_info'"
op|':'
string|"'[]'"
op|'}'
op|','
nl|'\n'
string|"'extra'"
op|':'
op|'{'
nl|'\n'
string|"'vcpu_model'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'numa_topology'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'pci_requests'"
op|':'
name|'None'
op|','
nl|'\n'
op|'}'
op|','
nl|'\n'
op|'}'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'secgroups'
op|'='
name|'security_group'
op|'.'
name|'SecurityGroupList'
op|'('
op|')'
newline|'\n'
name|'secgroups'
op|'.'
name|'objects'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'name'
name|'in'
op|'('
string|"'foo'"
op|','
string|"'bar'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'secgroup'
op|'='
name|'security_group'
op|'.'
name|'SecurityGroup'
op|'('
op|')'
newline|'\n'
name|'secgroup'
op|'.'
name|'name'
op|'='
name|'name'
newline|'\n'
name|'secgroups'
op|'.'
name|'objects'
op|'.'
name|'append'
op|'('
name|'secgroup'
op|')'
newline|'\n'
dedent|''
name|'info_cache'
op|'='
name|'instance_info_cache'
op|'.'
name|'InstanceInfoCache'
op|'('
op|')'
newline|'\n'
name|'info_cache'
op|'.'
name|'network_info'
op|'='
name|'network_model'
op|'.'
name|'NetworkInfo'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'host'
op|'='
string|"'foo-host'"
op|','
name|'security_groups'
op|'='
name|'secgroups'
op|','
nl|'\n'
name|'info_cache'
op|'='
name|'info_cache'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_destroy_stubbed
dedent|''
name|'def'
name|'test_destroy_stubbed'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_destroy'"
op|')'
newline|'\n'
name|'deleted_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'1955'
op|','
number|'11'
op|','
number|'6'
op|')'
newline|'\n'
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'deleted_at'
op|'='
name|'deleted_at'
op|','
nl|'\n'
name|'deleted'
op|'='
name|'True'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_destroy'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'constraint'
op|'='
name|'None'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
number|'1'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
name|'host'
op|'='
string|"'foo'"
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'destroy'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'timeutils'
op|'.'
name|'normalize_time'
op|'('
name|'deleted_at'
op|')'
op|','
nl|'\n'
name|'timeutils'
op|'.'
name|'normalize_time'
op|'('
name|'inst'
op|'.'
name|'deleted_at'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'inst'
op|'.'
name|'deleted'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_destroy
dedent|''
name|'def'
name|'test_destroy'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'values'
op|'='
op|'{'
string|"'user_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
string|"'project_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|'}'
newline|'\n'
name|'db_inst'
op|'='
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'values'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
name|'db_inst'
op|'['
string|"'id'"
op|']'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'destroy'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'exception'
op|'.'
name|'InstanceNotFound'
op|','
nl|'\n'
name|'db'
op|'.'
name|'instance_get_by_uuid'
op|','
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_destroy_host_constraint
dedent|''
name|'def'
name|'test_destroy_host_constraint'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'values'
op|'='
op|'{'
string|"'user_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
string|"'project_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'foo'"
op|'}'
newline|'\n'
name|'db_inst'
op|'='
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'values'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'host'
op|'='
name|'None'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'exception'
op|'.'
name|'ObjectActionError'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'destroy'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|','
string|"'instance_destroy_at_top'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_destroy'"
op|')'
newline|'\n'
DECL|member|test_destroy_cell_sync_to_top
name|'def'
name|'test_destroy_cell_sync_to_top'
op|'('
name|'self'
op|','
name|'mock_destroy'
op|','
name|'mock_destroy_at_top'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'enable'
op|'='
name|'True'
op|','
name|'cell_type'
op|'='
string|"'compute'"
op|','
name|'group'
op|'='
string|"'cells'"
op|')'
newline|'\n'
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'deleted'
op|'='
name|'True'
op|')'
newline|'\n'
name|'mock_destroy'
op|'.'
name|'return_value'
op|'='
name|'fake_inst'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
number|'1'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'destroy'
op|'('
op|')'
newline|'\n'
name|'mock_destroy_at_top'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'mock'
op|'.'
name|'ANY'
op|')'
newline|'\n'
name|'actual_inst'
op|'='
name|'mock_destroy_at_top'
op|'.'
name|'call_args'
op|'['
number|'0'
op|']'
op|'['
number|'1'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'actual_inst'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'cells_rpcapi'
op|'.'
name|'CellsAPI'
op|','
string|"'instance_destroy_at_top'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_destroy'"
op|')'
newline|'\n'
DECL|member|test_destroy_no_cell_sync_to_top
name|'def'
name|'test_destroy_no_cell_sync_to_top'
op|'('
name|'self'
op|','
name|'mock_destroy'
op|','
nl|'\n'
name|'mock_destroy_at_top'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'deleted'
op|'='
name|'True'
op|')'
newline|'\n'
name|'mock_destroy'
op|'.'
name|'return_value'
op|'='
name|'fake_inst'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'id'
op|'='
number|'1'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'destroy'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'mock_destroy_at_top'
op|'.'
name|'called'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_name_does_not_trigger_lazy_loads
dedent|''
name|'def'
name|'test_name_does_not_trigger_lazy_loads'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'values'
op|'='
op|'{'
string|"'user_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
string|"'project_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'foo'"
op|'}'
newline|'\n'
name|'db_inst'
op|'='
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'values'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'fault'"
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'flags'
op|'('
name|'instance_name_template'
op|'='
string|"'foo-%(uuid)s'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
string|"'foo-%s'"
op|'%'
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst'
op|'.'
name|'name'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'fault'"
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_from_db_object_not_overwrite_info_cache
dedent|''
name|'def'
name|'test_from_db_object_not_overwrite_info_cache'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'info_cache'
op|'='
name|'instance_info_cache'
op|'.'
name|'InstanceInfoCache'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'info_cache'
op|'='
name|'info_cache'
op|')'
newline|'\n'
name|'db_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|')'
newline|'\n'
name|'db_inst'
op|'['
string|"'info_cache'"
op|']'
op|'='
name|'dict'
op|'('
nl|'\n'
name|'test_instance_info_cache'
op|'.'
name|'fake_info_cache'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'_from_db_object'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|','
name|'db_inst'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'info_cache'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIs'
op|'('
name|'info_cache'
op|','
name|'inst'
op|'.'
name|'info_cache'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_from_db_object_info_cache_not_set
dedent|''
name|'def'
name|'test_from_db_object_info_cache_not_set'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'info_cache'
op|'='
name|'None'
op|')'
newline|'\n'
name|'db_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|')'
newline|'\n'
name|'db_inst'
op|'.'
name|'pop'
op|'('
string|"'info_cache'"
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'_from_db_object'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|','
name|'db_inst'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'info_cache'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'inst'
op|'.'
name|'info_cache'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_from_db_object_security_groups_net_set
dedent|''
name|'def'
name|'test_from_db_object_security_groups_net_set'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'info_cache'
op|'='
name|'None'
op|')'
newline|'\n'
name|'db_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
op|')'
newline|'\n'
name|'db_inst'
op|'.'
name|'pop'
op|'('
string|"'security_groups'"
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'_from_db_object'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|','
name|'db_inst'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'security_groups'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
op|']'
op|','
name|'inst'
op|'.'
name|'security_groups'
op|'.'
name|'objects'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.InstancePCIRequests.get_by_instance_uuid'"
op|')'
newline|'\n'
DECL|member|test_get_with_pci_requests
name|'def'
name|'test_get_with_pci_requests'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'objects'
op|'.'
name|'InstancePCIRequests'
op|'('
op|')'
newline|'\n'
name|'db_instance'
op|'='
name|'db'
op|'.'
name|'instance_create'
op|'('
name|'self'
op|'.'
name|'context'
op|','
op|'{'
nl|'\n'
string|"'user_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
string|"'project_id'"
op|':'
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|'}'
op|')'
newline|'\n'
name|'instance'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'db_instance'
op|'['
string|"'uuid'"
op|']'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'pci_requests'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'instance'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'pci_requests'"
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'instance'
op|'.'
name|'pci_requests'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_flavor
dedent|''
name|'def'
name|'test_get_flavor'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'db_flavor'
op|'='
name|'flavors'
op|'.'
name|'get_default_flavor'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'flavor'
op|'='
name|'db_flavor'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'db_flavor'
op|'['
string|"'flavorid'"
op|']'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'get_flavor'
op|'('
op|')'
op|'.'
name|'flavorid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_flavor_namespace
dedent|''
name|'def'
name|'test_get_flavor_namespace'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'db_flavor'
op|'='
name|'flavors'
op|'.'
name|'get_default_flavor'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'old_flavor'
op|'='
name|'db_flavor'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'db_flavor'
op|'['
string|"'flavorid'"
op|']'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'get_flavor'
op|'('
string|"'old'"
op|')'
op|'.'
name|'flavorid'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_metadata_delete'"
op|')'
newline|'\n'
DECL|member|test_delete_metadata_key
name|'def'
name|'test_delete_metadata_key'
op|'('
name|'self'
op|','
name|'db_delete'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'id'
op|'='
number|'1'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'metadata'
op|'='
op|'{'
string|"'foo'"
op|':'
string|"'1'"
op|','
string|"'bar'"
op|':'
string|"'2'"
op|'}'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'delete_metadata_key'
op|'('
string|"'foo'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
string|"'bar'"
op|':'
string|"'2'"
op|'}'
op|','
name|'inst'
op|'.'
name|'metadata'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
op|'}'
op|','
name|'inst'
op|'.'
name|'obj_get_changes'
op|'('
op|')'
op|')'
newline|'\n'
name|'db_delete'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
string|"'foo'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_reset_changes
dedent|''
name|'def'
name|'test_reset_changes'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'metadata'
op|'='
op|'{'
string|"'1985'"
op|':'
string|"'present'"
op|'}'
newline|'\n'
name|'inst'
op|'.'
name|'system_metadata'
op|'='
op|'{'
string|"'1955'"
op|':'
string|"'past'"
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
op|'}'
op|','
name|'inst'
op|'.'
name|'_orig_metadata'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|'['
string|"'metadata'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
string|"'1985'"
op|':'
string|"'present'"
op|'}'
op|','
name|'inst'
op|'.'
name|'_orig_metadata'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
op|'}'
op|','
name|'inst'
op|'.'
name|'_orig_system_metadata'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_generic_calls_handler
dedent|''
name|'def'
name|'test_load_generic_calls_handler'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'inst'
op|','
string|"'_load_generic'"
op|')'
name|'as'
name|'mock_load'
op|':'
newline|'\n'
DECL|function|fake_load
indent|' '
name|'def'
name|'fake_load'
op|'('
name|'name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'system_metadata'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
dedent|''
name|'mock_load'
op|'.'
name|'side_effect'
op|'='
name|'fake_load'
newline|'\n'
name|'inst'
op|'.'
name|'system_metadata'
newline|'\n'
name|'mock_load'
op|'.'
name|'assert_called_once_with'
op|'('
string|"'system_metadata'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_fault_calls_handler
dedent|''
dedent|''
name|'def'
name|'test_load_fault_calls_handler'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'inst'
op|','
string|"'_load_fault'"
op|')'
name|'as'
name|'mock_load'
op|':'
newline|'\n'
DECL|function|fake_load
indent|' '
name|'def'
name|'fake_load'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'fault'
op|'='
name|'None'
newline|'\n'
nl|'\n'
dedent|''
name|'mock_load'
op|'.'
name|'side_effect'
op|'='
name|'fake_load'
newline|'\n'
name|'inst'
op|'.'
name|'fault'
newline|'\n'
name|'mock_load'
op|'.'
name|'assert_called_once_with'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_ec2_ids_calls_handler
dedent|''
dedent|''
name|'def'
name|'test_load_ec2_ids_calls_handler'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'inst'
op|','
string|"'_load_ec2_ids'"
op|')'
name|'as'
name|'mock_load'
op|':'
newline|'\n'
DECL|function|fake_load
indent|' '
name|'def'
name|'fake_load'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'ec2_ids'
op|'='
name|'objects'
op|'.'
name|'EC2Ids'
op|'('
name|'instance_id'
op|'='
string|"'fake-inst'"
op|','
nl|'\n'
name|'ami_id'
op|'='
string|"'fake-ami'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'mock_load'
op|'.'
name|'side_effect'
op|'='
name|'fake_load'
newline|'\n'
name|'inst'
op|'.'
name|'ec2_ids'
newline|'\n'
name|'mock_load'
op|'.'
name|'assert_called_once_with'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_migration_context
dedent|''
dedent|''
name|'def'
name|'test_load_migration_context'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
nl|'\n'
name|'objects'
op|'.'
name|'MigrationContext'
op|','
string|"'get_by_instance_uuid'"
op|','
nl|'\n'
name|'return_value'
op|'='
name|'test_mig_ctxt'
op|'.'
name|'fake_migration_context_obj'
nl|'\n'
op|')'
name|'as'
name|'mock_get'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'migration_context'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_migration_context_no_context
dedent|''
dedent|''
name|'def'
name|'test_load_migration_context_no_context'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
nl|'\n'
name|'objects'
op|'.'
name|'MigrationContext'
op|','
string|"'get_by_instance_uuid'"
op|','
nl|'\n'
name|'side_effect'
op|'='
name|'exception'
op|'.'
name|'MigrationContextNotFound'
op|'('
nl|'\n'
name|'instance_uuid'
op|'='
name|'inst'
op|'.'
name|'uuid'
op|')'
nl|'\n'
op|')'
name|'as'
name|'mock_get'
op|':'
newline|'\n'
indent|' '
name|'mig_ctxt'
op|'='
name|'inst'
op|'.'
name|'migration_context'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'mig_ctxt'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_load_migration_context_no_data
dedent|''
dedent|''
name|'def'
name|'test_load_migration_context_no_data'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
nl|'\n'
name|'objects'
op|'.'
name|'MigrationContext'
op|','
string|"'get_by_instance_uuid'"
op|')'
name|'as'
name|'mock_get'
op|':'
newline|'\n'
indent|' '
name|'loaded_ctxt'
op|'='
name|'inst'
op|'.'
name|'_load_migration_context'
op|'('
name|'db_context'
op|'='
name|'None'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'mock_get'
op|'.'
name|'called'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'loaded_ctxt'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_apply_revert_migration_context
dedent|''
dedent|''
name|'def'
name|'test_apply_revert_migration_context'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'numa_topology'
op|'='
name|'None'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'='
name|'test_mig_ctxt'
op|'.'
name|'get_fake_migration_context_obj'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'apply_migration_context'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst'
op|'.'
name|'numa_topology'
op|','
name|'objects'
op|'.'
name|'InstanceNUMATopology'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'revert_migration_context'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'inst'
op|'.'
name|'numa_topology'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_drop_migration_context
dedent|''
name|'def'
name|'test_drop_migration_context'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'='
name|'test_mig_ctxt'
op|'.'
name|'get_fake_migration_context_obj'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'.'
name|'instance_uuid'
op|'='
name|'inst'
op|'.'
name|'uuid'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'.'
name|'id'
op|'='
number|'7'
newline|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'('
nl|'\n'
string|"'nova.db.instance_extra_update_by_uuid'"
op|')'
name|'as'
name|'update_extra'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'drop_migration_context'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'inst'
op|'.'
name|'migration_context'
op|')'
newline|'\n'
name|'update_extra'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|'.'
name|'uuid'
op|','
nl|'\n'
op|'{'
string|'"migration_context"'
op|':'
name|'None'
op|'}'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_mutated_migration_context
dedent|''
dedent|''
name|'def'
name|'test_mutated_migration_context'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'numa_topology'
op|'='
op|'('
name|'test_instance_numa_topology'
op|'.'
nl|'\n'
name|'fake_obj_numa_topology'
op|'.'
name|'obj_clone'
op|'('
op|')'
op|')'
newline|'\n'
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'0'
op|']'
op|'.'
name|'memory'
op|'='
number|'1024'
newline|'\n'
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'1'
op|']'
op|'.'
name|'memory'
op|'='
number|'1024'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'numa_topology'
op|'='
name|'numa_topology'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'='
name|'test_mig_ctxt'
op|'.'
name|'get_fake_migration_context_obj'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|')'
newline|'\n'
name|'with'
name|'inst'
op|'.'
name|'mutated_migration_context'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIs'
op|'('
name|'inst'
op|'.'
name|'numa_topology'
op|','
nl|'\n'
name|'inst'
op|'.'
name|'migration_context'
op|'.'
name|'new_numa_topology'
op|')'
newline|'\n'
dedent|''
name|'self'
op|'.'
name|'assertIs'
op|'('
name|'numa_topology'
op|','
name|'inst'
op|'.'
name|'numa_topology'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_clear_numa_topology
dedent|''
name|'def'
name|'test_clear_numa_topology'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'numa_topology'
op|'='
op|'('
name|'test_instance_numa_topology'
op|'.'
nl|'\n'
name|'fake_obj_numa_topology'
op|'.'
name|'obj_clone'
op|'('
op|')'
op|')'
newline|'\n'
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'0'
op|']'
op|'.'
name|'id'
op|'='
number|'42'
newline|'\n'
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'1'
op|']'
op|'.'
name|'id'
op|'='
number|'43'
newline|'\n'
nl|'\n'
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|','
nl|'\n'
name|'numa_topology'
op|'='
name|'numa_topology'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'clear_numa_topology'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIn'
op|'('
string|"'numa_topology'"
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'-'
number|'1'
op|','
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'0'
op|']'
op|'.'
name|'id'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'-'
number|'1'
op|','
name|'numa_topology'
op|'.'
name|'cells'
op|'['
number|'1'
op|']'
op|'.'
name|'id'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'objects'
op|'.'
name|'Instance'
op|','
string|"'get_by_uuid'"
op|')'
newline|'\n'
DECL|member|test_load_generic
name|'def'
name|'test_load_generic'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst2'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'metadata'
op|'='
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'inst2'
newline|'\n'
name|'inst'
op|'='
name|'instance'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'metadata'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_fault_get_by_instance_uuids'"
op|')'
newline|'\n'
DECL|member|test_load_fault
name|'def'
name|'test_load_fault'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_fault'
op|'='
name|'test_instance_fault'
op|'.'
name|'fake_faults'
op|'['
string|"'fake-uuid'"
op|']'
op|'['
number|'0'
op|']'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
op|'{'
name|'uuids'
op|'.'
name|'load_fault_instance'
op|':'
op|'['
name|'fake_fault'
op|']'
op|'}'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'load_fault_instance'
op|')'
newline|'\n'
name|'fault'
op|'='
name|'inst'
op|'.'
name|'fault'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
op|'['
name|'uuids'
op|'.'
name|'load_fault_instance'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_fault'
op|'['
string|"'id'"
op|']'
op|','
name|'fault'
op|'.'
name|'id'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'metadata'"
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.EC2Ids.get_by_instance'"
op|')'
newline|'\n'
DECL|member|test_load_ec2_ids
name|'def'
name|'test_load_ec2_ids'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_ec2_ids'
op|'='
name|'objects'
op|'.'
name|'EC2Ids'
op|'('
name|'instance_id'
op|'='
string|"'fake-inst'"
op|','
nl|'\n'
name|'ami_id'
op|'='
string|"'fake-ami'"
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'fake_ec2_ids'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'ec2_ids'
op|'='
name|'inst'
op|'.'
name|'ec2_ids'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_ec2_ids'
op|','
name|'ec2_ids'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.SecurityGroupList.get_by_instance'"
op|')'
newline|'\n'
DECL|member|test_load_security_groups
name|'def'
name|'test_load_security_groups'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'secgroups'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'name'
name|'in'
op|'('
string|"'foo'"
op|','
string|"'bar'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'secgroup'
op|'='
name|'security_group'
op|'.'
name|'SecurityGroup'
op|'('
op|')'
newline|'\n'
name|'secgroup'
op|'.'
name|'name'
op|'='
name|'name'
newline|'\n'
name|'secgroups'
op|'.'
name|'append'
op|'('
name|'secgroup'
op|')'
newline|'\n'
dedent|''
name|'fake_secgroups'
op|'='
name|'security_group'
op|'.'
name|'SecurityGroupList'
op|'('
name|'objects'
op|'='
name|'secgroups'
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'fake_secgroups'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'instance'
op|')'
newline|'\n'
name|'secgroups'
op|'='
name|'inst'
op|'.'
name|'security_groups'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_secgroups'
op|','
name|'secgroups'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.PciDeviceList.get_by_instance_uuid'"
op|')'
newline|'\n'
DECL|member|test_load_pci_devices
name|'def'
name|'test_load_pci_devices'
op|'('
name|'self'
op|','
name|'mock_get'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_pci_devices'
op|'='
name|'pci_device'
op|'.'
name|'PciDeviceList'
op|'('
op|')'
newline|'\n'
name|'mock_get'
op|'.'
name|'return_value'
op|'='
name|'fake_pci_devices'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'pci_devices'
op|')'
newline|'\n'
name|'pci_devices'
op|'='
name|'inst'
op|'.'
name|'pci_devices'
newline|'\n'
name|'mock_get'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuids'
op|'.'
name|'pci_devices'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_pci_devices'
op|','
name|'pci_devices'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_with_extras
dedent|''
name|'def'
name|'test_get_with_extras'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'pci_requests'
op|'='
name|'objects'
op|'.'
name|'InstancePCIRequests'
op|'('
name|'requests'
op|'='
op|'['
nl|'\n'
name|'objects'
op|'.'
name|'InstancePCIRequest'
op|'('
name|'count'
op|'='
number|'123'
op|','
name|'spec'
op|'='
op|'['
op|']'
op|')'
op|']'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'self'
op|'.'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'pci_requests'
op|'='
name|'pci_requests'
op|')'
newline|'\n'
name|'inst'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'uuid'
op|'='
name|'inst'
op|'.'
name|'uuid'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertFalse'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'pci_requests'"
op|')'
op|')'
newline|'\n'
name|'inst'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'.'
name|'get_by_uuid'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'uuid'
op|','
name|'expected_attrs'
op|'='
op|'['
string|"'pci_requests'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'inst'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'pci_requests'"
op|')'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
dedent|''
name|'class'
name|'TestInstanceObject'
op|'('
name|'test_objects'
op|'.'
name|'_LocalTest'
op|','
nl|'\n'
DECL|class|TestInstanceObject
name|'_TestInstanceObject'
op|')'
op|':'
newline|'\n'
DECL|member|_test_save_objectfield_fk_constraint_fails
indent|' '
name|'def'
name|'_test_save_objectfield_fk_constraint_fails'
op|'('
name|'self'
op|','
name|'foreign_key'
op|','
nl|'\n'
name|'expected_exception'
op|')'
op|':'
newline|'\n'
comment|'# NOTE(danms): Do this here and not in the remote test because'
nl|'\n'
comment|"# we're mocking out obj_attr_is_set() without the thing actually"
nl|'\n'
comment|'# being set, which confuses the heck out of the serialization'
nl|'\n'
comment|'# stuff.'
nl|'\n'
indent|' '
name|'error'
op|'='
name|'db_exc'
op|'.'
name|'DBReferenceError'
op|'('
string|"'table'"
op|','
string|"'constraint'"
op|','
name|'foreign_key'
op|','
nl|'\n'
string|"'key_table'"
op|')'
newline|'\n'
comment|'# Prevent lazy-loading any fields, results in InstanceNotFound'
nl|'\n'
name|'attrs'
op|'='
name|'objects'
op|'.'
name|'instance'
op|'.'
name|'INSTANCE_OPTIONAL_ATTRS'
newline|'\n'
name|'instance'
op|'='
name|'fake_instance'
op|'.'
name|'fake_instance_obj'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
name|'attrs'
op|')'
newline|'\n'
name|'fields_with_save_methods'
op|'='
op|'['
name|'field'
name|'for'
name|'field'
name|'in'
name|'instance'
op|'.'
name|'fields'
nl|'\n'
name|'if'
name|'hasattr'
op|'('
name|'instance'
op|','
string|"'_save_%s'"
op|'%'
name|'field'
op|')'
op|']'
newline|'\n'
name|'for'
name|'field'
name|'in'
name|'fields_with_save_methods'
op|':'
newline|'\n'
indent|' '
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'instance'
op|','
string|"'_save_%s'"
op|'%'
name|'field'
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'instance'
op|','
string|"'obj_attr_is_set'"
op|')'
newline|'\n'
DECL|function|_test
name|'def'
name|'_test'
op|'('
name|'mock_is_set'
op|','
name|'mock_save_field'
op|')'
op|':'
newline|'\n'
indent|' '
name|'mock_is_set'
op|'.'
name|'return_value'
op|'='
name|'True'
newline|'\n'
name|'mock_save_field'
op|'.'
name|'side_effect'
op|'='
name|'error'
newline|'\n'
name|'instance'
op|'.'
name|'obj_reset_changes'
op|'('
name|'fields'
op|'='
op|'['
name|'field'
op|']'
op|')'
newline|'\n'
name|'instance'
op|'.'
name|'_changed_fields'
op|'.'
name|'add'
op|'('
name|'field'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'expected_exception'
op|','
name|'instance'
op|'.'
name|'save'
op|')'
newline|'\n'
name|'instance'
op|'.'
name|'obj_reset_changes'
op|'('
name|'fields'
op|'='
op|'['
name|'field'
op|']'
op|')'
newline|'\n'
dedent|''
name|'_test'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_objectfield_missing_instance_row
dedent|''
dedent|''
name|'def'
name|'test_save_objectfield_missing_instance_row'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_save_objectfield_fk_constraint_fails'
op|'('
nl|'\n'
string|"'instance_uuid'"
op|','
name|'exception'
op|'.'
name|'InstanceNotFound'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_save_objectfield_reraises_if_not_instance_related
dedent|''
name|'def'
name|'test_save_objectfield_reraises_if_not_instance_related'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_test_save_objectfield_fk_constraint_fails'
op|'('
nl|'\n'
string|"'other_foreign_key'"
op|','
name|'db_exc'
op|'.'
name|'DBReferenceError'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
dedent|''
name|'class'
name|'TestRemoteInstanceObject'
op|'('
name|'test_objects'
op|'.'
name|'_RemoteTest'
op|','
nl|'\n'
DECL|class|TestRemoteInstanceObject
name|'_TestInstanceObject'
op|')'
op|':'
newline|'\n'
indent|' '
name|'pass'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|_TestInstanceListObject
dedent|''
name|'class'
name|'_TestInstanceListObject'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
DECL|member|fake_instance
indent|' '
name|'def'
name|'fake_instance'
op|'('
name|'self'
op|','
name|'id'
op|','
name|'updates'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
name|'db_inst'
op|'='
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'2'
op|','
nl|'\n'
name|'access_ip_v4'
op|'='
string|"'1.2.3.4'"
op|','
nl|'\n'
name|'access_ip_v6'
op|'='
string|"'::1'"
op|')'
newline|'\n'
name|'db_inst'
op|'['
string|"'terminated_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'deleted_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'created_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'updated_at'"
op|']'
op|'='
name|'None'
newline|'\n'
name|'db_inst'
op|'['
string|"'launched_at'"
op|']'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'1955'
op|','
number|'11'
op|','
number|'12'
op|','
nl|'\n'
number|'22'
op|','
number|'4'
op|','
number|'0'
op|')'
newline|'\n'
name|'db_inst'
op|'['
string|"'security_groups'"
op|']'
op|'='
op|'['
op|']'
newline|'\n'
name|'db_inst'
op|'['
string|"'deleted'"
op|']'
op|'='
number|'0'
newline|'\n'
nl|'\n'
name|'db_inst'
op|'['
string|"'info_cache'"
op|']'
op|'='
name|'dict'
op|'('
name|'test_instance_info_cache'
op|'.'
name|'fake_info_cache'
op|','
nl|'\n'
name|'instance_uuid'
op|'='
name|'db_inst'
op|'['
string|"'uuid'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'updates'
op|':'
newline|'\n'
indent|' '
name|'db_inst'
op|'.'
name|'update'
op|'('
name|'updates'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'db_inst'
newline|'\n'
nl|'\n'
DECL|member|test_get_all_by_filters
dedent|''
name|'def'
name|'test_get_all_by_filters'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_filters'
op|'('
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
string|"'uuid'"
op|','
nl|'\n'
string|"'asc'"
op|','
name|'limit'
op|'='
name|'None'
op|','
name|'marker'
op|'='
name|'None'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'metadata'"
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_filters'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
string|"'uuid'"
op|','
string|"'asc'"
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'metadata'"
op|']'
op|','
name|'use_slave'
op|'='
name|'False'
op|')'
newline|'\n'
nl|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_all_by_filters_sorted
dedent|''
dedent|''
name|'def'
name|'test_get_all_by_filters_sorted'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters_sort'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_filters_sort'
op|'('
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
nl|'\n'
name|'limit'
op|'='
name|'None'
op|','
name|'marker'
op|'='
name|'None'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'metadata'"
op|']'
op|','
nl|'\n'
name|'sort_keys'
op|'='
op|'['
string|"'uuid'"
op|']'
op|','
nl|'\n'
name|'sort_dirs'
op|'='
op|'['
string|"'asc'"
op|']'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_filters'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'expected_attrs'
op|'='
op|'['
string|"'metadata'"
op|']'
op|','
nl|'\n'
name|'use_slave'
op|'='
name|'False'
op|','
name|'sort_keys'
op|'='
op|'['
string|"'uuid'"
op|']'
op|','
name|'sort_dirs'
op|'='
op|'['
string|"'asc'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters_sort'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters'"
op|')'
newline|'\n'
DECL|member|test_get_all_by_filters_calls_non_sort
name|'def'
name|'test_get_all_by_filters_calls_non_sort'
op|'('
name|'self'
op|','
nl|'\n'
name|'mock_get_by_filters'
op|','
nl|'\n'
name|'mock_get_by_filters_sort'
op|')'
op|':'
newline|'\n'
indent|' '
string|"'''Verifies InstanceList.get_by_filters calls correct DB function.'''"
newline|'\n'
comment|'# Single sort key/direction is set, call non-sorted DB function'
nl|'\n'
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_filters'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'sort_key'
op|'='
string|"'key'"
op|','
name|'sort_dir'
op|'='
string|"'dir'"
op|','
nl|'\n'
name|'limit'
op|'='
number|'100'
op|','
name|'marker'
op|'='
string|"'uuid'"
op|','
name|'use_slave'
op|'='
name|'True'
op|')'
newline|'\n'
name|'mock_get_by_filters'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
string|"'key'"
op|','
string|"'dir'"
op|','
name|'limit'
op|'='
number|'100'
op|','
nl|'\n'
name|'marker'
op|'='
string|"'uuid'"
op|','
name|'columns_to_join'
op|'='
name|'None'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'0'
op|','
name|'mock_get_by_filters_sort'
op|'.'
name|'call_count'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters_sort'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters'"
op|')'
newline|'\n'
DECL|member|test_get_all_by_filters_calls_sort
name|'def'
name|'test_get_all_by_filters_calls_sort'
op|'('
name|'self'
op|','
nl|'\n'
name|'mock_get_by_filters'
op|','
nl|'\n'
name|'mock_get_by_filters_sort'
op|')'
op|':'
newline|'\n'
indent|' '
string|"'''Verifies InstanceList.get_by_filters calls correct DB function.'''"
newline|'\n'
comment|'# Multiple sort keys/directions are set, call sorted DB function'
nl|'\n'
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_filters'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'limit'
op|'='
number|'100'
op|','
name|'marker'
op|'='
string|"'uuid'"
op|','
nl|'\n'
name|'use_slave'
op|'='
name|'True'
op|','
name|'sort_keys'
op|'='
op|'['
string|"'key1'"
op|','
string|"'key2'"
op|']'
op|','
nl|'\n'
name|'sort_dirs'
op|'='
op|'['
string|"'dir1'"
op|','
string|"'dir2'"
op|']'
op|')'
newline|'\n'
name|'mock_get_by_filters_sort'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'limit'
op|'='
number|'100'
op|','
nl|'\n'
name|'marker'
op|'='
string|"'uuid'"
op|','
name|'columns_to_join'
op|'='
name|'None'
op|','
nl|'\n'
name|'sort_keys'
op|'='
op|'['
string|"'key1'"
op|','
string|"'key2'"
op|']'
op|','
name|'sort_dirs'
op|'='
op|'['
string|"'dir1'"
op|','
string|"'dir2'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'0'
op|','
name|'mock_get_by_filters'
op|'.'
name|'call_count'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_all_by_filters_works_for_cleaned
dedent|''
name|'def'
name|'test_get_all_by_filters_works_for_cleaned'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|','
name|'updates'
op|'='
op|'{'
string|"'deleted'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'cleaned'"
op|':'
name|'None'
op|'}'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'context'
op|'.'
name|'read_deleted'
op|'='
string|"'yes'"
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_filters'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_filters'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
op|'{'
string|"'deleted'"
op|':'
name|'True'
op|','
string|"'cleaned'"
op|':'
name|'False'
op|'}'
op|','
nl|'\n'
string|"'uuid'"
op|','
string|"'asc'"
op|','
name|'limit'
op|'='
name|'None'
op|','
name|'marker'
op|'='
name|'None'
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
string|"'metadata'"
op|']'
op|')'
op|'.'
name|'AndReturn'
op|'('
nl|'\n'
op|'['
name|'fakes'
op|'['
number|'1'
op|']'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_filters'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'{'
string|"'deleted'"
op|':'
name|'True'
op|','
string|"'cleaned'"
op|':'
name|'False'
op|'}'
op|','
string|"'uuid'"
op|','
string|"'asc'"
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'metadata'"
op|']'
op|','
name|'use_slave'
op|'='
name|'False'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'1'
op|','
name|'len'
op|'('
name|'inst_list'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
number|'0'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
number|'1'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
number|'0'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_by_host
dedent|''
name|'def'
name|'test_get_by_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_host'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_host'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'foo'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
name|'None'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_host'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'foo'"
op|')'
newline|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'_context'
op|')'
newline|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|')'
op|','
name|'inst_list'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_by_host_and_node
dedent|''
name|'def'
name|'test_get_by_host_and_node'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_host_and_node'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_host_and_node'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'foo'"
op|','
string|"'bar'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
name|'None'
op|')'
op|'.'
name|'AndReturn'
op|'('
nl|'\n'
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_host_and_node'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
string|"'foo'"
op|','
string|"'bar'"
op|')'
newline|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_by_host_and_not_type
dedent|''
dedent|''
name|'def'
name|'test_get_by_host_and_not_type'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_host_and_not_type'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_host_and_not_type'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'foo'"
op|','
nl|'\n'
name|'type_id'
op|'='
string|"'bar'"
op|')'
op|'.'
name|'AndReturn'
op|'('
nl|'\n'
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_host_and_not_type'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
string|"'foo'"
op|','
string|"'bar'"
op|')'
newline|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.instance._expected_cols'"
op|')'
newline|'\n'
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.db.instance_get_all'"
op|')'
newline|'\n'
DECL|member|test_get_all
name|'def'
name|'test_get_all'
op|'('
name|'self'
op|','
name|'mock_get_all'
op|','
name|'mock_exp'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'mock_get_all'
op|'.'
name|'return_value'
op|'='
name|'fakes'
newline|'\n'
name|'mock_exp'
op|'.'
name|'return_value'
op|'='
name|'mock'
op|'.'
name|'sentinel'
op|'.'
name|'exp_att'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_all'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'expected_attrs'
op|'='
string|"'fake'"
op|')'
newline|'\n'
name|'mock_get_all'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'columns_to_join'
op|'='
name|'mock'
op|'.'
name|'sentinel'
op|'.'
name|'exp_att'
op|')'
newline|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_hung_in_rebooting
dedent|''
dedent|''
name|'def'
name|'test_get_hung_in_rebooting'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
nl|'\n'
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
name|'dt'
op|'='
name|'utils'
op|'.'
name|'isotime'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_hung_in_rebooting'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_hung_in_rebooting'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'dt'
op|')'
op|'.'
name|'AndReturn'
op|'('
nl|'\n'
name|'fakes'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_hung_in_rebooting'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
name|'dt'
op|')'
newline|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
number|'0'
op|','
name|'len'
op|'('
name|'fakes'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fakes'
op|'['
name|'i'
op|']'
op|'['
string|"'uuid'"
op|']'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|'['
name|'i'
op|']'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_active_by_window_joined
dedent|''
dedent|''
name|'def'
name|'test_get_active_by_window_joined'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fakes'
op|'='
op|'['
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'1'
op|')'
op|','
name|'self'
op|'.'
name|'fake_instance'
op|'('
number|'2'
op|')'
op|']'
newline|'\n'
comment|'# NOTE(mriedem): Send in a timezone-naive datetime since the'
nl|'\n'
comment|'# InstanceList.get_active_by_window_joined method should convert it'
nl|'\n'
comment|"# to tz-aware for the DB API call, which we'll assert with our stub."
nl|'\n'
name|'dt'
op|'='
name|'timeutils'
op|'.'
name|'utcnow'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|function|fake_instance_get_active_by_window_joined
name|'def'
name|'fake_instance_get_active_by_window_joined'
op|'('
name|'context'
op|','
name|'begin'
op|','
name|'end'
op|','
nl|'\n'
name|'project_id'
op|','
name|'host'
op|','
nl|'\n'
name|'columns_to_join'
op|')'
op|':'
newline|'\n'
comment|'# make sure begin is tz-aware'
nl|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'begin'
op|'.'
name|'utcoffset'
op|'('
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'end'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
string|"'metadata'"
op|']'
op|','
name|'columns_to_join'
op|')'
newline|'\n'
name|'return'
name|'fakes'
newline|'\n'
nl|'\n'
dedent|''
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'instance_get_active_by_window_joined'"
op|','
nl|'\n'
name|'fake_instance_get_active_by_window_joined'
op|')'
op|':'
newline|'\n'
indent|' '
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_active_by_window_joined'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'dt'
op|','
name|'expected_attrs'
op|'='
op|'['
string|"'metadata'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'fake'
op|','
name|'obj'
name|'in'
name|'zip'
op|'('
name|'fakes'
op|','
name|'inst_list'
op|'.'
name|'objects'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertIsInstance'
op|'('
name|'obj'
op|','
name|'instance'
op|'.'
name|'Instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake'
op|'['
string|"'uuid'"
op|']'
op|','
name|'obj'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_with_fault
dedent|''
dedent|''
name|'def'
name|'test_with_fault'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_insts'
op|'='
op|'['
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'faults_instance'
op|','
nl|'\n'
name|'host'
op|'='
string|"'host'"
op|')'
op|','
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'faults_instance_nonexist'
op|','
nl|'\n'
name|'host'
op|'='
string|"'host'"
op|')'
op|','
nl|'\n'
op|']'
newline|'\n'
name|'fake_faults'
op|'='
name|'test_instance_fault'
op|'.'
name|'fake_faults'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_get_all_by_host'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_fault_get_by_instance_uuids'"
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_get_all_by_host'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'host'"
op|','
nl|'\n'
name|'columns_to_join'
op|'='
op|'['
op|']'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_insts'
op|')'
newline|'\n'
name|'db'
op|'.'
name|'instance_fault_get_by_instance_uuids'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
op|'['
name|'x'
op|'['
string|"'uuid'"
op|']'
name|'for'
name|'x'
name|'in'
name|'fake_insts'
op|']'
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'fake_faults'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'instances'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_host'
op|'('
name|'self'
op|'.'
name|'context'
op|','
string|"'host'"
op|','
nl|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'fault'"
op|']'
op|','
nl|'\n'
name|'use_slave'
op|'='
name|'False'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'len'
op|'('
name|'instances'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'fake_faults'
op|'['
string|"'fake-uuid'"
op|']'
op|'['
number|'0'
op|']'
op|','
nl|'\n'
name|'dict'
op|'('
name|'instances'
op|'['
number|'0'
op|']'
op|'.'
name|'fault'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'instances'
op|'['
number|'1'
op|']'
op|'.'
name|'fault'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_fill_faults
dedent|''
name|'def'
name|'test_fill_faults'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'mox'
op|'.'
name|'StubOutWithMock'
op|'('
name|'db'
op|','
string|"'instance_fault_get_by_instance_uuids'"
op|')'
newline|'\n'
nl|'\n'
name|'inst1'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'db_fault_1'
op|')'
newline|'\n'
name|'inst2'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'uuid'
op|'='
name|'uuids'
op|'.'
name|'db_fault_2'
op|')'
newline|'\n'
name|'insts'
op|'='
op|'['
name|'inst1'
op|','
name|'inst2'
op|']'
newline|'\n'
name|'for'
name|'inst'
name|'in'
name|'insts'
op|':'
newline|'\n'
indent|' '
name|'inst'
op|'.'
name|'obj_reset_changes'
op|'('
op|')'
newline|'\n'
dedent|''
name|'db_faults'
op|'='
op|'{'
nl|'\n'
string|"'uuid1'"
op|':'
op|'['
op|'{'
string|"'id'"
op|':'
number|'123'
op|','
nl|'\n'
string|"'instance_uuid'"
op|':'
name|'uuids'
op|'.'
name|'db_fault_1'
op|','
nl|'\n'
string|"'code'"
op|':'
number|'456'
op|','
nl|'\n'
string|"'message'"
op|':'
string|"'Fake message'"
op|','
nl|'\n'
string|"'details'"
op|':'
string|"'No details'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'foo'"
op|','
nl|'\n'
string|"'deleted'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'deleted_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'created_at'"
op|':'
name|'None'
op|','
nl|'\n'
op|'}'
nl|'\n'
op|']'
op|'}'
newline|'\n'
nl|'\n'
name|'db'
op|'.'
name|'instance_fault_get_by_instance_uuids'
op|'('
name|'self'
op|'.'
name|'context'
op|','
nl|'\n'
op|'['
name|'x'
op|'.'
name|'uuid'
name|'for'
name|'x'
name|'in'
name|'insts'
op|']'
op|','
nl|'\n'
op|')'
op|'.'
name|'AndReturn'
op|'('
name|'db_faults'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'mox'
op|'.'
name|'ReplayAll'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'('
op|')'
newline|'\n'
name|'inst_list'
op|'.'
name|'_context'
op|'='
name|'self'
op|'.'
name|'context'
newline|'\n'
name|'inst_list'
op|'.'
name|'objects'
op|'='
name|'insts'
newline|'\n'
name|'faulty'
op|'='
name|'inst_list'
op|'.'
name|'fill_faults'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
name|'uuids'
op|'.'
name|'db_fault_1'
op|']'
op|','
name|'list'
op|'('
name|'faulty'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'db_faults'
op|'['
string|"'uuid1'"
op|']'
op|'['
number|'0'
op|']'
op|'['
string|"'message'"
op|']'
op|','
nl|'\n'
name|'inst_list'
op|'['
number|'0'
op|']'
op|'.'
name|'fault'
op|'.'
name|'message'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'inst_list'
op|'['
number|'1'
op|']'
op|'.'
name|'fault'
op|')'
newline|'\n'
name|'for'
name|'inst'
name|'in'
name|'inst_list'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'set'
op|'('
op|')'
op|','
name|'inst'
op|'.'
name|'obj_what_changed'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'('
string|"'nova.objects.instance.Instance.obj_make_compatible'"
op|')'
newline|'\n'
DECL|member|test_get_by_security_group
name|'def'
name|'test_get_by_security_group'
op|'('
name|'self'
op|','
name|'mock_compat'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_secgroup'
op|'='
name|'dict'
op|'('
name|'test_security_group'
op|'.'
name|'fake_secgroup'
op|')'
newline|'\n'
name|'fake_secgroup'
op|'['
string|"'instances'"
op|']'
op|'='
op|'['
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'1'
op|','
nl|'\n'
name|'system_metadata'
op|'='
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|')'
op|','
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'2'
op|')'
op|','
nl|'\n'
op|']'
newline|'\n'
nl|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db'
op|','
string|"'security_group_get'"
op|')'
name|'as'
name|'sgg'
op|':'
newline|'\n'
indent|' '
name|'sgg'
op|'.'
name|'return_value'
op|'='
name|'fake_secgroup'
newline|'\n'
name|'secgroup'
op|'='
name|'security_group'
op|'.'
name|'SecurityGroup'
op|'('
op|')'
newline|'\n'
name|'secgroup'
op|'.'
name|'id'
op|'='
name|'fake_secgroup'
op|'['
string|"'id'"
op|']'
newline|'\n'
name|'instances'
op|'='
name|'instance'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_security_group'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'secgroup'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'len'
op|'('
name|'instances'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
number|'1'
op|','
number|'2'
op|']'
op|','
op|'['
name|'x'
op|'.'
name|'id'
name|'for'
name|'x'
name|'in'
name|'instances'
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertTrue'
op|'('
name|'instances'
op|'['
number|'0'
op|']'
op|'.'
name|'obj_attr_is_set'
op|'('
string|"'system_metadata'"
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'{'
string|"'foo'"
op|':'
string|"'bar'"
op|'}'
op|','
name|'instances'
op|'['
number|'0'
op|']'
op|'.'
name|'system_metadata'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_get_by_grantee_security_group_ids
dedent|''
name|'def'
name|'test_get_by_grantee_security_group_ids'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'fake_instances'
op|'='
op|'['
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'1'
op|')'
op|','
nl|'\n'
name|'fake_instance'
op|'.'
name|'fake_db_instance'
op|'('
name|'id'
op|'='
number|'2'
op|')'
nl|'\n'
op|']'
newline|'\n'
nl|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
nl|'\n'
name|'db'
op|','
string|"'instance_get_all_by_grantee_security_groups'"
op|')'
name|'as'
name|'igabgsg'
op|':'
newline|'\n'
indent|' '
name|'igabgsg'
op|'.'
name|'return_value'
op|'='
name|'fake_instances'
newline|'\n'
name|'secgroup_ids'
op|'='
op|'['
number|'1'
op|']'
newline|'\n'
name|'instances'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'.'
name|'get_by_grantee_security_group_ids'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'context'
op|','
name|'secgroup_ids'
op|')'
newline|'\n'
name|'igabgsg'
op|'.'
name|'assert_called_once_with'
op|'('
name|'self'
op|'.'
name|'context'
op|','
name|'secgroup_ids'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'len'
op|'('
name|'instances'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
number|'1'
op|','
number|'2'
op|']'
op|','
op|'['
name|'x'
op|'.'
name|'id'
name|'for'
name|'x'
name|'in'
name|'instances'
op|']'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
dedent|''
name|'class'
name|'TestInstanceListObject'
op|'('
name|'test_objects'
op|'.'
name|'_LocalTest'
op|','
nl|'\n'
DECL|class|TestInstanceListObject
name|'_TestInstanceListObject'
op|')'
op|':'
newline|'\n'
indent|' '
name|'pass'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
name|'class'
name|'TestRemoteInstanceListObject'
op|'('
name|'test_objects'
op|'.'
name|'_RemoteTest'
op|','
nl|'\n'
DECL|class|TestRemoteInstanceListObject
name|'_TestInstanceListObject'
op|')'
op|':'
newline|'\n'
indent|' '
name|'pass'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|TestInstanceObjectMisc
dedent|''
name|'class'
name|'TestInstanceObjectMisc'
op|'('
name|'test'
op|'.'
name|'TestCase'
op|')'
op|':'
newline|'\n'
DECL|member|test_expected_cols
indent|' '
name|'def'
name|'test_expected_cols'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'stubs'
op|'.'
name|'Set'
op|'('
name|'instance'
op|','
string|"'_INSTANCE_OPTIONAL_JOINED_FIELDS'"
op|','
op|'['
string|"'bar'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
string|"'bar'"
op|']'
op|','
name|'instance'
op|'.'
name|'_expected_cols'
op|'('
op|'['
string|"'foo'"
op|','
string|"'bar'"
op|']'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'instance'
op|'.'
name|'_expected_cols'
op|'('
name|'None'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_expected_cols_extra
dedent|''
name|'def'
name|'test_expected_cols_extra'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
string|"'metadata'"
op|','
string|"'extra'"
op|','
string|"'extra.numa_topology'"
op|']'
op|','
nl|'\n'
name|'instance'
op|'.'
name|'_expected_cols'
op|'('
op|'['
string|"'metadata'"
op|','
nl|'\n'
string|"'numa_topology'"
op|']'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_migrate_instance_keypairs
dedent|''
name|'def'
name|'test_migrate_instance_keypairs'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'ctxt'
op|'='
name|'context'
op|'.'
name|'RequestContext'
op|'('
string|"'foo'"
op|','
string|"'bar'"
op|')'
newline|'\n'
name|'key'
op|'='
name|'objects'
op|'.'
name|'KeyPair'
op|'('
name|'context'
op|'='
name|'ctxt'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'ctxt'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'name'
op|'='
string|"'testkey'"
op|','
nl|'\n'
name|'public_key'
op|'='
string|"'keydata'"
op|','
nl|'\n'
name|'type'
op|'='
string|"'ssh'"
op|')'
newline|'\n'
name|'key'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'inst1'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'ctxt'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'ctxt'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'ctxt'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'key_name'
op|'='
string|"'testkey'"
op|')'
newline|'\n'
name|'inst1'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'inst2'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'ctxt'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'ctxt'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'ctxt'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'key_name'
op|'='
string|"'testkey'"
op|','
nl|'\n'
name|'keypairs'
op|'='
name|'objects'
op|'.'
name|'KeyPairList'
op|'('
nl|'\n'
name|'objects'
op|'='
op|'['
name|'key'
op|']'
op|')'
op|')'
newline|'\n'
name|'inst2'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
name|'inst3'
op|'='
name|'objects'
op|'.'
name|'Instance'
op|'('
name|'context'
op|'='
name|'ctxt'
op|','
nl|'\n'
name|'user_id'
op|'='
name|'ctxt'
op|'.'
name|'user_id'
op|','
nl|'\n'
name|'project_id'
op|'='
name|'ctxt'
op|'.'
name|'project_id'
op|','
nl|'\n'
name|'key_name'
op|'='
string|"'missingkey'"
op|')'
newline|'\n'
name|'inst3'
op|'.'
name|'create'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'hit'
op|','
name|'done'
op|'='
name|'instance'
op|'.'
name|'migrate_instance_keypairs'
op|'('
name|'ctxt'
op|','
number|'10'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'hit'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
number|'2'
op|','
name|'done'
op|')'
newline|'\n'
name|'db_extra'
op|'='
name|'db'
op|'.'
name|'instance_extra_get_by_instance_uuid'
op|'('
nl|'\n'
name|'ctxt'
op|','
name|'inst1'
op|'.'
name|'uuid'
op|','
op|'['
string|"'keypairs'"
op|']'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertIsNotNone'
op|'('
name|'db_extra'
op|'.'
name|'keypairs'
op|')'
newline|'\n'
name|'db_extra'
op|'='
name|'db'
op|'.'
name|'instance_extra_get_by_instance_uuid'
op|'('
nl|'\n'
name|'ctxt'
op|','
name|'inst3'
op|'.'
name|'uuid'
op|','
op|'['
string|"'keypairs'"
op|']'
op|')'
newline|'\n'
name|'obj'
op|'='
name|'base'
op|'.'
name|'NovaObject'
op|'.'
name|'obj_from_primitive'
op|'('
nl|'\n'
name|'jsonutils'
op|'.'
name|'loads'
op|'('
name|'db_extra'
op|'['
string|"'keypairs'"
op|']'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
op|'['
op|']'
op|','
name|'obj'
op|'.'
name|'objects'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit
| 11.966685 | 88 | 0.597737 | 26,899 | 178,878 | 3.848024 | 0.024053 | 0.19726 | 0.089462 | 0.076825 | 0.942961 | 0.914548 | 0.876435 | 0.836351 | 0.79419 | 0.756048 | 0 | 0.002698 | 0.094573 | 178,878 | 14,947 | 89 | 11.967485 | 0.636394 | 0 | 0 | 0.969292 | 0 | 0 | 0.360028 | 0.044857 | 0 | 0 | 0 | 0 | 0.014786 | 0 | null | null | 0.000201 | 0.002208 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
a1409e6c64c3c1635aab7eba151e6c5d5167065d | 3,431 | py | Python | tests/test_lxml_to_dict.py | CRiva/lxml_to_dict | 53bde1cb9a7c212152b536abf837e6538e917bd0 | [
"MIT"
] | 1 | 2019-06-21T19:35:58.000Z | 2019-06-21T19:35:58.000Z | tests/test_lxml_to_dict.py | CRiva/lxml_to_dict | 53bde1cb9a7c212152b536abf837e6538e917bd0 | [
"MIT"
] | null | null | null | tests/test_lxml_to_dict.py | CRiva/lxml_to_dict | 53bde1cb9a7c212152b536abf837e6538e917bd0 | [
"MIT"
] | null | null | null | import pytest
from lxml import etree
from lxml import objectify
from lxml_to_dict import lxml_to_dict
def test_one_element():
root = objectify.Element("root") # <root></root>
assert lxml_to_dict(root) == {'root': None}
def test_one_subelement():
root = objectify.Element("root") # <root></root>
objectify.SubElement(root, "b") # <root><b></b></root>
assert lxml_to_dict(root) == {'root': {'b': None}}
def test_two_subelements():
root = objectify.Element("root") # <root></root>
objectify.SubElement(root, "b") # <root><b></b></root>
objectify.SubElement(root, "a") # <root><b></b><a></a></root>
assert lxml_to_dict(root) == {'root': {'b': None, 'a': None}}
def test_two_subelements_same_tag():
root = objectify.Element("root") # <root></root>
objectify.SubElement(root, "b") # <root><b></b></root>
objectify.SubElement(root, "b") # <root><b></b><b></b></root>
assert lxml_to_dict(root) == {'root': {'b': None, 'b1': None}}
def test_many_subelements_same_tag():
root = objectify.Element("root") # <root></root>
objectify.SubElement(root, "b") # <root><b></b></root>
objectify.SubElement(root, "b") # <root><b></b><b></b></root>
objectify.SubElement(root, "b")
objectify.SubElement(root, "b")
objectify.SubElement(root, "b")
objectify.SubElement(root, "b")
objectify.SubElement(root, "b")
assert lxml_to_dict(root) == {'root': {'b': None,
'b1': None,
'b2': None,
'b3': None,
'b4': None,
'b5': None,
'b6': None}}
def test_nested_subelements():
root = objectify.Element("root") # <root></root>
b = objectify.SubElement(root, "b") # <root><b></b></root>
a = objectify.SubElement(b, "a") # <root><b><a></a></b></root>
objectify.SubElement(a, "c") # <root><b><a><c></c></a></b></root>
assert lxml_to_dict(root) == {'root':
{'b':
{'a':
{'c': None}
}
}
}
def test_nested_subelements_same_tags():
root = objectify.Element("root") # <root></root>
b = objectify.SubElement(root, "b") # <root><b></b></root>
a = objectify.SubElement(b, "a") # <root><b><a></a></b></root>
a = objectify.SubElement(b, "a") # <root><b><a></a><a></a></b></root>
objectify.SubElement(a, "c") # <root><b><a></a><a><c></c></a></b></root>
objectify.SubElement(a, "c") # <root><b><a></a><a><c></c><c></c></a></b></root>
assert lxml_to_dict(root) == {'root':
{'b':
{'a': None,
'a1':
{'c': None,
'c1': None}
}
}
}
| 41.841463 | 98 | 0.41708 | 350 | 3,431 | 3.98 | 0.097143 | 0.129218 | 0.231156 | 0.223977 | 0.857861 | 0.808327 | 0.788227 | 0.752333 | 0.752333 | 0.728643 | 0 | 0.004371 | 0.399883 | 3,431 | 81 | 99 | 42.358025 | 0.672171 | 0.152725 | 0 | 0.461538 | 0 | 0 | 0.036408 | 0 | 0 | 0 | 0 | 0 | 0.107692 | 1 | 0.107692 | false | 0 | 0.061538 | 0 | 0.169231 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
a1ab38920a1a327cfb223647cc9ed55dadeee221 | 12,145 | py | Python | tests/test_fibonacci_lfsr.py | hussinhassan80/galois | 5553d0f17d5f4dcf105f92028fcde8f6afd53b6d | [
"MIT"
] | 65 | 2021-02-20T04:07:59.000Z | 2022-03-13T10:14:58.000Z | tests/test_fibonacci_lfsr.py | hussinhassan80/galois | 5553d0f17d5f4dcf105f92028fcde8f6afd53b6d | [
"MIT"
] | 303 | 2021-02-22T19:36:25.000Z | 2022-03-31T14:48:15.000Z | tests/test_fibonacci_lfsr.py | hussinhassan80/galois | 5553d0f17d5f4dcf105f92028fcde8f6afd53b6d | [
"MIT"
] | 9 | 2021-03-11T07:40:51.000Z | 2022-03-06T20:13:17.000Z | """
A pytest module to test the Fibonacci LFSR implementation.
"""
import pytest
import numpy as np
import galois
def test_exceptions():
poly = galois.Poly.Degrees([7,1,0])
with pytest.raises(TypeError):
galois.LFSR(poly.coeffs)
with pytest.raises(TypeError):
galois.LFSR(poly, state=float(poly.integer))
with pytest.raises(TypeError):
galois.LFSR(poly.coeffs, config=1)
with pytest.raises(ValueError):
galois.LFSR(poly, config="invalid-argument")
def test_state():
poly = galois.Poly.Degrees([7,1,0])
lfsr = galois.LFSR(poly, state=1)
assert np.array_equal(lfsr.state, [0, 0, 0, 0, 0, 0, 1])
lfsr = galois.LFSR(poly, state=4)
assert np.array_equal(lfsr.state, [0, 0, 0, 0, 1, 0, 0])
def test_str():
poly = galois.Poly.Degrees([7,1,0])
lfsr = galois.LFSR(poly)
assert str(lfsr) == "<Fibonacci LFSR: poly=Poly(x^7 + x + 1, GF(2))>"
def test_repr():
poly = galois.Poly.Degrees([7,1,0])
lfsr = galois.LFSR(poly)
assert repr(lfsr) == "<Fibonacci LFSR: poly=Poly(x^7 + x + 1, GF(2))>"
def test_step_exceptions():
poly = galois.Poly.Degrees([7,1,0])
lfsr = galois.LFSR(poly)
with pytest.raises(TypeError):
lfsr.step(10.0)
with pytest.raises(ValueError):
lfsr.step(0)
with pytest.raises(ValueError):
lfsr.step(-1)
def test_output_is_reversed_state():
poly = galois.Poly.Degrees([7,1,0])
state = galois.GF2.Zeros(7)
state[-1] = 1
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(7)
assert np.array_equal(y, state[::-1])
def test_gf2_output_1():
"""
Sage:
F = GF(2)
o = F(0); l = F(1)
key = [l,o,o,l]
fill = [l,l,o,l]
n = 20
s = lfsr_sequence(key,fill,n); s
"""
GF = galois.GF2
poly = galois.Poly([1,0,0,1,1], field=GF)
state = GF([1,0,1,1])
y_truth = GF([1,1,0,1,0,1,1,0,0,1,0,0,0,1,1,1,1,0,1,0])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_gf2_output_2():
"""
Sage:
F = GF(2)
o = F(0); l = F(1)
key = [l,l,o,l]
fill = [l,l,o,l]
n = 20
s = lfsr_sequence(key,fill,n); s
"""
GF = galois.GF2
poly = galois.Poly([1,1,0,1,1], field=GF)
state = GF([1,0,1,1])
y_truth = GF([1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_gf2_output_3():
"""
Sage:
F = GF(2)
o = F(0); l = F(1)
key = [l,o,o,o,l,l,l,o]
fill = [l,o,o,o,o,o,o,o]
n = 600
s = lfsr_sequence(key,fill,n); np.array(s)
"""
GF = galois.GF2
poly = galois.Poly([1,0,0,0,1,1,1,0,1], field=GF)
state = GF([0,0,0,0,0,0,0,1])
y_truth = GF([1,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,1,0,1,0,0,0,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,0,1,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,0,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,1,0,1,0,0,0,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,0,1,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,0,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,1,1,1,1,1])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_gf3_output():
"""
Sage:
F = GF(3)
key = [F(2),F(0),F(0),F(2)]
fill = [F(1),F(0),F(0),F(0)]
n = 200
s = lfsr_sequence(key,fill,n); np.array(s)
"""
GF = galois.GF(3)
poly = galois.Poly([2,0,0,2,1], field=GF) # galois.conway_poly(3, 4) / GF(2)
state = GF([0,0,0,1])
y_truth = GF([1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2,1,2,1,0,2,2,0,0,1,0,0,0,2])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_gf5_output():
"""
Sage:
F = GF(5)
key = [F(3),F(0),F(3),F(1)]
fill = [F(1),F(0),F(0),F(0)]
n = 800
s = lfsr_sequence(key,fill,n); np.array(s)
"""
GF = galois.GF(5)
poly = galois.Poly([3,0,3,1,1], field=GF) # galois.conway_poly(5, 4) / GF(2)
state = GF([0,0,0,1])
y_truth = GF([1,0,0,0,3,3,2,1,1,3,2,4,3,4,4,3,4,0,4,3,2,1,4,1,4,0,4,2,1,2,2,4,3,1,1,1,3,4,1,1,3,3,0,2,1,1,4,3,3,0,1,0,2,2,1,2,1,3,4,4,4,0,4,1,0,3,0,2,2,2,3,0,0,1,0,3,3,0,4,3,4,3,2,0,3,2,2,3,3,3,3,1,4,1,2,3,1,3,2,0,4,3,1,0,0,4,2,4,0,4,0,4,4,3,0,1,3,0,4,2,3,4,0,3,2,3,4,2,0,0,2,3,4,3,1,4,4,0,0,2,4,0,2,3,1,0,4,3,3,2,3,3,1,1,3,0,2,0,0,0,1,1,4,2,2,1,4,3,1,3,3,1,3,0,3,1,4,2,3,2,3,0,3,4,2,4,4,3,1,2,2,2,1,3,2,2,1,1,0,4,2,2,3,1,1,0,2,0,4,4,2,4,2,1,3,3,3,0,3,2,0,1,0,4,4,4,1,0,0,2,0,1,1,0,3,1,3,1,4,0,1,4,4,1,1,1,1,2,3,2,4,1,2,1,4,0,3,1,2,0,0,3,4,3,0,3,0,3,3,1,0,2,1,0,3,4,1,3,0,1,4,1,3,4,0,0,4,1,3,1,2,3,3,0,0,4,3,0,4,1,2,0,3,1,1,4,1,1,2,2,1,0,4,0,0,0,2,2,3,4,4,2,3,1,2,1,1,2,1,0,1,2,3,4,1,4,1,0,1,3,4,3,3,1,2,4,4,4,2,1,4,4,2,2,0,3,4,4,1,2,2,0,4,0,3,3,4,3,4,2,1,1,1,0,1,4,0,2,0,3,3,3,2,0,0,4,0,2,2,0,1,2,1,2,3,0,2,3,3,2,2,2,2,4,1,4,3,2,4,2,3,0,1,2,4,0,0,1,3,1,0,1,0,1,1,2,0,4,2,0,1,3,2,1,0,2,3,2,1,3,0,0,3,2,1,2,4,1,1,0,0,3,1,0,3,2,4,0,1,2,2,3,2,2,4,4,2,0,3,0,0,0,4,4,1,3,3,4,1,2,4,2,2,4,2,0,2,4,1,3,2,3,2,0,2,1,3,1,1,2,4,3,3,3,4,2,3,3,4,4,0,1,3,3,2,4,4,0,3,0,1,1,3,1,3,4,2,2,2,0,2,3,0,4,0,1,1,1,4,0,0,3,0,4,4,0,2,4,2,4,1,0,4,1,1,4,4,4,4,3,2,3,1,4,3,4,1,0,2,4,3,0,0,2,1,2,0,2,0,2,2,4,0,3,4,0,2,1,4,2,0,4,1,4,2,1,0,0,1,4,2,4,3,2,2,0,0,1,2,0,1,4,3,0,2,4,4,1,4,4,3,3,4,0,1,0,0,0,3,3,2,1,1,3,2,4,3,4,4,3,4,0,4,3,2,1,4,1,4,0,4,2,1,2,2,4,3,1,1,1,3,4,1,1,3,3,0,2,1,1,4,3,3,0,1,0,2,2,1,2,1,3,4,4,4,0,4,1,0,3,0,2,2,2,3,0,0,1,0,3,3,0,4,3,4,3,2,0,3,2,2,3,3,3,3,1,4,1,2,3,1,3,2,0,4,3,1,0,0,4,2,4,0,4,0,4,4,3,0,1,3,0,4,2,3,4,0,3,2,3,4,2,0,0,2,3,4,3,1,4,4,0,0,2,4,0,2,3,1,0,4,3,3,2,3,3,1,1,3,0,2,0,0,0,1,1,4,2,2,1,4,3,1,3,3,1,3,0,3,1])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_gfp_large_output():
"""
Sage:
F = GF(36893488147419103183)
key = [F(3),F(0),F(3),F(1)]
fill = [F(1),F(0),F(0),F(0)]
n = 20
s = lfsr_sequence(key,fill,n); np.array(s)
"""
GF = galois.GF(36893488147419103183)
poly = galois.Poly([3,0,3,1,1], field=GF) # Not a primitive polynomial...
state = GF([0,0,0,1])
y_truth = GF([1, 0, 0, 0, 3, 3, 12, 21, 66, 138, 372, 849, 2163, 5124, 12729, 30648, 75324, 182640, 446799, 1086663, 2653032, 6460941, 15760434, 38403246, 93643644, 228236205, 556448439, 1356366792, 3306643041, 8060452032, 19649726472, 47900182944, 116769291483, 284651196411, 693908250276, 1691562388341, 4123595013618, 10052235767874, 24504745559556, 59736140028201])
lfsr = galois.LFSR(poly, state=state)
y = lfsr.step(y_truth.size)
assert np.array_equal(y, y_truth)
def test_berlekamp_massey_exceptions():
GF = galois.GF2
s = GF([0,0,1,1,0,1,1,1,0,1])
with pytest.raises(TypeError):
galois.berlekamp_massey(s.view(np.ndarray))
with pytest.raises(TypeError):
galois.berlekamp_massey(s, config=1)
with pytest.raises(TypeError):
galois.berlekamp_massey(s, state=1)
with pytest.raises(ValueError):
galois.berlekamp_massey(np.atleast_2d(s))
with pytest.raises(ValueError):
galois.berlekamp_massey(s, config="invalid-argument")
def test_berlekamp_massey_gf2_1():
"""
Sage:
F = GF(2)
s = [0,0,1,1,0,1,1,1,0,1]
s = [F(si) for si in s]
berlekamp_massey(s).reverse() # Sage defines polynomial backwards
"""
GF = galois.GF2
s = GF([0,0,1,1,0,1,1,1,0,1])
c_truth = galois.Poly.Degrees([5,3,0])
c = galois.berlekamp_massey(s)
assert c == c_truth
def test_berlekamp_massey_gf2_2():
"""
Sage:
F = GF(2)
s = [1,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0]
s = [F(si) for si in s]
berlekamp_massey(s).reverse() # Sage defines polynomial backwards
"""
GF = galois.GF2
s = GF([1,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1,0])
c_truth = galois.Poly.Degrees([8,4,3,2,0])
c = galois.berlekamp_massey(s)
assert c == c_truth
def test_berlekamp_massey_gf2_3():
"""
Sage:
F = GF(2)
s = [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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,1,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,1,0,1,0,1,0,0,0,0,1,1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,0,1,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,1,1,1,1,1,0,1,1]
s = [F(si) for si in s]
berlekamp_massey(s).reverse() # Sage defines polynomial backwards
"""
GF = galois.GF2
s = GF([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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,1,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,1,0,1,0,1,0,0,0,0,1,1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,0,1,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,1,1,1,1,1,0,1,1])
c_truth = galois.Poly.Degrees([100,57,56,55,52,48,47,46,45,44,43,41,37,36,35,34,31,30,27,25,24,22,20,19,16,15,11,9,8,6,5,3,0])
c = galois.berlekamp_massey(s)
assert c == c_truth
# def test_berlekamp_massey_gfp_large():
# """
# Sage:
# F = GF(36893488147419103183)
# s = [1, 0, 0, 0, 3, 3, 12, 21, 66, 138, 372, 849, 2163, 5124, 12729, 30648, 75324, 182640, 446799, 1086663, 2653032, 6460941, 15760434, 38403246, 93643644, 228236205, 556448439, 1356366792, 3306643041, 8060452032, 19649726472, 47900182944, 116769291483, 284651196411, 693908250276, 1691562388341, 4123595013618, 10052235767874, 24504745559556, 59736140028201]
# s = [F(si) for si in s]
# berlekamp_massey(s).reverse() # Sage defines polynomial backwards
# """
# GF = galois.GF(36893488147419103183)
# s = GF([1, 0, 0, 0, 3, 3, 12, 21, 66, 138, 372, 849, 2163, 5124, 12729, 30648, 75324, 182640, 446799, 1086663, 2653032, 6460941, 15760434, 38403246, 93643644, 228236205, 556448439, 1356366792, 3306643041, 8060452032, 19649726472, 47900182944, 116769291483, 284651196411, 693908250276, 1691562388341, 4123595013618, 10052235767874, 24504745559556, 59736140028201])
# c_truth = galois.Poly([36893488147419103180, 0, 36893488147419103180, 36893488147419103182, 1], field=GF)
# c = galois.berlekamp_massey(s)
# assert c == c_truth
| 48.003953 | 1,619 | 0.559325 | 3,463 | 12,145 | 1.93214 | 0.04447 | 0.168585 | 0.162756 | 0.156628 | 0.836347 | 0.807054 | 0.78359 | 0.751607 | 0.71768 | 0.697803 | 0 | 0.342843 | 0.148621 | 12,145 | 252 | 1,620 | 48.194444 | 0.304255 | 0.265871 | 0 | 0.508197 | 0 | 0 | 0.01469 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 1 | 0.131148 | false | 0 | 0.02459 | 0 | 0.155738 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
629c1e5381bbd770813deb2c3099b4394ac4be96 | 187 | py | Python | temboo/core/Library/Tumblr/Tagged/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Tumblr/Tagged/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Tumblr/Tagged/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | from temboo.Library.Tumblr.Tagged.RetrievePostsWithTag import RetrievePostsWithTag, RetrievePostsWithTagInputSet, RetrievePostsWithTagResultSet, RetrievePostsWithTagChoreographyExecution
| 93.5 | 186 | 0.925134 | 11 | 187 | 15.727273 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037433 | 187 | 1 | 187 | 187 | 0.961111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
62a07e541c0d6a54364000781a6800dee1315591 | 2,291 | py | Python | 04 - Classes-inheritance-oops/56-classes-overloading.py | python-demo-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 2 | 2019-08-23T06:05:55.000Z | 2019-08-26T03:56:07.000Z | 04 - Classes-inheritance-oops/56-classes-overloading.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | null | null | null | 04 - Classes-inheritance-oops/56-classes-overloading.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 4 | 2020-10-01T07:16:07.000Z | 2021-07-17T07:55:08.000Z | # Classes
# Overloading
# Overloading using number of args, using default value
def fdefaults(x, y, z, a="Value", b="some", c="other", d="value"):
# do any operation below whether a,b,c is provided or not
print(a,y,z,a,b,c)
# Overloading using number of args, using *args
def fargs(*args):
# do any operation below using args
if len(args) > 0:
for i in args:
print(i)
# Overloading using number of kwargs, using **kwargs
def fkwargs(**kwargs):
# do any operation below using kwargs
if len(kwargs.keys()) > 0:
for i in kwargs:
print(i)
# Overloading using number of args & kwargs, using **kwargs
def fargskwargs(*args, **kwargs):
# do any operation below using args, kwargs
if len(args):
for i in args:
print(i)
if len(kwargs.keys()) > 0:
for i in kwargs:
print(i)
# Overloading within classes - different ways
class Vehicle():
start = 0
end = 0
def move(self, end):
self.end = end
print("Vehicle moved from {} to {}".format(self.start, self.end))
class Bike(Vehicle):
# overriding - Parent-Child scope
def move(self, end):
self.end = end
name = "Bike"
print("{} moved from {} to {}".format(name, self.start, self.end))
# Overloading using number of args, using default value
def fdefaults(self, x, y, z, a="Value", b="some", c="other", d="value"):
# do any operation below whether a,b,c is provided or not
print(a,y,z,a,b,c)
# Overloading using number of args, using *args
def fargs(self, *args):
# do any operation below using args
if len(args) > 0:
for i in args:
print(i)
# Overloading using number of kwargs, using **kwargs
def fkwargs(self, **kwargs):
# do any operation below using kwargs
if len(kwargs.keys()) > 0:
for i in kwargs:
print(i)
# Overloading using number of args & kwargs, using **kwargs
def fargskwargs(self, *args, **kwargs):
# do any operation below using args, kwargs
if len(args):
for i in args:
print(i)
if len(kwargs.keys()) > 0:
for i in kwargs:
print(i)
| 29.371795 | 76 | 0.578787 | 324 | 2,291 | 4.092593 | 0.182099 | 0.096531 | 0.13273 | 0.144796 | 0.834842 | 0.834842 | 0.834842 | 0.798643 | 0.798643 | 0.798643 | 0 | 0.005041 | 0.307289 | 2,291 | 77 | 77 | 29.753247 | 0.830498 | 0.370581 | 0 | 0.666667 | 0 | 0 | 0.06413 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0 | 0.311111 | 0.266667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
62b316525e0a59dbba9420001171e3b069e429d8 | 28 | py | Python | pypga/boards/__init__.py | pypga/pypga | 3efbf6b62afc33eb480fb5cc33b62ee6bdef134e | [
"MIT"
] | 6 | 2021-01-24T10:03:08.000Z | 2022-01-12T08:08:43.000Z | pypga/boards/__init__.py | lneuhaus/pypga | 836932e4a5abbc9d52eb824b446f176af65485c0 | [
"MIT"
] | 6 | 2022-03-28T12:00:02.000Z | 2022-03-28T12:02:31.000Z | pypga/boards/__init__.py | lneuhaus/pypga | 836932e4a5abbc9d52eb824b446f176af65485c0 | [
"MIT"
] | 1 | 2021-01-24T10:03:20.000Z | 2021-01-24T10:03:20.000Z | from . import stemlab125_14
| 14 | 27 | 0.821429 | 4 | 28 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 0.142857 | 28 | 1 | 28 | 28 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
62dfe0caf018ede689933441276b18d795432a18 | 3,373 | py | Python | python/graphscope/nx/algorithms/tests/forward/test_community.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | 1 | 2021-12-30T02:55:16.000Z | 2021-12-30T02:55:16.000Z | python/graphscope/nx/algorithms/tests/forward/test_community.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | python/graphscope/nx/algorithms/tests/forward/test_community.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | import networkx.algorithms.community.tests.test_asyn_fluid
import networkx.algorithms.community.tests.test_centrality
import networkx.algorithms.community.tests.test_kclique
import networkx.algorithms.community.tests.test_kernighan_lin
import networkx.algorithms.community.tests.test_label_propagation
import networkx.algorithms.community.tests.test_louvain
import networkx.algorithms.community.tests.test_lukes
import networkx.algorithms.community.tests.test_modularity_max
import networkx.algorithms.community.tests.test_quality
import networkx.algorithms.community.tests.test_utils
import pytest
from graphscope.nx.utils.compat import import_as_graphscope_nx
import_as_graphscope_nx(networkx.algorithms.community.tests.test_asyn_fluid,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_centrality,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_kclique,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_kernighan_lin,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_label_propagation,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_louvain,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_lukes,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_modularity_max,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_quality,
decorators=pytest.mark.usefixtures("graphscope_session"))
import_as_graphscope_nx(networkx.algorithms.community.tests.test_utils,
decorators=pytest.mark.usefixtures("graphscope_session"))
@pytest.mark.skip(reason="graphscope.nx not support LFR_benchmark_graph generator")
def test_modularity_increase():
pass
@pytest.mark.skip(reason="graphscope.nx not support LFR_benchmark_graph generator")
def test_valid_partition():
pass
@pytest.mark.skip(reason="graphscope.nx not support LFR_benchmark_graph generator")
def test_quality():
pass
@pytest.mark.skip(reason="graphscope.nx not support LFR_benchmark_graph generator")
def test_resolution():
pass
@pytest.mark.skip(reason="graphscope.nx not support LFR_benchmark_graph generator")
def test_threshold():
pass
@pytest.mark.skip(reason="graphscope.nx not support set as data")
def test_partition():
pass
@pytest.mark.skip(reason="graphscope.nx not support set as data")
def test_none_weight_param():
pass
@pytest.mark.skip(reason="graphscope.nx not support set as data")
def test_multigraph():
pass
@pytest.mark.skip(reason="graphscope.nx not support luke_partition")
def test_paper_1_case():
pass
@pytest.mark.skip(reason="graphscope.nx not support luke_partition")
def test_paper_2_case():
pass | 36.268817 | 83 | 0.780611 | 411 | 3,373 | 6.160584 | 0.136253 | 0.104265 | 0.21327 | 0.252765 | 0.939573 | 0.939573 | 0.779226 | 0.682859 | 0.682859 | 0.660743 | 0 | 0.000681 | 0.129558 | 3,373 | 93 | 84 | 36.268817 | 0.861717 | 0 | 0 | 0.483871 | 0 | 0 | 0.191464 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.16129 | true | 0.16129 | 0.354839 | 0 | 0.516129 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 10 |
1a097255e6c0d018897509737a46ac5c25ef6886 | 4,049 | py | Python | domainbed/lib/torchutils.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | 1 | 2022-03-15T16:30:14.000Z | 2022-03-15T16:30:14.000Z | domainbed/lib/torchutils.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | null | null | null | domainbed/lib/torchutils.py | alexrame/domainbedresearch | 6255da9aedf4584115324f8cf3a45be6e9004602 | [
"MIT"
] | null | null | null | import torch
def my_cdist(x1, x2):
x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
res = torch.addmm(x2_norm.transpose(-2, -1), x1, x2.transpose(-2, -1), alpha=-2).add_(x1_norm)
return res.clamp_min_(1e-30)
def gaussian_kernel(x, y, gamma=[0.001, 0.01, 0.1, 1, 10, 100, 1000]):
D = my_cdist(x, y)
K = torch.zeros_like(D)
for g in gamma:
K.add_(torch.exp(D.mul(-g)))
return K
def standard_mmd(x, y, kernel_type):
if kernel_type == "gaussian":
Kxx = gaussian_kernel(x, x).mean()
Kyy = gaussian_kernel(y, y).mean()
Kxy = gaussian_kernel(x, y).mean()
return Kxx + Kyy - 2 * Kxy
else:
mean_x = x.mean(0, keepdim=True)
mean_y = y.mean(0, keepdim=True)
cent_x = x - mean_x
cent_y = y - mean_y
cova_x = (cent_x.t() @ cent_x) / (len(x) - 1)
cova_y = (cent_y.t() @ cent_y) / (len(y) - 1)
mean_diff = (mean_x - mean_y).pow(2).mean()
cova_diff = (cova_x - cova_y).pow(2).mean()
return mean_diff + cova_diff
def mmd_ema(x, y, weights_x=None, weights_y=None, list_methods=None):
if "gaussian" in list_methods:
Kxx = gaussian_kernel(x, x).mean()
Kyy = gaussian_kernel(y, y).mean()
Kxy = gaussian_kernel(x, y).mean()
return Kxx + Kyy - 2 * Kxy
mean_x = x.mean(0, keepdim=True)
mean_y = y.mean(0, keepdim=True)
transf_x = x
transf_y = y
if "notcentered" not in list_methods:
transf_x = transf_x - mean_x
transf_y = transf_y - mean_y
if "weight" in list_methods:
assert weights_x is not None
transf_x = transf_x * weights_x.view((weights_x.size(0), 1))
transf_y = transf_y * weights_y.view((weights_y.size(0), 1))
if "offdiagonal" in list_methods:
# cova_x = (transf_x.t() @ transf_x) / (transf_x.size(0) * transf_x.size(1))
# cova_y = (transf_y.t() @ transf_y) / (transf_y.size(0) * transf_y.size(1))
cova_x = torch.einsum("na,nb->ab", transf_x,
transf_x) / (transf_x.size(0) * transf_x.size(1))
cova_y = torch.einsum("na,nb->ab", transf_y,
transf_y) / (transf_y.size(0) * transf_y.size(1))
else:
cova_x = (transf_x).pow(2).mean(dim=0)
cova_y = (transf_y).pow(2).mean(dim=0)
mean_diff = (mean_x - mean_y).pow(2).mean()
cova_diff = (cova_x - cova_y).pow(2).mean()
if "mean" in list_methods:
return cova_diff + mean_diff
return cova_diff
def mmd(x, y, weights_x=None, weights_y=None, list_methods=None):
if "gaussian" in list_methods:
Kxx = gaussian_kernel(x, x).mean()
Kyy = gaussian_kernel(y, y).mean()
Kxy = gaussian_kernel(x, y).mean()
return Kxx + Kyy - 2 * Kxy
mean_x = x.mean(0, keepdim=True)
mean_y = y.mean(0, keepdim=True)
transf_x = x
transf_y = y
if "notcentered" not in list_methods:
transf_x = transf_x - mean_x
transf_y = transf_y - mean_y
if "weight" in list_methods:
assert weights_x is not None
transf_x = transf_x * weights_x.view((weights_x.size(0), 1))
transf_y = transf_y * weights_y.view((weights_y.size(0), 1))
if "offdiagonal" in list_methods:
# cova_x = (transf_x.t() @ transf_x) / (transf_x.size(0) * transf_x.size(1))
# cova_y = (transf_y.t() @ transf_y) / (transf_y.size(0) * transf_y.size(1))
cova_x = torch.einsum("na,nb->ab", transf_x,
transf_x) / (transf_x.size(0) * transf_x.size(1))
cova_y = torch.einsum("na,nb->ab", transf_y,
transf_y) / (transf_y.size(0) * transf_y.size(1))
else:
cova_x = (transf_x).pow(2).mean(dim=0)
cova_y = (transf_y).pow(2).mean(dim=0)
mean_diff = (mean_x - mean_y).pow(2).mean()
cova_diff = (cova_x - cova_y).pow(2).mean()
if "mean" in list_methods:
return cova_diff + mean_diff
return cova_diff
| 34.02521 | 98 | 0.581131 | 667 | 4,049 | 3.28036 | 0.115442 | 0.08958 | 0.051188 | 0.063985 | 0.827697 | 0.827697 | 0.827697 | 0.807587 | 0.807587 | 0.807587 | 0 | 0.030416 | 0.269202 | 4,049 | 118 | 99 | 34.313559 | 0.709023 | 0.073845 | 0 | 0.761364 | 0 | 0 | 0.033111 | 0 | 0 | 0 | 0 | 0 | 0.022727 | 1 | 0.056818 | false | 0 | 0.011364 | 0 | 0.181818 | 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 |
a7e1bfeea8af2f841e2e855f10e061bac8cec3f6 | 112 | py | Python | Application/methods/confirmation.py | Robert565/pxollypy | 4874ca9625feed7d3b318a6aa3c0c8c5d4e895ea | [
"MIT"
] | 6 | 2021-11-05T17:34:28.000Z | 2022-01-28T12:33:11.000Z | Application/methods/confirmation.py | ReaperGames637/pxollypy | 916d2199403285c4d177a6c39d448f650e82c902 | [
"MIT"
] | null | null | null | Application/methods/confirmation.py | ReaperGames637/pxollypy | 916d2199403285c4d177a6c39d448f650e82c902 | [
"MIT"
] | 2 | 2021-11-05T17:33:46.000Z | 2021-11-06T08:34:53.000Z | from . import reg_signal
@reg_signal('confirmation')
def confirmation(**kwargs):
return kwargs['db'].code
| 16 | 28 | 0.723214 | 14 | 112 | 5.642857 | 0.714286 | 0.227848 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133929 | 112 | 6 | 29 | 18.666667 | 0.814433 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.25 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 7 |
c51828e466821450138ea26b314596c1f1dcdb2f | 884 | py | Python | performance-storage-service/pss_project/api/tests/factories/rest/metrics/LatencyMetricsFactory.py | cmu-db/noisepage-stats | d61a0e143904748b3f7f43628a5b29769a5c9cf8 | [
"MIT"
] | 23 | 2020-12-22T20:19:51.000Z | 2021-11-24T06:11:01.000Z | performance-storage-service/pss_project/api/tests/factories/rest/metrics/LatencyMetricsFactory.py | cmu-db/noisepage-test | d61a0e143904748b3f7f43628a5b29769a5c9cf8 | [
"MIT"
] | 13 | 2020-06-05T22:36:49.000Z | 2020-11-10T16:25:04.000Z | performance-storage-service/pss_project/api/tests/factories/rest/metrics/LatencyMetricsFactory.py | cmu-db/noisepage-test | d61a0e143904748b3f7f43628a5b29769a5c9cf8 | [
"MIT"
] | 2 | 2020-06-08T18:03:34.000Z | 2020-10-06T18:01:35.000Z | from factory import Factory, Faker
from pss_project.api.models.rest.metrics.LatencyMetrics import LatencyMetrics
class LatencyMetricsFactory(Factory):
class Meta:
model = LatencyMetrics
l_25 = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
l_75 = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
l_90 = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
l_95 = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
l_99 = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
avg = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
median = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
max = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
min = Faker('pydecimal', left_digits=6, right_digits=4, positive=True)
| 49.111111 | 77 | 0.738688 | 126 | 884 | 4.992063 | 0.261905 | 0.200318 | 0.257552 | 0.343402 | 0.707472 | 0.707472 | 0.707472 | 0.707472 | 0.707472 | 0.707472 | 0 | 0.036697 | 0.136878 | 884 | 17 | 78 | 52 | 0.78768 | 0 | 0 | 0 | 0 | 0 | 0.091629 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.928571 | 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 | 1 | 0 | 0 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.